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

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



Revision: 3239
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3239&view=rev
Author:   ehuelsmann
Date:     2011-06-13 17:36:52 +0000 (Mon, 13 Jun 2011)

Log Message:
-----------
Fix bug 3315195: sales orders report refers to non-existing ct.pl.

 * LedgerSMB/OE.pm (transactions): Return additional credit account info.
 * bin/oe.pl
  (transactions): Add support for a 'Number' column, containing the credit
     account number.
  (search): Add the 'Number' column to the default output.

Modified Paths:
--------------
    trunk/LedgerSMB/OE.pm
    trunk/bin/oe.pl

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2011-06-13 15:38:21 UTC (rev 3238)
+++ trunk/LedgerSMB/OE.pm	2011-06-13 17:36:52 UTC (rev 3239)
@@ -82,7 +82,7 @@
 			o.shippingpoint, o.shipvia,
 			pe.first_name \|\| ' ' \|\| pe.last_name AS employee, 
 			pm.first_name \|\| ' ' \|\| pm.last_name AS manager, 
-			o.curr, o.ponumber
+			o.curr, o.ponumber, ct.meta_number, c.entity_id
 		FROM oe o
 		JOIN entity_credit_account ct ON (o.entity_credit_account = ct.id)
 		JOIN company c ON (c.entity_id = ct.entity_id)

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2011-06-13 15:38:21 UTC (rev 3238)
+++ trunk/bin/oe.pl	2011-06-13 17:36:52 UTC (rev 3239)
@@ -1367,6 +1367,8 @@
 qq|<input name="l_reqdate" class=checkbox type=checkbox value=Y checked> $requiredby|;
     push @a,
 qq|<input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel|;
+    push @a,
+    qq|<input name="l_meta_number" class=checkbox type=checkbox value=Y checked>| . $locale->text('Number');
     push @a, $l_employee if $l_employee;
     push @a, $l_manager  if $l_manager;
     push @a, qq|<input name="l_shipvia" class=checkbox type=checkbox value=Y> |
@@ -1494,6 +1496,14 @@
     $name = $form->escape( $form->{ $form->{vc} } );
     $name .= qq|--$form->{"$form->{vc}_id"}| if $form->{"$form->{vc}_id"};
 
+    if ($form->{vc} eq 'customer') {
+	$account_class = 2;
+    } elsif ($form->{vc} eq 'vendor') {
+	$account_class = 1;
+    } else {
+	### fixme: invalid VC type
+    }
+
     # construct href
     $href = qq|$form->{script}?action=transactions|;
     for (
@@ -1540,7 +1550,7 @@
 
     @columns = $form->sort_columns(
         "transdate", "reqdate", "id",        "$ordnumber",
-        "ponumber",  "name",    "netamount", "tax",
+        "ponumber",  "name",    "meta_number", "netamount", "tax",
         "amount",    "curr",    "employee",  "manager",
         "shipvia",   "open",    "closed"
     );
@@ -1714,6 +1724,9 @@
 qq|<th><a class=listheading href=$href&sort=quonumber>$quotation</a></th>|;
     $column_header{name} =
       qq|<th><a class=listheading href=$href&sort=name>$name</a></th>|;
+    $column_header{meta_number} =
+      qq|<th><a class=listheading href=$href&sort=meta_number>|
+      . $locale->text('Number') . qq|</a></th>|;
     $column_header{netamount} =
       qq|<th class=listheading>| . $locale->text('Amount') . qq|</th>|;
     $column_header{tax} =
@@ -1917,9 +1930,13 @@
 "<td><a href=$form->{script}?path=$form->{path}&action=$action&type=$form->{type}&id=$oe->{id}&warehouse=$warehouse&vc=$form->{vc}&login=$form->{login}&sessionid=$form->{sessionid}&callback=$callback>$oe->{$ordnumber}</a></td>";
 
         $name = $form->escape( $oe->{name} );
+	$meta_number = $form->escape( $oe->{meta_number} );
         $column_data{name} =
-qq|<td><a href=ct.pl?path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&action=edit&id=$oe->{"$form->{vc}_id"}&db=$form->{vc}&callback=$callback>$oe->{name}</a></td>|;
+qq|<td><a href=$form->{vc}.pl?path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&action=get&entity_id=$oe->{entity_id}&meta_number=$meta_number&account_class=$account_class&callback=$callback>$name</a></td>|;
+        $column_data{meta_number} =
+qq|<td><a href=$form->{vc}.pl?path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&action=get&entity_id=$oe->{entity_id}&meta_number=$meta_number&account_class=$account_class&callback=$callback>$meta_number</a></td>|;
 
+
         for (qw(employee manager shipvia curr ponumber)) {
             $column_data{$_} = "<td>$oe->{$_}&nbsp;</td>";
         }


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