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 DiscountCode { get; set; }
public string CustomerCode { get; set; } public string CustomerCode { get; set; }
public string SalesOrgCode { get; set; }
public string TeritoryCode { get; set; }
public string? MaterialCode { get; set; } public string? MaterialCode { get; set; }
public string UnitOfMeasurement { get; set; } public string UnitOfMeasurement { get; set; }
public string CalculationType { get; set; } public string CalculationType { get; set; }
@ -202,6 +204,8 @@ public class GetFOCMaterialResponse
{ {
public string FOCCode { get; set; } public string FOCCode { get; set; }
public string CustomerCode { get; set; } public string CustomerCode { get; set; }
public string SalesOrgCode { get; set; }
public string TeritoryCode { get; set; }
public string MaterialCode { get; set; } public string MaterialCode { get; set; }
public string? UnitOfMeasurement { get; set; } public string? UnitOfMeasurement { get; set; }
public decimal? MinimumOrderQty { get; set; } public decimal? MinimumOrderQty { get; set; }

View File

@ -831,6 +831,8 @@ public class MobileMasterDataService : IMobileMasterDataService
StartDate = dr.GetDateTime(6), StartDate = dr.GetDateTime(6),
EndDate = dr.GetDateTime(7), EndDate = dr.GetDateTime(7),
Threshold = dr.GetDecimal(8), Threshold = dr.GetDecimal(8),
SalesOrgCode = dr.GetString(9),
TeritoryCode = dr.GetString(10)
}); });
} }
dr.Close(); dr.Close();
@ -947,6 +949,8 @@ public class MobileMasterDataService : IMobileMasterDataService
FOCUnitOfMeasurement = dr.IsDBNull(7) ? null : dr.GetString(7), FOCUnitOfMeasurement = dr.IsDBNull(7) ? null : dr.GetString(7),
StartDate = dr.GetDateTime(8), StartDate = dr.GetDateTime(8),
EndDate = dr.GetDateTime(9), EndDate = dr.GetDateTime(9),
SalesOrgCode =dr.GetString(10),
TeritoryCode =dr.GetString(11),
}); });
} }
dr.Close(); dr.Close();

View File

@ -70,26 +70,32 @@ public class OrderService : IOrderService
foreach (var item in request.Items) 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.ItemId = 0;
item.OrderId = request.OrderId; item.OrderId = request.OrderId;
} }
//var materialStock = await _httpService.GetMaterialStockAsync(request.PlantCode); var materialStock = await _httpService.GetMaterialStockAsync(request.PlantCode);
//if(materialStock is null || materialStock?.Count==0) if (materialStock is null || materialStock?.Count == 0)
//{ {
// throw new Exception($"Material Stocks not found against this Plant Code-{request.PlantCode}"); throw new Exception($"Material Stocks not found against this Plant Code-{request.PlantCode}");
//} }
//foreach (var item in request.Items) foreach (var item in request.Items)
//{ {
// decimal currentStock = materialStock.FirstOrDefault(x => x.MaterialCode == item.MaterialCode)?.AvailableStock ?? 0; decimal currentStock = materialStock.FirstOrDefault(x => x.MaterialCode == item.MaterialCode)?.AvailableStock ?? 0;
// if(currentStock<item.ApprovedQuantity) if (currentStock < item.ApprovedQuantity)
// { {
// throw new Exception($"Insufficient stock is available for Material Code '{item.MaterialCode}' in Plant Code '{request.PlantCode}'."); throw new Exception($"Insufficient stock is available for Material Code '{item.MaterialCode}' in Plant Code '{request.PlantCode}'.");
// } }
//} }
// 2. Insert vs update decision // 2. Insert vs update decision
@ -182,6 +188,11 @@ public class OrderService : IOrderService
{ {
var customerLedger = await _httpService.GetCustomerLedgerAsync(request.CustomerCode, customer.CompanyCode); 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); var creditBalance = customer.CreditLimit- (customerLedger.CurrentBalance + usedCreditBalance);
if(creditBalance < request.NetValue) if(creditBalance < request.NetValue)

View File

@ -602,7 +602,7 @@ namespace OnlineSalesAutoCrop.CoreAPI
}); });
var fileName = 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; string filePath = string.Empty;