currency rate by document or by transaction

Description

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.

Environment

None

Activity

Show:
Michael Powacht
February 26, 2021, 2:53 AM

Currently, this solution doesn’t address a multi-country/organization and multi-schema scenario. Forum discussions in progress here: ttps://groups.google.com/g/idempiere/c/9BIjom1Oeqs/m/3fAiOwWMBQAJ

Michael Powacht
February 20, 2021, 11:06 AM

After investigating the issue reported under it seems, it’s also related to the changes made under this ticket.

Carlos Ruiz
February 16, 2021, 11:56 AM

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

Carlos Ruiz
November 10, 2020, 4:52 PM

Thanks .

I also found a problem in the bank statement, create button and is ready for peer review in pull request 372

Luis Amesty
November 10, 2020, 3:51 PM

Hi Carlos

  1. On Functions:
    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.

  2. Function currencyrate:
    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.

  3. All the Functions mentioned on point 1.
    They all includes a Allocation amount calculation loop for v_PaidAmt. Like:
    LOOP

            v_Temp := ar.Amount + ar.DisCountAmt + ar.WriteOffAmt;

    v_PaidAmt := v_PaidAmt

            -- Allocation

    + 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;

    END LOOP;
    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.
    WDYT ?

  4. Finally. I could contribute on Java Classes too. But let me Un Lock all my Jasper reports affected by this feature, First.

    regards
    Luis Amesty



Assignee

Carlos Ruiz

Reporter

Thomas Bayen

Labels

Tested By

None

Fix versions

Priority

Major