sub form_header {
$lxdebug->enter_sub();
+ if ($form->{old_employee_id}) {
+ $form->{employee_id} = $form->{old_employee_id};
+ }
+ if ($form->{old_salesman_id}) {
+ $form->{salesman_id} = $form->{old_salesman_id};
+ }
+
if ($edit) {
if ($form->{type} eq "credit_note") {
my $checkedclosed = $form->{"closed"} ? "checked" : "";
my $checkeddelivered = $form->{"delivered"} ? "checked" : "";
+ if ($form->{old_employee_id}) {
+ $form->{employee_id} = $form->{old_employee_id};
+ }
+ if ($form->{old_salesman_id}) {
+ $form->{salesman_id} = $form->{old_salesman_id};
+ }
+
map { $form->{$_} =~ s/\"/"/g }
qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname
shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact
sub invoice {
$lxdebug->enter_sub();
+ $form->{old_employee_id} = $form->{employee_id};
+ $form->{old_salesman_id} = $form->{salesman_id};
+
if ($form->{type} =~ /_order$/) {
# these checks only apply if the items don't bring their own ordnumbers/transdates.
$exchangerate =
$form->check_exchangerate(\%myconfig, $form->{currency}, $orddate,
$buysell);
+ print(STDERR "CURRENCY $form->{currency} DEFAULT: $form->{defaultcurrency} EXCHANGE $exchangerate\n");
if (!$exchangerate) {
&backorder_exchangerate($orddate, $buysell);
$form->{closed} = 0;
+ $form->{old_employee_id} = $form->{employee_id};
+ $form->{old_salesman_id} = $form->{salesman_id};
+
# reset
map { delete $form->{$_} }
qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal);