Page 1 of 1
Controlling printing and emailing on processing sales orders

Posted:
Wed Apr 20, 2016 2:39 pm
by Atronics
A client wants to do the following on processing a sales order;
1. If it is a "cash only" debtor (DB_Main setting) then print the invoice.
2. If it is an account customer then print the delivery docket and email the invoice.
How do I make the above occur?
Re: Controlling printing and emailing on processing sales or

Posted:
Thu Apr 21, 2016 9:39 am
by Scott.Pearce
Do you still want the dialogs to appear - "Print Type" that usually appears upon processing, and "Email Options" that usually appears when the "Email" button is clicked?
I could have them still popup but with defaults set as per your requirements - this would allow the user to quickly eyeball to ensure everything is sane.
Alternatively, I could suppress the popups, and just push the various default values straight through (print and email).
Let me know and I can knock something up.
Re: Controlling printing and emailing on processing sales or

Posted:
Fri Apr 22, 2016 5:30 pm
by Atronics
Hi Scott.
We need a very simple solution, without any popup. Pressing "Process" needs to be the only user action. --> Print Invoice to Cash Only debtors or Print Del Dcc and email invoice for other debtors.
Re: Controlling printing and emailing on processing sales or

Posted:
Mon Aug 22, 2016 4:32 pm
by Atronics
Hi Scott,
Back to the plugin. The attached works fine for manually processed sales orders but fails. . When the debtor is Cash, the invoice is successfully printed however when non cash, I am getting an error. I cannot locate the part of the code which is failing, made harder when it works if a cash debtor (as a batch process), and also works if the sales order is processed individually.
Would you be able to have a look at this to find where the problem is.
Thanks.
Re: Controlling printing and emailing on processing sales or

Posted:
Sat Nov 12, 2016 12:52 pm
by Mike.Sheen
Hi John,
I had an error "Unable to update table SO_Main..." when testing with your plugin. I found the problem to be the bill types having invoices configured as well - so it was trying to email multiple invoices without re-reading them first (so upon save the concurrency control determined the data was stale) , so by simply adding
- Code: Select all
AndAlso salesOrderReport.BillingType = salesOrder.BillType Then
to your checks for which report to print / email and the problem went away.
Modified plugin attached.
Mike
Re: Controlling printing and emailing on processing sales or 

Posted:
Mon Nov 14, 2016 7:34 am
by Atronics
Thanks Mike.
You have had a busy weekend!
John