currency rate by document or by transaction
We discussed that on the iDempiere Chateau Chapelle Workshop 2019.
We like to set a currency rate per document because the rate may change during days or for other reasons. We like a field to set a "manual" currency rate calculation in a document header.
There is a patch from TrekGlobal that uses a spot currency rate type (e.g. "manual") that allows to enter a currency rate for every single document. Carlos likes to review the TrekGlobal implementation.
After investigating the issue reported under it seems, it’s also related to the changes made under this ticket.
Annoying message found copying a record in the Payment window:
Open Payment window and search for record with DocumentNo = 400000
Click the Copy Record button
Harmless but confusing message is shown: Invalid:Rate
Functions invoicepaid, invoicepaidtodate, invoiceopen, invoiceopentodate, invoiceopentodatewithTS, paymentallocated, paymentavailable.
I am working with them on PostgreSQL, because I used then on many Jasper reports. I would add invoiceopen and invoiceopentodate to the list.
I don’t have oracle test dev, but I could give you mi comments about them or final code script when I finish testing.
This function is used by currencyconvert function, which in turn is used by currencyconvertinvoice and currencyconvertpayment. But as you say ”intended for generic conversions, not related to invoices/payments”
NOT need to be considered.
All the Functions mentioned on point 1.
They all includes a Allocation amount calculation loop for v_PaidAmt. Like:
v_Temp := ar.Amount + ar.DisCountAmt + ar.WriteOffAmt;
v_PaidAmt := v_PaidAmt
+ currencyConvert(v_Temp * v_MultiplierAP,
ar.C_Currency_ID, v_Currency_ID, ar.DateTrx, null, ar.AD_Client_ID, ar.AD_Org_ID);
RAISE NOTICE ' PaidAmt=% , Allocation= % * %', v_PaidAmt, v_Temp, v_MultiplierAP;
The function currencyconvert is called with null parameter on C_ConversionType_ID. So a generic and any CurrencyType value for CurrencyRate is returned.
This is due, because C_AllocationHdr table doesn't have C_ConversionType_ID field. But in spite of, a right value must be taken from Invoice or payment allocated with, in order to calculate v_PaidAmt value correctly.
Finally. I could contribute on Java Classes too. But let me Un Lock all my Jasper reports affected by this feature, First.