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

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



Revision: 2479
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2479&view=rev
Author:   einhverfr
Date:     2009-03-05 22:40:08 +0000 (Thu, 05 Mar 2009)

Log Message:
-----------
Reconciliation fix for empty set submission.  Tests added for this too

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/t/62-api.t
    trunk/t/data/62-request-data

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-05 00:31:10 UTC (rev 2478)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-05 22:40:08 UTC (rev 2479)
@@ -111,7 +111,7 @@
         }
         ++ $i;
     }
-    $self->{line_ids} =~ s/,$/}/; 
+    $self->{line_ids} =~ s/,?$/}/; 
 }
 
 sub submit {

Modified: trunk/t/62-api.t
===================================================================
--- trunk/t/62-api.t	2009-03-05 00:31:10 UTC (rev 2478)
+++ trunk/t/62-api.t	2009-03-05 22:40:08 UTC (rev 2479)
@@ -23,7 +23,7 @@
 
 for (qw(	drafts.pl     login.pl      payment.pl      
 		report.pl    employee.pl   menu.pl       vendor.pl
-		customer.pl  inventory.pl  vouchers.pl)
+		customer.pl  inventory.pl  vouchers.pl recon.pl)
     ){
 	ok(eval { require "scripts/$_" }, "Importing $_");
 	if ($@){

Modified: trunk/t/data/62-request-data
===================================================================
--- trunk/t/data/62-request-data	2009-03-05 00:31:10 UTC (rev 2478)
+++ trunk/t/data/62-request-data	2009-03-05 22:40:08 UTC (rev 2479)
@@ -114,6 +114,25 @@
                 '_user'         =>  { numberformat => '1,000.00', dateformat => 'yyyy-mm-dd' },
 	},
 	{
+		'_test_id'     => 'Empty Recon Submission',
+		'_codebase'    => 'new',
+		'action'       => 'submit_recon_set',
+		'module'       => 'recon.pl',
+		'report_id'    => '-100',
+		'their_total'  => '0',
+		'_exec_override' => {
+			'reconciliation__submit_set' => sub {
+					my ($self) = @_;
+					$self->_pre_save;
+					is($self->{line_ids}, '{}', 
+						'Empty recon set line ids ok');
+					is($self->{report_id}, -100, 
+						'Recon set report id correct');
+					},
+				
+				},
+	},
+	{
 		'_test_id'     => 'Payment search (OLD)',
 		'_codebase'    => 'old',
 		'account'      => '1060--Checking Account',
@@ -258,3 +277,9 @@
     }
     LedgerSMB::DBObject::exec_method($self, @_);
 }
+
+package LedgerSMB::DBObject::Reconciliation;
+
+sub exec_method {
+    LedgerSMB::DBObject::Payment::exec_method(@_);
+}


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