Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2aacfefa

Von Bernd Bleßmann vor etwa 2 Monaten hinzugefügt

  • ID 2aacfefae1dfdb847adfd2798cdb14587f4ba2fd
  • Vorgänger d3c92dc2
  • Nachfolger ff9b6a50

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.

Unterschiede anzeigen:

SL/Controller/Part.pm
1042 1042
  if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
1043 1043
    # No right to set or change prices, so delete prices from params.
1044 1044
    delete $params->{$_} for qw(sellprice_as_number lastcost_as_number listprice_as_number);
1045

  
1046
    # Todo: makemodel prices, customer prices?
1047 1045
  }
1048 1046

  
1049 1047
  delete $params->{id};
......
1131 1129
                                     lastcost             => $::form->parse_amount(\%::myconfig, $makemodel->{lastcost_as_number}),
1132 1130
                                     sortorder            => $position,
1133 1131
                                   );
1132

  
1133
    if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
1134
      # No right to edit prices -> restore old lastcost.
1135
      $mm->lastcost($makemodels_map->{$id} ? $makemodels_map->{$id}->lastcost : undef);
1136
    }
1137

  
1134 1138
    if ($makemodels_map->{$mm->id} && !$makemodels_map->{$mm->id}->lastupdate && $makemodels_map->{$mm->id}->lastcost == 0 && $mm->lastcost == 0) {
1135 1139
      # lastupdate isn't set, original lastcost is 0 and new lastcost is 0
1136 1140
      # don't change lastupdate
......
1204 1208
                                     price                => $::form->parse_amount(\%::myconfig, $customerprice->{price_as_number}),
1205 1209
                                     sortorder            => $position,
1206 1210
                                   );
1211

  
1212
    if (!$::auth->assert('part_service_assembly_edit_prices', 'may_fail')) {
1213
      # No right to edit prices -> restore old price.
1214
      $cu->price($customerprices_map->{$id} ? $customerprices_map->{$id}->price : undef);
1215
    }
1216

  
1207 1217
    if ($customerprices_map->{$cu->id} && !$customerprices_map->{$cu->id}->lastupdate && $customerprices_map->{$cu->id}->price == 0 && $cu->price == 0) {
1208 1218
      # lastupdate isn't set, original price is 0 and new lastcost is 0
1209 1219
      # don't change lastupdate

Auch abrufbar als: Unified diff