Controlling printing and emailing on processing sales orders  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Controlling printing and emailing on processing sales orders

Postby Atronics » Wed Apr 20, 2016 2:39 pm

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?
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Controlling printing and emailing on processing sales or

Postby Scott.Pearce » Thu Apr 21, 2016 9:39 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Controlling printing and emailing on processing sales or

Postby Atronics » Fri Apr 22, 2016 5:30 pm

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.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Controlling printing and emailing on processing sales or

Postby Atronics » Mon Aug 22, 2016 4:32 pm

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.
Attachments
Plugin Sales Orders. Print and email after Processed..xml
(38.75 KiB) Downloaded 170 times
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Controlling printing and emailing on processing sales or

Postby Mike.Sheen » Sat Nov 12, 2016 12:52 pm

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
Attachments
Plugin Sales Orders. Print and email after Processed..xml
Modified Plugin
(41.65 KiB) Downloaded 151 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Controlling printing and emailing on processing sales or  Topic is solved

Postby Atronics » Mon Nov 14, 2016 7:34 am

Thanks Mike.
You have had a busy weekend!
John
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests

cron