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

SF.net SVN: ledger-smb:[5925] trunk/LedgerSMB/Scripts/payment.pm



Revision: 5925
          http://sourceforge.net/p/ledger-smb/code/5925
Author:   tshvr
Date:     2013-07-27 09:58:55 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
coding ?:,format_amount needs PGNumber to format correctly

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/payment.pm

Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm	2013-07-26 14:49:44 UTC (rev 5924)
+++ trunk/LedgerSMB/Scripts/payment.pm	2013-07-27 09:58:55 UTC (rev 5925)
@@ -825,7 +825,10 @@
       $request->{"optional_discount_$array_options[$ref]->{invoice_id}"} = $request->{first_load}? "on":  $request->{"optional_discount_$array_options[$ref]->{invoice_id}"};
 
 # LETS SET THE EXCHANGERATE VALUES
-   my $due_fx = $request->{"optional_discount_$array_options[$ref]->{invoice_id}"} ? $request->round_amount($array_options[$ref]->{due_fx}) : $request->round_amount($array_options[$ref]->{due_fx});
+   #tshvr4 meaning of next statement? does the same in either case!
+   #my $due_fx = $request->{"optional_discount_$array_options[$ref]->{invoice_id}"} ? $request->round_amount($array_options[$ref]->{due_fx}) : $request->round_amount($array_options[$ref]->{due_fx});
+   my $due_fx = $request->round_amount($array_options[$ref]->{due_fx});
+
    my $topay_fx_value;
    if ("$exchangerate") {
        $topay_fx_value =   $due_fx;
@@ -1046,7 +1049,10 @@
  notes => $request->{notes},
  overpayment         => ..hidden..,
  overpayment_account => ..hidden..,
- format_amount => sub {return $Payment->format_amount(amount=>@_)}
+ #tshvr4 format_amount() should be passed PGNumber to format correctly
+ #tshvr4 e.g  $request_topay_fx_bigfloat, passed as string to template, passed back as string to format_amount , '3.14' then bad formatted if numberformat '1.000,00'
+ #format_amount => sub {return $Payment->format_amount(amount=>@_)}
+ format_amount => sub {return $Payment->format_amount(amount=>new LedgerSMB::PGNumber(@_))} #tshvr4
 };
 
 $select->{selected_account} = $vc_options[0]->{cash_account_id} 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.