Purchase Order lines. Make Line Total Ex editable.  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Purchase Order lines. Make Line Total Ex editable.

Postby DannyC » Tue Mar 08, 2016 5:20 pm

Hi,

I am having trouble seeing if this is doable.

I can't find a suitable event to hook into in the FormPlugin class.
I have tried purchaseOrderForm.Load but can't work out how to get to the grid to open up Line Total Ex for editing.
I have also tried purchaseOrderForm.LinesJiwaGrid but unsure of the appropriate event to use.

If I was able to get this column unlocked, would Jiwa automatically calculate the Unit Cost Ex by dividing by the qty ordered?

Have scoured through past forum posts but can't locate anything similar.

Thanks

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Purchase Order lines. Make Line Total Ex editable.  Topic is solved

Postby Mike.Sheen » Sat Mar 12, 2016 12:54 pm

DannyC wrote:Hi,

I am having trouble seeing if this is doable.

I can't find a suitable event to hook into in the FormPlugin class.
I have tried purchaseOrderForm.Load but can't work out how to get to the grid to open up Line Total Ex for editing.
I have also tried purchaseOrderForm.LinesJiwaGrid but unsure of the appropriate event to use.

If I was able to get this column unlocked, would Jiwa automatically calculate the Unit Cost Ex by dividing by the qty ordered?

Have scoured through past forum posts but can't locate anything similar.

Thanks

Danny


The form won't pass on to the business logic any change event for that column, but the business logic will happily accept the change and perform recalculations for you.
So, it's a matter then of unlocking the column in a few places (ReadEnd, Line property changed) and then handling the grid change event for the column.

Attached is a plugin which does this.
Attachments
Plugin Purchase Order LineTotalExTax editable.xml
Plugin - unlock PO LineTotalExTax column
(32.3 KiB) Downloaded 815 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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Purchase Order lines. Make Line Total Ex editable.

Postby DannyC » Mon Mar 14, 2016 3:08 pm

Thanks Mike. That's a great little plugin.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Purchase Order lines. Make Line Total Ex editable.

Postby DannyC » Mon Mar 21, 2016 1:03 pm

Almost there.
Whilst this plugin opens up the Line Total Ex on the purchase order, the adjusted value doesn't flow through to the GRN and more importantly to the Purchase Invoice.

Using the same plugin framework, I have tried to make the ExLineTotal editable on the PI, but its a read only field.
I also thought I could use the FXTotal but that's coming up with an error "Set accessor of property FXTotal is not accessible."

Can you assist with this one too?

Thanks

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Purchase Order lines. Make Line Total Ex editable.

Postby Mike.Sheen » Mon Mar 21, 2016 3:09 pm

DannyC wrote:Whilst this plugin opens up the Line Total Ex on the purchase order, the adjusted value doesn't flow through to the GRN and more importantly to the Purchase Invoice.


It does for me.

In demo data, I created a new PO for supplier 5001 - auto search using replenish to minimum added two lines - changing the "Line Total ex. Tax" column reclalculated the Ex Price and Inc Price columns. Saving, Marking as Sent then creating the GRN and it shows the Ex Price to be the same as the PO.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Purchase Order lines. Make Line Total Ex editable.

Postby DannyC » Mon Mar 21, 2016 4:04 pm

My test was on a high qty with small unit cost items.
Try this:
Creditor 5005.
Items 6022 and 6025.

Qty for both lines: 144
Unit price ex for 6022 - change it to 1.74
Unit price ex for 6025 - change it to 0.91.

Then change the line total Ex for 6022 to $250.00
And for 6025 to $131.00

Try making a GRN. I've found that the GRN changes to line totals to $250.56 and $131.04 respectively.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Purchase Order lines. Make Line Total Ex editable.

Postby Mike.Sheen » Mon Mar 21, 2016 5:09 pm

DannyC wrote:Try making a GRN. I've found that the GRN changes to line totals to $250.56 and $131.04 respectively.


I see - The plugin is doing what it was designed to do, but it's the rounding of the Ex GST Unit price which is causing the GRN to have a different value.

When we create the GRN from the PO, we set the price ex of the GRN item to be the price ex of the PO.

You want it to set the GRN line total to be the PO Line Total instead. That is really a different problem to this topic. I'll see what I can do, but we'll probably need to alter Jiwa to accommodate this.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Purchase Order lines. Make Line Total Ex editable.

Postby DannyC » Mon Mar 21, 2016 5:23 pm

The line total may not be so important on the GRN, although would be good if it matched identically.
It's more important on the Purchase Invoice.
If the generated PI is incorrect, at least if the ExLineTotal was opened up for editing, this may suffice for the client.

cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Purchase Order lines. Make Line Total Ex editable.

Postby Mike.Sheen » Thu Apr 14, 2016 1:19 pm

DannyC wrote:The line total may not be so important on the GRN, although would be good if it matched identically.
It's more important on the Purchase Invoice.
If the generated PI is incorrect, at least if the ExLineTotal was opened up for editing, this may suffice for the client.


Generating the PI uses the GRN unit price and quantity, so you're never going to get the same line total on the PI as the PO if the GRN is rounding the unit price (as it currently does).

When the GRN is created from the PO, we set the quantity to 0, as we want the user to supply the quantity actually received. Because of this we can't have the line total on the GRN matching that of the PO. We could let the user enter the line total on the GRN, but we'd need to add a new field in RE_Lines to store that - and if we added the intelligence infer the cost price as (PO Line total / PO Quantity) and carry that in memory to a greater degree of precision than the currency precision, then we should be able to get the costs right on the GRN. If we apply the same logic to the PI, then we'd solve your problem.

I'm marking this topic as solved as the original requirement was to make the Line Total Ex on PO Lines editable, and this been met. You just have 2 new problems as a result.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests