Revision 101b9705
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
bin/mozilla/ar.pl | ||
---|---|---|
$::form->{AR_chart_id} = $template->ar_ap_chart_id;
|
||
$::form->{transdate} = $today->to_kivitendo;
|
||
$::form->{duedate} = $today->to_kivitendo;
|
||
$::form->{rowcount} = @{ $template->items } + 1;
|
||
$::form->{rowcount} = @{ $template->items };
|
||
$::form->{paidaccounts} = 1;
|
||
$::form->{$_} = $template->$_ for qw(department_id ordnumber taxincluded employee_id notes);
|
||
|
||
... | ... | |
|
||
flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name));
|
||
|
||
update();
|
||
update(
|
||
keep_rows_without_amount => 1,
|
||
dont_add_new_row => 1,
|
||
);
|
||
}
|
||
|
||
sub save_record_template {
|
||
... | ... | |
$js->dialog->close('#record_template_dialog');
|
||
|
||
my @items = grep {
|
||
$_->{chart_id} && (($_->{tax_id} // '') ne '') && ($_->{amount1} != 0)
|
||
$_->{chart_id} && (($_->{tax_id} // '') ne '')
|
||
} map {
|
||
+{ chart_id => $::form->{"AR_amount_chart_id_${_}"},
|
||
amount1 => $::form->parse_amount(\%::myconfig, $::form->{"amount_${_}"}),
|
||
... | ... | |
}
|
||
|
||
sub update {
|
||
my %params = @_;
|
||
$main::lxdebug->enter_sub();
|
||
|
||
$main::auth->assert('ar_transactions');
|
||
... | ... | |
|
||
for my $i (1 .. $form->{rowcount}) {
|
||
$form->{"amount_$i"} = $form->parse_amount(\%myconfig, $form->{"amount_$i"});
|
||
if ($form->{"amount_$i"}) {
|
||
if ($form->{"amount_$i"} || $params{keep_rows_without_amount}) {
|
||
push @a, {};
|
||
my $j = $#a;
|
||
my ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
|
||
... | ... | |
}
|
||
|
||
$form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
|
||
$form->{rowcount} = $count + 1;
|
||
$form->{rowcount} = $count + ($params{dont_add_new_row} ? 0 : 1);
|
||
map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
|
||
|
||
$form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
|
||
... | ... | |
$form->{oldinvtotal} = $form->{invtotal};
|
||
$form->{oldtotalpaid} = $form->{totalpaid};
|
||
|
||
&display_form;
|
||
display_form();
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
Auch abrufbar als: Unified diff
Belegvorlagen: Zeilen ohne Betrag beibehalten