update UAT feedback
This commit is contained in:
parent
4d9a467558
commit
458b7b6976
|
|
@ -179,6 +179,8 @@ public class GetDiscountMaterialResponse
|
|||
{
|
||||
public string DiscountCode { get; set; }
|
||||
public string CustomerCode { get; set; }
|
||||
public string SalesOrgCode { get; set; }
|
||||
public string TeritoryCode { get; set; }
|
||||
public string? MaterialCode { get; set; }
|
||||
public string UnitOfMeasurement { get; set; }
|
||||
public string CalculationType { get; set; }
|
||||
|
|
@ -202,6 +204,8 @@ public class GetFOCMaterialResponse
|
|||
{
|
||||
public string FOCCode { get; set; }
|
||||
public string CustomerCode { get; set; }
|
||||
public string SalesOrgCode { get; set; }
|
||||
public string TeritoryCode { get; set; }
|
||||
public string MaterialCode { get; set; }
|
||||
public string? UnitOfMeasurement { get; set; }
|
||||
public decimal? MinimumOrderQty { get; set; }
|
||||
|
|
|
|||
|
|
@ -831,6 +831,8 @@ public class MobileMasterDataService : IMobileMasterDataService
|
|||
StartDate = dr.GetDateTime(6),
|
||||
EndDate = dr.GetDateTime(7),
|
||||
Threshold = dr.GetDecimal(8),
|
||||
SalesOrgCode = dr.GetString(9),
|
||||
TeritoryCode = dr.GetString(10)
|
||||
});
|
||||
}
|
||||
dr.Close();
|
||||
|
|
@ -947,6 +949,8 @@ public class MobileMasterDataService : IMobileMasterDataService
|
|||
FOCUnitOfMeasurement = dr.IsDBNull(7) ? null : dr.GetString(7),
|
||||
StartDate = dr.GetDateTime(8),
|
||||
EndDate = dr.GetDateTime(9),
|
||||
SalesOrgCode =dr.GetString(10),
|
||||
TeritoryCode =dr.GetString(11),
|
||||
});
|
||||
}
|
||||
dr.Close();
|
||||
|
|
|
|||
|
|
@ -70,26 +70,32 @@ public class OrderService : IOrderService
|
|||
|
||||
foreach (var item in request.Items)
|
||||
{
|
||||
|
||||
if(!item.IsFocItem && item.UnitPrice<=0)
|
||||
{
|
||||
throw new Exception(string.Format("No base price is available for this material of this customer distributor channel.Material:{0}-{1}", item.MaterialCode,item.MaterialName));
|
||||
}
|
||||
|
||||
item.ItemId = 0;
|
||||
item.OrderId = request.OrderId;
|
||||
}
|
||||
|
||||
//var materialStock = await _httpService.GetMaterialStockAsync(request.PlantCode);
|
||||
//if(materialStock is null || materialStock?.Count==0)
|
||||
//{
|
||||
// throw new Exception($"Material Stocks not found against this Plant Code-{request.PlantCode}");
|
||||
//}
|
||||
var materialStock = await _httpService.GetMaterialStockAsync(request.PlantCode);
|
||||
if (materialStock is null || materialStock?.Count == 0)
|
||||
{
|
||||
throw new Exception($"Material Stocks not found against this Plant Code-{request.PlantCode}");
|
||||
}
|
||||
|
||||
|
||||
//foreach (var item in request.Items)
|
||||
//{
|
||||
// decimal currentStock = materialStock.FirstOrDefault(x => x.MaterialCode == item.MaterialCode)?.AvailableStock ?? 0;
|
||||
foreach (var item in request.Items)
|
||||
{
|
||||
decimal currentStock = materialStock.FirstOrDefault(x => x.MaterialCode == item.MaterialCode)?.AvailableStock ?? 0;
|
||||
|
||||
// if(currentStock<item.ApprovedQuantity)
|
||||
// {
|
||||
// throw new Exception($"Insufficient stock is available for Material Code '{item.MaterialCode}' in Plant Code '{request.PlantCode}'.");
|
||||
// }
|
||||
//}
|
||||
if (currentStock < item.ApprovedQuantity)
|
||||
{
|
||||
throw new Exception($"Insufficient stock is available for Material Code '{item.MaterialCode}' in Plant Code '{request.PlantCode}'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2. Insert vs update decision
|
||||
|
|
@ -182,6 +188,11 @@ public class OrderService : IOrderService
|
|||
{
|
||||
var customerLedger = await _httpService.GetCustomerLedgerAsync(request.CustomerCode, customer.CompanyCode);
|
||||
|
||||
if(customerLedger == null)
|
||||
{
|
||||
throw new Exception(string.Format("Customer ledger is not found for this customer. Customer Code:{0}",request.CustomerCode));
|
||||
}
|
||||
|
||||
var creditBalance = customer.CreditLimit- (customerLedger.CurrentBalance + usedCreditBalance);
|
||||
|
||||
if(creditBalance < request.NetValue)
|
||||
|
|
|
|||
|
|
@ -602,7 +602,7 @@ namespace OnlineSalesAutoCrop.CoreAPI
|
|||
});
|
||||
|
||||
var fileName =
|
||||
$"{DateTime.Now:yyyy-MM-dd_HH-mm-ss-fff}.json";
|
||||
$"{ context.Request.Path.ToString().Split('/').Last() }-{ DateTime.Now:yyyy-MM-dd_HH-mm-ss-fff}.json";
|
||||
|
||||
string filePath = string.Empty;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user