X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/88bb5aaaa09976ba6310116828121d28afe8ffc8..3f4f01dcd306d7ebb51a1186d722e6aecd237003:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index 052dcfd3f..28323326f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -821,7 +821,7 @@ sub post_invoice { } $project_id = conv_i($form->{"globalproject_id"}); - + # entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen my $taxdate = $form->{deliverydate} ? $form->{deliverydate} : $form->{invdate}; foreach my $trans_id (keys %{ $form->{amount_cogs} }) { @@ -863,19 +863,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -892,19 +892,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -956,19 +956,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -983,19 +983,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -1042,19 +1042,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, '0', '1', - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -2034,7 +2034,6 @@ sub retrieve_item { my $i = 0; while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) { - # if ($customertax{$ref->{accno}}) if (($ptr->{accno} eq "") && ($ptr->{rate} == 0)) { $i++; $ptr->{accno} = $i;