Revision 9364a0ca
Von Bernd Bleßmann vor 7 Monaten hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
|
||
# No right to set or change prices, so delete prices from params.
|
||
delete $params->{$_} for qw(sellprice_as_number lastcost_as_number listprice_as_number);
|
||
|
||
# Todo: makemodel prices, customer prices?
|
||
}
|
||
|
||
delete $params->{id};
|
||
... | ... | |
lastcost => $::form->parse_amount(\%::myconfig, $makemodel->{lastcost_as_number}),
|
||
sortorder => $position,
|
||
);
|
||
|
||
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
|
||
# No right to edit prices -> restore old lastcost.
|
||
$mm->lastcost($makemodels_map->{$id} ? $makemodels_map->{$id}->lastcost : undef);
|
||
}
|
||
|
||
if ($makemodels_map->{$mm->id} && !$makemodels_map->{$mm->id}->lastupdate && $makemodels_map->{$mm->id}->lastcost == 0 && $mm->lastcost == 0) {
|
||
# lastupdate isn't set, original lastcost is 0 and new lastcost is 0
|
||
# don't change lastupdate
|
||
... | ... | |
price => $::form->parse_amount(\%::myconfig, $customerprice->{price_as_number}),
|
||
sortorder => $position,
|
||
);
|
||
|
||
if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
|
||
# No right to edit prices -> restore old price.
|
||
$cu->price($customerprices_map->{$id} ? $customerprices_map->{$id}->price : undef);
|
||
}
|
||
|
||
if ($customerprices_map->{$cu->id} && !$customerprices_map->{$cu->id}->lastupdate && $customerprices_map->{$cu->id}->price == 0 && $cu->price == 0) {
|
||
# lastupdate isn't set, original price is 0 and new lastcost is 0
|
||
# don't change lastupdate
|
templates/design40_webpages/part/_customerprice_row.html | ||
---|---|---|
<td>[% L.input_tag('customerprices[].customer_partnumber' , customerprice.customer_partnumber , size=10) %]</td>
|
||
<td>[% L.input_tag('customerprices[].part_description' , customerprice.part_description , size=10) %]</td>
|
||
<td>[% L.areainput_tag('customerprices[].part_longdescription', customerprice.part_longdescription, size=10) %]</td>
|
||
<td>[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , class="reformat_number numeric", size=10) %]</td>
|
||
<td>
|
||
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %]
|
||
[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , class="reformat_number numeric", size=10) %]
|
||
[% ELSE %]
|
||
<span class="data numeric">[% customerprice.price_as_number %]</span>
|
||
[% END %]
|
||
</td>
|
||
<td>[% L.hidden_tag('customerprices[].lastupdate' , customerprice.lastupdate.to_kivitendo) %][% customerprice.lastupdate.to_kivitendo | html %]</td>
|
||
</tr>
|
templates/design40_webpages/part/_makemodel_row.html | ||
---|---|---|
<td>[% L.input_tag('makemodels[].model', makemodel.model, size=10) %] </td>
|
||
<td>[% L.input_tag('makemodels[].part_description', makemodel.part_description, size=10) %]</td>
|
||
<td>[% L.areainput_tag('makemodels[].part_longdescription', makemodel.part_longdescription, size=10) %]</td>
|
||
<td>[% L.input_tag('makemodels[].lastcost_as_number', makemodel.lastcost_as_number, class='reformat_number numeric', size=10) %] </td>
|
||
<td>
|
||
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %]
|
||
[% L.input_tag('makemodels[].lastcost_as_number', makemodel.lastcost_as_number, class='reformat_number numeric', size=10) %]
|
||
[% ELSE %]
|
||
<span class="data numeric">[% makemodel.lastcost_as_number %]</span>
|
||
[% END %]
|
||
<td>
|
||
[% L.hidden_tag('makemodels[].lastupdate', makemodel.lastupdate.to_kivitendo) %]
|
||
[% makemodel.lastupdate.to_kivitendo | html %]
|
templates/webpages/part/_customerprice_row.html | ||
---|---|---|
<td>[% L.input_tag('customerprices[].customer_partnumber' , customerprice.customer_partnumber , size=30 ) %]</td>
|
||
<td>[% L.input_tag('customerprices[].part_description' , customerprice.part_description , size=30 ) %]</td>
|
||
<td>[% L.areainput_tag('customerprices[].part_longdescription', customerprice.part_longdescription, size=30 ) %]</td>
|
||
<td>[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , size=15 , class="reformat_number numeric") %]</td>
|
||
<td>
|
||
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %]
|
||
[% L.input_tag('customerprices[].price_as_number' , customerprice.price_as_number , size=15 , class="reformat_number numeric") %]
|
||
[% ELSE %]
|
||
<span class="numeric">[% customerprice.price_as_number %]</span>
|
||
[% END %]
|
||
</td>
|
||
<td>[% L.hidden_tag('customerprices[].lastupdate' , customerprice.lastupdate.to_kivitendo) %][% customerprice.lastupdate.to_kivitendo | html %]</td>
|
||
</tr>
|
templates/webpages/part/_makemodel_row.html | ||
---|---|---|
<td>[% L.input_tag('makemodels[].model' , makemodel.model , size=30 ) %]</td>
|
||
<td>[% L.input_tag('makemodels[].part_description' , makemodel.part_description , size=30 ) %]</td>
|
||
<td>[% L.areainput_tag('makemodels[].part_longdescription', makemodel.part_longdescription, size=30 ) %]</td>
|
||
<td>[% L.input_tag('makemodels[].lastcost_as_number' , makemodel.lastcost_as_number , size=15 , class="reformat_number numeric") %]</td>
|
||
<td>
|
||
[% IF (AUTH.assert('part_service_assembly_edit_prices', 'may_fail')) %]
|
||
[% L.input_tag('makemodels[].lastcost_as_number' , makemodel.lastcost_as_number , size=15 , class="reformat_number numeric") %]
|
||
[% ELSE %]
|
||
<span class="numeric">[% makemodel.lastcost_as_number %]</span>
|
||
[% END %]
|
||
</td>
|
||
<td>[% L.hidden_tag('makemodels[].lastupdate' , makemodel.lastupdate.to_kivitendo) %][% makemodel.lastupdate.to_kivitendo | html %]</td>
|
||
</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.