소스 검색

PRS STORES - bug fix purchase order item store (was causing duplicate stock movements when changing received PO items)

Nick-PRSDigital@bitbucket.org 2 년 전
부모
커밋
c191cacba5
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      prs.stores/PurchaseOrderItemStore.cs

+ 4 - 1
prs.stores/PurchaseOrderItemStore.cs

@@ -26,6 +26,7 @@ namespace Comal.Stores
                 var result = Provider.Query(
                     new Filter<StockMovement>(x => x.OrderItem.ID).IsEqualTo(entity.ID),
                     new Columns<StockMovement>(
+                        x => x.ID,
                         x => x.Date,
                         x => x.Product.ID,
                         x => x.Received,
@@ -41,7 +42,8 @@ namespace Comal.Stores
                         x => x.Dimensions.Width,
                         x => x.Dimensions.Height,
                         x => x.Dimensions.Weight,
-                        x => x.Notes
+                        x => x.Notes,
+                        x => x.Cost
                     )
                 ).Rows.Select(x => x.ToObject<StockMovement>()).ToList();
                 if (!result.Any())
@@ -167,6 +169,7 @@ namespace Comal.Stores
                 movement.Style.Code = entity.Style.Code;
                 movement.Style.Description = entity.Style.Description;
                 movement.Notes = string.Format("Received on PO {0}", entity.PurchaseOrderLink.PONumber);
+                movement.Cost = entity.Cost;
             }
 
             var updates = movements.Where(x => x.IsChanged());