$main::lxdebug->leave_sub();
}
-sub mark_as_paid {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $db_name) = @_;
-
- if($self->{mark_as_paid}) {
- my $dbh ||= $self->get_standard_dbh($myconfig);
- my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|;
- do_query($self, $dbh, $query, $self->{id});
- $dbh->commit();
- $self->redirect($main::locale->text("Marked as paid"));
- }
- else {
- my $referer = $ENV{HTTP_REFERER};
- $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$self->{login}\&password\=$self->{password}\&id\=$self->{id}\&$2/;
- $self->header();
- print qq|<body>|;
- print qq|<p><b>|.$main::locale->text('Mark as paid?').qq|</b></p>|;
- print qq|<input type="button" value="|.$main::locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'"> |;
- print qq|<input type="button" value="|.$main::locale->text('no').qq|" onclick="javascript:history.back();">|;
- print qq|</body></html>|;
- }
-
- $main::lxdebug->leave_sub();
-}
-
1;
sub mark_as_paid {
$lxdebug->enter_sub();
- $form->mark_as_paid(\%myconfig,"ap");
+ &mark_as_paid_common(\%myconfig,"ap");
$lxdebug->leave_sub();
}
sub mark_as_paid {
$lxdebug->enter_sub();
- $form->mark_as_paid(\%myconfig,"ar");
+ &mark_as_paid_common(\%myconfig,"ar");
$lxdebug->leave_sub();
}
$lxdebug->leave_sub();
}
+sub mark_as_paid_common {
+ $lxdebug->enter_sub();
+ use SL::DBUtils;
+ my ($myconfig, $db_name) = @_;
+
+ if($form->{mark_as_paid}) {
+ my $dbh ||= $form->get_standard_dbh($myconfig);
+ my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|;
+ do_query($form, $dbh, $query, $form->{id});
+ $dbh->commit();
+ $form->redirect($locale->text("Marked as paid"));
+}
+ else {
+ my $referer = $ENV{HTTP_REFERER};
+ $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$form->{login}\&password\=$form->{password}\&id\=$form->{id}\&$2/;
+ $form->header();
+ print qq|<body>|;
+ print qq|<p><b>|.$locale->text('Mark as paid?').qq|</b></p>|;
+ print qq|<input type="button" value="|.$locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'"> |;
+ print qq|<input type="button" value="|.$locale->text('no').qq|" onclick="javascript:history.back();">|;
+ print qq|</body></html>|;
+}
+
+ $lxdebug->leave_sub();
+}
+
1;
sub mark_as_paid {
$lxdebug->enter_sub();
- $form->mark_as_paid(\%myconfig,"ap");
+ &mark_as_paid_common(\%myconfig,"ap");
$lxdebug->leave_sub();
}
sub mark_as_paid {
$lxdebug->enter_sub();
- $form->mark_as_paid(\%myconfig,"ar");
+ &mark_as_paid_common(\%myconfig,"ar");
$lxdebug->leave_sub();
}
'lock_system' => 'lock_system',
'login' => 'login',
'login_name' => 'login_name',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'pg_database_administration' => 'pg_database_administration',
'project_selection_internal' => 'project_selection_internal',
'list_lead' => 'list_lead',
'list_payment' => 'list_payment',
'list_printer' => 'list_printer',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'payment_header' => 'payment_header',
'printer_header' => 'printer_header',
'edit_template' => 'edit_template',
'employee_selection_internal' => 'employee_selection_internal',
'format_dates' => 'format_dates',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'load_draft' => 'load_draft',
'load_draft_maybe' => 'load_draft_maybe',
'mark_as_paid' => 'mark_as_paid',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'post' => 'post',
'load_draft' => 'load_draft',
'load_draft_maybe' => 'load_draft_maybe',
'mark_as_paid' => 'mark_as_paid',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'post' => 'post',
'employee_selection_internal' => 'employee_selection_internal',
'format_dates' => 'format_dates',
'gl_transaction' => 'gl_transaction',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'project_selected' => 'project_selected',
'employee_selection_internal' => 'employee_selection_internal',
'format_dates' => 'format_dates',
'list_spool' => 'list_spool',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'print' => 'print',
'project_selection_internal' => 'project_selection_internal',
'delivery_customer_selection' => 'delivery_customer_selection',
'employee_selection_internal' => 'employee_selection_internal',
'format_dates' => 'format_dates',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'format_dates' => 'format_dates',
'gl_transaction' => 'gl_transaction',
'list_invoices' => 'list_invoices',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'payment' => 'payment',
'get_delivery' => 'get_delivery',
'get_shipto' => 'get_shipto',
'list_names' => 'list_names',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'export_bewegungsdaten' => 'export_bewegungsdaten',
'export_stammdaten' => 'export_stammdaten',
'format_dates' => 'format_dates',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'gl_transaction' => 'gl_transaction',
'invoicetotal' => 'invoicetotal',
'item_selected' => 'item_selected',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'new_item' => 'new_item',
'new_license' => 'new_license',
'format_dates' => 'format_dates',
'load_draft' => 'load_draft',
'load_draft_maybe' => 'load_draft_maybe',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'generate_report' => 'generate_report',
'gl_subtotal' => 'gl_subtotal',
'gl_transaction' => 'gl_transaction',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'post' => 'post',
'link_part' => 'link_part',
'list' => 'list',
'makemodel_row' => 'makemodel_row',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'new_item' => 'new_item',
'new_license' => 'new_license',
'order' => 'order',
'format_dates' => 'format_dates',
'invoicetotal' => 'invoicetotal',
'item_selected' => 'item_selected',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'new_item' => 'new_item',
'new_license' => 'new_license',
'order' => 'order',
'load_draft' => 'load_draft',
'load_draft_maybe' => 'load_draft_maybe',
'mark_as_paid' => 'mark_as_paid',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'new_item' => 'new_item',
'new_license' => 'new_license',
'load_draft' => 'load_draft',
'load_draft_maybe' => 'load_draft_maybe',
'mark_as_paid' => 'mark_as_paid',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'new_item' => 'new_item',
'new_license' => 'new_license',
'form_footer' => 'form_footer',
'form_header' => 'form_header',
'format_dates' => 'format_dates',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'print_customer_selection' => 'print_customer_selection',
'print_license_form' => 'print_license_form',
'login' => 'login',
'login_screen' => 'login_screen',
'logout' => 'logout',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reformat_numbers' => 'reformat_numbers',
'invoice' => 'invoice',
'invoicetotal' => 'invoicetotal',
'item_selected' => 'item_selected',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'new_item' => 'new_item',
'new_license' => 'new_license',
'form_project_footer' => 'form_project_footer',
'form_project_header' => 'form_project_header',
'format_dates' => 'format_dates',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'partsgroup_report' => 'partsgroup_report',
'pricegroup_report' => 'pricegroup_report',
'employee_selection_internal' => 'employee_selection_internal',
'format_dates' => 'format_dates',
'get_payments' => 'get_payments',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'part_selection_internal' => 'part_selection_internal',
'project_selection_internal' => 'project_selection_internal',
'reconciliation' => 'reconciliation',
'gl_transaction' => 'gl_transaction',
'list_accounts' => 'list_accounts',
'list_payments' => 'list_payments',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'print' => 'print',
'generate_ustva' => 'generate_ustva',
'gl_transaction' => 'gl_transaction',
'help' => 'help',
+ 'mark_as_paid_common' => 'mark_as_paid_common',
'name_selected' => 'name_selected',
'part_selection_internal' => 'part_selection_internal',
'project_selected' => 'project_selected',