Revision c79f44be
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/Controller/DeliveryPlan.pm | ||
---|---|---|
67 | 67 |
delivered_qty => { sub => sub { $::form->format_amount(\%::myconfig, $_[0]->delivered_qty, 2) . ' ' . $_[0]->unit } }, |
68 | 68 |
ordnumber => { sub => sub { $_[0]->order->ordnumber }, |
69 | 69 |
obj_link => sub { $self->link_to($_[0]->order) } }, |
70 |
#vendor => { sub => sub { $_[0]->order->vendor->name }, |
|
71 |
# obj_link => sub { $self->link_to($_[0]->order->vendor) } }, |
|
72 |
#customer => { sub => sub { $_[0]->order->customer->name }, |
|
73 |
# obj_link => sub { $self->link_to($_[0]->order->customer) } }, |
|
70 |
vendor => { sub => sub { $_[0]->order->vendor->name }, |
|
71 |
visible => $vc eq 'vendor', |
|
72 |
obj_link => sub { $self->link_to($_[0]->order->vendor) } }, |
|
73 |
customer => { sub => sub { $_[0]->order->customer->name }, |
|
74 |
visible => $vc eq 'customer', |
|
75 |
obj_link => sub { $self->link_to($_[0]->order->customer) } }, |
|
76 |
value_of_goods => { sub => sub { $::form->format_amount(\%::myconfig, $_[0]->value_of_goods, 2) . ' ' . $_[0]->taxincluded }, |
|
77 |
visible => $::auth->assert('sales_order_edit', 1) && $::instance_conf->get_delivery_plan_show_value_of_goods, }, |
|
74 | 78 |
); |
75 | 79 |
|
76 |
# add value of goods in report |
|
77 |
if ($main::auth->assert('sales_order_edit') && $::instance_conf->get_delivery_plan_show_value_of_goods) { |
|
78 |
$column_defs{value_of_goods} = { sub => sub { $::form->format_amount(\%::myconfig, $_[0]->value_of_goods, 2) . ' ' . $_[0]->taxincluded } }; |
|
79 |
} |
|
80 |
|
|
81 |
# hotfix for today |
|
82 |
# if visible is not working |
|
83 |
if ($vc eq 'customer') { |
|
84 |
$column_defs{customer} = { sub => sub { $_[0]->order->customer->name }, |
|
85 |
obj_link => sub { $self->link_to($_[0]->order->customer) } }; |
|
86 |
} |
|
87 |
if ($vc eq 'vendor') { |
|
88 |
$column_defs{vendor} = { sub => sub { $_[0]->order->vendor->name }, |
|
89 |
obj_link => sub { $self->link_to($_[0]->order->vendor) } }, |
|
90 |
} |
|
91 |
|
|
92 | 80 |
$column_defs{$_}->{text} = $sort_columns{$_} for keys %column_defs; |
93 | 81 |
|
94 | 82 |
$report->set_options( |
... | ... | |
264 | 252 |
my $vc = $self->vc; |
265 | 253 |
|
266 | 254 |
SL::Controller::Helper::GetModels->new( |
267 |
controller => $self, |
|
268 |
model => 'OrderItem', |
|
269 |
sorted => { |
|
270 |
_default => { |
|
271 |
by => 'reqdate', |
|
272 |
dir => 1, |
|
255 |
controller => $self,
|
|
256 |
model => 'OrderItem',
|
|
257 |
sorted => {
|
|
258 |
_default => {
|
|
259 |
by => 'reqdate',
|
|
260 |
dir => 1,
|
|
273 | 261 |
}, |
274 | 262 |
%sort_columns, |
275 | 263 |
}, |
276 |
query => $self->delivery_plan_query, |
|
277 |
with_objects => [ 'order', "order.$vc", 'part' ], |
|
264 |
query => $self->delivery_plan_query, |
|
265 |
with_objects => [ 'order', "order.$vc", 'part' ], |
|
266 |
additional_url_params => { vc => $vc }, |
|
278 | 267 |
); |
279 | 268 |
} |
280 | 269 |
|
Auch abrufbar als: Unified diff
DeliveryPlan: Cleanup, vc mitschleifen