[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1976] trunk



Revision: 1976
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1976&view=rev
Author:   einhverfr
Date:     2007-12-12 16:13:37 -0800 (Wed, 12 Dec 2007)

Log Message:
-----------
More payment fixes

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Payment.pm
    trunk/UI/lib/elements.html
    trunk/UI/lib/ui-header.html
    trunk/UI/payments/payments_detail.html
    trunk/UI/payments/payments_filter.html
    trunk/scripts/payment.pl
    trunk/sql/modules/Payment.sql

Added Paths:
-----------
    trunk/UI/payments/check_job.html
    trunk/job.pl
    trunk/utils/process_queue/config.pl.default

Removed Paths:
-------------
    trunk/utils/process_queue/config.pl

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2007-12-13 00:13:37 UTC (rev 1976)
@@ -416,7 +416,7 @@
         if ($queue_payments){
              my ($job_ref) = $self->exec_method(
                  funcname => 'job__create'
-             )
+             );
              $self->{job_id} = $job_ref->{job__create};
              $self->exec_method(
                  funcname => 'payment_bulk_queue_entry'
@@ -429,4 +429,9 @@
     return $self->{dbh}->commit;
 }
 
+sub check_job {
+    my ($self) = @_;
+    ($self->{job}) = $self->exec_method(funcname => 'job__status');
+}
+
 1;

Modified: trunk/UI/lib/elements.html
===================================================================
--- trunk/UI/lib/elements.html	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/UI/lib/elements.html	2007-12-13 00:13:37 UTC (rev 1976)
@@ -109,7 +109,7 @@
 	<?lsmb text_attr = 'text' ?>
     <?lsmb END ?>
     <?lsmb IF element_data.defined('value_attr') ?>
-        <?lsmb text_attr =  element_data.value_attr ?>
+        <?lsmb value_attr =  element_data.value_attr ?>
         <?lsmb element.delete('value_attr') ?>
     <?lsmb ELSE ?>
 	<?lsmb value_attr = 'value' ?>

Modified: trunk/UI/lib/ui-header.html
===================================================================
--- trunk/UI/lib/ui-header.html	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/UI/lib/ui-header.html	2007-12-13 00:13:37 UTC (rev 1976)
@@ -5,6 +5,10 @@
 	<title><?lsmb form.titlebar ? form.titlebar : titlebar ?></title>
 	<meta http-equiv="Pragma" content="no-cache" />
 	<meta http-equiv="Expires" content="-1" />
+	<?lsmb IF refresh -?>
+	<meta http-equiv="refresh" 
+		content="<?lsmb refresh.delay ?>;<?lsmb refresh.url ?>">
+	<?lsmb END -?>
 	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
 	<?lsmb IF form.stylesheet ?>
 	<link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />

Added: trunk/UI/payments/check_job.html
===================================================================
--- trunk/UI/payments/check_job.html	                        (rev 0)
+++ trunk/UI/payments/check_job.html	2007-12-13 00:13:37 UTC (rev 1976)
@@ -0,0 +1,36 @@
+<?lsmb INCLUDE 'ui-header.html'
+		include_stylesheet = [
+			'css/global.css' 
+			'UI/payments/payments.css'
+			stylesheet
+		]
+		titlebar = text('Checking Job') # '
+		refresh = {
+			url = "payment.pl?job_id=${job_id}&account_class=${account_class}"
+			delay = 20
+		}
+?>
+<body>
+   <div class="listtop"><?lsmb text('Checking Job [_1]', job_id) ?></div>
+   <div class="info">
+	<?lsmb IF job.completed;
+		text('Status: Still Running');
+	ELSE;
+		text('Status: Complete');
+	END ?></div>
+   <?lsmb IF job.completed ?>
+   <div class="info">
+	<?lsmb IF job.success;
+		text('Completed Successfully');
+	ELSE;
+		text('Job Failed');
+	END ?></div>
+	<?lsmb IF ! job.success ?>
+  <div class="info">
+	<?lsmb text('Error:') ?><br />
+	<?lsmb job.error_condition ?>
+  </div>
+	<?lsmb END # if ! job.success ?>
+  <?lsmb END # if job.completed ?>
+</body>
+</html>

Modified: trunk/UI/payments/payments_detail.html
===================================================================
--- trunk/UI/payments/payments_detail.html	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/UI/payments/payments_detail.html	2007-12-13 00:13:37 UTC (rev 1976)
@@ -265,7 +265,7 @@
 	value = count
     } ?>
     <?lsmb INCLUDE button element_data = {
-	text = text('Post'),
+	text = text((batch_id) ? 'Save' : 'Post'),
 	value = 'post_payments_bulk'
 	class = "submit"
 	name = 'action'

Modified: trunk/UI/payments/payments_filter.html
===================================================================
--- trunk/UI/payments/payments_filter.html	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/UI/payments/payments_filter.html	2007-12-13 00:13:37 UTC (rev 1976)
@@ -2,6 +2,7 @@
 		include_stylesheet = [
 			'css/global.css' 
 			'UI/payments/payments.css'
+			stylesheet
 		]
 		titlebar = text('Selection')
 ?>
@@ -104,6 +105,22 @@
 </select>
 </div>
 </div>
+<div class="listtop">
+	<!-- <?lsmb INCLUDE select element_data = {
+		name = "cash_accno"
+		default_values = [cash_accno]
+		options = cash_accounts
+		value_attr = "accno"
+		text_attr = "text"
+		label = text('Pay From:') # '
+	} ?> -->
+	<select name="cash_accno" id="cash_account">
+	<?lsmb FOREACH a = cash_accounts ?>
+	<option value="<?lsmb a.accno ?>">
+		<?lsmb a.accno ?>--<?lsmb a.description ?>
+	</option>
+	<?lsmb END # foreach a ?>
+	</select>
 <div class = "input">
 <?lsmb INCLUDE input element_data = {
 	type = "text"

Added: trunk/job.pl
===================================================================
--- trunk/job.pl	                        (rev 0)
+++ trunk/job.pl	2007-12-13 00:13:37 UTC (rev 1976)
@@ -0,0 +1,3 @@
+#!/usr/bin/perl
+
+require "lsmb-request.pl";


Property changes on: trunk/job.pl
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/scripts/payment.pl	2007-12-13 00:13:37 UTC (rev 1976)
@@ -82,20 +82,46 @@
     $template->render($payment);
 }
 
-sub post_payments_bulk {
+sub check_job {
     my ($request) = @_;
     my $payment =  LedgerSMB::DBObject::Payment->new({'base' => $request});
-    $payment->post_bulk();
+    $payment->check_job;
     my $template = LedgerSMB::Template->new(
         user     => $request->{_user},
         locale   => $request->{_locale},
         path     => 'UI/payments',
-        template => 'payments_filter',
+        template => 'check_job',
         format   => 'HTML', 
     );
     $template->render($payment);
 }
 
+sub post_payments_bulk {
+    my ($request) = @_;
+    my $payment =  LedgerSMB::DBObject::Payment->new({'base' => $request});
+    $payment->post_bulk();
+    my $template;
+    if ($payment->{queue_payments}){
+        $payment->{job_label} = 'Payments';
+        $template = LedgerSMB::Template->new(
+            user     => $request->{_user},
+            locale   => $request->{_locale},
+            path     => 'UI/payments',
+            template => 'check_job',
+            format   => 'HTML', 
+        );
+    } else {
+        $template = LedgerSMB::Template->new(
+            user     => $request->{_user},
+            locale   => $request->{_locale},
+            path     => 'UI/payments',
+            template => 'payments_filter',
+            format   => 'HTML', 
+        );
+    }
+    $template->render($payment);
+}
+
 sub display_payments {
     my ($request) = @_;
     my $payment =  LedgerSMB::DBObject::Payment->new({'base' => $request});

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/sql/modules/Payment.sql	2007-12-13 00:13:37 UTC (rev 1976)
@@ -230,7 +230,7 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
-CREATE OR REPLACE FUNCTION job__process_payments(in_job_id int)
+CREATE OR REPLACE FUNCTION job__process_payment(in_job_id int)
 RETURNS bool AS $$
 DECLARE 
 	queue_record RECORD

Deleted: trunk/utils/process_queue/config.pl
===================================================================
--- trunk/utils/process_queue/config.pl	2007-12-12 22:27:12 UTC (rev 1975)
+++ trunk/utils/process_queue/config.pl	2007-12-13 00:13:37 UTC (rev 1976)
@@ -1,18 +0,0 @@
-#!/usr/bin/perl
-
-use vars qw($database $db_user
-  $db_passwd);
-
-# The databases containing LedgerSMB
-our $database = ("ledgersmb");
-
-# The user to connect with.  This must be a superuser so that set session auth
-# works as expected
-
-our $db_user = "postgres";
-
-# The password for the db user:
-our $db_passwd = "mypasswd";
-
-1;
-

Copied: trunk/utils/process_queue/config.pl.default (from rev 1975, trunk/utils/process_queue/config.pl)
===================================================================
--- trunk/utils/process_queue/config.pl.default	                        (rev 0)
+++ trunk/utils/process_queue/config.pl.default	2007-12-13 00:13:37 UTC (rev 1976)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use vars qw($database $db_user
+  $db_passwd);
+
+# The databases containing LedgerSMB
+our $database = ("ledgersmb");
+
+# The user to connect with.  This must be a superuser so that set session auth
+# works as expected
+
+our $db_user = "postgres";
+
+# The password for the db user:
+our $db_passwd = "mypasswd";
+
+1;
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.