use SL::DB::Default;
use SL::DB::Customer;
+use SL::DB::Department;
use SL::DB::Invoice;
use SL::DB::PaymentTerm;
+require "bin/mozilla/common.pl";
require "bin/mozilla/io.pl";
-require "bin/mozilla/arap.pl";
use strict;
if ($form->{type} eq "credit_note") {
$form->{type} = "credit_note";
$form->{formname} = "credit_note";
+ } elsif ($form->{formname} eq "proforma" ) {
+ $form->{type} = "invoice";
} else {
$form->{type} = "invoice";
$form->{formname} = "invoice";
"currencies" => "ALL_CURRENCIES",
"price_factors" => "ALL_PRICE_FACTORS");
- $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
+ $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
# Projects
my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
]
]
]);
- $TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" };
# currencies and exchangerate
my @values = map { $_ } @{ $form->{ALL_CURRENCIES} };
if (!$form->{no_redirect_after_post}) {
$form->{action} = 'edit';
$form->{script} = 'is.pl';
- $form->{saved_message} = $form->{label} . " $form->{invnumber} " . $locale->text('posted!');
$form->{callback} = build_std_url(qw(action edit id callback saved_message));
- $form->redirect;
+ $form->redirect($form->{label} . " $form->{invnumber} " . $locale->text('posted!'));
}
$main::lxdebug->leave_sub();