$form->get_lists("taxzones" => ($form->{id} ? "ALL_TAXZONES" : "ALL_ACTIVE_TAXZONES"),
"payments" => "ALL_PAYMENTS",
- "projects" => "ALL_PROJECTS",
"currencies" => "ALL_CURRENCIES",
"departments" => "ALL_DEPARTMENTS",
$vc => { key => "ALL_" . uc($vc),
]);
$TMPL_VAR{ALL_PROJECTS} = SL::DB::Manager::Project->get_all_sorted(query => \@conditions);
+ $form->{ALL_PROJECTS} = $TMPL_VAR{ALL_PROJECTS}; # make projects available for second row drop-down in io.pl
# label subs
my $employee_list_query_gen = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
</tr> |;
}
}
-
-# $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); # template does this
-
} else {
foreach my $item (split / /, $form->{taxaccounts}) {
if ($form->{"${item}_base"}) {
}
}
- $form->{oldinvtotal} = $form->{invtotal};
+ # beware numeric effects
+ $form->{oldinvtotal} = $form->round_amount( $form->{invtotal},2,1 );
+ $form->{rounding} = $form->round_amount( $form->{oldinvtotal}-$form->{invtotal}, 2 );
+ $form->{invtotal} = $form->{oldinvtotal};
$TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
if ($form->{type} =~ /^sales/) {
IS->retrieve_item(\%myconfig, \%$form);
$mode = 'IS';
- } else {
+ } else {
IR->retrieve_item(\%myconfig, \%$form);
$mode = 'IR';
}
my $locale = $main::locale;
check_oe_access();
+ $form->mtime_ischanged('oe');
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
check_oe_access();
+ $form->mtime_ischanged('oe');
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
check_oe_access();
check_oe_conversion_to_sales_invoice_allowed();
+ $form->mtime_ischanged('oe');
+
$main::auth->assert($form->{type} eq 'purchase_order' || $form->{type} eq 'request_quotation' ? 'vendor_invoice_edit' : 'invoice_edit');
$form->{old_salesman_id} = $form->{salesman_id};
my $locale = $main::locale;
check_oe_access();
+ $form->mtime_ischanged('oe');
+
$main::auth->assert('purchase_order_edit');
$form->{sales_order_to_purchase_order} = 0;
check_oe_access();
$main::auth->assert('sales_order_edit');
+ $form->mtime_ischanged('oe');
if ($form->{type} eq "purchase_order") {
delete($form->{ordnumber});
my $form = $main::form;
my %myconfig = %main::myconfig;
+ $form->mtime_ischanged('oe');
+
if ($form->{type} =~ /^sales/) {
$main::auth->assert('sales_delivery_order_edit');
check_oe_access();
+ $form->mtime_ischanged('oe','mail');
$form->{print_and_save} = 1;
my $saved_form = save_form();
my $config = { active => $::form->{active} ? 1 : 0,
terminated => $::form->{terminated} ? 1 : 0,
+ direct_debit => $::form->{direct_debit} ? 1 : 0,
periodicity => (any { $_ eq $::form->{periodicity} } @SL::DB::PeriodicInvoicesConfig::PERIODICITIES) ? $::form->{periodicity} : 'm',
order_value_periodicity => (any { $_ eq $::form->{order_value_periodicity} } ('p', @SL::DB::PeriodicInvoicesConfig::ORDER_VALUE_PERIODICITIES)) ? $::form->{order_value_periodicity} : 'p',
start_date_as_date => $::form->{start_date_as_date},