1010 |
1010 |
# bought sold onorder ordered rfq quoted
|
1011 |
1011 |
# l_partnumber l_description l_serialnumber l_unit l_listprice l_sellprice l_lastcost
|
1012 |
1012 |
# l_linetotal l_priceupdate l_bin l_rop l_weight l_image l_drawing l_microfiche
|
1013 |
|
# l_partsgroup l_subtotal l_soldtotal l_deliverydate
|
|
1013 |
# l_partsgroup l_subtotal l_soldtotal l_deliverydate l_pricegroups
|
1014 |
1014 |
#
|
1015 |
1015 |
# hiddens:
|
1016 |
1016 |
# nextsub revers lastsort sort ndxs_counter
|
... | ... | |
1220 |
1220 |
transdate name serialnumber deliverydate ean projectnumber projectdescription
|
1221 |
1221 |
);
|
1222 |
1222 |
|
|
1223 |
my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id');
|
|
1224 |
my @pricegroup_columns;
|
|
1225 |
my %column_defs_pricegroups;
|
|
1226 |
if ($form->{l_pricegroups}) {
|
|
1227 |
@pricegroup_columns = map { "pricegroup_" . $_->id } @{ $pricegroups };
|
|
1228 |
%column_defs_pricegroups = map {
|
|
1229 |
"pricegroup_" . $_->id => {
|
|
1230 |
text => $::locale->text('Pricegroup') . ' ' . $_->pricegroup,
|
|
1231 |
visible => 1,
|
|
1232 |
},
|
|
1233 |
} @{ $pricegroups };
|
|
1234 |
}
|
|
1235 |
push @columns, @pricegroup_columns;
|
|
1236 |
|
1223 |
1237 |
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
|
1224 |
1238 |
my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs };
|
1225 |
1239 |
my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
|
1226 |
1240 |
|
1227 |
1241 |
push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
|
1228 |
1242 |
|
1229 |
|
%column_defs = (%column_defs,%column_defs_cvars); # nochmal die cvars als überschrift hinzufügen
|
1230 |
|
map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns;
|
1231 |
|
map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal);
|
|
1243 |
%column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups);
|
|
1244 |
map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns;
|
|
1245 |
map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal), @pricegroup_columns;
|
1232 |
1246 |
|
1233 |
|
my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys,
|
|
1247 |
my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @itemstatus_keys, @callback_keys,
|
1234 |
1248 |
map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns);
|
|
1249 |
|
1235 |
1250 |
my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
|
1236 |
1251 |
|
1237 |
1252 |
my @sort_full = qw(partnumber description onhand soldtotal deliverydate);
|
... | ... | |
1319 |
1334 |
$row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, -2);
|
1320 |
1335 |
$row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
|
1321 |
1336 |
}
|
|
1337 |
foreach ( @pricegroup_columns ) {
|
|
1338 |
$row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{"$_"}, -2);
|
|
1339 |
};
|
|
1340 |
|
1322 |
1341 |
|
1323 |
1342 |
map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal);
|
1324 |
1343 |
|
Preisgruppen in all_parts Lieferanten
(Implementierung grösstenteils von Geoffrey, leicht modifiziert von mir)