Revision c383fc0b
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/Controller/PriceRule.pm | ||
---|---|---|
109 | 109 |
sub display_form { |
110 | 110 |
my ($self, %params) = @_; |
111 | 111 |
my $is_new = !$self->price_rule->id; |
112 |
my $title = $is_new ? |
|
113 |
($self->price_rule->is_sales ? t8('Create a new sales price rule') : t8('Create a new purchase price rule')) : |
|
114 |
($self->price_rule->is_sales ? t8('Edit sales price rule') : t8('Edit purchase price rule')); |
|
112 |
my $title = $self->form_title(($is_new ? 'create' : 'edit'), $self->price_rule->type); |
|
115 | 113 |
$self->render('price_rule/form', |
116 | 114 |
title => $title, |
117 | 115 |
%params |
118 | 116 |
); |
119 | 117 |
} |
120 | 118 |
|
119 |
sub form_title { |
|
120 |
my ($self, $action, $type) = @_; |
|
121 |
|
|
122 |
return { |
|
123 |
edit => { |
|
124 |
customer => t8('Edit sales price rule'), |
|
125 |
vendor => t8('Edit purchase price rule'), |
|
126 |
'' => t8('Edit price rule'), |
|
127 |
}, |
|
128 |
create => { |
|
129 |
customer => t8('Create a new sales price rule'), |
|
130 |
vendor => t8('Create a new purchase price rule'), |
|
131 |
'' => t8('Create a new price rule'), |
|
132 |
}, |
|
133 |
list => { |
|
134 |
customer => t8('Sales Price Rules'), |
|
135 |
vendor => t8('Purchase Price Rules'), |
|
136 |
'' => t8('Price Rules'), |
|
137 |
}, |
|
138 |
}->{$action}{$type}; |
|
139 |
} |
|
140 |
|
|
121 | 141 |
sub create_or_update { |
122 | 142 |
my $self = shift; |
123 | 143 |
my $is_new = !$self->price_rule->id; |
... | ... | |
171 | 191 |
std_column_visibility => 1, |
172 | 192 |
controller_class => 'PriceRule', |
173 | 193 |
output_format => 'HTML', |
174 |
title => ($self->vc eq 'customer' ? t8('Sales Price Rules') : t8('Purchase Price Rules')) ,
|
|
194 |
title => $self->form_title('list', $self->vc),
|
|
175 | 195 |
allow_pdf_export => !$::form->{inline}, |
176 | 196 |
allow_csv_export => !$::form->{inline}, |
177 | 197 |
); |
SL/DB/Manager/PriceRuleItem.pm | ||
---|---|---|
75 | 75 |
sub get_all_types { |
76 | 76 |
my ($class, $vc) = @_; |
77 | 77 |
|
78 |
[ map { [ $_, $types{$_}{description} ] } grep { $types{$_}{$vc} } map { $_ } @types ]; |
|
78 |
$vc |
|
79 |
? [ map { [ $_, $types{$_}{description} ] } grep { $types{$_}{$vc} } map { $_ } @types ] |
|
80 |
: [ map { [ $_, $types{$_}{description} ] } map { $_ } @types ] |
|
79 | 81 |
} |
80 | 82 |
|
81 | 83 |
sub get_type { |
js/kivi.PriceRule.js | ||
---|---|---|
15 | 15 |
}); |
16 | 16 |
} |
17 | 17 |
|
18 |
ns.on_change_filter_type = function() { |
|
19 |
var val = $('#price_rule_filter_type').val(); |
|
20 |
if (val == 'vendor') { |
|
21 |
$('#price_rule_filter_customer').data('customer_vendor_picker').set_item({}); |
|
22 |
$('#price_rule_filter_customer_tr').hide(); |
|
23 |
$('#price_rule_filter_vendor_tr').show(); |
|
24 |
} |
|
25 |
if (val == 'customer') { |
|
26 |
$('#price_rule_filter_vendor').data('customer_vendor_picker').set_item({}); |
|
27 |
$('#price_rule_filter_vendor_tr').hide(); |
|
28 |
$('#price_rule_filter_customer_tr').show(); |
|
29 |
} |
|
30 |
if (val == '') { |
|
31 |
$('#price_rule_filter_customer_tr').show(); |
|
32 |
$('#price_rule_filter_vendor_tr').show(); |
|
33 |
} |
|
34 |
} |
|
35 |
|
|
18 | 36 |
$(function() { |
19 | 37 |
$('#price_rule_item_add').click(function() { |
20 | 38 |
ns.add_new_row($('#price_rules_empty_item_select').val()); |
... | ... | |
23 | 41 |
$(this).closest('div').remove(); |
24 | 42 |
}) |
25 | 43 |
$('#price_rule_price_type_help').click(ns.open_price_type_help_popup); |
44 |
$('#price_rule_filter_type').change(ns.on_change_filter_type); |
|
26 | 45 |
}); |
27 | 46 |
}); |
locale/de/all | ||
---|---|---|
590 | 590 |
'Create a new group' => 'Neue Benutzergruppe erfassen', |
591 | 591 |
'Create a new payment term' => 'Neue Zahlungsbedingungen anlegen', |
592 | 592 |
'Create a new predefined text' => 'Einen neuen vordefinierten Textblock anlegen', |
593 |
'Create a new price rule' => 'Neue Preisregel anlegen', |
|
593 | 594 |
'Create a new printer' => 'Einen neuen Drucker anlegen', |
594 | 595 |
'Create a new project' => 'Neues Projekt anlegen', |
595 | 596 |
'Create a new project and link to it.' => 'Neues Projekt anlegen und damit verknüpfen.', |
... | ... | |
984 | 985 |
'Edit payment term' => 'Zahlungsbedingungen bearbeiten', |
985 | 986 |
'Edit picture' => 'Bild bearbeiten', |
986 | 987 |
'Edit predefined text' => 'Vordefinierten Textblock bearbeiten', |
988 |
'Edit price rule' => 'Preisregel bearbeiten', |
|
987 | 989 |
'Edit prices and discount (if not used, textfield is ONLY set readonly)' => 'Preise und Rabatt in Formularen frei anpassen (falls deaktiviert, wird allerdings NUR das textfield auf READONLY gesetzt / kann je nach Browserversion und technischen Fähigkeiten des Anwenders noch umgangen werden)', |
988 | 990 |
'Edit project' => 'Projekt bearbeiten', |
989 | 991 |
'Edit project #1' => 'Projekt #1 bearbeiten', |
... | ... | |
1540 | 1542 |
'Net amount (for verification)' => 'Nettobetrag (zur Überprüfung)', |
1541 | 1543 |
'Netto Terms' => 'Zahlungsziel netto', |
1542 | 1544 |
'New Password' => 'Neues Passwort', |
1543 |
'New Price Rule' => 'Neue Preisregel', |
|
1545 |
'New Purchase Price Rule' => 'Neue Einkaufspreisregel', |
|
1546 |
'New Sales Price Rule' => 'Neue Verkaufspreisregel', |
|
1544 | 1547 |
'New assembly' => 'Neues Erzeugnis', |
1545 | 1548 |
'New bank account' => 'Neues Bankkonto', |
1546 | 1549 |
'New client #1: The database configuration fields "host", "port", "name" and "user" must not be empty.' => 'Neuer Mandant #1: Die Datenbankkonfigurationsfelder "Host", "Port" und "Name" dürfen nicht leer sein.', |
menus/erp.ini | ||
---|---|---|
46 | 46 |
module=ic.pl |
47 | 47 |
action=search_update_prices |
48 | 48 |
|
49 |
[Master Data--Sales Price Rules ]
|
|
49 |
[Master Data--Price Rules]
|
|
50 | 50 |
ACCESS=part_service_assembly_edit |
51 | 51 |
module=controller.pl |
52 | 52 |
action=PriceRule/list |
53 |
filter.type=customer |
|
54 |
filter.obsolete=0 |
|
55 |
|
|
56 |
[Master Data--Purchase Price Rules ] |
|
57 |
ACCESS=part_service_assembly_edit |
|
58 |
module=controller.pl |
|
59 |
action=PriceRule/list |
|
60 |
filter.type=vendor |
|
61 | 53 |
filter.obsolete=0 |
62 | 54 |
|
63 | 55 |
[Master Data--Reports] |
templates/webpages/price_rule/_filter.html | ||
---|---|---|
14 | 14 |
<th align="right">[% 'Description' | $T8 %]</th> |
15 | 15 |
<td>[% L.input_tag('filter.name:substr::ilike', filter.name_substr__ilike, size = 20, style='width: 300px') %]</td> |
16 | 16 |
</tr> |
17 |
<tr> |
|
18 |
<th align="right">[% 'Type' | $T8 %]</th> |
|
19 |
<td>[% L.select_tag('filter.type', [ [ 'customer', LxERP.t8('Sales Price Rules '), ] [ 'vendor', LxERP.t8('Purchase Price Rules ') ] ], with_empty=1, default=filter.type, id='price_rule_filter_type', style='width: 300px') %]</td> |
|
20 |
</tr> |
|
17 | 21 |
<tr> |
18 | 22 |
<th align="right">[% 'Part' | $T8 %]</th> |
19 | 23 |
<td>[% L.part_picker('filter.item_type_matches[].part', FORM.filter.item_type_matches.0.part, style='width: 300px') %]</td> |
20 | 24 |
</tr> |
21 |
[%- IF SELF.vc == 'customer' %] |
|
22 |
<tr> |
|
25 |
<tr id='price_rule_filter_customer_tr' [% "style='display:hidden' " UNLESS SELF.vc == 'customer' %]> |
|
23 | 26 |
<th align="right">[% 'Customer' | $T8 %]</th> |
24 |
<td>[% L.customer_vendor_picker('filter.item_type_matches[].customer', FORM.filter.item_type_matches.0.customer, type='customer', style='width: 300px') %]</td> |
|
27 |
<td>[% L.customer_vendor_picker('filter.item_type_matches[].customer', FORM.filter.item_type_matches.0.customer, type='customer', id='price_rule_filter_customer', style='width: 300px') %]</td>
|
|
25 | 28 |
</tr> |
26 |
[%- END %] |
|
27 |
[%- IF SELF.vc == 'vendor' %] |
|
28 |
<tr> |
|
29 |
<tr id='price_rule_filter_vendor_tr' [% "style='display:hidden' " UNLESS SELF.vc == 'customer' %]> |
|
29 | 30 |
<th align="right">[% 'Vendor' | $T8 %]</th> |
30 |
<td>[% L.customer_vendor_picker('filter.item_type_matches[].vendor', FORM.filter.item_type_matches.0.vendor, type='vendor', style='width: 300px') %]</td> |
|
31 |
<td>[% L.customer_vendor_picker('filter.item_type_matches[].vendor', FORM.filter.item_type_matches.0.vendor, type='vendor', id='price_rule_filter_vendor', style='width: 300px') %]</td>
|
|
31 | 32 |
</tr> |
32 |
[%- END %] |
|
33 | 33 |
<tr> |
34 | 34 |
<th align="right">[% 'Business' | $T8 %]</th> |
35 | 35 |
<td>[% L.select_tag('filter.item_type_matches[].business', SELF.businesses, title_key='description', default=FORM.filter.item_type_matches.0.business, with_empty=1, style='width: 300px') %]</td> |
... | ... | |
87 | 87 |
</table> |
88 | 88 |
|
89 | 89 |
[% L.hidden_tag('action', 'PriceRule/dispatch') %] |
90 |
[% L.hidden_tag('filter.type', FORM.filter.type) %] |
|
91 | 90 |
[% L.hidden_tag('sort_by', FORM.sort_by) %] |
92 | 91 |
[% L.hidden_tag('sort_dir', FORM.sort_dir) %] |
93 | 92 |
[% L.hidden_tag('page', FORM.page) %] |
94 |
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] |
|
93 |
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit') %]
|
|
95 | 94 |
|
96 |
<a onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);$("#filter_table select").val("")'>[% 'Reset' | $T8 %]</a> |
|
95 |
<a class='interact cursor-pointer' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);$("#filter_table select").val("")'>[% 'Reset' | $T8 %]</a>
|
|
97 | 96 |
|
98 | 97 |
</div> |
99 | 98 |
|
templates/webpages/price_rule/report_bottom.html | ||
---|---|---|
4 | 4 |
[%- L.paginate_controls(models=SELF.models) %] |
5 | 5 |
|
6 | 6 |
[%- UNLESS FORM.inline %] |
7 |
<a href="[% SELF.url_for(action='new', 'price_rule.type'=SELF.vc, callback=SELF.models.get_callback) | html %]">[% 'New Price Rule' | $T8 %]</a> |
|
7 |
<a href="[% SELF.url_for(action='new', 'price_rule.type'='customer', callback=SELF.models.get_callback) | html %]">[% 'New Sales Price Rule' | $T8 %]</a> |
|
8 |
<a href="[% SELF.url_for(action='new', 'price_rule.type'='vendor', callback=SELF.models.get_callback) | html %]">[% 'New Purchase Price Rule' | $T8 %]</a> |
|
8 | 9 |
[%- END %] |
Auch abrufbar als: Unified diff
PriceRule: Ein menüeintrag und Typen frei filterbar