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

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



Revision: 2520
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2520&view=rev
Author:   einhverfr
Date:     2009-03-20 22:31:41 +0000 (Fri, 20 Mar 2009)

Log Message:
-----------
non-JS menu fixes, AR fixes, workflow changes for bank-file-upload and reconciliation

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Customer.pm
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/LedgerSMB/ScriptLib/Company.pm
    trunk/UI/reconciliation/report.css
    trunk/UI/reconciliation/report.html
    trunk/css/ledgersmb.css
    trunk/scripts/recon.pl
    trunk/sql/modules/Reconciliaton.sql
    trunk/t/data/62-request-data

Modified: trunk/LedgerSMB/DBObject/Customer.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Customer.pm	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/LedgerSMB/DBObject/Customer.pm	2009-03-20 22:31:41 UTC (rev 2520)
@@ -10,11 +10,4 @@
     $self->{entity_class} = $ENTITY_CLASS;
 }
     
-
-
-
-sub search {
-    
-    
-}
 1;

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-20 22:31:41 UTC (rev 2520)
@@ -304,13 +304,37 @@
 
     $our_balance = $ref->{reconciliation__get_cleared_balance};
     $self->{beginning_balance} = $our_balance;
-    $self->{cleared_total} = 0;
-    $self->{outstanding_total} = 0;
+    $self->{cleared_total} = $self->parse_amount(amount => 0);
+    $self->{outstanding_total} = $self->parse_amount(amount => 0);
+    $self->{mismatch_our_total} = $self->parse_amount(amount => 0);
+    $self->{mismatch_our_credits} = $self->parse_amount(amount => 0);
+    $self->{mismatch_our_debits} = $self->parse_amount(amount => 0);
+    $self->{mismatch_their_total} = $self->parse_amount(amount => 0);
+    $self->{mismatch_their_credits} = $self->parse_amount(amount => 0);
+    $self->{mismatch_their_debits} = $self->parse_amount(amount => 0);
 
+
     for my $line (@{$self->{report_lines}}){
         if ($self->{"cleared_$line->{id}"} or $line->{cleared}){
             $our_balance += $line->{our_balance};
             $self->{cleared_total} += $line->{our_balance};
+	}elsif ((($self->{their_balance} != '0')
+		and ($self->{their_balance} != $self->{our_balance}))
+		or $line->{our_balance} == 0){
+	
+            $line->{err} = 'mismatch';
+            $self->{mismatch_our_total} += $line->{our_balance};
+            $self->{mismatch_their_total} += $line->{their_balance};
+            if ($line->{our_balance} < 0){
+                $self->{mismatch_our_debits} += -$line->{our_balance}; 
+            } else {
+		$self->{mismatch_our_credits} += $line->{our_balance};
+            }
+            if ($line->{their_balance} < 0){
+                $self->{mismatch_their_debits} += -$line->{their_balance}; 
+            } else {
+		$self->{mismatch_their_credits} += $line->{their_balance};
+            }
         } else {
             $self->{outstanding_total} += $line->{our_balance};
         } 

Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/LedgerSMB/ScriptLib/Company.pm	2009-03-20 22:31:41 UTC (rev 2520)
@@ -250,6 +250,11 @@
                 curr          => $ref->{curr},
                 };
     }
+    my $label = $ec_labels->{"$company->{account_class}"};
+# CT:  Labels for i18n:
+# text->{'Add Customer')
+# text->('Add Vendor')
+
 # CT:  The CSV Report is broken.  I get:
 # Not an ARRAY reference at 
 # /usr/lib/perl5/site_perl/5.8.8/CGI/Simple.pm line 423
@@ -263,7 +268,7 @@
 #        },
 	{name => 'action',
         value => 'add',
-        text => $company->{_locale}->text('Add Vendor'),
+        text => $company->{_locale}->text("Add $label"),
         type => 'submit',
         class => 'submit',
 	}

Modified: trunk/UI/reconciliation/report.css
===================================================================
--- trunk/UI/reconciliation/report.css	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/UI/reconciliation/report.css	2009-03-20 22:31:41 UTC (rev 2520)
@@ -6,6 +6,10 @@
 	width: 800px;
 }
 
+#error-table {
+	width: 800px;
+}
+
 span.heading {
 	font-weight: bold;
 }

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/UI/reconciliation/report.html	2009-03-20 22:31:41 UTC (rev 2520)
@@ -75,7 +75,8 @@
 	</tr>
 	
 	<?lsmb FOREACH row = report_lines ?>
-			<?lsmb IF (row.our_balance == row.their_balance) or
+			<?lsmb IF (row.our_balance == row.their_balance AND 
+				row.our_balance != zero_string) or
 				row.cleared or ${"cleared_$row.id"}
 				-?>
 				<?lsmb row.cleared = 'checked' ?>
@@ -87,13 +88,7 @@
 		name = "id_$i",
 		value = row.id
 	} ?>
-		<?lsmb IF row.errorcode != 0 ?>
-		<tr style="background-color:pink;">
-		<?lsmb ELSIF row.id == corrected ?>
-		<tr style="background-color:yellow;">		
-		<?lsmb ELSE ?>
-		<tr>
-		<?lsmb END ?>
+		<tr class="record">
 			<td><?lsmb INCLUDE input element_data = {
 			type = "checkbox"
 			name = "cleared_$row.id"
@@ -119,6 +114,57 @@
 		<td><?lsmb total_cleared_credits ?></td>
 	</tr>
 	</table>
+<table border=0 id="error-table">
+	<tr class="listtop">
+		<th colspan=9><?lsmb text('Mismatched Transactions (From Upload)') ?></th>
+	</tr>
+	<tr class="listheading">
+		<th><?lsmb text('Cleared') ?></th>
+		<th><?lsmb text('Transaction Type') ?></th>
+		<th><?lsmb text('Clear date') ?></th>
+		<th><?lsmb text('Source') ?></th>
+		<th><?lsmb text('Posted Date') ?></th>
+		<th><?lsmb text('Our Debits') ?></th>
+		<th><?lsmb text('Our Credits') ?></th>
+		<th><?lsmb text('Their Debits') ?></th>
+		<th><?lsmb text('Their Credits') ?></th>
+	</tr>
+	
+	<?lsmb FOREACH row = report_lines ?>
+	<?lsmb IF row.err == 'mismatch' ?>
+	<?lsmb INCLUDE input element_data = {
+		type = "hidden",
+		name = "id_$i",
+		value = row.id
+	} ?>
+		<tr class="warning">		
+			<td><?lsmb INCLUDE input element_data = {
+			type = "checkbox"
+			name = "cleared_$row.id"
+			value = row.id
+			checked = row.cleared
+			}
+			?></td>
+			<td><?lsmb row.transaction_type ?></td>
+			<td><?lsmb row.clear_time ?></td>
+			<td><?lsmb row.scn ?> </td>
+			<td><?lsmb row.post_date ?></td>
+			<td><?lsmb row.our_debits ?></td>
+			<td><?lsmb row.our_credits ?></td>
+			<td><?lsmb row.their_debits ?></td>
+			<td><?lsmb row.their_credits ?></td>
+		</tr>
+	<?lsmb i = i + 1 -?>
+	<?lsmb END -?>
+	<?lsmb END -?>
+	<tr class="subtotal">
+		<th colspan=5><?lsmb text('Total') ?></th>
+		<td><?lsmb mismatch_our_debits ?></td>
+		<td><?lsmb mismatch_our_credits ?></td>
+		<td><?lsmb mismatch_their_debits ?></td>
+		<td><?lsmb mismatch_their_credits ?></td>
+	</tr>
+	</table>
 	<table id="outstanding-table">
 	<tr class="listtop">
 		<th colspan=5><?lsmb text('Outstanding Transactions') ?></th>
@@ -131,19 +177,13 @@
 		<th><?lsmb text('Our Credits') ?></th>
 	</tr>
 	<?lsmb FOREACH row = report_lines ?>
-	<?lsmb IF row.cleared != 'checked' ?>
+	<?lsmb IF row.cleared != 'checked' and row.err != 'mismatch' ?>
 	<?lsmb INCLUDE input element_data = {
 		type = "hidden",
 		name = "id_$i",
 		value = row.id
 	} ?>
-		<?lsmb IF row.errorcode != 0 ?>
-		<tr style="background-color:pink;">
-		<?lsmb ELSIF row.id == corrected ?>
-		<tr style="background-color:yellow;">		
-		<?lsmb ELSE ?>
-		<tr>
-		<?lsmb END ?>
+		<tr class="record">
 			<td><?lsmb INCLUDE input element_data = {
 			type = "checkbox"
 			name = "cleared_$row.id"

Modified: trunk/css/ledgersmb.css
===================================================================
--- trunk/css/ledgersmb.css	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/css/ledgersmb.css	2009-03-20 22:31:41 UTC (rev 2520)
@@ -215,6 +215,13 @@
 	background-color: #ddd;
 }
 
+tr.record {
+	background-color: pink;
+}
+
+tr.warning {
+	background-color: yellow;
+}
 /* media stuff */
 
 @media screen {
@@ -228,4 +235,3 @@
     display: none;
   }
 }
-

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/scripts/recon.pl	2009-03-20 22:31:41 UTC (rev 2520)
@@ -361,6 +361,7 @@
         $recon->{total_uncleared_credits} = $recon->parse_amount(amount => 0);
         $recon->{total_uncleared_debits} = $recon->parse_amount(amount => 0);
 
+
         # Credit/Debit separation (useful for some)
         for my $l (@{$recon->{report_lines}}){
             if ($l->{their_balance} < 0){
@@ -398,12 +399,24 @@
             $l->{our_debits} = $recon->format_amount({amount => $l->{our_debits}, money => 1});
             $l->{our_credits} = $recon->format_amount({amount => $l->{our_credits}, money => 1});
         }
+
+	$recon->{zero_string} = $recon->format_amount({amount => 0, money => 1});
+
 	$recon->{statement_gl_calc} = $recon->{their_total} 
 		+ $recon->{outstanding_total};
 	$recon->{out_of_balance} = $recon->{their_total} - $recon->{our_total};
         $recon->{cleared_total} = $recon->format_amount({amount => $recon->{cleared_total}, money => 1});
         $recon->{outstanding_total} = $recon->format_amount({amount => $recon->{outstanding_total}, money => 1});
-        $recon->{statement_gl_calc} = $recon->format_amount({amount => $recon->{statement_gl_calc}, money => 1});
+        $recon->{mismatch_our_debits} = $recon->format_amount(
+		{amount => $recon->{mismatch_our_debits}, money => 1});
+        $recon->{mismatch_our_credits} = $recon->format_amount(
+		{amount => $recon->{mismatch_our_credits}, money => 1});
+        $recon->{mismatch_their_debits} = $recon->format_amount(
+		{amount => $recon->{mismatch_their_debits}, money => 1});
+        $recon->{mismatch_their_credits} = $recon->format_amount(
+		{amount => $recon->{mismatch_their_credits}, money => 1});
+        $recon->{statement_gl_calc} = $recon->format_amount(
+		{amount => $recon->{statement_gl_calc}, money => 1});
         $recon->{total_cleared_debits} = $recon->format_amount(
               {amount => $recon->{total_cleared_debits}, money => 1}
         );

Modified: trunk/sql/modules/Reconciliaton.sql
===================================================================
--- trunk/sql/modules/Reconciliaton.sql	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/sql/modules/Reconciliaton.sql	2009-03-20 22:31:41 UTC (rev 2520)
@@ -223,7 +223,7 @@
 	ELSE -- scn IS NULL, check on amount instead
 		SELECT count(*) INTO in_count FROM cr_report_line
 		WHERE report_id = in_report_id AND amount = in_amount
-			AND their_balance = 0;
+			AND their_balance = 0 and posted_date = in_date;
 
 		IF in_count = 0 THEN -- no match
 			INSERT INTO cr_report_line
@@ -238,7 +238,7 @@
 		ELSE -- more than one match
 			SELECT min(id) INTO lid FROM cr_report_line
 			WHERE report_id = in_report_id AND amount = in_amount
-                        	AND their_balance = 0;
+                        	AND their_balance = 0 and posted_date = in_date;
 
 			UPDATE cr_report_line SET their_balance = in_amount,
 					clear_time = in_date

Modified: trunk/t/data/62-request-data
===================================================================
--- trunk/t/data/62-request-data	2009-03-20 00:37:26 UTC (rev 2519)
+++ trunk/t/data/62-request-data	2009-03-20 22:31:41 UTC (rev 2520)
@@ -171,6 +171,14 @@
 		'action'    => 'search',
 	},	
 	{
+		'_test_id'  => 'Menu round trip',
+		'_codebase' => 'new',
+		'module'    => 'menu.pl',
+		'menu'      => '1',
+		'id'        => '4',
+                'open'      => ':1:4:11',
+	},	
+	{
 		'_test_id'      => 'Payment print total',
 		'_codebase'     => 'new',
 		'action'        => 'print',


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