Revision 768b390e
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
216 | 216 |
|
217 | 217 |
# check if we sold the item already and |
218 | 218 |
# make an entry for the expense and inventory |
219 |
my $taxzone = $form->{taxzone_id} * 1; |
|
219 | 220 |
$query = |
220 | 221 |
qq|SELECT i.id, i.qty, i.allocated, i.trans_id, i.base_qty, |
221 |
p.inventory_accno_id, p.expense_accno_id, a.transdate
|
|
222 |
FROM invoice i, ar a, parts p |
|
222 |
bg.inventory_accno_id, bg.expense_accno_id_${taxzone} AS expense_accno_id, a.transdate
|
|
223 |
FROM invoice i, ar a, parts p, buchungsgruppen bg
|
|
223 | 224 |
WHERE (i.parts_id = p.id) |
224 | 225 |
AND (i.parts_id = ?) |
225 | 226 |
AND ((i.base_qty + i.allocated) > 0) |
226 | 227 |
AND (i.trans_id = a.id) |
228 |
AND (p.buchungsgruppen_id = bg.id) |
|
227 | 229 |
ORDER BY transdate|; |
228 | 230 |
# ORDER BY transdate guarantees FIFO |
229 | 231 |
|
Auch abrufbar als: Unified diff
Einkaufsrechnung buchen bei Bestandsmethode: Kontenverknüpfung aus Buchungsgruppen, nicht aus parts