瀏覽代碼

Added License Tag to Foreign Currency Entity
Fixed Cost -> Ex Tax Calculation in Purchase Order Item

frogsoftware 11 月之前
父節點
當前提交
7f24b63e5a

+ 1 - 1
prs.classes/Entities/ForeignCurrency/ForeignCurrency.cs

@@ -2,7 +2,7 @@ using InABox.Core;
 
 namespace Comal.Classes
 {
-    public class ForeignCurrency : Entity, IRemotable, IPersistent, IForeignCurrency
+    public class ForeignCurrency : Entity, IRemotable, IPersistent, IForeignCurrency, ILicense<CoreLicense>
     {
         [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
         [EditorSequence(1)]

+ 6 - 3
prs.classes/Entities/PurchaseOrder/PurchaseOrderItem.cs

@@ -236,10 +236,13 @@ namespace Comal.Classes
                     ExTax = Qty * Cost;
                 }
 
-                else if (name.Equals(nameof(Cost)) && (after is double cost) && 
-                    PurchaseOrderLink.SupplierLink.Currency.ID != Guid.Empty)
+                else if (name.Equals(nameof(Cost)) && (after is double cost))
+
                 {
-                    ForeignCurrencyCost = cost * (PurchaseOrderLink.SupplierLink.Currency.ExchangeRate.IsEffectivelyEqual(0.0) ? 1.0 : PurchaseOrderLink.SupplierLink.Currency.ExchangeRate);
+                    ExTax = cost * Qty;
+                    if (PurchaseOrderLink.SupplierLink.Currency.ID != Guid.Empty)
+                        ForeignCurrencyCost = cost * (PurchaseOrderLink.SupplierLink.Currency.ExchangeRate.IsEffectivelyEqual(0.0) ? 1.0 : PurchaseOrderLink.SupplierLink.Currency.ExchangeRate);
+                    
                 }
 
                 else if (name.Equals(nameof(ExTax)) && after is double extax)