return $self unless wantarray;
- return map { ($_ => $data{$_}) } qw(taxes amounts amounts_cogs allocated exchangerate assembly_items items);
+ return map { ($_ => $data{$_}) } qw(taxes amounts amounts_cogs allocated exchangerate assembly_items items rounding);
}
sub _get_exchangerate {
_dbg("Sna " . $self->netamount . " idiff " . $data->{invoicediff} . " tdiff ${tax_diff}");
my $tax = sum values %{ $data->{taxes} };
- $data->{arap_amount} = $netamount + $tax;
+ $amount = $netamount + $tax;
+ my $grossamount = _round($amount, 2, 1);
+ $data->{rounding} = _round($grossamount - $amount, 2);
+ $data->{arap_amount} = $grossamount;
$self->netamount( $netamount);
- $self->amount( $netamount + $tax);
+ $self->amount( $grossamount);
$self->marge_percent($self->netamount ? ($self->netamount - $data->{lastcost_total}) * 100 / $self->netamount : 0);
}
my $worker = sub {
my %data = $self->calculate_prices_and_taxes;
- my $grossamount = $self->amount;
- $self->amount($::form->round_amount($grossamount, 2, 1));
- my $rounding = $::form->round_amount(
- $self->amount - $grossamount,
- 2
- );
$self->_post_create_assemblyitem_entries($data{assembly_items});
$self->save;
$self->_post_add_acctrans($data{amounts_cogs});
$self->_post_add_acctrans($data{amounts});
$self->_post_add_acctrans($data{taxes});
+
$self->_post_add_acctrans({ $params{ar_id} => $self->amount * -1 });
$self->_post_update_allocated($data{allocated});
- $self->_post_book_rounding($rounding);
+ $self->_post_book_rounding($data{rounding});
};
if ($self->db->in_transaction) {
'Pre-defined Texts' => 'Vordefinierte Textblöcke',
'Preamble' => 'Einleitung',
'Precision' => 'Genauigkeit',
+ 'Precision Note' => '<b>Achtung:</b> Bei Genauigkeit 0.05 dürfen Verkaufsbelege aktuell nur in Standardwährung erstellt werden.',
'Preferences' => 'Einstellungen',
'Preferences saved!' => 'Einstellungen gespeichert!',
'Prefix for the new bins\' names' => 'Namenspräfix für die neuen Lagerplätze',
'Postscript' => '',
'Posustva_coa' => '',
'Precision' => '',
+ 'Precision Note' => '<b>Attention:</b> currently with a precision of 0.05 sales sheets have to use the default currency.',
'Preferences' => '',
'Preferences saved!' => '',
'Prefix for the new bins\' names' => '',
'Updating the client fields in the database "#1" on host "#2:#3" failed.' => '',
'Uploaded on #1, size #2 kB' => '',
'Use As New' => '',
- 'Use Income' => 'Use GUV and BWA',
+ 'Use Income' => 'Use GUV and BWA',
'Use WebDAV Repository' => '',
'Use existing templates' => '',
'Use linked items' => '',
<tr>
<th align="right" nowrap>[% LxERP.t8('Precision') %]</th>
- <td>[% L.input_tag('precision_as_number', LxERP.format_amount(FORM.precision, 2)) %]</td>
+ <td>[% L.input_tag('precision_as_number', LxERP.format_amount(FORM.precision, 2)) %] [% LxERP.t8('Precision Note') %]</td>
</tr>
<tr>