Hello
I have this issue where all invoices created from the below code are always created with payment method "Cash", even though I make it "Pay Later". Also, the invoices have a "PAID" stamp on them, which they shouldn't according to SAGE users here.
Here's the code:
salesInvoice = SDKInstanceManager.Instance.OpenSalesJournal();
salesInvoice.SetJournalDate(invDate.ToString("yyyy-MM-dd"));
salesInvoice.SelectTransType(0);
salesInvoice.SelectPaidByType("Pay Later");
salesInvoice.InvoiceNumber = inv.tec_manualinvoicenumber;
salesInvoice.SetShipDate(salesInvoice.GetJournalDate());
if (!string.IsNullOrEmpty(custLedger.Contact)) {
salesInvoice.SelectAPARLedger(custLedger.Contact);
}
salesInvoice.SelectShiptoAddressName("<Mailing Address>");
salesInvoice.SetShipToAddressLine(inv.invoice_customer_accounts.Name, 1);
if (!string.IsNullOrEmpty(custLedger.Contact)) salesInvoice.SetShipToAddressLine(custLedger.Contact, 2);
if (!string.IsNullOrEmpty(custLedger.Street1)) salesInvoice.SetShipToAddressLine(custLedger.Street1, 3);
if (!string.IsNullOrEmpty(custLedger.City) && !string.IsNullOrEmpty(custLedger.Province)) salesInvoice.SetShipToAddressLine(string.Format("{0}, {1}", custLedger.City, custLedger.Province), 4);
if (!string.IsNullOrEmpty(custLedger.PostalCode)) salesInvoice.SetShipToAddressLine(custLedger.PostalCode, 5);
//add all the lines...
salesInvoice.SetFreightAmount(0.00);
salesInvoice.SetComment("");
salesInvoice.Post();
custLedger is a CustomerLedger, fetched by another method (that works fine).
Any ideas as to why this is happening ? I literally took the code from a console application and put it in a web service and it's not doing what people expect apparently.
Thanks.