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

SF.net SVN: ledger-smb:[5874] branches/1.3



Revision: 5874
          http://sourceforge.net/p/ledger-smb/code/5874
Author:   tshvr
Date:     2013-05-26 20:50:49 +0000 (Sun, 26 May 2013)
Log Message:
-----------
on_hold vendor invoice via ir.pl and IR.pm to table ap

Modified Paths:
--------------
    branches/1.3/LedgerSMB/IR.pm
    branches/1.3/bin/ir.pl

Modified: branches/1.3/LedgerSMB/IR.pm
===================================================================
--- branches/1.3/LedgerSMB/IR.pm	2013-05-26 08:29:13 UTC (rev 5873)
+++ branches/1.3/LedgerSMB/IR.pm	2013-05-26 20:50:49 UTC (rev 5874)
@@ -1584,12 +1584,13 @@
     if ($form->{id}) { # it's an existing (.. probably) invoice.
         
         my $dbh = $form->{dbh};
-        my $sth = $dbh->prepare("SELECT on_hold from ar where ar.id = ?");
+        #my $sth = $dbh->prepare("SELECT on_hold from ar where ar.id = ?");#tshvr4
+        my $sth = $dbh->prepare("SELECT on_hold from ap where ap.id = ?");
         $sth->execute($form->{id});
         my $state = $sth->fetchrow_array;
         my $n_s; # new state
-        if ($state[0] == 't') {
-            
+        #if ($state[0] == 't') {
+        if ($state) {#tshvr4            
             # Turn it off
             $n_s = 'f';
             
@@ -1597,8 +1598,10 @@
             $n_s = 't';
         }
         
-        $sth = $dbh->prepare("update ar set on_hold = ?::boolean where ar.id = ?");
-        my $code = $dbh->execute($ns, $form->{id});
+        #$sth = $dbh->prepare("update ar set on_hold = ?::boolean where ar.id = ?");#tshvr4
+        $sth = $dbh->prepare("update ap set on_hold = ?::boolean where ap.id = ?");
+        #my $code = $dbh->execute($ns, $form->{id});#tshvr4
+        my $code = $sth->execute($n_s, $form->{id});#tshvr4
         
         return 1;
         

Modified: branches/1.3/bin/ir.pl
===================================================================
--- branches/1.3/bin/ir.pl	2013-05-26 08:29:13 UTC (rev 5873)
+++ branches/1.3/bin/ir.pl	2013-05-26 20:50:49 UTC (rev 5874)
@@ -39,7 +39,6 @@
 #======================================================================
 
 use LedgerSMB::IR;
-use LedgerSMB::IS;
 use LedgerSMB::PE;
 use LedgerSMB::Tax;
 
@@ -1402,8 +1401,8 @@
 sub on_hold {
     
     if ($form->{id}) {
-        
-my $toggled = IS->toggle_on_hold($form);
+	#my $toggled = IS->toggle_on_hold($form);#tshvr4
+	my $toggled = IR->toggle_on_hold($form);#tshvr4
     
         #&invoice_links(); # is that it?
         &edit(); # it was already IN edit for this to be reached.

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