Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2aacfefa

Von Bernd Bleßmann vor 3 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
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