Revision f5b56d67
Von Jan Büren vor etwa 10 Jahren hinzugefügt
SL/Controller/DeliveryPlan.pm | ||
---|---|---|
22 | 22 |
partnumber => t8('Part Number'), |
23 | 23 |
qty => t8('Qty'), |
24 | 24 |
shipped_qty => t8('shipped'), |
25 |
delivered_qty => t8('transferred out'), |
|
25 |
delivered_qty => t8('transferred in / out'),
|
|
26 | 26 |
not_shipped_qty => t8('not shipped'), |
27 | 27 |
ordnumber => t8('Order'), |
28 | 28 |
customer => t8('Customer'), |
29 |
vendor => t8('Vendor'), |
|
29 | 30 |
value_of_goods => t8('Value of goods'), |
30 | 31 |
); |
31 | 32 |
|
33 |
my $vc; |
|
34 |
|
|
32 | 35 |
sub action_list { |
33 | 36 |
my ($self) = @_; |
34 | 37 |
|
38 |
$vc = "customer"; |
|
39 |
$self->make_filter_summary; |
|
40 |
$self->prepare_report; |
|
41 |
|
|
42 |
my $orderitems = $self->models->get; |
|
43 |
|
|
44 |
$self->report_generator_list_objects(report => $self->{report}, objects => $orderitems); |
|
45 |
} |
|
46 |
|
|
47 |
sub action_list_ap { |
|
48 |
my ($self) = @_; |
|
49 |
|
|
50 |
$vc = "vendor"; |
|
35 | 51 |
$self->make_filter_summary; |
36 | 52 |
$self->prepare_report; |
37 | 53 |
|
... | ... | |
63 | 79 |
delivered_qty => { sub => sub { $::form->format_amount(\%::myconfig, $_[0]->delivered_qty, 2) . ' ' . $_[0]->unit } }, |
64 | 80 |
ordnumber => { sub => sub { $_[0]->order->ordnumber }, |
65 | 81 |
obj_link => sub { $self->link_to($_[0]->order) } }, |
66 |
customer => { sub => sub { $_[0]->order->customer->name },
|
|
67 |
obj_link => sub { $self->link_to($_[0]->order->customer) } },
|
|
82 |
$vc => { sub => sub { $_[0]->order->$vc->name },
|
|
83 |
obj_link => sub { $self->link_to($_[0]->order->$vc) } },
|
|
68 | 84 |
); |
69 | 85 |
|
70 | 86 |
# add value of goods in report |
... | ... | |
77 | 93 |
std_column_visibility => 1, |
78 | 94 |
controller_class => 'DeliveryPlan', |
79 | 95 |
output_format => 'HTML', |
80 |
top_info_text => $::locale->text('Delivery Plan for currently outstanding sales orders'), |
|
96 |
top_info_text => ($vc eq 'customer') ? $::locale->text('Delivery Plan for currently outstanding sales orders') : |
|
97 |
$::locale->text('Delivery Plan for currently outstanding purchase orders'), |
|
81 | 98 |
title => $::locale->text('Delivery Plan'), |
82 | 99 |
allow_pdf_export => 1, |
83 | 100 |
allow_csv_export => 1, |
... | ... | |
90 | 107 |
$self->models->finalize; # for filter laundering |
91 | 108 |
$self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); |
92 | 109 |
$report->set_options( |
93 |
raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }), |
|
110 |
raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }, vc => $vc),
|
|
94 | 111 |
raw_bottom_info_text => $self->render('delivery_plan/report_bottom', { output => 0 }, models => $self->models), |
95 | 112 |
); |
96 | 113 |
} |
... | ... | |
108 | 125 |
[ $filter->{"reqdate:date::ge"}, $::locale->text('Delivery Date') . " " . $::locale->text('From Date') ], |
109 | 126 |
[ $filter->{"reqdate:date::le"}, $::locale->text('Delivery Date') . " " . $::locale->text('To Date') ], |
110 | 127 |
[ $filter->{"qty:number"}, $::locale->text('Quantity') ], |
111 |
[ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ],
|
|
112 |
[ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ],
|
|
128 |
[ $filter->{order}{$vc}{"name:substr::ilike"}, ($vc eq 'customer') ? $::locale->text('Customer') : $::locale->text('Vendor') ],
|
|
129 |
[ $filter->{order}{$vc}{"${vc}number:substr::ilike"}, ($vc eq 'customer') ? $::locale->text('Customer Number') : $::locale->text('Vendor Number') ],
|
|
113 | 130 |
); |
114 | 131 |
|
115 | 132 |
my %flags = ( |
... | ... | |
131 | 148 |
|
132 | 149 |
sub delivery_plan_query { |
133 | 150 |
my $employee_id = SL::DB::Manager::Employee->current->id; |
134 |
my $oe_owner = $_[0]->all_edit_right ? '' : " oe.eployee_id = $employee_id AND"; |
|
151 |
my $oe_owner = $_[0]->all_edit_right ? '' : " oe.employee_id = $employee_id AND";
|
|
135 | 152 |
# check delivered state for delivery_orders (transferred out) if enabled |
136 | 153 |
my $filter_delivered = $::instance_conf->get_delivery_plan_calculate_transferred_do ? |
137 | 154 |
"AND (SELECT delivered from delivery_orders where id = doi.delivery_order_id)" : ''; |
138 | 155 |
[ |
139 |
'order.customer_id' => { gt => 0 },
|
|
156 |
"order.${vc}_id" => { gt => 0 },
|
|
140 | 157 |
'order.closed' => 0, |
141 | 158 |
or => [ 'order.quotation' => 0, 'order.quotation' => undef ], |
142 | 159 |
|
... | ... | |
152 | 169 |
FROM orderitems oi, oe, record_links rl, delivery_order_items doi |
153 | 170 |
WHERE |
154 | 171 |
oe.id = oi.trans_id AND |
155 |
oe.customer_id IS NOT NULL AND
|
|
172 |
oe.${vc}_id IS NOT NULL AND
|
|
156 | 173 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND |
157 | 174 |
NOT oe.closed AND |
158 | 175 |
$oe_owner |
... | ... | |
176 | 193 |
SELECT oi.id FROM orderitems oi, oe |
177 | 194 |
WHERE |
178 | 195 |
oe.id = oi.trans_id AND |
179 |
oe.customer_id IS NOT NULL AND
|
|
196 |
oe.${vc}_id IS NOT NULL AND
|
|
180 | 197 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND |
181 | 198 |
NOT oe.closed AND |
182 | 199 |
$oe_owner |
... | ... | |
211 | 228 |
rl.from_table = 'oe' AND |
212 | 229 |
rl.to_table = 'delivery_orders' AND |
213 | 230 |
|
214 |
oe.customer_id IS NOT NULL AND
|
|
231 |
oe.${vc}_id IS NOT NULL AND
|
|
215 | 232 |
$oe_owner |
216 | 233 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed |
217 | 234 |
) rl |
... | ... | |
228 | 245 |
WHERE oi.trans_id = rl.from_id AND rl.from_table = 'oe' AND rl.to_table = 'delivery_orders' |
229 | 246 |
) AND |
230 | 247 |
coalesce(sum, 0) < oi.qty AND |
231 |
oe.customer_id IS NOT NULL AND
|
|
248 |
oe.${vc}_id IS NOT NULL AND
|
|
232 | 249 |
$oe_owner |
233 | 250 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed |
234 | 251 |
" ], |
... | ... | |
249 | 266 |
%sort_columns, |
250 | 267 |
}, |
251 | 268 |
query => $self->delivery_plan_query, |
252 |
with_objects => [ 'order', 'order.customer', 'part' ],
|
|
269 |
with_objects => [ 'order', "order.$vc", 'part' ],
|
|
253 | 270 |
); |
254 | 271 |
} |
255 | 272 |
|
locale/de/all | ||
---|---|---|
789 | 789 |
'Delivery Orders' => 'Lieferscheine', |
790 | 790 |
'Delivery Plan' => 'Lieferplan', |
791 | 791 |
'Delivery Plan check for transferred delivery orders' => 'Lieferplan berücksichtig den Status des Lieferscheins (ausgelagert / nicht ausgelagert)', |
792 |
'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für offene Verkaufsaufträge', |
|
792 |
'Delivery Plan for currently outstanding purchase orders' => 'Lieferplan für nicht vollständig gelieferte Einkaufs-Aufträge', |
|
793 |
'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für nicht vollständig gelieferte Verkaufsaufträge', |
|
793 | 794 |
'Delivery Terms' => 'Lieferbedingungen', |
794 | 795 |
'Delivery terms' => 'Lieferbedingungen', |
795 | 796 |
'Delivery terms (database ID)' => 'Lieferbedingungen (Datenbank-ID)', |
... | ... | |
3125 | 3126 |
'to (time)' => 'bis', |
3126 | 3127 |
'transfer' => 'Umlagerung', |
3127 | 3128 |
'transferred in' => 'eingelagert', |
3129 |
'transferred in / out' => 'ein- / ausgelagert', |
|
3128 | 3130 |
'transferred out' => 'ausgelagert', |
3129 | 3131 |
'trial_balance' => 'susa', |
3130 | 3132 |
'unconfigured' => 'unkonfiguriert', |
menus/erp.ini | ||
---|---|---|
256 | 256 |
action=search |
257 | 257 |
nextsub=ap_transactions |
258 | 258 |
|
259 |
[AP--Reports--Delivery Plan] |
|
260 |
ACCESS=delivery_plan |
|
261 |
module=controller.pl |
|
262 |
action=DeliveryPlan/list_ap |
|
259 | 263 |
|
260 | 264 |
[Warehouse] |
261 | 265 |
|
templates/webpages/delivery_plan/_filter.html | ||
---|---|---|
34 | 34 |
<th align="right">[% 'Quantity' | $T8 %]</th> |
35 | 35 |
<td>[% L.input_tag('filter.qty:number', filter.qty_number, size = 20) %]</td> |
36 | 36 |
</tr> |
37 |
<tr> |
|
38 |
<th align="right">[% 'Customer' | $T8 %]</th> |
|
39 |
<td>[% L.input_tag('filter.order.customer.name:substr::ilike', filter.order.customer.name_substr__ilike, size = 20) %]</td> |
|
40 |
</tr> |
|
41 |
<tr> |
|
42 |
<th align="right">[% 'Customer Number' | $T8 %]</th> |
|
43 |
<td>[% L.input_tag('filter.order.customer.customernumber:substr::ilike', filter.order.customer.customernumber_substr__ilike, size = 20) %]</td> |
|
44 |
</tr> |
|
37 |
[% IF vc == 'customer' %] |
|
38 |
<tr> |
|
39 |
<th align="right">[% vc | $T8 %]</th> |
|
40 |
<td>[% L.input_tag('filter.order.customer.name:substr::ilike', filter.order.customer.name_substr__ilike, size = 20) %]</td> |
|
41 |
</tr> |
|
42 |
<tr> |
|
43 |
<th align="right">[% 'Customer Number' | $T8 %]</th> |
|
44 |
<td>[% L.input_tag('filter.order.customer.customernumber:substr::ilike', filter.order.customer.customernumber_substr__ilike, size = 20) %]</td> |
|
45 |
</tr> |
|
46 |
[% ELSE %] <tr> |
|
47 |
<th align="right">[% vc | $T8 %]</th> |
|
48 |
<td>[% L.input_tag('filter.order.vendor.name:substr::ilike', filter.order.vendor.name_substr__ilike, size = 20) %]</td> |
|
49 |
</tr> |
|
50 |
<tr> |
|
51 |
<th align="right">[% 'Vendor Number' | $T8 %]</th> |
|
52 |
<td>[% L.input_tag('filter.order.vendor.vendornumber:substr::ilike', filter.order.vendor.vendornumber_substr__ilike, size = 20) %]</td> |
|
53 |
</tr> |
|
54 |
[% END %] |
|
45 | 55 |
<tr> |
46 | 56 |
<th align="right">[% 'Type' | $T8 %]</th> |
47 | 57 |
<td> |
... | ... | |
56 | 66 |
[% L.hidden_tag('sort_by', FORM.sort_by) %] |
57 | 67 |
[% L.hidden_tag('sort_dir', FORM.sort_dir) %] |
58 | 68 |
[% L.hidden_tag('page', FORM.page) %] |
59 |
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] |
|
69 |
[% IF vc == 'customer' %] |
|
70 |
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] |
|
71 |
[% ELSE %] |
|
72 |
[% L.input_tag('action_list_ap', LxERP.t8('Continue'), type = 'submit', class='submit')%] |
|
73 |
[% END %] |
|
60 | 74 |
|
61 | 75 |
|
62 | 76 |
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);'>[% 'Reset' | $T8 %]</a> |
Auch abrufbar als: Unified diff
Einkaufs-Lieferplan
Lieferplan für noch nicht vollständig gelieferte Einkaufsaufträge.