Bei Kundenangeboten, Kundenaufträgen, Lieferantenbestellungen und Lieferantenanfragen...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 27 Apr 2007 12:08:16 +0000 (12:08 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 27 Apr 2007 12:08:16 +0000 (12:08 +0000)
SL/OE.pm
bin/mozilla/oe.pl
doc/dokumentenvorlagen-und-variablen.html
locale/de/all
locale/de/oe
sql/Pg-upgrade2/transaction_description.sql [new file with mode: 0644]

index 8e0cfb9..201f5b5 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -66,6 +66,7 @@ sub transactions {
     qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate, | .
     qq|  o.amount, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | .
     qq|  o.closed, o.delivered, o.quonumber, o.shippingpoint, o.shipvia, | .
+    qq|  o.transaction_description, | .
     qq|  ex.$rate AS exchangerate, | .
     qq|  pr.projectnumber AS globalprojectnumber, | .
     qq|  e.name AS employee | .
@@ -128,6 +129,11 @@ sub transactions {
     push(@values, conv_date($form->{transdateto}));
   }
 
+  if ($form->{transaction_description}) {
+    $query .= qq| AND o.transaction_description ILIKE ?|;
+    push(@values, '%' . $form->{transaction_description} . '%');
+  }
+
   my $sortorder = join(', ', ("o.id", $form->sort_columns("transdate", $ordnumber, "name")));
   my %allowed_sort_columns =
     ("transdate" => "o.transdate",
@@ -137,7 +143,8 @@ sub transactions {
      "quonumber" => "o.quonumber",
      "name" => "ct.name",
      "employee" => "e.name",
-     "shipvia" => "o.shipvia");
+     "shipvia" => "o.shipvia",
+     "transaction_description" => "o.transaction_description");
   if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
     $sortorder = $allowed_sort_columns{$form->{sort}};
   }
@@ -407,7 +414,7 @@ Message: $form->{message}\r| if $form->{message};
     qq|shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = ?, closed = ?, | .
     qq|delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?, | .
     qq|taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?, | .
-    qq|globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ? | .
+    qq|globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ? | .
     qq|WHERE id = ?|;
 
   @values = ($form->{ordnumber}, $form->{quonumber},
@@ -425,6 +432,7 @@ Message: $form->{message}\r| if $form->{message};
              conv_i($form->{delivery_customer_id}),
              conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
              conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
+             $form->{transaction_description},
              conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
 
@@ -669,7 +677,7 @@ sub retrieve {
       qq|  o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber, | .
       qq|  d.description AS department, o.payment_id, o.language_id, o.taxzone_id, | .
       qq|  o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id, | .
-      qq|  o.globalproject_id, o.delivered | .
+      qq|  o.globalproject_id, o.delivered, o.transaction_description | .
       qq|FROM oe o | .
       qq|JOIN ${vc} cv ON (o.${vc}_id = cv.id) | .
       qq|LEFT JOIN employee e ON (o.employee_id = e.id) | .
index 6c7cb65..3c55ee5 100644 (file)
@@ -814,7 +814,11 @@ onchange="document.getElementById('update_button').click();">| .
              <tr>
                <th align=right>| . $locale->text('Ship via') . qq|</th>
                <td colspan=3><input name=shipvia size=35 value="$form->{shipvia}"></td>
-             </tr>|;
+             </tr>
+              <tr>
+                <th align="right">| . $locale->text('Transaction description') . qq|</th>
+                <td colspan="3"><input name="transaction_description" size="35" value="| . H($form->{transaction_description}) . qq|"></td>
+              </tr>|;
 #              <tr>
 #                 <td colspan=4>
 #                   <table>
@@ -1461,6 +1465,10 @@ sub search {
           <th align=right>$ordlabel</th>
           <td colspan=3><input name="$ordnumber" size=20></td>
         </tr>
+        <tr>
+          <th align="right">| . $locale->text('Transaction description') . qq|</th>
+          <td colspan="3"><input name="transaction_description" size=20></td>
+        </tr>
         <tr>
           <th align="right">| . $locale->text("Project Number") . qq|</th>
           <td colspan="3">$projectnumber</td>
@@ -1506,8 +1514,12 @@ sub search {
     . $locale->text('Tax') . qq|</td>
                <td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
     . $locale->text('Total') . qq|</td>
+             </tr>
+             <tr>
           <td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> |
           . $locale->text('Project Number') . qq|</td>
+          <td><input name="l_transaction_description" class=checkbox type=checkbox value=Y> |
+          . $locale->text('Transaction description') . qq|</td>
              </tr>
              <tr>
                <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
@@ -1553,27 +1565,26 @@ sub orders {
 
   $ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber";
 
-  $number     = $form->escape($form->{$ordnumber});
-  $name       = $form->escape($form->{ $form->{vc} });
-  $department = $form->escape($form->{department});
-
   # construct href
-  $href =
-    "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}&notdelivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
-
-  # construct callback
-  $number     = $form->escape($form->{$ordnumber},    1);
-  $name       = $form->escape($form->{ $form->{vc} }, 1);
-  $department = $form->escape($form->{department},    1);
-
-  $callback =
-    "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}&notdelivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
-
-  @columns =
-    $form->sort_columns("transdate", "reqdate",   "id",      "$ordnumber",
-                        "name",      "netamount", "tax",     "amount",
-                        "curr",      "employee",  "shipvia", "globalprojectnumber",
-                        "open",      "closed",    "delivered");
+  my @fields =
+    qw(type vc login password transdatefrom transdateto
+       open closed notdelivered delivered department
+       transaction_description);
+  $href = "$form->{script}?action=orders&"
+    . join("&", map { "${_}=" . E($form->{$_}) } @fields)
+    . "&${ordnumber}=" . E($form->{$ordnumber});
+  $callback = $href;
+
+  @columns = (
+    "transdate",               "reqdate",
+    "id",                      "$ordnumber",
+    "name",                    "netamount",
+    "tax",                     "amount",
+    "curr",                    "employee",
+    "shipvia",                 "globalprojectnumber",
+    "transaction_description", "open",
+    "closed",                  "delivered"
+  );
 
   $form->{l_open} = $form->{l_closed} = "Y"
     if ($form->{open} && $form->{closed});
@@ -1667,6 +1678,9 @@ sub orders {
 
   $column_header{employee} =
     qq|<th><a class=listheading href=$href&sort=employee>$employee</a></th>|;
+  $column_header{transaction_description} =
+    qq|<th><a class=listheading href="$href&sort=transaction_description">|
+    . $locale->text("Transaction description") . qq|</a></th>|;
 
   $column_header{ids} = qq|<th></th>|;
 
@@ -1786,6 +1800,7 @@ sub orders {
     $column_data{"delivered"} = "<td>" .
       ($oe->{"delivered"} ? $locale->text("Yes") : $locale->text("No")) .
       "</td>";
+    $column_data{transaction_description} = "<td>" . H($oe->{transaction_description}) . "</td>";
 
     $i++;
     $i %= 2;
index fe7d321..cb2dd68 100644 (file)
@@ -621,6 +621,10 @@ td {
     <td><code>total</code></td>
     <td>Restsumme der Rechnung (Summe abz&uuml;glich bereits bezahlter Posten)</td>
    </tr>
+   <tr>
+    <td><code>transaction_description</code></td>
+    <td>Vorgangsbezeichnung</td>
+   </tr>
    <tr>
     <td><code>transdate</code></td>
     <td>Auftragsdatum wenn die Rechnung aus einem Auftrag erstellt wurde</td>
index 1426aee..046e4a6 100644 (file)
@@ -1074,6 +1074,7 @@ gestartet',
   'Trade Discount'              => 'Rabatt',
   'Transaction Date missing!'   => 'Buchungsdatum fehlt!',
   'Transaction deleted!'        => 'Buchung gelöscht!',
+  'Transaction description'     => 'Vorgangsbezeichnung',
   'Transaction posted!'         => 'Buchung verbucht!',
   'Transaction reversal enforced for all dates' => 'Fehleintragungen müssen für jeden Zeitraum mit einer Kontraeintragung ausgebessert werden',
   'Transaction reversal enforced up to' => 'Fehleintragungen können bis zu dem angegebenen Zeitraum nur mit einer Kontraeintragung ausgebessert werden!',
index edba448..78053b3 100644 (file)
@@ -226,6 +226,7 @@ $self->{texts} = {
   'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
   'Total'                       => 'Summe',
   'Trade Discount'              => 'Rabatt',
+  'Transaction description'     => 'Vorgangsbezeichnung',
   'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
   'Unit'                        => 'Einheit',
   'Unknown dependency \'%s\'.'  => 'Unbekannte Abh&auml;ngigkeit \'%s\'.',
diff --git a/sql/Pg-upgrade2/transaction_description.sql b/sql/Pg-upgrade2/transaction_description.sql
new file mode 100644 (file)
index 0000000..08a0cbb
--- /dev/null
@@ -0,0 +1,6 @@
+-- @tag: transaction_description
+-- @description: Neue Spalte f&uuml;r ein Feld &quot;Vorgangsbezeichnung&quot; in Verkaufs- und Einkaufsmasken
+-- @depends: release_2_4_2
+ALTER TABLE ap ADD COLUMN transaction_description text;
+ALTER TABLE ar ADD COLUMN transaction_description text;
+ALTER TABLE oe ADD COLUMN transaction_description text;