Revision 9d07c34f
Von Bernd Bleßmann vor etwa 9 Jahren hinzugefügt
bin/mozilla/is.pl | ||
---|---|---|
39 | 39 |
use DateTime; |
40 | 40 |
use List::MoreUtils qw(uniq); |
41 | 41 |
use List::Util qw(max sum); |
42 |
use English qw(-no_match_vars); |
|
42 | 43 |
|
43 | 44 |
use SL::DB::Default; |
44 | 45 |
use SL::DB::Customer; |
... | ... | |
778 | 779 |
} |
779 | 780 |
|
780 | 781 |
relink_accounts(); |
781 |
$form->error($locale->text('Cannot post invoice!')) |
|
782 |
unless IS->post_invoice(\%myconfig, \%$form); |
|
782 |
|
|
783 |
# If transfer_out is requested, get rose db handle and do post and |
|
784 |
# transfer out in one transaction. Otherwise just post the invoice. |
|
785 |
if ($::instance_conf->get_is_transfer_out) { |
|
786 |
require SL::DB::Inventory; |
|
787 |
my $rose_db = SL::DB::Inventory->new->db; |
|
788 |
my $error; |
|
789 |
|
|
790 |
if (!$rose_db->with_transaction(sub { |
|
791 |
if (!eval { |
|
792 |
IS->post_invoice(\%myconfig, \%$form, $rose_db->dbh); |
|
793 |
IS->transfer_out(\%$form); |
|
794 |
1; |
|
795 |
}) { |
|
796 |
$error = $EVAL_ERROR; |
|
797 |
return; |
|
798 |
} |
|
799 |
|
|
800 |
1; |
|
801 |
})) { |
|
802 |
$form->error($locale->text("Cannot post invoice and/or transfer out!\nError was:\n") . $locale->text($error)); |
|
803 |
} |
|
804 |
} else { |
|
805 |
if (!IS->post_invoice(\%myconfig, \%$form)) { |
|
806 |
$form->error($locale->text('Cannot post invoice!')); |
|
807 |
} |
|
808 |
} |
|
809 |
|
|
783 | 810 |
remove_draft() if $form->{remove_draft}; |
784 | 811 |
|
785 | 812 |
if(!exists $form->{addition}) { |
Auch abrufbar als: Unified diff
Auslagern in VK-Rechnung: Beim Buchen einer VK-Rechnung wird ausgelagert.
Todo: Es werden noch nicht alle Einstellungen berücksichtigt, die bestimmen,
wann von welchem Lager/Lagerplatz ausgelagert wird.