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

SF.net SVN: ledger-smb:[3307] trunk



Revision: 3307
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3307&view=rev
Author:   einhverfr
Date:     2011-06-21 14:41:12 +0000 (Tue, 21 Jun 2011)

Log Message:
-----------
Added internal notes field to ar/ap transactions (no db schema changes needed)
save_info now works

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/bin/aa.pl
    trunk/bin/ir.pl
    trunk/bin/is.pl

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2011-06-20 23:53:31 UTC (rev 3306)
+++ trunk/LedgerSMB/AA.pm	2011-06-21 14:41:12 UTC (rev 3307)
@@ -376,6 +376,7 @@
 			netamount = ?,
 			curr = ?,
 			notes = ?,
+			intnotes = ?,
 			department_id = ?,
 			ponumber = ?,
                         reverse = ?
@@ -389,7 +390,7 @@
         $form->{duedate},       $paid,
         $datepaid,              $invnetamount,
         $form->{currency},      $form->{notes},
-        $form->{department_id},
+        $form->{intnotes},      $form->{department_id},
         $form->{ponumber},      $form->{reverse},
         $form->{id}
     );
@@ -1507,4 +1508,20 @@
 
 }
 
+sub save_intnotes {
+    my ($self,$form) = @_;
+    my $table;
+    if ($form->{arap} eq 'ar') {
+        $table = 'ar';
+    } elsif ($form->{arap} eq 'ap') {
+        $table = 'ap';
+    } else {
+        $form->error('Bad arap in save_intnotes');
+    }
+    my $sth = $form->{dbh}->prepare("UPDATE $table SET intnotes = ? " .
+                                      "where id = ?");
+    $sth->execute($form->{intnotes}, $form->{id});
+    $form->{dbh}->commit;
+}
+
 1;

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2011-06-20 23:53:31 UTC (rev 3306)
+++ trunk/bin/aa.pl	2011-06-21 14:41:12 UTC (rev 3307)
@@ -516,6 +516,8 @@
     }
     $notes =
 qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+    $intnotes =
+qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</textarea>|;
 
     $department = qq|
 	      <tr>
@@ -805,10 +807,17 @@
 	  <td></td>
 	  <td><select name=$form->{ARAP}>$form->{"select$form->{ARAP}"}</select></td>
         </tr>
+        <tr>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+           <th align=left>| . $locale->text('Notes') . qq|</th>
+           <th align=left>| . $locale->text('Internal Notes') . qq|</th>
+        </tr>
 	<tr>
-	  <th align=right>| . $locale->text('Notes') . qq|</th>
-	  <td></td>
-	  <td colspan=3>$notes</td>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+	  <td>$notes</td>
+          <td>$intnotes</td>
 	</tr>
       </table>
     </td>
@@ -1292,10 +1301,11 @@
 
 sub save_info {
 
-    
 	    my $taxformfound=0;
 
 	    $taxformfound=AA->taxform_exist($form,$form->{"$form->{vc}_id"});
+            $form->{arap} = lc($form->{ARAP});
+            AA->save_intnotes($form);
 	    
 	    foreach my $i(1..($form->{rowcount}))
 	    {

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2011-06-20 23:53:31 UTC (rev 3306)
+++ trunk/bin/ir.pl	2011-06-21 14:41:12 UTC (rev 3307)
@@ -1154,11 +1154,12 @@
 
 
 sub save_info {
-
     
 	    my $taxformfound=0;
 
 	    $taxformfound=IR->taxform_exist($form,$form->{"vendor_id"});
+            $form->{arap} = 'ap';
+            AA->save_intnotes($form);
 	    
         #print STDERR qq|___Rowcount=$form->{rowcount} _______|;
 

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2011-06-20 23:53:31 UTC (rev 3306)
+++ trunk/bin/is.pl	2011-06-21 14:41:12 UTC (rev 3307)
@@ -1239,13 +1239,14 @@
 
 
 sub save_info {
-
     
 	    my $taxformfound=0;
 
 	    $taxformfound=IS->taxform_exist($form,$form->{"customer_id"});
 	    
         #print STDERR qq|___Rowcount=$form->{rowcount} _______|;
+            $form->{arap} = 'ar';
+            AA->save_intnotes($form);
 
 	    foreach my $i(1..($form->{rowcount}))
 	    {


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