Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fe6275f8

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID fe6275f8eff9e0bab568cb6eba5ed70662148a88
  • Vorgänger 79c048aa
  • Nachfolger 68610bad

Unnötige Hiddens entfernen
Anzeigekonfiguration von Gewichten
Gewichte in Druckvorlagen

Durch diesen Commit werden
1. unnötige Hidden-Variablen aus html-templates entfernt, die mit
Gewichten zu tun haben.
2. die Anzeige von Gewichten konfigurierbar gemacht.
3. Gewichte in Druckvorlagen zur Verfügung gestellt. Es stehen ein
Zeilengewicht (lineweight), Einzelgewicht des Artikels (weight) und
Gesamtgewicht (totalweight) zur Verfügung, die letzten beiden auch
als unformatierte Variablen (weight_nofmt und totalweight_nofmt).

Unterschiede anzeigen:

SL/Controller/ClientConfig.pm
43 43

  
44 44
  map { $self->{$_} = SL::DB::Default->get->$_ } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete);
45 45

  
46
  $self->{show_weight} = SL::DB::Default->get->show_weight;
47

  
46 48
  $self->render('client_config/form', title => $::locale->text('Client Configuration'));
47 49
}
48 50

  
......
64 66

  
65 67
  map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete);
66 68

  
69
  SL::DB::Default->get->update_attributes('show_weight'     => $::form->{show_weight});
70

  
67 71
  flash_later('info', $::locale->text('Client Configuration saved!'));
68 72

  
69 73
  $self->redirect_to(action => 'edit');
SL/DB/MetaSetup/Default.pm
68 68
    ar_show_mark_as_paid                => { type => 'boolean', default => 'true' },
69 69
    ap_show_mark_as_paid                => { type => 'boolean', default => 'true' },
70 70
    assemblynumber                      => { type => 'text' },
71
    show_weight                         => { type => 'boolean', default => 'false', not_null => 1 },
71 72
  ],
72 73

  
73 74
  primary_key_columns => [ 'id' ],
SL/DO.pm
920 920

  
921 921
  $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
922 922
  $form->{totalweight_nofmt} = $totalweight;
923
  my $defaults = AM->get_defaults();
924
  $form->{weightunit}        = $defaults->{weightunit};
923 925

  
924 926
  $h_pg->finish();
925 927
  $h_bin_wh->finish();
SL/IS.pm
376 376

  
377 377
  $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
378 378
  $form->{totalweight_nofmt} = $totalweight;
379
  my $defaults = AM->get_defaults();
380
  $form->{weightunit}        = $defaults->{weightunit};
379 381

  
380 382
  foreach my $item (sort keys %taxaccounts) {
381 383
    $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
SL/OE.pm
1318 1318

  
1319 1319
  $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
1320 1320
  $form->{totalweight_nofmt} = $totalweight;
1321
  my $defaults = AM->get_defaults();
1322
  $form->{weightunit}        = $defaults->{weightunit};
1321 1323

  
1322 1324
  my $tax = 0;
1323 1325
  foreach $item (sort keys %taxaccounts) {
bin/mozilla/io.pl
123 123

  
124 124
  my ($stock_in_out, $stock_in_out_title);
125 125

  
126
  my $defaults = AM->get_defaults();
127
  $form->{show_weight} = $defaults->{show_weight};
128
  $form->{weightunit} = $defaults->{weightunit};
129

  
126 130
  my $is_purchase        = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl');
127 131
  my $show_min_order_qty =  first { $_ eq $form->{type} } qw(request_quotation purchase_order);
128 132
  my $is_delivery_order  = $form->{type} =~ /_delivery_order$/;
......
150 154
    {  id => 'qty',           width => 5,     value => $locale->text('Qty'),                  display => 1, },
151 155
    {  id => 'price_factor',  width => 5,     value => $locale->text('Price Factor'),         display => !$is_delivery_order, },
152 156
    {  id => 'unit',          width => 5,     value => $locale->text('Unit'),                 display => 1, },
153
    {  id => 'weight',        width => 5,     value => $locale->text('Weight'),               display => 1, },
157
    {  id => 'weight',        width => 5,     value => $locale->text('Weight'),               display => $defaults->{show_weight}, },
154 158
    {  id => 'serialnr',      width => 10,    value => $locale->text('Serial No.'),           display => 0, },
155 159
    {  id => 'projectnr',     width => 10,    value => $locale->text('Project'),              display => 0, },
156 160
    {  id => 'sellprice',     width => 15,    value => $locale->text('Price'),                display => !$is_delivery_order, },
......
208 212
  _update_custom_variables();
209 213

  
210 214
  my $totalweight = 0;
211
  my $defaults = AM->get_defaults();
212 215

  
213
  $form->{weightunit} = $defaults->{weightunit};
214 216
  # rows
215 217

  
216 218
  my @ROWS;
......
332 334
    $column_data{linetotal}   = $form->format_amount(\%myconfig, $linetotal, 2);
333 335
    $column_data{bin}         = $form->{"bin_$i"};
334 336

  
335
    $column_data{weight}      = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit};
336
    #To add the hidden variable lineweight:
337
    $form->{"lineweight_$i"}       = $column_data{weight};
337
    $column_data{weight}      = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit} if $defaults->{show_weight};
338 338

  
339 339
    if ($is_delivery_order) {
340 340
      $column_data{stock_in_out} =  calculate_stock_in_out($i);
......
430 430
          map { ($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } map { $_."_$i" }
431 431
            (qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes
432 432
                income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber
433
                longdescription basefactor marge_absolut marge_percent marge_price_factor weight lineweight), @hidden_vars)
433
                longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
434 434
    );
435 435

  
436 436
    map { $form->{"${_}_base"} += $linetotal } (split(/ /, $form->{"taxaccounts_$i"}));
locale/de/all
1797 1797
  'Show old dunnings'           => 'Alte Mahnungen anzeigen',
1798 1798
  'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
1799 1799
  'Show settings'               => 'Einstellungen anzeigen',
1800
  'Show the weights of articles and the total weight in orders, invoices and delivery notes?' => 'Sollen Warengewichte und Gesamtgewicht in Aufträgen, Rechnungen und Lieferscheinen angezeigt werden?',
1801
  'Show weights'                => 'Gewichte anzeigen',
1800 1802
  'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen',
1801 1803
  'Signature'                   => 'Unterschrift',
1802 1804
  'Since bin is not enforced in the parts data, please specify a bin where goods without a specified bin will be put.' => 'Da Lagerplätze kein Pflichtfeld sind, geben Sie bitte einen Lagerplatz an, in dem Waren ohne spezifizierten Lagerplatz eingelagert werden sollen.',
templates/webpages/client_config/form.html
177 177
   </td>
178 178
 </tr>
179 179

  
180
 <tr class='listheading'>
181
   <th colspan="3">[% 'Weight' | $T8 %]</th>
182
 </tr>
183
 <tr>
184
   <td align="right">[% 'Show weights' | $T8 %]</td>
185
   <td>
186
     [% L.yes_no_tag('show_weight', SELF.show_weight) %]
187
   </td>
188
   <td>
189
     [% 'Show the weights of articles and the total weight in orders, invoices and delivery notes?' | $T8 %]<br>
190
   </td>
191
 </tr>
180 192
</table>
181 193

  
182 194
<br>
templates/webpages/do/form_footer.html
20 20

  
21 21
     </td>
22 22
    </tr>
23
[%- IF show_weight %]
23 24
  <tr>
24 25
    <td>
25 26
      <table width="100%">
......
30 31
              <th  align="left">[% 'Total weight' | $T8 %]</th>
31 32
              <td align="right">
32 33
                [% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
33
                <input type="hidden" name="totalweight" value="[% HTML.escape(totalweight) %]">
34 34
              </td>
35 35
            </tr>
36 36
            </table>
......
38 38
        </tr>
39 39
      </table>
40 40
    </td>
41
  </tr>
42
[%- END %]
41 43
   </table>
42 44
  </p>
43 45

  
templates/webpages/ir/form_footer.html
33 33
[%- END %]
34 34
       </table>
35 35
      </td>
36
[%- IF show_weight %]
36 37
      <td>
37 38
       <table>
38 39
        <tr>
39 40
         <th  align=left>[% 'Total weight' | $T8 %]</th>
40 41
         <td>
41 42
          [% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
42
          <input type=hidden name="totalweight" value="[% totalweight %]">
43
          <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
44 43
         </td>
45 44
        </tr>
46 45
       </table>
47 46
      </td>
47
[%- END %]
48 48
      <td align="right">
49 49
  [%- IF taxaccounts %]
50 50
       <input name="taxincluded" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
templates/webpages/is/form_footer.html
43 43
[%- END %]
44 44
       </table>
45 45
      </td>
46
[%- IF show_weight %]
46 47
      <td>
47 48
       <table>
48 49
        <tr>
49 50
         <th  align=left>[% 'Total weight' | $T8 %]</th>
50 51
         <td>
51 52
          [% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
52
          <input type=hidden name="totalweight" value="[% totalweight %]">
53
          <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
54 53
         </td>
55 54
        </tr>
56 55
       </table>
57 56
      </td>
57
[%- END %]
58 58
      <td>
59 59
       <table>
60 60
        <tr>
templates/webpages/oe/form_footer.html
47 47
      [%- END %]
48 48
      </table>
49 49
          </td>
50
      [%- IF show_weight %]
50 51
          <td>
51 52
            <table>
52 53
            <tr>
53 54
              <th  align="left">[% 'Total weight' | $T8 %]</th>
54 55
              <td align="right">
55 56
                [% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
56
                <input type=hidden name="totalweight" value="[% totalweight %]">
57
                <input type="hidden" name="weightunit" value="[% HTML.escape(weightunit) %]">
58 57
              </td>
59 58
            </tr>
60 59
            </table>
61 60
          </td>
61
      [%- END %]
62 62
[%- IF is_sales %]
63 63
          <td>
64 64
            <table>

Auch abrufbar als: Unified diff