Revision 156a5d3b
Von Bernd Bleßmann vor 2 Monaten hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
253 | 253 |
$self->part($oldpart->clone_and_reset_deep); |
254 | 254 |
$self->parse_form(use_as_new => 1); |
255 | 255 |
$self->part->partnumber(undef); |
256 |
|
|
257 |
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) { |
|
258 |
# No right to edit prices -> remove prices for new part. |
|
259 |
$self->part->$_(undef) for qw(sellprice lastcost listprice); |
|
260 |
} |
|
261 |
|
|
256 | 262 |
$self->render_form(use_as_new => 1); |
257 | 263 |
} |
258 | 264 |
|
... | ... | |
1030 | 1036 |
|
1031 | 1037 |
my $params = delete($::form->{part}) || { }; |
1032 | 1038 |
|
1039 |
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) { |
|
1040 |
# No right to set or change prices, so delete prices from params. |
|
1041 |
delete $params->{$_} for qw(sellprice_as_number lastcost_as_number listprice_as_number); |
|
1042 |
|
|
1043 |
# Todo: pricegroup prices, makemodel prices, customer prices? |
|
1044 |
} |
|
1045 |
|
|
1033 | 1046 |
delete $params->{id}; |
1034 | 1047 |
$self->part->assign_attributes(%{ $params}); |
1035 | 1048 |
$self->part->bin_id(undef) unless $self->part->warehouse_id; |
templates/design40_webpages/part/_basic_data.html | ||
---|---|---|
107 | 107 |
</tr> |
108 | 108 |
<tr> |
109 | 109 |
<th>[% 'List Price' | $T8 %]</th> |
110 |
<td>[% L.input_tag("part.listprice_as_number", SELF.part.listprice_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %]</td> |
|
110 |
<td> |
|
111 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
112 |
[% L.input_tag("part.listprice_as_number", SELF.part.listprice_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %] |
|
113 |
[% ELSE %] |
|
114 |
<span class="data wi-mediumsmall numeric">[% SELF.part.listprice_as_number %]</span> |
|
115 |
[% END %] |
|
116 |
</td> |
|
111 | 117 |
</tr> |
112 | 118 |
<tr> |
113 | 119 |
<th>[% 'Sell Price' | $T8 %]</th> |
114 | 120 |
<td> |
115 |
[% L.input_tag("part.sellprice_as_number", SELF.part.sellprice_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %] |
|
121 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
122 |
[% L.input_tag("part.sellprice_as_number", SELF.part.sellprice_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %] |
|
123 |
[% ELSE %] |
|
124 |
<span class="data wi-mediumsmall numeric">[% SELF.part.sellprice_as_number %]</span> |
|
125 |
[% END %] |
|
116 | 126 |
[% IF (SELF.part.is_assortment or SELF.part.is_assembly) %] |
117 | 127 |
<span id="items_sellprice_sum_basic" class="data below wi-mediumsmall numeric">([% LxERP.format_amount(SELF.part.items_sellprice_sum, 2) %])</span> |
118 | 128 |
[% END %] |
... | ... | |
122 | 132 |
<th>[% 'Last Cost' | $T8 %]</th> |
123 | 133 |
<td> |
124 | 134 |
[%- UNLESS SELF.part.is_assembly %] |
125 |
[% L.input_tag("part.lastcost_as_number", SELF.part.lastcost_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %] |
|
135 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
136 |
[% L.input_tag("part.lastcost_as_number", SELF.part.lastcost_as_number, class='reformat_number numeric wi-mediumsmall', size=10) %] |
|
137 |
[% ELSE %] |
|
138 |
<span class="data wi-mediumsmall numeric">[% SELF.part.lastcost_as_number %]</span> |
|
139 |
[% END %] |
|
126 | 140 |
[% END %] |
127 | 141 |
[% IF SELF.part.is_assortment || SELF.part.is_assembly %] |
128 | 142 |
<span id="items_lastcost_sum_basic" class="data below wi-mediumsmall numeric">([% LxERP.format_amount(SELF.part.items_lastcost_sum, 2) %])</span> |
templates/webpages/part/_basic_data.html | ||
---|---|---|
108 | 108 |
|
109 | 109 |
<tr> |
110 | 110 |
<th align="right" nowrap="true">[% 'List Price' | $T8 %]</th> |
111 |
<td>[% L.input_tag("part.listprice_as_number", SELF.part.listprice_as_number, size=11 class='reformat_number numeric') %]</td> |
|
111 |
<td> |
|
112 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
113 |
[% L.input_tag("part.listprice_as_number", SELF.part.listprice_as_number, size=11 class='reformat_number numeric') %]</td> |
|
114 |
[% ELSE %] |
|
115 |
<span class="numeric">[% SELF.part.listprice_as_number %]</span> |
|
116 |
[% END %] |
|
112 | 117 |
</tr> |
113 | 118 |
|
114 | 119 |
<tr > |
115 | 120 |
<th align="right" nowrap="true">[% 'Sell Price' | $T8 %]</th> |
116 |
<td>[% L.input_tag("part.sellprice_as_number", SELF.part.sellprice_as_number, size=11, class='reformat_number numeric') %] [% IF (SELF.part.is_assortment or SELF.part.is_assembly) %] (<span id="items_sellprice_sum_basic">[% LxERP.format_amount(SELF.part.items_sellprice_sum, 2) %]</span>) [% END %]</td> |
|
121 |
<td> |
|
122 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
123 |
[% L.input_tag("part.sellprice_as_number", SELF.part.sellprice_as_number, size=11, class='reformat_number numeric') %] |
|
124 |
[% IF (SELF.part.is_assortment or SELF.part.is_assembly) %] (<span id="items_sellprice_sum_basic">[% LxERP.format_amount(SELF.part.items_sellprice_sum, 2) %]</span>) [% END %] |
|
125 |
[% ELSE %] |
|
126 |
<span class="numeric">[% SELF.part.sellprice_as_number %]</span> |
|
127 |
[% END %] |
|
128 |
</td> |
|
117 | 129 |
</tr> |
118 | 130 |
<tr> |
119 | 131 |
<th align="right" nowrap="true">[% 'Last Cost' | $T8 %]</th> |
120 | 132 |
<td> |
121 | 133 |
[%- UNLESS SELF.part.is_assembly %] |
122 |
[% L.input_tag("part.lastcost_as_number", SELF.part.lastcost_as_number, size=11 class='reformat_number numeric') %] |
|
134 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
135 |
[% L.input_tag("part.lastcost_as_number", SELF.part.lastcost_as_number, size=11 class='reformat_number numeric') %] |
|
136 |
[% ELSE %] |
|
137 |
<span class="numeric">[% SELF.part.lastcost_as_number %]</span> |
|
138 |
[% END %] |
|
123 | 139 |
[%- END %] |
124 | 140 |
[% IF SELF.part.is_assortment || SELF.part.is_assembly %] (<span id="items_lastcost_sum_basic">[% LxERP.format_amount(SELF.part.items_lastcost_sum, 2) %]</span>) [% END %] |
125 | 141 |
</td> |
Auch abrufbar als: Unified diff
Artikelstamm: Listen-, Verkaufs- und Einkaufspreis nicht ändern können, …
wenn kein Recht.
Preisfelder in der Maske sind nicht editierbar und Preise werden nicht
aus der Form geholt. Preise des vorhandenen Objekts werden nicht überschrieben.