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);
+ $self->{show_weight} = SL::DB::Default->get->show_weight;
+
$self->render('client_config/form', title => $::locale->text('Client Configuration'));
}
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);
+ SL::DB::Default->get->update_attributes('show_weight' => $::form->{show_weight});
+
flash_later('info', $::locale->text('Client Configuration saved!'));
$self->redirect_to(action => 'edit');
ar_show_mark_as_paid => { type => 'boolean', default => 'true' },
ap_show_mark_as_paid => { type => 'boolean', default => 'true' },
assemblynumber => { type => 'text' },
+ show_weight => { type => 'boolean', default => 'false', not_null => 1 },
],
primary_key_columns => [ 'id' ],
$form->{totalweight} = $form->format_amount($myconfig, $totalweight, 3);
$form->{totalweight_nofmt} = $totalweight;
+ my $defaults = AM->get_defaults();
+ $form->{weightunit} = $defaults->{weightunit};
$h_pg->finish();
$h_bin_wh->finish();
$form->{totalweight} = $form->format_amount($myconfig, $totalweight, 3);
$form->{totalweight_nofmt} = $totalweight;
+ my $defaults = AM->get_defaults();
+ $form->{weightunit} = $defaults->{weightunit};
foreach my $item (sort keys %taxaccounts) {
$tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
$form->{totalweight} = $form->format_amount($myconfig, $totalweight, 3);
$form->{totalweight_nofmt} = $totalweight;
+ my $defaults = AM->get_defaults();
+ $form->{weightunit} = $defaults->{weightunit};
my $tax = 0;
foreach $item (sort keys %taxaccounts) {
my ($stock_in_out, $stock_in_out_title);
+ my $defaults = AM->get_defaults();
+ $form->{show_weight} = $defaults->{show_weight};
+ $form->{weightunit} = $defaults->{weightunit};
+
my $is_purchase = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl');
my $show_min_order_qty = first { $_ eq $form->{type} } qw(request_quotation purchase_order);
my $is_delivery_order = $form->{type} =~ /_delivery_order$/;
{ id => 'qty', width => 5, value => $locale->text('Qty'), display => 1, },
{ id => 'price_factor', width => 5, value => $locale->text('Price Factor'), display => !$is_delivery_order, },
{ id => 'unit', width => 5, value => $locale->text('Unit'), display => 1, },
- { id => 'weight', width => 5, value => $locale->text('Weight'), display => 1, },
+ { id => 'weight', width => 5, value => $locale->text('Weight'), display => $defaults->{show_weight}, },
{ id => 'serialnr', width => 10, value => $locale->text('Serial No.'), display => 0, },
{ id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, },
{ id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, },
_update_custom_variables();
my $totalweight = 0;
- my $defaults = AM->get_defaults();
- $form->{weightunit} = $defaults->{weightunit};
# rows
my @ROWS;
$column_data{linetotal} = $form->format_amount(\%myconfig, $linetotal, 2);
$column_data{bin} = $form->{"bin_$i"};
- $column_data{weight} = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit};
- #To add the hidden variable lineweight:
- $form->{"lineweight_$i"} = $column_data{weight};
+ $column_data{weight} = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit} if $defaults->{show_weight};
if ($is_delivery_order) {
$column_data{stock_in_out} = calculate_stock_in_out($i);
map { ($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } map { $_."_$i" }
(qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes
income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber
- longdescription basefactor marge_absolut marge_percent marge_price_factor weight lineweight), @hidden_vars)
+ longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
);
map { $form->{"${_}_base"} += $linetotal } (split(/ /, $form->{"taxaccounts_$i"}));
'Show old dunnings' => 'Alte Mahnungen anzeigen',
'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
'Show settings' => 'Einstellungen anzeigen',
+ '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?',
+ 'Show weights' => 'Gewichte anzeigen',
'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen',
'Signature' => 'Unterschrift',
'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.',
</td>
</tr>
+ <tr class='listheading'>
+ <th colspan="3">[% 'Weight' | $T8 %]</th>
+ </tr>
+ <tr>
+ <td align="right">[% 'Show weights' | $T8 %]</td>
+ <td>
+ [% L.yes_no_tag('show_weight', SELF.show_weight) %]
+ </td>
+ <td>
+ [% 'Show the weights of articles and the total weight in orders, invoices and delivery notes?' | $T8 %]<br>
+ </td>
+ </tr>
</table>
<br>
</td>
</tr>
+[%- IF show_weight %]
<tr>
<td>
<table width="100%">
<th align="left">[% 'Total weight' | $T8 %]</th>
<td align="right">
[% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
- <input type="hidden" name="totalweight" value="[% HTML.escape(totalweight) %]">
</td>
</tr>
</table>
</tr>
</table>
</td>
+ </tr>
+[%- END %]
</table>
</p>
[%- END %]
</table>
</td>
+[%- IF show_weight %]
<td>
<table>
<tr>
<th align=left>[% 'Total weight' | $T8 %]</th>
<td>
[% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
- <input type=hidden name="totalweight" value="[% totalweight %]">
- <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
</td>
</tr>
</table>
</td>
+[%- END %]
<td align="right">
[%- IF taxaccounts %]
<input name="taxincluded" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
[%- END %]
</table>
</td>
+[%- IF show_weight %]
<td>
<table>
<tr>
<th align=left>[% 'Total weight' | $T8 %]</th>
<td>
[% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
- <input type=hidden name="totalweight" value="[% totalweight %]">
- <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
</td>
</tr>
</table>
</td>
+[%- END %]
<td>
<table>
<tr>
[%- END %]
</table>
</td>
+ [%- IF show_weight %]
<td>
<table>
<tr>
<th align="left">[% 'Total weight' | $T8 %]</th>
<td align="right">
[% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
- <input type=hidden name="totalweight" value="[% totalweight %]">
- <input type="hidden" name="weightunit" value="[% HTML.escape(weightunit) %]">
</td>
</tr>
</table>
</td>
+ [%- END %]
[%- IF is_sales %]
<td>
<table>