Revision 0560b39e
Von Bernd Bleßmann vor fast 10 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
587 | 587 |
my $all_units = AM->retrieve_units($myconfig, $form); |
588 | 588 |
|
589 | 589 |
if (!$payments_only) { |
590 |
if ($form->{storno}) { |
|
591 |
_delete_transfers($dbh, $form, $form->{storno_id}); |
|
592 |
} |
|
590 | 593 |
if ($form->{id}) { |
591 | 594 |
&reverse_invoice($dbh, $form); |
595 |
_delete_transfers($dbh, $form, $form->{id}); |
|
592 | 596 |
|
593 | 597 |
} else { |
594 | 598 |
my $trans_number = SL::TransNumber->new(type => $form->{type}, dbh => $dbh, number => $form->{invnumber}, save => 1); |
... | ... | |
1348 | 1352 |
return ($wh_id, $bin_id); |
1349 | 1353 |
} |
1350 | 1354 |
|
1355 |
sub _delete_transfers { |
|
1356 |
$::lxdebug->enter_sub; |
|
1357 |
|
|
1358 |
my ($dbh, $form, $id) = @_; |
|
1359 |
|
|
1360 |
my $query = qq|DELETE FROM inventory WHERE invoice_id |
|
1361 |
IN (SELECT id FROM invoice WHERE trans_id = ?)|; |
|
1362 |
|
|
1363 |
do_query($form, $dbh, $query, $id); |
|
1364 |
|
|
1365 |
$::lxdebug->leave_sub; |
|
1366 |
} |
|
1367 |
|
|
1351 | 1368 |
sub _delete_payments { |
1352 | 1369 |
$main::lxdebug->enter_sub(); |
1353 | 1370 |
|
... | ... | |
1654 | 1671 |
my $dbh = $form->get_standard_dbh; |
1655 | 1672 |
|
1656 | 1673 |
&reverse_invoice($dbh, $form); |
1674 |
_delete_transfers($dbh, $form, $form->{id}); |
|
1657 | 1675 |
|
1658 | 1676 |
my @values = (conv_i($form->{id})); |
1659 | 1677 |
|
bin/mozilla/is.pl | ||
---|---|---|
782 | 782 |
|
783 | 783 |
# If transfer_out is requested, get rose db handle and do post and |
784 | 784 |
# transfer out in one transaction. Otherwise just post the invoice. |
785 |
if ($::instance_conf->get_is_transfer_out) { |
|
785 |
if ($::instance_conf->get_is_transfer_out && $form->{type} ne 'credit_note' && !$form->{storno}) {
|
|
786 | 786 |
require SL::DB::Inventory; |
787 | 787 |
my $rose_db = SL::DB::Inventory->new->db; |
788 | 788 |
my $error; |
Auch abrufbar als: Unified diff
Auslagern in VK-Rechnung: Löschen der Lagerbewegung beim Löschen/Storno der Rechnung