Revision f1c1921d
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
1844 | 1844 |
|
1845 | 1845 |
# setup last accounts used for this customer |
1846 | 1846 |
if (!$form->{id} && $form->{type} !~ /_(order|quotation)/) { |
1847 |
$query = qq|SELECT c.accno, c.description, c.link, c.category |
|
1847 |
$query = qq|SELECT c.id, c.accno, c.description, c.link, c.category
|
|
1848 | 1848 |
FROM chart c |
1849 | 1849 |
JOIN acc_trans ac ON (ac.chart_id = c.id) |
1850 | 1850 |
JOIN ar a ON (a.id = ac.trans_id) |
... | ... | |
1860 | 1860 |
if ($ref->{category} eq 'I') { |
1861 | 1861 |
$i++; |
1862 | 1862 |
$form->{"AR_amount_$i"} = "$ref->{accno}--$ref->{description}"; |
1863 |
|
|
1864 |
if ($form->{initial_transdate}) { |
|
1865 |
my $tax_query = |
|
1866 |
qq|SELECT tk.tax_id, t.rate FROM taxkeys tk | . |
|
1867 |
qq|LEFT JOIN tax t ON tk.tax_id = t.id | . |
|
1868 |
qq|WHERE tk.chart_id = ? AND startdate <= ? | . |
|
1869 |
qq|ORDER BY tk.startdate DESC LIMIT 1|; |
|
1870 |
my ($tax_id, $rate) = |
|
1871 |
selectrow_query($form, $dbh, $tax_query, $ref->{id}, |
|
1872 |
$form->{initial_transdate}); |
|
1873 |
$form->{"taxchart_$i"} = "${tax_id}--${rate}"; |
|
1874 |
} |
|
1863 | 1875 |
} |
1864 | 1876 |
if ($ref->{category} eq 'A') { |
1865 | 1877 |
$form->{ARselected} = $form->{AR_1} = $ref->{accno}; |
Auch abrufbar als: Unified diff
Debitorenrechnungen: Beim Erstellen einer neuen Debitorenrechnung das richtige Steuerkonto für die erste Zeile auswählen, auch wenn das ausgewählte Konto nicht das erste Konto in der Liste ist.