[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2452] trunk
- Subject: SF.net SVN: ledger-smb:[2452] trunk
- From: ..hidden..
- Date: Wed, 18 Feb 2009 19:54:06 +0000
Revision: 2452
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2452&view=rev
Author: einhverfr
Date: 2009-02-18 19:54:05 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Reconciliation workflow changes
Modified Paths:
--------------
trunk/LedgerSMB/DBObject/Reconciliation.pm
trunk/UI/reconciliation/report.html
trunk/UI/reconciliation/upload.html
trunk/scripts/recon.pl
Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm 2009-02-13 23:01:48 UTC (rev 2451)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm 2009-02-18 19:54:05 UTC (rev 2452)
@@ -174,6 +174,16 @@
# Now that we have this, we need to create the internal report representation.
# Ideally, we OUGHT to not return anything here, save the report number.
+ $self->add_entries($entries);
+
+ $self->{dbh}->commit;
+
+ return ($report_id, $entries); # returns the report ID.
+}
+
+sub add_entries {
+ my $self = shift;
+ my ($entries) = @_;
for my $entry ( @{$entries} ) {
# Codes:
@@ -198,10 +208,6 @@
);
$entry{report_id} = $report_id;
}
-
- $self->{dbh}->commit;
-
- return ($report_id, $entries); # returns the report ID.
}
sub correct_entry {
Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html 2009-02-13 23:01:48 UTC (rev 2451)
+++ trunk/UI/reconciliation/report.html 2009-02-18 19:54:05 UTC (rev 2452)
@@ -16,6 +16,10 @@
</div>
<div><?lsmb text('Beginning Balance:') ?><?lsmb beginning_balance ?></div>
<div><?lsmb text('Ledger Balance:') ?><?lsmb our_total ?></div>
+<div><?lsmb text('Difference:') ?><?lsmb out_of_balance ?></div>
+ <div id="csv-file">
+ <label for="file_upload"><?lsmb text('CSV File:') ?></label>
+ <input type="file" name="csv_file" id="file_upload" /></div>
<center>Report generated by <?lsmb user ?></center>
Modified: trunk/UI/reconciliation/upload.html
===================================================================
--- trunk/UI/reconciliation/upload.html 2009-02-13 23:01:48 UTC (rev 2451)
+++ trunk/UI/reconciliation/upload.html 2009-02-18 19:54:05 UTC (rev 2452)
@@ -1,7 +1,7 @@
<?lsmb PROCESS 'ui-header.html' ?>
<?lsmb PROCESS 'elements.html' ?>
-<div class="body">
+<div class="body" id ="recon1">
<div class="title">
New Reconciliation Report
</div>
@@ -11,10 +11,10 @@
</div>
<?lsmb END?>
<form name="csv_upload" method="POST" action="recon.pl">
-
- <div id="csv-file">
- <label for="file_upload">CSV File:</label>
- <input type="file" name="csv_file" id="file_upload" /></div>
+ <!-- TODO: Move this to CSS show/hide" -->
+ <!-- div id="csv-file">
+ <label for="file_upload"><?lsmb text('CSV File:') ?></label>
+ <input type="file" name="csv_file" id="file_upload" /></div -->
<div id="acc-date-row">
<?lsmb INCLUDE select element_data = {
name = "chart_id",
Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl 2009-02-13 23:01:48 UTC (rev 2451)
+++ trunk/scripts/recon.pl 2009-02-18 19:54:05 UTC (rev 2452)
@@ -74,6 +74,8 @@
sub update_recon_set {
my ($request) = shift;
my $recon = LedgerSMB::DBObject::Reconciliation->new(base => $request);
+ $recon->add_entries($recon->import_file());
+ $recon->{dbh}->commit;
$recon->update();
_display_report($recon);
}
@@ -279,8 +281,11 @@
$l->{their_balance} = $recon->format_amount({amount => $l->{their_balance}, money => 1});
$l->{our_balance} = $recon->format_amount({amount => $l->{our_balance}, 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->{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.