Revision 0e470b13
Von Bernd Bleßmann vor mehr als 9 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
1226 | 1226 |
|
1227 | 1227 |
$form->{discount} = []; |
1228 | 1228 |
|
1229 |
# get some values of parts from db on store them in extra array, |
|
1230 |
# so that they can be sorted in later |
|
1231 |
my %prepared_template_arrays = IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); |
|
1232 |
my @prepared_arrays = keys %prepared_template_arrays; |
|
1233 |
|
|
1229 | 1234 |
$form->{TEMPLATE_ARRAYS} = { }; |
1230 |
IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); |
|
1231 | 1235 |
|
1232 | 1236 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
1233 | 1237 |
my $project_cvar_configs = CVar->get_configs(module => 'Projects'); |
1234 | 1238 |
|
1235 | 1239 |
my @arrays = |
1236 |
qw(runningnumber number description longdescription qty ship unit bin
|
|
1237 |
partnotes serialnumber reqdate sellprice listprice netprice
|
|
1238 |
discount p_discount discount_sub nodiscount_sub
|
|
1239 |
linetotal nodiscount_linetotal tax_rate projectnumber projectdescription
|
|
1240 |
price_factor price_factor_name partsgroup weight lineweight);
|
|
1240 |
qw(runningnumber number description longdescription qty qty_nofmt ship ship_nofmt unit bin
|
|
1241 |
partnotes serialnumber reqdate sellprice sellprice_nofmt listprice listprice_nofmt netprice netprice_nofmt
|
|
1242 |
discount discount_nofmt p_discount discount_sub discount_sub_nofmt nodiscount_sub nodiscount_sub_nofmt
|
|
1243 |
linetotal linetotal_nofmt nodiscount_linetotal nodiscount_linetotal_nofmt tax_rate projectnumber projectdescription
|
|
1244 |
price_factor price_factor_name partsgroup weight weight_nofmt lineweight lineweight_nofmt);
|
|
1241 | 1245 |
|
1242 | 1246 |
push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; |
1243 | 1247 |
push @arrays, map { "project_cvar_$_->{name}" } @{ $project_cvar_configs }; |
1244 | 1248 |
|
1245 | 1249 |
my @tax_arrays = qw(taxbase tax taxdescription taxrate taxnumber); |
1246 | 1250 |
|
1247 |
map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays); |
|
1251 |
map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays, @prepared_arrays);
|
|
1248 | 1252 |
|
1249 | 1253 |
my $totalweight = 0; |
1250 | 1254 |
my $sameitem = ""; |
... | ... | |
1252 | 1256 |
$i = $item->[0]; |
1253 | 1257 |
|
1254 | 1258 |
if ($item->[1] ne $sameitem) { |
1259 |
push(@{ $form->{TEMPLATE_ARRAYS}->{entry_type} }, 'partsgroup'); |
|
1255 | 1260 |
push(@{ $form->{TEMPLATE_ARRAYS}->{description} }, qq|$item->[1]|); |
1256 | 1261 |
$sameitem = $item->[1]; |
1257 | 1262 |
|
1258 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } @arrays));
|
|
1263 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } (@arrays, @prepared_arrays)));
|
|
1259 | 1264 |
} |
1260 | 1265 |
|
1261 | 1266 |
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"}); |
... | ... | |
1280 | 1285 |
|
1281 | 1286 |
my $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || { 'factor' => 1 }; |
1282 | 1287 |
|
1288 |
push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, $prepared_template_arrays{$_}[$i - 1]) for @prepared_arrays; |
|
1289 |
|
|
1290 |
push @{ $form->{TEMPLATE_ARRAYS}->{entry_type} }, 'normal'; |
|
1283 | 1291 |
push @{ $form->{TEMPLATE_ARRAYS}->{runningnumber} }, $position; |
1284 | 1292 |
push @{ $form->{TEMPLATE_ARRAYS}->{number} }, $form->{"partnumber_$i"}; |
1285 | 1293 |
push @{ $form->{TEMPLATE_ARRAYS}->{description} }, $form->{"description_$i"}; |
... | ... | |
1420 | 1428 |
|
1421 | 1429 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
1422 | 1430 |
if ($form->{groupitems} && $ref->{partsgroup} ne $sameitem) { |
1423 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } @arrays));
|
|
1431 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } (@arrays, @prepared_arrays)));
|
|
1424 | 1432 |
$sameitem = ($ref->{partsgroup}) ? $ref->{partsgroup} : "--"; |
1433 |
push(@{ $form->{TEMPLATE_ARRAYS}->{entry_type} }, 'assembly-item-partsgroup'); |
|
1425 | 1434 |
push(@{ $form->{TEMPLATE_ARRAYS}->{description} }, $sameitem); |
1426 | 1435 |
} |
1427 | 1436 |
|
1437 |
push(@{ $form->{TEMPLATE_ARRAYS}->{entry_type} }, 'assembly-item'); |
|
1428 | 1438 |
push(@{ $form->{TEMPLATE_ARRAYS}->{description} }, $form->format_amount($myconfig, $ref->{qty} * $form->{"qty_$i"}) . qq|, $ref->{partnumber}, $ref->{description}|); |
1429 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } @arrays));
|
|
1439 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } (@arrays, @prepared_arrays)));
|
|
1430 | 1440 |
} |
1431 | 1441 |
$sth->finish; |
1432 | 1442 |
} |
Auch abrufbar als: Unified diff
Ausdruck Erzeugnisse mit Stückliste und Lieferantenartikelnummer repariert.
Betraf wohl auch andere Felder zu Artikeln, die vor der Aufbereitung des
TEMPLATE_ARRAYS aus der DB gelesen wurden. Diese werden jetzt richtig in
TEMPLATE_ARRAYS einsortiert.
Um auch die Einträge für Erzeugnis-Teile und Warengruppen (beim Gruppieren
der Waren) in den Druckvorlagen unterscheiden zu können, gibt es ein Feld
'entry_type', dass die Werte 'normal', 'partsgroup', 'assembly-item' und
'assembly-item-partsgroup' annehmen kann.