ct->get_delivery auf template umgestellt
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Jan 2008 17:02:44 +0000 (17:02 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Jan 2008 17:02:44 +0000 (17:02 +0000)
bin/mozilla/ct.pl
templates/webpages/ct/get_delivery_de.html [new file with mode: 0644]
templates/webpages/ct/get_delivery_master.html [new file with mode: 0644]

index b8451f9..9e5e188 100644 (file)
@@ -542,85 +542,9 @@ sub get_delivery {
 
   CT->get_delivery(\%myconfig, \%$form );
 
-  @column_index =
-    $form->sort_columns(shiptoname,
-                        invnumber,
-                        ordnumber,
-                        transdate,
-                        description,
-                        qty,
-                        unit,
-                        sellprice);
-
-
-
-  $column_header{shiptoname} =
-    qq|<th class=listheading>| . $locale->text('Shipping Address') . qq|</th>|;
-  $column_header{invnumber} =
-      qq|<th class=listheading>|. $locale->text('Invoice'). qq|</th>|;
-  $column_header{ordnumber} =
-      qq|<th class=listheading>|. $locale->text('Order'). qq|</th>|;
-  $column_header{transdate} =
-    qq|<th class=listheading>| . $locale->text('Invdate') . qq|</th>|;
-  $column_header{description} =
-    qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
-  $column_header{qty} =
-    qq|<th class=listheading>| . $locale->text('Qty') . qq|</th>|;
-  $column_header{unit} =
-    qq|<th class=listheading>| . $locale->text('Unit') . qq|</th>|;
-  $column_header{sellprice} =
-    qq|<th class=listheading>| . $locale->text('Sell Price') . qq|</th>|;
-  $result .= qq|
-
-<table width=100%>
-  <tr>
-    <td>
-      <table width=100%>
-       <tr class=listheading>
-|;
-
-  map { $result .= "$column_header{$_}\n" } @column_index;
-
-  $result .= qq|
-        </tr>
-|;
-
-
-  foreach $ref (@{ $form->{DELIVERY} }) {
-
-    if ($ref->{shiptoname} eq $sameshiptoname) {
-      map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } @column_index;
-      $column_data{shiptoname} = "<td>&nbsp;</td>";
-    } else {
-      map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } @column_index;
-    }
-    $column_data{sellprice} = "<td>". $form->format_amount(\%myconfig,$ref->{sellprice},2)."&nbsp;</td>";
-    $i++;
-    $i %= 2;
-    $result .= "
-        <tr class=listrow$i>
-";
-
-    map { $result .= "$column_data{$_}\n" } @column_index;
-
-    $result .= qq|
-        </tr>
-|;
-
-    $sameshiptoname = $ref->{shiptoname};
-
-  }
-
-  $result .= qq|
-      </table>
-|;
-
-
-  my $q = new CGI;
-  print $q->header();
-  print $result;
+  print CGI->new->header();
+  print $form->parse_html_template('ct/get_delivery');
   $lxdebug->leave_sub();
-
 }
 
 sub continue { call_sub($form->{nextsub}); }
diff --git a/templates/webpages/ct/get_delivery_de.html b/templates/webpages/ct/get_delivery_de.html
new file mode 100644 (file)
index 0000000..9f723f7
--- /dev/null
@@ -0,0 +1,30 @@
+[% USE LxERP %]
+<table width=100%>
+  <tr>
+    <td>
+      <table width=100%>
+        <tr class=listheading>
+          <th class=listheading>Lieferadresse</th>
+          <th class=listheading>Rechnung</th>
+          <th class=listheading>Auftrag</th>
+          <th class=listheading>Rechnungsdatum</th>
+          <th class=listheading>Beschreibung</th>
+          <th class=listheading>Menge</th>
+          <th class=listheading>Einheit</th>
+          <th class=listheading>Verkaufspreis</th>
+        </tr>
+[%- FOREACH row = DELIVERY %]
+        <tr class=listrow[% loop.count % 2 %]>
+          
+          <td>[% row.shiptoname UNLESS loop.prev.shiptoname == row.shiptoname %]&nbsp;</td>
+          <td>[% row.invnumber   %]&nbsp;</td>
+          <td>[% row.ordnumber   %]&nbsp;</td>
+          <td>[% row.transdate   %]&nbsp;</td>
+          <td>[% row.description %]&nbsp;</td>
+          <td>[% row.qty         %]&nbsp;</td>
+          <td>[% row.unit        %]&nbsp;</td>
+          <td>[% LxERP.format_amount(row.sellprice, 2) %]&nbsp;</td>
+        </tr>
+[%- END %]
+
+     </table>
diff --git a/templates/webpages/ct/get_delivery_master.html b/templates/webpages/ct/get_delivery_master.html
new file mode 100644 (file)
index 0000000..772b83b
--- /dev/null
@@ -0,0 +1,30 @@
+[% USE LxERP %]
+<table width=100%>
+  <tr>
+    <td>
+      <table width=100%>
+        <tr class=listheading>
+          <th class=listheading><translate>Shipping Address</translate></th>
+          <th class=listheading><translate>Invoice</translate></th>
+          <th class=listheading><translate>Order</translate></th>
+          <th class=listheading><translate>Invdate</translate></th>
+          <th class=listheading><translate>Description</translate></th>
+          <th class=listheading><translate>Qty</translate></th>
+          <th class=listheading><translate>Unit</translate></th>
+          <th class=listheading><translate>Sell Price</translate></th>
+        </tr>
+[%- FOREACH row = DELIVERY %]
+        <tr class=listrow[% loop.count % 2 %]>
+          
+          <td>[% row.shiptoname UNLESS loop.prev.shiptoname == row.shiptoname %]&nbsp;</td>
+          <td>[% row.invnumber   %]&nbsp;</td>
+          <td>[% row.ordnumber   %]&nbsp;</td>
+          <td>[% row.transdate   %]&nbsp;</td>
+          <td>[% row.description %]&nbsp;</td>
+          <td>[% row.qty         %]&nbsp;</td>
+          <td>[% row.unit        %]&nbsp;</td>
+          <td>[% LxERP.format_amount(row.sellprice, 2) %]&nbsp;</td>
+        </tr>
+[%- END %]
+
+     </table>