Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0d060ae4

Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt

Rechte zum Bearbeiten von Preisen in Belgen getrennt nach VK/EK anwenden

Unterschiede anzeigen:

SL/Controller/PriceSource.pm
61 61
#
62 62

  
63 63
sub check_auth {
64
  $::auth->assert('edit_prices');
64
  if ($::form->{vc} eq 'customer') {
65
    $::auth->assert('sales_edit_prices');
66
  } elsif ($::form->{vc} eq 'vendor') {
67
    $::auth->assert('purchase_edit_prices');
68
  } else {
69
    $::auth->assert('no_such_right');
70
  }
65 71
}
66 72

  
67 73
sub init_record {
......
194 200
}
195 201

  
196 202
1;
197

  
bin/mozilla/io.pl
371 371
      }
372 372
    }
373 373

  
374
    my $edit_prices     = $main::auth->assert('edit_prices', 1) && (!$::form->{"active_price_source_$i"} || !$price || $price->editable);
375
    my $edit_discounts  = $main::auth->assert('edit_prices', 1) && !$::form->{"active_discount_source_$i"};
374
    my $right_to_edit_prices  = (!$is_purchase && $main::auth->assert('sales_edit_prices', 1)) || ($is_purchase && $main::auth->assert('purchase_edit_prices', 1));
375
    my $edit_prices           = $right_to_edit_prices && (!$::form->{"active_price_source_$i"} || !$price || $price->editable);
376
    my $edit_discounts        = $right_to_edit_prices && !$::form->{"active_discount_source_$i"};
376 377
    $column_data{sellprice}   = (!$edit_prices)
377 378
                                ? $cgi->hidden(   -name => "sellprice_$i", -id => "sellprice_$i", -value => $sellprice_value) . $sellprice_value
378 379
                                : $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric", -value => $sellprice_value);
templates/webpages/order/tabs/_price_sources_dialog.html
4 4
[%- USE LxERP %]
5 5
[% SET best_price = price_source.best_price %]
6 6
[% SET best_discount = price_source.best_discount %]
7
[% SET price_editable = AUTH.assert('edit_prices', 1) %]
7
[% SET price_editable = 0 %]
8
[% IF (FORM.type == "sales_order" || FORM.type == "sales_quotation") %]
9
  [% SET price_editable = AUTH.assert('sales_edit_prices', 1) %]
10
[% END %]
11
[% IF (FORM.type == "purchase_order" || FORM.type == "request_quotation") %]
12
  [% SET price_editable = AUTH.assert('purchase_edit_prices', 1) %]
13
[% END %]
8 14
  <h2>[% 'Prices' | $T8 %]</h2>
9 15

  
10 16
  <table>
templates/webpages/order/tabs/_row.html
100 100
                       ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
101 101
                       name = "price_chooser_button") %]
102 102
    </td>
103
    [% SET RIGHT_TO_EDIT_PRICES = 0 %]
104
    [% IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") %]
105
      [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('sales_edit_prices', 1) %]
106
    [% END %]
107
    [% IF (SELF.type == "purchase_order" || SELF.type == "request_quotation") %]
108
      [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('purchase_edit_prices', 1) %]
109
    [% END %]
103 110
    <td>
104 111
      [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
105
      [%- SET EDIT_PRICE = (AUTH.assert('edit_prices', 1) && ITEM.active_price_source.source == '') %]
112
      [%- SET EDIT_PRICE = (RIGHT_TO_EDIT_PRICES && ITEM.active_price_source.source == '') %]
106 113
      <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %] class="numeric">
107 114
        [%- L.input_tag("order.orderitems[].sellprice_as_number",
108 115
                        ITEM.sellprice_as_number,
......
119 126
    </td>
120 127
    <td>
121 128
      [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
122
      [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
129
      [%- SET EDIT_DISCOUNT = (RIGHT_TO_EDIT_PRICES && ITEM.active_discount_source.source == '') %]
123 130
      <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %] class="numeric">
124 131
        [%- L.input_tag("order.orderitems[].discount_as_percent",
125 132
                        ITEM.discount_as_percent,

Auch abrufbar als: Unified diff