]> wagnertech.de Git - mfinanz.git/blobdiff - SL/GL.pm
OE::, DO::order_details und IC::prepare_parts_for_printing mit lokaler form ...
[mfinanz.git] / SL / GL.pm
index ade1948badb83c60c3a7dc245f267c042c03a33e..10d6ee120a00ecac476d69d550d1fb7b84ed0288 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -171,7 +171,11 @@ sub post_transaction {
         qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
                                   source, memo, project_id, taxkey, tax_id, chart_link)
            VALUES (?, (SELECT chart_id FROM tax WHERE id = ?),
-                   ?, ?, ?, ?, ?, ?, ?, (SELECT link FROM chart WHERE accno = ?))|;
+                   ?, ?, ?, ?, ?, ?, ?, (SELECT link 
+                                         FROM chart 
+                                         WHERE id = (SELECT chart_id 
+                                                     FROM tax 
+                                                     WHERE id = ?)))|;
       @values = (conv_i($form->{id}), conv_i($form->{"tax_id_$i"}),
                  $tax, conv_date($form->{transdate}), $form->{"source_$i"},
                  $form->{"memo_$i"}, $project_id, $taxkey, conv_i($form->{"tax_id_$i"}), conv_i($form->{"tax_id_$i"}));
@@ -280,7 +284,7 @@ sub all_transactions {
     push(@arvalues, '%' . $form->{description} . '%');
     push(@apvalues, '%' . $form->{description} . '%');
   }
+
   if ($form->{employee} =~ /--/) {
     ($form->{employee_id},$form->{employee_name}) = split(/--/,$form->{employee});
   #if ($form->{employee_id}) {
@@ -366,7 +370,7 @@ sub all_transactions {
     'source'          => { 'gl' => 'ac.source',     'arap' => 'ac.source',   },
     'description'     => { 'gl' => 'g.description', 'arap' => 'ct.name',     },
     );
-  
+
   # sortdir = sort direction (ascending or descending)
   my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
   my $sortkey   = $sort_columns{$form->{sort}} ? $form->{sort} : $form->{datesort};  # default used to be transdate