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") {
}
}
}
-
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
$form->{radier} =
($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
$form->{"exchangerate_$i"} =
$form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
+ if ($form->{"exchangerate_$i"} == 0) {
+ $form->{"exchangerate_$i"} = "";
+ }
$exchangerate = qq| |;
if ($form->{currency} ne $form->{defaultcurrency}) {
if ($form->{"forex_$i"}) {
. Q($form->{id})
. qq|);" name="history" id="history" value="|
. $locale->text('history')
- . qq|">|;
+ . qq|"> |;
}
# /button for saving history
-
-
+
+ # mark_as_paid button
+ if($form->{id} ne "") {
+ print qq|<input type="submit" class="submit" name="action" value="|
+ . $locale->text('mark as paid') . qq|">|;
+ }
+ # /mark_as_paid button
print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
qq|
$lxdebug->leave_sub();
}
+sub mark_as_paid {
+ $lxdebug->enter_sub();
+ &mark_as_paid_common(\%myconfig,"ar");
+ $lxdebug->leave_sub();
+}
+
sub update {
$lxdebug->enter_sub();
sub post_payment {
$lxdebug->enter_sub();
+
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
for $i (1 .. $form->{paidaccounts}) {
if ($form->{"paid_$i"}) {
$datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
sub post {
$lxdebug->enter_sub();
+
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));
($form->{AR}) = split /--/, $form->{AR};
($form->{AR_paid}) = split /--/, $form->{AR_paid};
+ $form->{storno} = 0;
$form->{label} = $locale->text('Invoice');
$form->{preview} = 1;
$old_form = new Form;
for (keys %$form) { $old_form->{$_} = $form->{$_} }
- $old_form->{rowcount}++;
&print_form($old_form);
$lxdebug->leave_sub();