|
@@ -287,7 +287,10 @@ namespace comal.timesheets
|
|
|
|
|
|
CoreTable table = new Client<PurchaseOrderItem>().Query(new Filter<PurchaseOrderItem>(x => x.ID).IsEqualTo(poItemShell.ID),
|
|
|
columns);
|
|
|
- PurchaseOrderItem purchaseOrderItem = table.Rows.FirstOrDefault().ToObject<PurchaseOrderItem>();
|
|
|
+ PurchaseOrderItem purchaseOrderItem = table.Rows.FirstOrDefault()?.ToObject<PurchaseOrderItem>();
|
|
|
+
|
|
|
+ if (purchaseOrderItem == null)
|
|
|
+ return;
|
|
|
|
|
|
purchaseOrderItem.ID = Guid.Empty;
|
|
|
purchaseOrderItem.Created = DateTime.Now;
|
|
@@ -356,6 +359,10 @@ namespace comal.timesheets
|
|
|
CoreTable table = new Client<PurchaseOrderItem>().Query(new Filter<PurchaseOrderItem>(x => x.ID).IsEqualTo(poItemShell.ID)
|
|
|
, columns);
|
|
|
PurchaseOrderItem newPurchaseOrderItem = table.Rows.FirstOrDefault().ToObject<PurchaseOrderItem>();
|
|
|
+
|
|
|
+ if (newPurchaseOrderItem == null)
|
|
|
+ return;
|
|
|
+
|
|
|
newPurchaseOrderItem.ReceivedDate = DateTime.Now;
|
|
|
newPurchaseOrderItem.ID = Guid.Empty;
|
|
|
newPurchaseOrderItem.Created = DateTime.Now;
|
|
@@ -396,6 +403,7 @@ namespace comal.timesheets
|
|
|
purchaseOrderItem.Dimensions.Weight = poItemShell.DimensionsWeight;
|
|
|
purchaseOrderItem.Dimensions.Value = poItemShell.DimensionsValue;
|
|
|
purchaseOrderItem.Dimensions.UnitSize = poItemShell.DimensionsUnitSize;
|
|
|
+ purchaseOrderItem.Cost = poItemShell.Cost;
|
|
|
return purchaseOrderItem;
|
|
|
}
|
|
|
|
|
@@ -816,7 +824,8 @@ namespace comal.timesheets
|
|
|
x => x.Dimensions.Height, //24
|
|
|
x => x.Dimensions.Weight, //25
|
|
|
x => x.Dimensions.Value, //26
|
|
|
- x => x.Dimensions.UnitSize //27
|
|
|
+ x => x.Dimensions.UnitSize, //27
|
|
|
+ x => x.Cost //28
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -862,6 +871,8 @@ public class POItemShell
|
|
|
public ImageSource ImageSource { get; set; }
|
|
|
public double LastRowHeight { get; set; }
|
|
|
|
|
|
+ public double Cost { get; set; }
|
|
|
+
|
|
|
public Guid DimensionsUnitID { get; set; }
|
|
|
public double DimensionsQuantity { get; set; }
|
|
|
public double DimensionsLength { get; set; }
|
|
@@ -911,6 +922,7 @@ public class POItemShell
|
|
|
DimensionsWeight = 0;
|
|
|
DimensionsValue = 0;
|
|
|
DimensionsUnitSize = "";
|
|
|
+ Cost = 0.0;
|
|
|
}
|
|
|
|
|
|
public POItemShell DuplicateNewShell(POItemShell poitemshell)
|
|
@@ -956,6 +968,7 @@ public class POItemShell
|
|
|
DimensionsWeight = poitemshell.DimensionsWeight,
|
|
|
DimensionsValue = poitemshell.DimensionsValue,
|
|
|
DimensionsUnitSize = poitemshell.DimensionsUnitSize,
|
|
|
+ Cost = poitemshell.Cost
|
|
|
};
|
|
|
return shell;
|
|
|
}
|