Revision 9364a0ca
Von Bernd Bleßmann vor 2 Monaten hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
1039 | 1039 |
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) { |
1040 | 1040 |
# No right to set or change prices, so delete prices from params. |
1041 | 1041 |
delete $params->{$_} for qw(sellprice_as_number lastcost_as_number listprice_as_number); |
1042 |
|
|
1043 |
# Todo: makemodel prices, customer prices? |
|
1044 | 1042 |
} |
1045 | 1043 |
|
1046 | 1044 |
delete $params->{id}; |
... | ... | |
1128 | 1126 |
lastcost => $::form->parse_amount(\%::myconfig, $makemodel->{lastcost_as_number}), |
1129 | 1127 |
sortorder => $position, |
1130 | 1128 |
); |
1129 |
|
|
1130 |
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) { |
|
1131 |
# No right to edit prices -> restore old lastcost. |
|
1132 |
$mm->lastcost($makemodels_map->{$id} ? $makemodels_map->{$id}->lastcost : undef); |
|
1133 |
} |
|
1134 |
|
|
1131 | 1135 |
if ($makemodels_map->{$mm->id} && !$makemodels_map->{$mm->id}->lastupdate && $makemodels_map->{$mm->id}->lastcost == 0 && $mm->lastcost == 0) { |
1132 | 1136 |
# lastupdate isn't set, original lastcost is 0 and new lastcost is 0 |
1133 | 1137 |
# don't change lastupdate |
... | ... | |
1201 | 1205 |
price => $::form->parse_amount(\%::myconfig, $customerprice->{price_as_number}), |
1202 | 1206 |
sortorder => $position, |
1203 | 1207 |
); |
1208 |
|
|
1209 |
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) { |
|
1210 |
# No right to edit prices -> restore old price. |
|
1211 |
$cu->price($customerprices_map->{$id} ? $customerprices_map->{$id}->price : undef); |
|
1212 |
} |
|
1213 |
|
|
1204 | 1214 |
if ($customerprices_map->{$cu->id} && !$customerprices_map->{$cu->id}->lastupdate && $customerprices_map->{$cu->id}->price == 0 && $cu->price == 0) { |
1205 | 1215 |
# lastupdate isn't set, original price is 0 and new lastcost is 0 |
1206 | 1216 |
# don't change lastupdate |
templates/design40_webpages/part/_customerprice_row.html | ||
---|---|---|
18 | 18 |
<td>[% L.input_tag('customerprices[].customer_partnumber' , customerprice.customer_partnumber , size=10) %]</td> |
19 | 19 |
<td>[% L.input_tag('customerprices[].part_description' , customerprice.part_description , size=10) %]</td> |
20 | 20 |
<td>[% L.areainput_tag('customerprices[].part_longdescription', customerprice.part_longdescription, size=10) %]</td> |
21 |
<td>[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , class="reformat_number numeric", size=10) %]</td> |
|
21 |
<td> |
|
22 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
23 |
[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , class="reformat_number numeric", size=10) %] |
|
24 |
[% ELSE %] |
|
25 |
<span class="data numeric">[% customerprice.price_as_number %]</span> |
|
26 |
[% END %] |
|
27 |
</td> |
|
22 | 28 |
<td>[% L.hidden_tag('customerprices[].lastupdate' , customerprice.lastupdate.to_kivitendo) %][% customerprice.lastupdate.to_kivitendo | html %]</td> |
23 | 29 |
</tr> |
templates/design40_webpages/part/_makemodel_row.html | ||
---|---|---|
18 | 18 |
<td>[% L.input_tag('makemodels[].model', makemodel.model, size=10) %] </td> |
19 | 19 |
<td>[% L.input_tag('makemodels[].part_description', makemodel.part_description, size=10) %]</td> |
20 | 20 |
<td>[% L.areainput_tag('makemodels[].part_longdescription', makemodel.part_longdescription, size=10) %]</td> |
21 |
<td>[% L.input_tag('makemodels[].lastcost_as_number', makemodel.lastcost_as_number, class='reformat_number numeric', size=10) %] </td> |
|
21 |
<td> |
|
22 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
23 |
[% L.input_tag('makemodels[].lastcost_as_number', makemodel.lastcost_as_number, class='reformat_number numeric', size=10) %] |
|
24 |
[% ELSE %] |
|
25 |
<span class="data numeric">[% makemodel.lastcost_as_number %]</span> |
|
26 |
[% END %] |
|
22 | 27 |
<td> |
23 | 28 |
[% L.hidden_tag('makemodels[].lastupdate', makemodel.lastupdate.to_kivitendo) %] |
24 | 29 |
[% makemodel.lastupdate.to_kivitendo | html %] |
templates/webpages/part/_customerprice_row.html | ||
---|---|---|
20 | 20 |
<td>[% L.input_tag('customerprices[].customer_partnumber' , customerprice.customer_partnumber , size=30 ) %]</td> |
21 | 21 |
<td>[% L.input_tag('customerprices[].part_description' , customerprice.part_description , size=30 ) %]</td> |
22 | 22 |
<td>[% L.areainput_tag('customerprices[].part_longdescription', customerprice.part_longdescription, size=30 ) %]</td> |
23 |
<td>[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , size=15 , class="reformat_number numeric") %]</td> |
|
23 |
<td> |
|
24 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
25 |
[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , size=15 , class="reformat_number numeric") %] |
|
26 |
[% ELSE %] |
|
27 |
<span class="numeric">[% customerprice.price_as_number %]</span> |
|
28 |
[% END %] |
|
29 |
</td> |
|
24 | 30 |
<td>[% L.hidden_tag('customerprices[].lastupdate' , customerprice.lastupdate.to_kivitendo) %][% customerprice.lastupdate.to_kivitendo | html %]</td> |
25 | 31 |
</tr> |
templates/webpages/part/_makemodel_row.html | ||
---|---|---|
20 | 20 |
<td>[% L.input_tag('makemodels[].model' , makemodel.model , size=30 ) %]</td> |
21 | 21 |
<td>[% L.input_tag('makemodels[].part_description' , makemodel.part_description , size=30 ) %]</td> |
22 | 22 |
<td>[% L.areainput_tag('makemodels[].part_longdescription', makemodel.part_longdescription, size=30 ) %]</td> |
23 |
<td>[% L.input_tag('makemodels[].lastcost_as_number' , makemodel.lastcost_as_number , size=15 , class="reformat_number numeric") %]</td> |
|
23 |
<td> |
|
24 |
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %] |
|
25 |
[% L.input_tag('makemodels[].lastcost_as_number' , makemodel.lastcost_as_number , size=15 , class="reformat_number numeric") %] |
|
26 |
[% ELSE %] |
|
27 |
<span class="numeric">[% makemodel.lastcost_as_number %]</span> |
|
28 |
[% END %] |
|
29 |
</td> |
|
24 | 30 |
<td>[% L.hidden_tag('makemodels[].lastupdate' , makemodel.lastupdate.to_kivitendo) %][% makemodel.lastupdate.to_kivitendo | html %]</td> |
25 | 31 |
</tr> |
Auch abrufbar als: Unified diff
Artikelstamm: Lieferanten- und Kundenpreise nicht ändern können, wenn kein Recht
Preisfelder in der Maske sind nicht editierbar und Preise werden nicht
aus der Form geholt, sondern aus dem vorhandenen Objekt.