update UAT feedback

This commit is contained in:
dibakor 2026-08-12 18:29:10 +06:00
parent 4d9a467558
commit 458b7b6976
4 changed files with 35 additions and 16 deletions

View File

@ -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; }

View File

@ -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();

View File

@ -70,27 +70,33 @@ 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;
// if(currentStock<item.ApprovedQuantity)
// {
// throw new Exception($"Insufficient stock is available for Material Code '{item.MaterialCode}' in Plant Code '{request.PlantCode}'.");
// }
//}
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}'.");
}
}
// 2. Insert vs update decision
bool isUpdate = existingOrder != null && existingOrder.OrderId > 0 ;
@ -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)

View File

@ -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;