Revision ef220490
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
193 | 193 |
|
194 | 194 |
_update_part_information(); |
195 | 195 |
_update_ship() if ($is_s_p_order); |
196 |
_update_custom_variables(); |
|
196 | 197 |
|
197 | 198 |
# rows |
198 | 199 |
for $i (1 .. $numrows) { |
... | ... | |
356 | 357 |
|
357 | 358 |
$form->{invsubtotal} += $linetotal; |
358 | 359 |
|
360 |
# Benutzerdefinierte Variablen für Waren/Dienstleistungen/Erzeugnisse |
|
361 |
_render_custom_variables_inputs(ROW2 => \@ROW2, row => $i); |
|
362 |
|
|
359 | 363 |
push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, error => $form->{"row_error_$i"}, }; |
360 | 364 |
} |
361 | 365 |
|
... | ... | |
441 | 445 |
|
442 | 446 |
print qq|</tr>|; |
443 | 447 |
|
448 |
my @new_fields = |
|
449 |
qw(bin listprice inventory_accno income_accno expense_accno unit weight |
|
450 |
assembly taxaccounts partsgroup formel longdescription not_discountable |
|
451 |
part_payment_id partnotes id lastcost price_factor_id price_factor); |
|
452 |
push @new_fields, "lizenzen" if ($lizenzen); |
|
453 |
push @new_fields, grep { m/^ic_cvar_/ } keys %{ $form->{item_list}->[0] }; |
|
454 |
|
|
444 | 455 |
my $i = 0; |
445 | 456 |
foreach $ref (@{ $form->{item_list} }) { |
446 | 457 |
$checked = ($i++) ? "" : "checked"; |
... | ... | |
494 | 505 |
|
495 | 506 |
print("</tr>\n"); |
496 | 507 |
|
497 |
my @new_fields = |
|
498 |
qw(bin listprice inventory_accno income_accno expense_accno unit weight |
|
499 |
assembly taxaccounts partsgroup formel longdescription not_discountable |
|
500 |
part_payment_id partnotes id lastcost price_factor_id price_factor); |
|
501 |
push(@new_fields, "lizenzen") if ($lizenzen); |
|
502 |
|
|
503 | 508 |
print join "\n", map { $cgi->hidden("-name" => "new_${_}_$i", "-value" => $ref->{$_}) } @new_fields; |
504 | 509 |
print "\n"; |
505 | 510 |
} |
... | ... | |
562 | 567 |
partsgroup formel longdescription not_discountable partnotes lastcost |
563 | 568 |
price_factor_id price_factor); |
564 | 569 |
|
570 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
|
571 |
push @new_fields, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; |
|
572 |
|
|
565 | 573 |
map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } @new_fields; |
566 | 574 |
|
567 | 575 |
$form->{"marge_price_factor_$i"} = $form->{"new_price_factor_$j"}; |
... | ... | |
672 | 680 |
my @a = (); |
673 | 681 |
my $count = 0; |
674 | 682 |
|
675 |
my @flds = qw(id partnumber description qty ship sellprice unit |
|
676 |
discount inventory_accno income_accno expense_accno listprice |
|
677 |
taxaccounts bin assembly weight projectnumber project_id |
|
678 |
oldprojectnumber runningnumber serialnumber partsgroup payment_id |
|
679 |
not_discountable shop ve gv buchungsgruppen_id language_values |
|
680 |
sellprice_pg pricegroup_old price_old price_new unit_old ordnumber |
|
681 |
transdate longdescription basefactor marge_total marge_percent |
|
682 |
marge_price_factor lastcost price_factor_id partnotes |
|
683 |
stock_out stock_in); |
|
684 |
|
|
685 | 683 |
# remove any makes or model rows |
686 | 684 |
if ($form->{item} eq 'part') { |
687 | 685 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } |
... | ... | |
695 | 693 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } |
696 | 694 |
qw(listprice sellprice rop stock); |
697 | 695 |
|
698 |
@flds = |
|
699 |
qw(id qty unit bom partnumber description sellprice weight runningnumber partsgroup lastcost); |
|
696 |
my @flds = qw(id qty unit bom partnumber description sellprice weight runningnumber partsgroup lastcost); |
|
700 | 697 |
|
701 | 698 |
for my $i (1 .. ($form->{assembly_rows} - 1)) { |
702 | 699 |
if ($form->{"qty_$i"}) { |
... | ... | |
725 | 722 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice lastcost); |
726 | 723 |
|
727 | 724 |
} else { |
725 |
my @flds = qw(id partnumber description qty ship sellprice unit |
|
726 |
discount inventory_accno income_accno expense_accno listprice |
|
727 |
taxaccounts bin assembly weight projectnumber project_id |
|
728 |
oldprojectnumber runningnumber serialnumber partsgroup payment_id |
|
729 |
not_discountable shop ve gv buchungsgruppen_id language_values |
|
730 |
sellprice_pg pricegroup_old price_old price_new unit_old ordnumber |
|
731 |
transdate longdescription basefactor marge_total marge_percent |
|
732 |
marge_price_factor lastcost price_factor_id partnotes |
|
733 |
stock_out stock_in); |
|
734 |
|
|
735 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
|
736 |
push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; |
|
728 | 737 |
|
729 | 738 |
# this section applies to invoices and orders |
730 | 739 |
# remove any empty numbers |
... | ... | |
1936 | 1945 |
|
1937 | 1946 |
$lxdebug->leave_sub(); |
1938 | 1947 |
} |
1948 |
|
|
1949 |
sub _update_custom_variables { |
|
1950 |
$lxdebug->enter_sub(); |
|
1951 |
|
|
1952 |
$form->{CVAR_CONFIGS} ||= { }; |
|
1953 |
$form->{CVAR_CONFIGS}->{IC} = CVar->get_configs(module => 'IC'); |
|
1954 |
|
|
1955 |
$lxdebug->leave_sub(); |
|
1956 |
} |
|
1957 |
|
|
1958 |
sub _render_custom_variables_inputs { |
|
1959 |
$lxdebug->enter_sub(); |
|
1960 |
|
|
1961 |
my %params = @_; |
|
1962 |
|
|
1963 |
if (!$form->{CVAR_CONFIGS}->{IC}) { |
|
1964 |
$lxdebug->leave_sub(); |
|
1965 |
return; |
|
1966 |
} |
|
1967 |
|
|
1968 |
foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { |
|
1969 |
$cvar->{value} = $form->{"ic_cvar_" . $cvar->{name} . "_$params{row}"}; |
|
1970 |
} |
|
1971 |
|
|
1972 |
CVar->render_inputs(hide_non_editable => 1, |
|
1973 |
variables => $form->{CVAR_CONFIGS}->{IC}, |
|
1974 |
name_prefix => 'ic_', |
|
1975 |
name_postfix => "_$params{row}"); |
|
1976 |
|
|
1977 |
my $num_visible_cvars = 0; |
|
1978 |
foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { |
|
1979 |
my $description = ''; |
|
1980 |
if ($cvar->{flag_editable}) { |
|
1981 |
$num_visible_cvars++; |
|
1982 |
$description = $cvar->{description} . ' '; |
|
1983 |
} |
|
1984 |
|
|
1985 |
push @{ $params{ROW2} }, { line_break => $num_visible_cvars == 1, |
|
1986 |
value => $description . $cvar->{HTML_CODE}, |
|
1987 |
}; |
|
1988 |
} |
|
1989 |
|
|
1990 |
$lxdebug->leave_sub(); |
|
1991 |
} |
Auch abrufbar als: Unified diff
Ausweitung der benutzerdefinierten Variablen für Waren/Dienstleistungen/Erzeugnisse auf Anzeige/Modifikation in Angeboten/Aufträgen.