[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SF.net SVN: ledger-smb:[4249] branches/1.3/LedgerSMB/AA.pm



Hi Chris,

After testing more, I found that the rounding issue only affected
AR+AP /transactions/ -- ie not invoices.

Further more, the commenting out below works well: amounts in local
currency can't be entered into the system with higher precision than 2
digits (cents) while foreign currency amounts - 2 digits precise - get
posted at full translated precision now.

Seems like whatever 'one cent off' fixes were applied to 1.2 for
invoices didn't get applied to transactions?

Anyway,

I'm now confident that this commit fix solves one of my most prominent
FX issues.


Bye,


Erik.


On Sat, Dec 31, 2011 at 12:10 PM,  <..hidden..> wrote:
> Revision: 4249
>          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4249&view=rev
> Author:   ehuelsmann
> Date:     2011-12-31 11:10:54 +0000 (Sat, 31 Dec 2011)
> Log Message:
> -----------
> Fix mismatch in foreign currency AR/AP transaction creation and payment.
>
> Modified Paths:
> --------------
>    branches/1.3/LedgerSMB/AA.pm
>
> Modified: branches/1.3/LedgerSMB/AA.pm
> ===================================================================
> --- branches/1.3/LedgerSMB/AA.pm        2011-12-29 12:32:16 UTC (rev 4248)
> +++ branches/1.3/LedgerSMB/AA.pm        2011-12-31 11:10:54 UTC (rev 4249)
> @@ -188,7 +188,12 @@
>
>             # multiply by exchangerate
>             $amount = $amount{fxamount}{$i} * $form->{exchangerate};
> -            $amount{amount}{$i} = $form->round_amount( $amount - $diff, 2 );
> +
> +           # The following line used to be
> +           # $amount{amount}{$i} =  $form->round_amount( $amount - $diff, 2 );
> +           # but that causes problems when processing the payments
> +           # due to the fact that the payments are un-rounded
> +            $amount{amount}{$i} = $amount;
>             $diff = $amount{amount}{$i} - ( $amount - $diff );
>
>             ( $null, $project_id ) = split /--/, $form->{"projectnumber_$i"};
> @@ -267,9 +272,12 @@
>     }
>
>     $fxinvamount += $fxtax unless $form->{taxincluded};
> -    $fxinvamount = $form->round_amount( $fxinvamount, 2 );
> -    $invamount   = $form->round_amount( $invamount,   2 );
> -    $paid        = $form->round_amount( $paid,        2 );
> +#   These lines are commented out because payments get posted without
> +#   rounding. Having rounded amounts on the AR/AP creation side leads
> +#   to unmatched payments
> +#    $fxinvamount = $form->round_amount( $fxinvamount, 2 );
> +#    $invamount   = $form->round_amount( $invamount,   2 );
> +#    $paid        = $form->round_amount( $paid,        2 );
>
>     $paid =
>       ( $fxinvamount == $paid )
>
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Ledger-smb-commits mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits