Explorar o código

Adding customers and suppliers as fragments to bills, invoices and receipts

Kenric Nugteren hai 1 ano
pai
achega
74ee200105

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

@@ -54,7 +54,7 @@ namespace Comal.Classes
 
     [UserTracking(typeof(Job))]
     public class Customer : Entity, IPersistent, IRemotable, ISchedulable, ILicense<ProjectManagementLicense>, IExportable, IImportable, IMergeable,
-        IPostable, IPostableFragment<Invoice>
+        IPostable, IPostableFragment<Invoice>, IPostableFragment<Receipt>
     {
         [EditorSequence(1)]
         [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]

+ 2 - 1
prs.classes/Entities/Supplier/Supplier.cs

@@ -54,7 +54,8 @@ namespace Comal.Classes
     }
 
     [UserTracking(typeof(Bill))]
-    public class Supplier : Entity, IPersistent, IRemotable, ILicense<CoreLicense>, IExportable, IImportable, IMergeable, IPostable
+    public class Supplier : Entity, IPersistent, IRemotable, ILicense<CoreLicense>, IExportable, IImportable, IMergeable, IPostable,
+        IPostableFragment<Bill>
     {
         [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
         [EditorSequence(1)]

+ 1 - 0
prs.shared/Posters/MYOB/BillMYOBPoster.cs

@@ -130,6 +130,7 @@ public class BillMYOBPoster : IMYOBPoster<Bill, BillMYOBPosterSettings>
                 }
                 myobBill.Supplier ??= new();
                 myobBill.Supplier.UID = supplierID;
+                results.AddFragment(supplier);
             }
 
             // myobBill.ShipToAddress = 

+ 1 - 0
prs.shared/Posters/MYOB/InvoiceMYOBPoster.cs

@@ -124,6 +124,7 @@ public class InvoiceMYOBPoster : IMYOBPoster<Invoice, InvoiceMYOBPosterSettings>
                 }
                 myobInvoice.Customer ??= new();
                 myobInvoice.Customer.UID = customerID;
+                results.AddFragment(customer);
             }
             // myobInvoice.PromisedDate = 
             if(invoiceLines.TryGetValue(invoice.ID, out var lines))

+ 1 - 0
prs.shared/Posters/MYOB/ReceiptMYOBPoster.cs

@@ -112,6 +112,7 @@ public class ReceiptMYOBPoster : IMYOBPoster<Receipt, ReceiptMYOBPosterSettings>
                 }
                 myobReceipt.Customer ??= new();
                 myobReceipt.Customer.UID = customerID;
+                results.AddFragment(customer);
             }
 
             // myobReceipt.ReceiptNumber =