|
@@ -11,6 +11,7 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using MYOB.AccountRight.SDK.Contracts.Version2;
|
|
|
using MYOBBill = MYOB.AccountRight.SDK.Contracts.Version2.Purchase.ServiceBill;
|
|
|
using MYOBBillLine = MYOB.AccountRight.SDK.Contracts.Version2.Purchase.ServiceBillLine;
|
|
|
using MYOBTaxCode = MYOB.AccountRight.SDK.Contracts.Version2.GeneralLedger.TaxCode;
|
|
@@ -95,6 +96,7 @@ public class BillMYOBPoster : IMYOBPoster<Bill, BillMYOBPosterSettings>
|
|
|
.Add(x => x.PostedReference)
|
|
|
.Add(x => x.Number)
|
|
|
.Add(x => x.AccountingDate)
|
|
|
+ .Add(x => x.PaymentDate)
|
|
|
.Add(x => x.SupplierLink.ID)
|
|
|
.Add(x => x.Description);
|
|
|
}
|
|
@@ -163,6 +165,10 @@ public class BillMYOBPoster : IMYOBPoster<Bill, BillMYOBPosterSettings>
|
|
|
|
|
|
// Probably configure which date.
|
|
|
myobBill.Date = bill.AccountingDate;
|
|
|
+
|
|
|
+ myobBill.Terms ??= new();
|
|
|
+ myobBill.Terms.PaymentIsDue = TermsPaymentType.InAGivenNumberOfDays;
|
|
|
+ myobBill.Terms.BalanceDueDate = (bill.PaymentDate.Date - bill.BillDate.Date).Days + 1;
|
|
|
myobBill.SupplierInvoiceNumber = bill.Number.Truncate(255);
|
|
|
|
|
|
if(suppliers.TryGetValue(bill.SupplierLink.ID, out var supplier))
|