Sales Order Processing Screen

Discussions relating to plugin development, and the Jiwa API.

Re: Sales Order Processing Screen

Postby pricerc » Fri Feb 21, 2020 2:49 pm

So attached is my plugin which adds an "Order No" filter to the batch sales processing screen.

If your filter's stored procedure has the string 'AERP' in the name, it will run a custom version of the candidate population logic, adding the "Order No" filter to the logic. It will also put the Order No into the "Remark" field in the candidate list.

If your filter's stored procedure does not have the string 'AERP' in the name, it will run the standard JIWA logic.

The current use-case for my customer's requirement is the default value for the Order No filter, which is used in a CHARINDEX clause in the stored procedure; this could easily be changed to use a 'LIKE' clause instead.

My stored procedure also returns 'Active' orders and excludes credit notes.

The SQL Script is in the plugin documents. It also includes a test execution of the stored procedure so that you can make sure it's returning useful data before trying to use it in JIWA.

Unlike the manual BO process customisation referenced at the start of this thread, this doesn't need reflection.

I also dabbled with disabling some of the filters, there are some commented-out lines for this in the setup method.

ProcessingScreenShot.png
Screen shot
Attachments
Plugin AERP - 836 - Sales Order Processing UI.xml
Plugin
(42.67 KiB) Downloaded 6 times
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
User avatar
pricerc
Jiwa Kohai
Jiwa Kohai
 
Posts: 226
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 6

Re: Sales Order Processing Screen

Postby SBarnes » Sat Feb 22, 2020 8:19 am

Hi Ryan,

Having a quick look at you code you largely did the same thing I did except that you added a control to the form where as I used add column on the ranges grid, but then we both took over control og the click of the button and threw a client cancelled exception to stop Jiwa's button click.

Same principle just applied in a slightly different way.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 816
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 71

Re: Sales Order Processing Screen

Postby pricerc » Fri Feb 28, 2020 2:28 pm

Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
User avatar
pricerc
Jiwa Kohai
Jiwa Kohai
 
Posts: 226
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 6

Re: Sales Order Processing Screen

Postby SBarnes » Fri Feb 28, 2020 2:34 pm

I would suggest a custom field on the order and put the process run number there, of course your other option would be to print them as you process them.

I am pretty sure you can update a custom field on a processed order as I can tell you the ui will let you do it.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 816
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 71

Re: Sales Order Processing Screen

Postby Mike.Sheen » Fri Feb 28, 2020 5:28 pm

pricerc wrote:Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?


Add a handler to the OnProcessStart and OnProcessEnd events, and in the OnProcessStart handler, add a handler for the Removed event of the ProcessCandidates collection - the removed event gets raised after successful processing of each sales order. And in that Removed handler, you can add to your own list of what was processed.

Then, in the OnProcessEnd handler, remove your handler for the ProcessCandidates.Removed, and then you can do your printing.

If you wanted to invoke just one report with all sales orders identified as being in the batch just processed, then you can use the SO_History.RunNo of anything in your collection to find cohorts. The other option is to use the PrintProcessReport report option to invoke a single report at the conclusion of batch processing the the formula {SO_VInv.InvRunNo} is set by us to be that of the RunNo generated and set for each SO_History.RunNo.

I've also added improvement DEV-8119 to expose the RunNo as a property you can examine after processing to make this all much easier.
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
Jiwa Shihan
Jiwa Shihan
 
Posts: 1640
Joined: Tue Feb 12, 2008 11:12 am
Location: North Sydney
Topics Solved: 522

Re: Sales Order Processing Screen

Postby SBarnes » Fri Feb 28, 2020 5:42 pm

I forgot you can't get the process number, the change will definitely make things easier
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 816
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 71

Re: Sales Order Processing Screen

Postby Mike.Sheen » Fri Feb 28, 2020 8:02 pm

SBarnes wrote:I forgot you can't get the process number, the change will definitely make things easier


Well, you're one ahead of me then - I didn't even know that you cannot get the RunNo, let alone have known that and then forgotten it!
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
Jiwa Shihan
Jiwa Shihan
 
Posts: 1640
Joined: Tue Feb 12, 2008 11:12 am
Location: North Sydney
Topics Solved: 522

Re: Sales Order Processing Screen

Postby SBarnes » Sat Feb 29, 2020 8:49 am

I discovered it when I was trying to do the contortion of splitting the sales order into multiple debtor transactions on the sales order processing but then you generously provided the event that allowed that to happen, sorry for not letting you know as I assumed it was that way for a reason.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 816
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 71

Re: Sales Order Processing Screen

Postby pricerc » Sat Feb 29, 2020 12:21 pm

Mike.Sheen wrote:
pricerc wrote:Ok, so related question.

I've processed a bunch of orders through this screen.

If I want to go and print them through batch printing, is there a clever way of identifying the ones I've just processed?


Add a handler to the OnProcessStart and OnProcessEnd events, and in the OnProcessStart handler, add a handler for the Removed event of the ProcessCandidates collection - the removed event gets raised after successful processing of each sales order. And in that Removed handler, you can add to your own list of what was processed.

Then, in the OnProcessEnd handler, remove your handler for the ProcessCandidates.Removed, and then you can do your printing.

If you wanted to invoke just one report with all sales orders identified as being in the batch just processed, then you can use the SO_History.RunNo of anything in your collection to find cohorts. The other option is to use the PrintProcessReport report option to invoke a single report at the conclusion of batch processing the the formula {SO_VInv.InvRunNo} is set by us to be that of the RunNo generated and set for each SO_History.RunNo.


Thanks Mike,

At least I know what I'll be doing on Monday.
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
User avatar
pricerc
Jiwa Kohai
Jiwa Kohai
 
Posts: 226
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 6

Previous

Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron