Revision 96ab68a3
Von Jan Büren vor mehr als 8 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
418 | 418 |
dbh => $dbh); |
419 | 419 |
|
420 | 420 |
# link previous items with invoice items See IS.pm (no credit note -> no invoice item) |
421 |
foreach (qw(delivery_order_items orderitems)) { |
|
421 |
foreach (qw(delivery_order_items orderitems invoice)) {
|
|
422 | 422 |
if (!$form->{useasnew} && $form->{"converted_from_${_}_id_$i"}) { |
423 | 423 |
RecordLinks->create_links('dbh' => $dbh, |
424 | 424 |
'mode' => 'ids', |
... | ... | |
758 | 758 |
|
759 | 759 |
Common::webdav_folder($form); |
760 | 760 |
|
761 |
# Link this record to the records it was created from. |
|
762 |
if ($form->{convert_from_oe_ids}) { |
|
763 |
RecordLinks->create_links('dbh' => $dbh, |
|
764 |
'mode' => 'ids', |
|
765 |
'from_table' => 'oe', |
|
766 |
'from_ids' => $form->{convert_from_oe_ids}, |
|
767 |
'to_table' => 'ap', |
|
768 |
'to_id' => $form->{id}, |
|
761 |
# Link this record to the records it was created from order or invoice (storno) |
|
762 |
foreach (qw(oe ap)) { |
|
763 |
if ($form->{"convert_from_${_}_ids"}) { |
|
764 |
RecordLinks->create_links('dbh' => $dbh, |
|
765 |
'mode' => 'ids', |
|
766 |
'from_table' => $_, |
|
767 |
'from_ids' => $form->{"convert_from_${_}_ids"}, |
|
768 |
'to_table' => 'ap', |
|
769 |
'to_id' => $form->{id}, |
|
769 | 770 |
); |
770 |
delete $form->{convert_from_oe_ids}; |
|
771 |
delete $form->{"convert_from_${_}_ids"}; |
|
772 |
} |
|
771 | 773 |
} |
772 | 774 |
|
773 | 775 |
my @convert_from_do_ids = map { $_ * 1 } grep { $_ } split m/\s+/, $form->{convert_from_do_ids}; |
bin/mozilla/ir.pl | ||
---|---|---|
334 | 334 |
max_dunning_level dunning_amount |
335 | 335 |
shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln shiptocontact shiptophone shiptofax |
336 | 336 |
shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus |
337 |
convert_from_do_ids convert_from_oe_ids show_details gldate useasnew |
|
337 |
convert_from_do_ids convert_from_oe_ids convert_from_ap_ids show_details gldate useasnew
|
|
338 | 338 |
), @custom_hiddens, |
339 | 339 |
map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; |
340 | 340 |
|
... | ... | |
626 | 626 |
$form->{paidaccounts} = 0; |
627 | 627 |
map { my $key = $_; delete $form->{$key} if grep { $key =~ /^$_/ } qw(datepaid_ gldate_ acc_trans_id_ source_ memo_ paid_ exchangerate_ AR_paid_) } keys %{ $form }; |
628 | 628 |
# set new ids for storno invoice |
629 |
delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; |
|
629 |
# set new persistent ids for storno invoice items |
|
630 |
$form->{"converted_from_invoice_id_$_"} = delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; |
|
630 | 631 |
|
631 | 632 |
# saving the history |
632 | 633 |
if(!exists $form->{addition} && $form->{id} ne "") { |
... | ... | |
637 | 638 |
} |
638 | 639 |
# /saving the history |
639 | 640 |
|
641 |
# record link invoice to storno |
|
642 |
$form->{convert_from_ap_ids} = $form->{id}; |
|
640 | 643 |
$form->{storno_id} = $form->{id}; |
641 | 644 |
$form->{storno} = 1; |
642 | 645 |
$form->{id} = ""; |
Auch abrufbar als: Unified diff
Einkaufsstornos auch verknüpfen
Analog zur Verkaufs-Ansicht auch die Einkaufsrechnungen bei
Stornos verknüpfn