Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9364a0ca

Von Bernd Bleßmann vor 6 Tagen hinzugefügt

  • ID 9364a0ca10dbb201d527d36e4c8c544ce196d7dd
  • Vorgänger fe7c0e24
  • Nachfolger 631f096d

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
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

Auch abrufbar als: Unified diff