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

SF.net SVN: ledger-smb:[3731] branches/1.3/scripts/payment.pl



Revision: 3731
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3731&view=rev
Author:   einhverfr
Date:     2011-09-22 18:30:54 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
Allowing customizations to easily allow for checking/unchecking all payments by default

Modified Paths:
--------------
    branches/1.3/scripts/payment.pl

Modified: branches/1.3/scripts/payment.pl
===================================================================
--- branches/1.3/scripts/payment.pl	2011-09-22 18:02:13 UTC (rev 3730)
+++ branches/1.3/scripts/payment.pl	2011-09-22 18:30:54 UTC (rev 3731)
@@ -570,6 +570,7 @@
             if (($payment->{action} ne 'update_payments') 
                   or (defined $payment->{"id_$_->{contact_id}"})){
                    $payment->{"paid_$_->{contact_id}"} = "" unless defined $payment->{"paid_$_->{contact_id}"};
+
                    if ($payment->{"paid_$_->{contact_id}"} eq 'some'){
                       my $i_id = $invoice->[0];
                       my $payment_amt = $payment->parse_amount(
@@ -602,6 +603,12 @@
             $_->{contact_total} = $contact_total;
             $_->{to_pay} = $contact_to_pay;
             $payment->{grand_total} += $contact_total;
+
+            my ($check_all) = $payment->get_default_value_by_key('check_payments');
+            if ($payment->{account_class} == 1 and $check_all){
+                 $payment->{"id_$_->{contact_id}"} = $_->{contact_id};
+            }
+                       
         }
         $_->{total_due} = $payment->format_amount(amount =>  $_->{total_due},
                                                   money  => 1);

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