]> wagnertech.de Git - mfinanz.git/blobdiff - SL/GL.pm
Buchungsjournal: Abteilung im Bericht anzeigen können
[mfinanz.git] / SL / GL.pm
index 245e5b8008776b4d48fbcdcaf674397bd23697a9..6212d5b343c0fcb39ae77b388ed442e65cf6c081 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -123,12 +123,12 @@ sub _post_transaction {
   $query =
     qq|UPDATE gl SET
          reference = ?, description = ?, notes = ?,
-         transdate = ?, deliverydate = ?, department_id = ?, taxincluded = ?,
+         transdate = ?, deliverydate = ?, tax_point = ?, department_id = ?, taxincluded = ?,
          storno = ?, storno_id = ?, ob_transaction = ?, cb_transaction = ?
        WHERE id = ?|;
 
   @values = ($form->{reference}, $form->{description}, $form->{notes},
-             conv_date($form->{transdate}), conv_date($form->{deliverydate}), conv_i($form->{department_id}), $form->{taxincluded} ? 't' : 'f',
+             conv_date($form->{transdate}), conv_date($form->{deliverydate}), conv_date($form->{tax_point}), conv_i($form->{department_id}), $form->{taxincluded} ? 't' : 'f',
              $form->{storno} ? 't' : 'f', conv_i($form->{storno_id}), $form->{ob_transaction} ? 't' : 'f', $form->{cb_transaction} ? 't' : 'f',
              conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
@@ -356,6 +356,7 @@ sub all_transactions {
     'reference'    => [ qw(lower_reference id)   ],
     'description'  => [ qw(lower_description id) ],
     'accno'        => [ qw(accno transdate id)   ],
+    'department'   => [ qw(department transdate id)   ],
     );
   my %lowered_columns =  (
     'reference'       => { 'gl' => 'g.reference',   'arap' => 'a.invnumber', },
@@ -381,11 +382,13 @@ sub all_transactions {
         ac.acc_trans_id, g.id, 'gl' AS type, FALSE AS invoice, g.reference, ac.taxkey, c.link,
         g.description, ac.transdate, ac.gldate, ac.source, ac.trans_id,
         ac.amount, c.accno, g.notes, t.chart_id,
+        d.description AS department,
         CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
         $project_columns
         $columns_for_sorting{gl}
       FROM gl g
-      LEFT JOIN employee e ON (g.employee_id = e.id),
+      LEFT JOIN employee e ON (g.employee_id = e.id)
+      LEFT JOIN department d ON (g.department_id = d.id),
       acc_trans ac $project_join, chart c
       LEFT JOIN tax t ON (t.chart_id = c.id)
       WHERE $glwhere
@@ -397,11 +400,13 @@ sub all_transactions {
       SELECT ac.acc_trans_id, a.id, 'ar' AS type, a.invoice, a.invnumber, ac.taxkey, c.link,
         ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id,
         ac.amount, c.accno, a.notes, t.chart_id,
+        d.description AS department,
         CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
         $project_columns
         $columns_for_sorting{arap}
       FROM ar a
-      LEFT JOIN employee e ON (a.employee_id = e.id),
+      LEFT JOIN employee e ON (a.employee_id = e.id)
+      LEFT JOIN department d ON (a.department_id = d.id),
       acc_trans ac $project_join, customer ct, chart c
       LEFT JOIN tax t ON (t.chart_id=c.id)
       WHERE $arwhere
@@ -414,11 +419,13 @@ sub all_transactions {
       SELECT ac.acc_trans_id, a.id, 'ap' AS type, a.invoice, a.invnumber, ac.taxkey, c.link,
         ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id,
         ac.amount, c.accno, a.notes, t.chart_id,
+        d.description AS department,
         CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
         $project_columns
         $columns_for_sorting{arap}
       FROM ap a
-      LEFT JOIN employee e ON (a.employee_id = e.id),
+      LEFT JOIN employee e ON (a.employee_id = e.id)
+      LEFT JOIN department d ON (a.department_id = d.id),
       acc_trans ac $project_join, vendor ct, chart c
       LEFT JOIN tax t ON (t.chart_id=c.id)
       WHERE $apwhere
@@ -637,7 +644,7 @@ sub transaction {
 
   if ($form->{id}) {
     $query =
-      qq|SELECT g.reference, g.description, g.notes, g.transdate, g.deliverydate,
+      qq|SELECT g.reference, g.description, g.notes, g.transdate, g.deliverydate, g.tax_point,
            g.storno, g.storno_id,
            g.department_id, d.description AS department,
            e.name AS employee, g.taxincluded, g.gldate,
@@ -835,12 +842,14 @@ The functions returns an array which may be used for building dropdowns in ar/ap
 
 =head1 TODO
 
+Nothing here yet.
+
 =head1 BUGS
 
 Nothing here yet.
 
 =head1 AUTHOR
 
-G. Richardson E<lt>grichardson@kivitec.de<gt>
+G. Richardson E<lt>grichardson@kivitec.deE<gt>
 
 =cut