Revision d12e02e0
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
38 | 38 |
|
39 | 39 |
use SL::AM; |
40 | 40 |
use SL::Common; |
41 |
use SL::CVar; |
|
41 | 42 |
use SL::DBUtils; |
42 | 43 |
use SL::RecordLinks; |
43 | 44 |
|
... | ... | |
190 | 191 |
my $all_units = AM->retrieve_units($myconfig, $form); |
191 | 192 |
$form->{all_units} = $all_units; |
192 | 193 |
|
194 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC', |
|
195 |
dbh => $dbh); |
|
196 |
|
|
193 | 197 |
$form->{donumber} = $form->update_defaults($myconfig, $form->{type} eq 'sales_delivery_order' ? 'sdonumber' : 'pdonumber', $dbh) unless $form->{donumber}; |
194 | 198 |
$form->{employee_id} = (split /--/, $form->{employee})[1] if !$form->{employee_id}; |
195 | 199 |
$form->get_employee($dbh) unless ($form->{employee_id}); |
... | ... | |
300 | 304 |
conv_i($sinfo->{bin_id}), $sinfo->{chargenumber}); |
301 | 305 |
do_statement($form, $h_item_stock, $q_item_stock, @values); |
302 | 306 |
} |
307 |
|
|
308 |
CVar->save_custom_variables(module => 'IC', |
|
309 |
sub_module => 'delivery_order_items', |
|
310 |
trans_id => $item_id, |
|
311 |
configs => $ic_cvar_configs, |
|
312 |
variables => $form, |
|
313 |
name_prefix => 'ic_', |
|
314 |
name_postfix => "_$i", |
|
315 |
dbh => $dbh); |
|
303 | 316 |
} |
304 | 317 |
|
305 | 318 |
$h_item_id->finish(); |
... | ... | |
545 | 558 |
|
546 | 559 |
my ($query, $query_add, @values, $sth, $ref); |
547 | 560 |
|
561 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC', |
|
562 |
dbh => $dbh); |
|
563 |
|
|
548 | 564 |
my $vc = $params{vc} eq 'customer' ? 'customer' : 'vendor'; |
549 | 565 |
|
550 | 566 |
my $mode = !$params{ids} ? 'default' : ref $params{ids} eq 'ARRAY' ? 'multi' : 'single'; |
... | ... | |
654 | 670 |
|
655 | 671 |
$form->{form_details} = selectall_hashref_query($form, $dbh, $query, @do_ids); |
656 | 672 |
|
673 |
# Retrieve custom variables. |
|
674 |
foreach my $doi (@{ $form->{form_details} }) { |
|
675 |
my $cvars = CVar->get_custom_variables(dbh => $dbh, |
|
676 |
module => 'IC', |
|
677 |
sub_module => 'delivery_order_items', |
|
678 |
trans_id => $doi->{delivery_order_items_id}, |
|
679 |
); |
|
680 |
map { $doi->{"ic_cvar_$_->{name}"} = $_->{value} } @{ $cvars }; |
|
681 |
} |
|
682 |
|
|
657 | 683 |
if ($mode eq 'single') { |
658 | 684 |
my $in_out = $form->{type} =~ /^sales/ ? 'out' : 'in'; |
659 | 685 |
|
... | ... | |
748 | 774 |
|
749 | 775 |
my $num_si = 0; |
750 | 776 |
|
777 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
|
778 |
|
|
751 | 779 |
my @arrays = |
752 | 780 |
qw(runningnumber number description longdescription qty unit |
753 | 781 |
partnotes serialnumber reqdate projectnumber |
754 | 782 |
si_runningnumber si_number si_description |
755 | 783 |
si_warehouse si_bin si_chargenumber si_qty si_unit); |
756 | 784 |
|
785 |
push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; |
|
786 |
|
|
757 | 787 |
my $sameitem = ""; |
758 | 788 |
foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) { |
759 | 789 |
$i = $item->[0]; |
... | ... | |
832 | 862 |
push @{ $form->{TEMPLATE_ARRAYS}{si_unit}[$position-1] }, $si->{unit}; |
833 | 863 |
} |
834 | 864 |
} |
865 |
|
|
866 |
map { push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} }, $form->{"ic_cvar_$_->{name}_$i"} } @{ $ic_cvar_configs }; |
|
835 | 867 |
} |
836 | 868 |
|
837 | 869 |
$h_pg->finish(); |
Auch abrufbar als: Unified diff
Verwendung der benutzerdefinierten Variablen für Waren/Dienstleistungen/Erzegunisse in Lieferscheinen.