FXRate issue  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

FXRate issue

Postby Riyaz » Tue Jul 31, 2018 7:05 pm

Hi There

Facing a weird problem, when we alter the FXRate column on the purchase order lines and then create a shipment for that purchase order, the shipment order lines comes up with a default FXRate all the time. Can you pls advise, thanks
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue

Postby Mike.Sheen » Tue Jul 31, 2018 7:22 pm

Riyaz wrote:Hi There

Facing a weird problem, when we alter the FXRate column on the purchase order lines and then create a shipment for that purchase order, the shipment order lines comes up with a default FXRate all the time. Can you pls advise, thanks


Hi Riyaz,

What version of Jiwa are you using?

Mike
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: FXRate issue

Postby Riyaz » Tue Jul 31, 2018 7:25 pm

Jiwa 7.1.0
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue

Postby Mike.Sheen » Tue Jul 31, 2018 8:05 pm

Hi Riyaz,

It looks like this is by design.

We intentionally use the current FX rate when a PO is added to the shipment, as we expect it may have changed between placing the PO and raising the invoice - so we set the FX rate to the current rate. This especially makes sense when you add multiple PO's to the shipment for the same supplier at different FX Rates - we create on consolidated invoice automatically (although the user can manually add invoices and set the rates and link the invoices to lines if desired).

If you think this behaviour is incorrect, or would like a better explanation, then I suggest you create an issue on our helpdesk and our support team will be able to better assist.

Mike
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: FXRate issue

Postby Riyaz » Mon Aug 06, 2018 12:50 pm

Hi Mike

Yes this is a problem because the value of the order changes when the purchase order is raised and when its being shipped.

Anyways, for the interim, am writing a plugin to fix this, but strange thing is that the value wont get, below is the code am using, the message box pop up with correct value but it wont get assigned.

public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Shipment Shipment = (JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Shipment)JiwaBusinessLogic;
Shipment.Lines.Added += adding;
}

private void adding(JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Line line)
{MessageBox.Show(line.PurchaseOrderLine.CurrencyRateUsed.ToString());
line.FXRate = line.PurchaseOrderLine.CurrencyRateUsed;
}
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue  Topic is solved

Postby Mike.Sheen » Tue Aug 07, 2018 10:20 am

Riyaz wrote:Yes this is a problem because the value of the order changes when the purchase order is raised and when its being shipped.


I'm not sure why that is a problem - there is no accounting impact until the goods are received or the invoice created - and for FX shipments the currency would normally change between the time of PO and goods receipt / invoice anyway.

When we receipt the goods we know the original PO FX Rate and reverse out the Expected Asset and Liability at the FX rate of the PO, and use the Invoice FX Rate on the shipment to work out the stock value.

Riyaz wrote:am writing a plugin to fix this, but strange thing is that the value wont get, below is the code am using, the message box pop up with correct value but it wont get assigned

We only recalculate things in the property setter of the FXRate of the Shipment Line under certain conditions - so setting that property won't work for you.

Set the FX Rate of the Shipment Invoice instead - this will automatically set the FX Rate of every shipment line associated with that invoice and will cause a recalculation.
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: FXRate issue

Postby Riyaz » Tue Aug 07, 2018 12:58 pm

Set the FX Rate of the Shipment Invoice instead - this will automatically set the FX Rate of every shipment line associated with that invoice and will cause a recalculation.


Thanks Mike, can you pls show me an example on how to do this, as we can only access the PO FXRate once the PO is added to the shipment
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue

Postby Riyaz » Fri May 10, 2019 11:33 am

Hi Mike

Pls advise on this, any example on how to set fx rate on shipment invoice to solve this, thanks
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue

Postby Riyaz » Mon May 13, 2019 11:25 am

Hi Mike

Pls let me know on this, as this has become critical now, couple of our clients are waiting on this, as they cant also edit the FX rate manually.
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: FXRate issue

Postby Scott.Pearce » Mon May 13, 2019 12:23 pm

When a purchase order is added to a shipment, it's lines are added as shipment lines. An invoice is also added for the supplier on the purchase order. If an invoice entry already exists for that supplier, an invoice entry is not created. The shipment lines for that supplier are associated with the invoice for that supplier. Additional invoices can be added, perhaps multiple invoices per supplier, and the lines can be manually associated to different invoices if desired.

Changing the FX fate on an invoice will change the FX rate for the associated shipment lines:

Capture.PNG


Changing the FX rate on a shipment invoice is allowed because it is likely that you will be charged a different FX rate than that which you entered when raising the purchase order because of normal FX currency fluctuations. When you use/enter an FX rate on a purchase order, you are really just "estimating" the FX rate so as to give the most accurate total possible. Of course, the likelihood of the FX rate being the same when the supplier actually generates the bill (invoice) to you is low.

The FX rate on a invoice can be changed pro-grammatically thus:

Code: Select all
    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
      JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Shipment Shipment = (JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Shipment)JiwaBusinessLogic;
      Shipment.Invoices.Added += Shipment_Invoices_Added;      
    }
   
   private void Shipment_Invoices_Added(JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Invoice Invoice)
   {
      Invoice.FXRate = 1;
   }


The code above will set the FX rate for added invoices (and hence shipment lines) to 1. Remember, invoices will be automatically added for each unique supplier as purchase orders are added to the shipment.
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

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron