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

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



Revision: 2490
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2490&view=rev
Author:   einhverfr
Date:     2009-03-12 21:15:44 +0000 (Thu, 12 Mar 2009)

Log Message:
-----------
Reconciliation changes:  Sorting is currently possible by amount.  Now we can display by debits and credits too.

Modified Paths:
--------------
    trunk/UI/reconciliation/report.html
    trunk/scripts/recon.pl

Removed Paths:
-------------
    trunk/UI/rp-search-balance_sheet.html
    trunk/UI/rp-search-income_statement.html
    trunk/UI/rp-search-inv_activity.html

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2009-03-12 17:36:37 UTC (rev 2489)
+++ trunk/UI/reconciliation/report.html	2009-03-12 21:15:44 UTC (rev 2490)
@@ -31,7 +31,7 @@
 <?lsmb i = 1 ?>
 <table border=0>
 	<tr class="listtop">
-		<th colspan=7><?lsmb text('Cleared Transactions') ?></th>
+		<th colspan=9><?lsmb text('Cleared Transactions') ?></th>
 	</tr>
 	<tr class="listheading">
 		<th><?lsmb text('Cleared') ?></th>
@@ -39,9 +39,10 @@
 		<th><?lsmb text('Clear date') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
-		<th><?lsmb text('Our Balance') ?></th>
-		<th><?lsmb text('Their Balance') ?></th>
-		<th></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 ?>
@@ -75,17 +76,21 @@
 			<td><?lsmb row.clear_time ?></td>
 			<td><?lsmb row.scn ?> </td>
 			<td><?lsmb row.post_date ?></td>
-			<td><?lsmb row.our_balance ?></td>
-			<td><?lsmb row.their_balance ?></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="subtital">
-		<th colspan=5><?lsmb text('Total') ?></th><td><?lsmb cleared_total ?></td>
+	<tr class="subtotal">
+		<th colspan=5><?lsmb text('Total') ?></th>
+		<td><?lsmb total_cleared_debits ?></td>
+		<td><?lsmb total_cleared_credits ?></td>
 	</tr>
 	<tr class="listheading">
-		<th colspan=7><?lsmb text('Outstanding Transactions') ?></th>
+		<th colspan=9><?lsmb text('Outstanding Transactions') ?></th>
 	</tr>
 	<tr class="listheading">
 		<th><?lsmb text('Cleared') ?></th>
@@ -93,9 +98,10 @@
 		<th><?lsmb text('Clear date') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
-		<th><?lsmb text('Our Balance') ?></th>
-		<th><?lsmb text('Their Balance') ?></th>
-		<th></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.cleared != 'checked' ?>
@@ -122,14 +128,18 @@
 			<td><?lsmb row.clear_time ?></td>
 			<td><?lsmb row.scn ?> </td>
 			<td><?lsmb row.post_date ?></td>
-			<td><?lsmb row.our_balance ?></td>
-			<td><?lsmb row.their_balance ?></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="subtital">
-		<th colspan=5><?lsmb text('Total') ?></th><td><?lsmb outstanding_total ?></td>
+	<tr class="subtotal">
+		<th colspan=5><?lsmb text('Total') ?></th>
+		<td><?lsmb total_uncleared_debits ?></td>
+		<td><?lsmb total_uncleared_credits ?></td>
 	</tr>
 </table>
 <?lsmb INCLUDE input element_data = {

Deleted: trunk/UI/rp-search-balance_sheet.html
===================================================================
--- trunk/UI/rp-search-balance_sheet.html	2009-03-12 17:36:37 UTC (rev 2489)
+++ trunk/UI/rp-search-balance_sheet.html	2009-03-12 21:15:44 UTC (rev 2490)
@@ -1,97 +0,0 @@
-      <tr>
-        <th align="right"><?lsmb text('as at') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'asofdate',
-        size => '11',
-        title => user.dateformat,
-        value => form.asofdate,
-        } ?></td>
-        <td colspan="2">
-<?lsmb IF form.selectaccountingyear.defined ?>
-  <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
-  <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
-<?lsmb END ?>
-        </td>
-      </tr>
-      <tr><th align="right"><?lsmb text('Compare to') ?></th><td colspan="3" /></tr>
-      <tr>
-        <th align="right"><?lsmb text('From') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'compareasofdate',
-        size => '11',
-        title => user.dateformat,
-        } ?></td>
-        <td>
-<?lsmb IF form.selectaccountingyear.defined;
-  compare_month = {
-    options => form.selectaccountingmonth.options,
-    name => 'compareasofmonth',
-    };
-  compare_year = {
-    options => form.selectaccountingyear.options,
-    name => 'compareasofyear',
-    };
- -?>
-  <?lsmb PROCESS select element_data=compare_month -?>
-  <?lsmb PROCESS select element_data=compare_year -?>
-<?lsmb END ?>
-        </td>
-      </tr>
-      <tr>
-        <th align="right"><?lsmb text('Decimal Places') ?></th>
-        <td colspan="3"><?lsmb PROCESS input element_data={
-  name => 'decimalplaces',
-  size => '3',
-  value => '2',
-  } ?>
-        </td>
-      </tr>
-    </table>
-  </td>
-</tr>
-<tr>
-  <td>
-    <table>
-      <tr>
-        <th align="right"><?lsmb text('Method') ?></th>
-        <td colspan="3">
-<?lsmb PROCESS input element_data={
-  name => 'method',
-  type => 'radio',
-  value => 'accrual',
-  label => text('Accrual'),
-  checked => 'checked',
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'method',
-  type => 'radio',
-  value => 'cash',
-  label => text('Cash'),
-  } -?>
-        </td>
-      </tr>
-      <tr>
-        <th align="right"><?lsmb text('Include in Report') ?></th>
-        <td colspan="3">
-<?lsmb PROCESS input element_data={
-  name => 'l_heading',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Heading'),
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'l_subtotal',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Subtotal'),
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'l_accno',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Account Number'),
-  } -?>
-        </td>
-      </tr>

Deleted: trunk/UI/rp-search-income_statement.html
===================================================================
--- trunk/UI/rp-search-income_statement.html	2009-03-12 17:36:37 UTC (rev 2489)
+++ trunk/UI/rp-search-income_statement.html	2009-03-12 21:15:44 UTC (rev 2490)
@@ -1,147 +0,0 @@
-      <tr>
-        <th align="right"><?lsmb text('Project') ?></th>
-        <td colspan="3"><?lsmb PROCESS select element_data=form.selectproject ?></td>
-      </tr>
-      <tr>
-        <th align="right"><?lsmb text('From') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'fromdate',
-        size => '11',
-        title => user.dateformat,
-        value => form.fromdate,
-        } ?></td>
-        <th align="right"><?lsmb text('To') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'todate',
-        size => '11',
-        title => user.dateformat,
-        value => form.todate,
-        } ?></td>
-      </tr>
-<?lsmb IF form.selectaccountingyear.defined ?>
-      <tr>
-        <th align="right"><?lsmb text('Period') ?></th>
-        <td colspan="3">
-  <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
-  <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '0',
-    label => text('Current'),
-    checked => 'checked',
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '1',
-    label => text('Month'),
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '3',
-    label => text('Quarter'),
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '12',
-    label => text('Year'),
-    } -?>
-        </td>
-      </tr>
-<?lsmb END ?>
-      <tr><th align="right"><?lsmb text('Compare to') ?></th><td colspan="3" /></tr>
-      <tr>
-        <th align="right"><?lsmb text('From') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'comparefromdate',
-        size => '11',
-        title => user.dateformat,
-        } ?></td>
-        <th align="right"><?lsmb text('To') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'comparetodate',
-        size => '11',
-        title => user.dateformat,
-        } ?></td>
-      </tr>
-<?lsmb IF form.selectaccountingyear.defined;
-  compare_month = {
-    options => form.selectaccountingmonth.options,
-    name => 'comparemonth',
-    };
-  compare_year = {
-    options => form.selectaccountingyear.options,
-    name => 'compareyear',
-    };
- -?>
-      <tr>
-        <th align="right"><?lsmb text('Period') ?></th>
-        <td colspan="3">
-  <?lsmb PROCESS select element_data=compare_month -?>
-  <?lsmb PROCESS select element_data=compare_year -?>
-        </td>
-      </tr>
-<?lsmb END ?>
-      <tr>
-        <th align="right"><?lsmb text('Decimal Places') ?></th>
-        <td colspan="3"><?lsmb PROCESS input element_data={
-  name => 'decimalplaces',
-  size => '3',
-  value => '2',
-  } ?>
-        </td>
-      </tr>
-    </table>
-  </td>
-</tr>
-<tr>
-  <td>
-    <table>
-      <tr>
-        <th align="right"><?lsmb text('Method') ?></th>
-        <td colspan="3">
-<?lsmb PROCESS input element_data={
-  name => 'method',
-  type => 'radio',
-  value => 'accrual',
-  label => text('Accrual'),
-  checked => 'checked',
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'method',
-  type => 'radio',
-  value => 'cash',
-  label => text('Cash'),
-  } -?>
-        </td>
-      </tr>
-      <tr>
-        <th align="right"><?lsmb text('Include in Report') ?></th>
-        <td colspan="3">
-<?lsmb PROCESS input element_data={
-  name => 'l_heading',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Heading'),
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'l_subtotal',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Subtotal'),
-  } -?>
-<?lsmb PROCESS input element_data={
-  name => 'l_accno',
-  type => 'checkbox',
-  value => 'Y',
-  label => text('Account Number'),
-  } -?>
-        </td>
-      </tr>

Deleted: trunk/UI/rp-search-inv_activity.html
===================================================================
--- trunk/UI/rp-search-inv_activity.html	2009-03-12 17:36:37 UTC (rev 2489)
+++ trunk/UI/rp-search-inv_activity.html	2009-03-12 21:15:44 UTC (rev 2490)
@@ -1,60 +0,0 @@
-      <tr>
-        <th align="right"><?lsmb text('From') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'fromdate',
-        size => '11',
-        title => user.dateformat,
-        value => form.fromdate,
-        } ?></td>
-        <th align="right"><?lsmb text('To') ?></th>
-        <td><?lsmb PROCESS input element_data={
-        class => 'date',
-        name => 'todate',
-        size => '11',
-        title => user.dateformat,
-        value => form.todate,
-        } ?></td>
-      </tr>
-<?lsmb IF form.selectaccountingyear.defined ?>
-      <tr>
-        <th align="right"><?lsmb text('Period') ?></th>
-        <td colspan="3">
-  <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
-  <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '0',
-    label => text('Current'),
-    checked => 'checked',
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '1',
-    label => text('Month'),
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '3',
-    label => text('Quarter'),
-    } -?>
-  <?lsmb PROCESS input element_data={
-    type => 'radio',
-    name => 'interval',
-    value => '12',
-    label => text('Year'),
-    } -?>
-        </td>
-      </tr>
-<?lsmb END ?>
-    </table>
-    <table>
-      <tr>
-        <th><?lsmb text('Part Number') ?></th>
-        <td><?lsmb PROCESS input element_data={name => 'partnumber'} ?></td>
-        <th><?lsmb text('Description') ?></th>
-        <td><?lsmb PROCESS input element_data={name => 'description'} ?></td>
-      </tr>

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2009-03-12 17:36:37 UTC (rev 2489)
+++ trunk/scripts/recon.pl	2009-03-12 21:15:44 UTC (rev 2490)
@@ -330,15 +330,63 @@
         if (!$recon->{line_order}){
            $recon->{line_order} = 'scn';
         }
+        $recon->{total_cleared_credits} = $recon->parse_amount(amount => 0);
+        $recon->{total_cleared_debits} = $recon->parse_amount(amount => 0);
+        $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){
+               $l->{their_debits} = $recon->parse_amount(amount => 0);
+               $l->{their_credits} = $l->{their_balance}->bneg;
+            }
+            else {
+               $l->{their_credits} = $recon->parse_amount(amount => 0);
+               $l->{their_debits} = $l->{their_balance};
+            }
+            if ($l->{our_balance} < 0){
+               $l->{our_debits} = $recon->parse_amount(amount => 0);
+               $l->{our_credits} = $l->{our_balance}->bneg;
+            }
+            else {
+               $l->{our_credits} = $recon->parse_amount(amount => 0);
+               $l->{our_debits} = $l->{our_balance};
+            }
+
+            if ($l->{our_balance} != 0 and 
+                $l->{our_balance} == $l->{their_balance} or
+                defined $recon->{"cleared_$l->{id}"}
+            ){
+                 $recon->{total_cleared_credits}->badd($l->{our_credits});
+                 $recon->{total_cleared_debits}->badd($l->{our_debits});
+            } else {
+                 $recon->{total_uncleared_credits}->badd($l->{our_credits});
+                 $recon->{total_uncleared_debits}->badd($l->{our_debits});
+            }
+
             $l->{their_balance} = $recon->format_amount({amount => $l->{their_balance}, money => 1});
             $l->{our_balance} = $recon->format_amount({amount => $l->{our_balance}, money => 1});
+            $l->{their_debits} = $recon->format_amount({amount => $l->{their_debits}, money => 1});
+            $l->{their_credits} = $recon->format_amount({amount => $l->{their_credits}, money => 1});
+            $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->{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->{out_of_balance} = $recon->format_amount(
-		{amount => $recon->{out_of_balance}, money => 1});
+        $recon->{total_cleared_debits} = $recon->format_amount(
+              {amount => $recon->{total_cleared_debits}, money => 1}
+        );
+        $recon->{total_cleared_credits} = $recon->format_amount(
+               {amount => $recon->{total_cleared_credits}, money => 1}
+        );
+        $recon->{total_uncleared_debits} = $recon->format_amount(
+              {amount => $recon->{total_uncleared_debits}, money => 1}
+        );
+        $recon->{total_uncleared_credits} = $recon->format_amount(
+               {amount => $recon->{total_uncleared_credits}, money => 1}
+        );
 	$recon->{their_total} = $recon->format_amount(
 		{amount => $recon->{their_total}, money => 1});
 	$recon->{our_total} = $recon->format_amount(


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