check null in save order for discount and foc item
This commit is contained in:
parent
794086917b
commit
56bbcdfa04
|
|
@ -121,6 +121,8 @@ public class OrderService : IOrderService
|
|||
|
||||
request.FocValue = 0;
|
||||
|
||||
if(dicountItem!= null)
|
||||
{
|
||||
promotions.Add(new SaveOrderPromotionRequest()
|
||||
{
|
||||
OrderId = isUpdate ? existingOrder.OrderId : 0,
|
||||
|
|
@ -134,7 +136,10 @@ public class OrderService : IOrderService
|
|||
ApprovedFocQty = 0,
|
||||
PromotionType = 1,
|
||||
});
|
||||
}
|
||||
|
||||
if(focItem != null)
|
||||
{
|
||||
promotions.Add(new SaveOrderPromotionRequest()
|
||||
{
|
||||
OrderId = isUpdate ? existingOrder.OrderId : 0,
|
||||
|
|
@ -148,6 +153,7 @@ public class OrderService : IOrderService
|
|||
ApprovedFocQty = (request.OrderStatus == OrderStatusEnum.CancelledByApprover || request.OrderStatus == OrderStatusEnum.Approved) ? focItem.OrderQuantity : 0,
|
||||
PromotionType = 2,
|
||||
});
|
||||
}
|
||||
|
||||
// 5. Insert or update
|
||||
int orderId;
|
||||
|
|
@ -629,6 +635,7 @@ public class OrderService : IOrderService
|
|||
SqlHelperExtension.CreateInParam(pName: "@NetValue", pType: SqlDbType.Decimal, pValue: request.NetValue),
|
||||
SqlHelperExtension.CreateInParam(pName: "@OrderStatus", pType: SqlDbType.Int, pValue: (int)request.OrderStatus),
|
||||
SqlHelperExtension.CreateInParam(pName: "@SapRefferenceOrderNo", pType: SqlDbType.NVarChar, pValue: null),
|
||||
SqlHelperExtension.CreateInParam(pName: "@UserId", pType: SqlDbType.Int, pValue: userId),
|
||||
itemsParam,
|
||||
promotionsParam
|
||||
];
|
||||
|
|
@ -677,6 +684,7 @@ public class OrderService : IOrderService
|
|||
SqlHelperExtension.CreateInParam(pName: "@FOCValue", pType: SqlDbType.Decimal, pValue: request.FocCode),
|
||||
SqlHelperExtension.CreateInParam(pName: "@NetValue", pType: SqlDbType.Decimal, pValue: request.NetValue),
|
||||
SqlHelperExtension.CreateInParam(pName: "@OrderStatus", pType: SqlDbType.Int, pValue: (int)request.OrderStatus),
|
||||
SqlHelperExtension.CreateInParam(pName: "@UserId", pType: SqlDbType.Int, pValue: userId),
|
||||
itemsParam,
|
||||
promotionsParam
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user