"Als bezahlt markieren" Button-Funktion in die common.pl verlegt.
authorThomas Kasulke <t.kasulke@linet-services.de>
Fri, 8 Jun 2007 13:11:49 +0000 (13:11 +0000)
committerThomas Kasulke <t.kasulke@linet-services.de>
Fri, 8 Jun 2007 13:11:49 +0000 (13:11 +0000)
31 files changed:
SL/Form.pm
bin/mozilla/ap.pl
bin/mozilla/ar.pl
bin/mozilla/common.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
locale/de/admin
locale/de/am
locale/de/amtemplates
locale/de/ap
locale/de/ar
locale/de/arap
locale/de/bp
locale/de/common
locale/de/cp
locale/de/ct
locale/de/datev
locale/de/dn
locale/de/drafts
locale/de/gl
locale/de/ic
locale/de/io
locale/de/ir
locale/de/is
locale/de/licenses
locale/de/login
locale/de/oe
locale/de/pe
locale/de/rc
locale/de/rp
locale/de/ustva

index 50b2e02..f5305e0 100644 (file)
@@ -2706,30 +2706,4 @@ sub all_years {
   $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|'">&nbsp;|;
-    print qq|<input type="button" value="|.$main::locale->text('no').qq|" onclick="javascript:history.back();">|;
-    print qq|</body></html>|;
-  }
-  
-  $main::lxdebug->leave_sub();
-}
-
 1;
index c84b614..4b2b4e1 100644 (file)
@@ -796,7 +796,7 @@ sub form_footer {
 
 sub mark_as_paid {
   $lxdebug->enter_sub();
-  $form->mark_as_paid(\%myconfig,"ap");  
+  &mark_as_paid_common(\%myconfig,"ap");  
   $lxdebug->leave_sub();
 }
 
index ad682ee..ba98a8e 100644 (file)
@@ -838,7 +838,7 @@ sub form_footer {
 
 sub mark_as_paid {
   $lxdebug->enter_sub();
-  $form->mark_as_paid(\%myconfig,"ar");  
+  &mark_as_paid_common(\%myconfig,"ar");  
   $lxdebug->leave_sub();
 }
 
index 359e586..d006c54 100644 (file)
@@ -565,4 +565,30 @@ sub show_vc_details {
        $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|'">&nbsp;|;
+    print qq|<input type="button" value="|.$locale->text('no').qq|" onclick="javascript:history.back();">|;
+    print qq|</body></html>|;
+}
+  
+  $lxdebug->leave_sub();
+}
+
 1;
index a8b9258..701c91b 100644 (file)
@@ -882,7 +882,7 @@ print qq|</form>
 
 sub mark_as_paid {
   $lxdebug->enter_sub();
-  $form->mark_as_paid(\%myconfig,"ap");  
+  &mark_as_paid_common(\%myconfig,"ap");  
   $lxdebug->leave_sub();
 }
 
index 6268f40..cd20dda 100644 (file)
@@ -1200,7 +1200,7 @@ print qq|
 
 sub mark_as_paid {
   $lxdebug->enter_sub();
-  $form->mark_as_paid(\%myconfig,"ar");  
+  &mark_as_paid_common(\%myconfig,"ar");  
   $lxdebug->leave_sub();
 }
 
index 77a84bb..fe2c915 100644 (file)
@@ -144,6 +144,7 @@ $self->{subs} = {
   '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',
index 90b80c3..d512748 100644 (file)
@@ -351,6 +351,7 @@ $self->{subs} = {
   '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',
index 956a009..af1b07c 100644 (file)
@@ -107,6 +107,7 @@ $self->{subs} = {
   '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',
index 6632a2c..511cd0c 100644 (file)
@@ -223,6 +223,7 @@ $self->{subs} = {
   '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',
index cd57b86..81f38e6 100644 (file)
@@ -232,6 +232,7 @@ $self->{subs} = {
   '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',
index 8d31f20..a729112 100644 (file)
@@ -103,6 +103,7 @@ $self->{subs} = {
   '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',
index df1558a..7dc5de5 100644 (file)
@@ -125,6 +125,7 @@ $self->{subs} = {
   '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',
index 13152ca..9523cd0 100644 (file)
@@ -86,6 +86,7 @@ $self->{subs} = {
   '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',
index 260271d..f82677b 100644 (file)
@@ -148,6 +148,7 @@ $self->{subs} = {
   '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',
index dad36ba..d88f698 100644 (file)
@@ -196,6 +196,7 @@ $self->{subs} = {
   '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',
index fe1e7e7..f7844aa 100644 (file)
@@ -132,6 +132,7 @@ $self->{subs} = {
   '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',
index 363b713..14e4907 100644 (file)
@@ -226,6 +226,7 @@ $self->{subs} = {
   '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',
index 4367b83..43f0f7e 100644 (file)
@@ -94,6 +94,7 @@ $self->{subs} = {
   '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',
index 0e5accf..09404bd 100644 (file)
@@ -213,6 +213,7 @@ $self->{subs} = {
   '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',
index 9fe464a..8fa658e 100644 (file)
@@ -310,6 +310,7 @@ $self->{subs} = {
   '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',
index 57900f7..00540cb 100644 (file)
@@ -189,6 +189,7 @@ $self->{subs} = {
   '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',
index 4236dae..051c94b 100644 (file)
@@ -279,6 +279,7 @@ $self->{subs} = {
   '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',
index 8c5e186..0f0c67d 100644 (file)
@@ -306,6 +306,7 @@ $self->{subs} = {
   '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',
index e2fe7e2..d309bdc 100644 (file)
@@ -122,6 +122,7 @@ $self->{subs} = {
   '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',
index 1b0bda5..f7976c8 100644 (file)
@@ -103,6 +103,7 @@ $self->{subs} = {
   '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',
index 6ae7f0a..639a795 100644 (file)
@@ -313,6 +313,7 @@ $self->{subs} = {
   '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',
index cdbe683..f2b9edf 100644 (file)
@@ -131,6 +131,7 @@ $self->{subs} = {
   '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',
index 54388b0..f26d287 100644 (file)
@@ -112,6 +112,7 @@ $self->{subs} = {
   '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',
index ab1e9d1..12441f1 100644 (file)
@@ -228,6 +228,7 @@ $self->{subs} = {
   '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',
index 6599558..176e58f 100644 (file)
@@ -171,6 +171,7 @@ $self->{subs} = {
   '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',