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

SF.net SVN: ledger-smb:[6017] trunk/LedgerSMB



Revision: 6017
          http://sourceforge.net/p/ledger-smb/code/6017
Author:   einhverfr
Date:     2013-09-13 15:38:10 +0000 (Fri, 13 Sep 2013)
Log Message:
-----------
Some taxform report issues fixed (trunk only)

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/TaxForm.pm
    trunk/LedgerSMB/Report/Taxform/Detail.pm
    trunk/LedgerSMB/Report/Taxform/Summary.pm
    trunk/LedgerSMB/Scripts/taxform.pm

Modified: trunk/LedgerSMB/DBObject/TaxForm.pm
===================================================================
--- trunk/LedgerSMB/DBObject/TaxForm.pm	2013-09-13 15:21:20 UTC (rev 6016)
+++ trunk/LedgerSMB/DBObject/TaxForm.pm	2013-09-13 15:38:10 UTC (rev 6017)
@@ -82,8 +82,8 @@
 {
     my ($self, $id) = @_;
 
-    my @results = $self->exec_method(
-                funcname => 'tax_form__get', args => [$id]
+    my @results = $self->call_procedure(
+                procname => 'tax_form__get', args => [$id]
     );
     return $results[0];
 }

Modified: trunk/LedgerSMB/Report/Taxform/Detail.pm
===================================================================
--- trunk/LedgerSMB/Report/Taxform/Detail.pm	2013-09-13 15:21:20 UTC (rev 6016)
+++ trunk/LedgerSMB/Report/Taxform/Detail.pm	2013-09-13 15:38:10 UTC (rev 6017)
@@ -26,13 +26,13 @@
 
 =head1 CRITERIA PROPERTIES
 
-=head2 taxform_id
+=head2 tax_form_id
 
 This is the id of the taxform.
 
 =cut
 
-has taxform_id => (is => 'ro', isa => 'Int', required => '1');
+has tax_form_id => (is => 'ro', isa => 'Int', required => '1');
 
 =head2 meta_number
 
@@ -135,7 +135,7 @@
 
 sub run_report {
     my ($self) = @_;
-    my $tf = LedgerSMB::DBObject::TaxForm->get($self->taxform_id);
+    my $tf = LedgerSMB::DBObject::TaxForm->get($self->tax_form_id);
     $self->taxform($tf->{form_name});
     my $fname = 'tax_form_details_report';
     $fname .= '_accrual' if $tf->{is_accrual};
@@ -144,7 +144,7 @@
     for my $row(@rows){
        $row->{total} = $row->{acc_total} + $row->{invoice_total};
     }
-    $self->rows(@rows);
+    $self->rows(..hidden..);
 }
 
 =head1 COPYRIGHT

Modified: trunk/LedgerSMB/Report/Taxform/Summary.pm
===================================================================
--- trunk/LedgerSMB/Report/Taxform/Summary.pm	2013-09-13 15:21:20 UTC (rev 6016)
+++ trunk/LedgerSMB/Report/Taxform/Summary.pm	2013-09-13 15:38:10 UTC (rev 6017)
@@ -31,13 +31,13 @@
 
 In addition to the standard dates, there is only one property expected.
 
-=head2 taxform_id
+=head2 tax_form_id
 
 This is the id of the taxform.
 
 =cut
 
-has taxform_id => (is => 'ro', isa => 'Int', required => '1');
+has tax_form_id => (is => 'ro', isa => 'Int', required => '1');
 
 has taxform => (is => 'rw', isa => 'Str', required => 0);
 
@@ -133,7 +133,7 @@
 
 sub run_report {
     my ($self) = @_;
-    my $tf = LedgerSMB::DBObject::TaxForm->get($self->taxform_id);
+    my $tf = LedgerSMB::DBObject::TaxForm->get($self->tax_form_id);
     $self->taxform($tf->{form_name});
     my $fname = 'tax_form_summary_report';
     $fname .= '_accrual' if $tf->{is_accrual};
@@ -141,13 +141,13 @@
 
     my $href_suffix_base = 'from_date=' . $self->from_date 
                          . '&to_date=' . $self->to_date
-                         . '&taxform_id=' . $self->taxform_id;
+                         . '&tax_form_id=' . $self->tax_form_id;
     for my $row(@rows){
        $row->{total_href_suffix} = $href_suffix_base 
                                  . '&meta_number=' . $row->{meta_number};
        $row->{total} = $row->{acc_total} + $row->{invoice_total};
     }
-    $self->rows(@rows);
+    $self->rows(..hidden..);
 }
 
 =head1 COPYRIGHT

Modified: trunk/LedgerSMB/Scripts/taxform.pm
===================================================================
--- trunk/LedgerSMB/Scripts/taxform.pm	2013-09-13 15:21:20 UTC (rev 6016)
+++ trunk/LedgerSMB/Scripts/taxform.pm	2013-09-13 15:38:10 UTC (rev 6017)
@@ -60,7 +60,7 @@
 
 =cut
 
-sub add_taxform 
+sub _taxform_screen
 {
     my ($request) = @_;
     my $taxform = LedgerSMB::DBObject::TaxForm->new({base => $request});
@@ -76,6 +76,23 @@
     $template->render($taxform);
 }
 
+sub add_taxform {
+    _taxform_screen(@_);
+}
+
+=item edit 
+
+This retrieves and edits a tax form.  Requires that id be set.
+
+=cut
+
+sub edit {
+    my ($request) = @_;
+    my $tf = LedgerSMB::DBObject::TaxForm->get($request->{id});
+    $request->merge($tf);
+    _taxform_screen($request);
+}
+
 =item generate_report
 
 Generates the summary or detail report.   Query inputs (required unless
@@ -126,11 +143,13 @@
     my $report = LedgerSMB::Report::Taxform::Summary->new(%$request);
     $report->run_report($request);
     if ($request->{meta_number}){
-       my $rows = $report->rows;
-       for my (@$rows){
-           delete $_ unless $_->{meta_number} eq $request->{meta_number}
+       my @rows = $report->rows;
+       my $inc = 0;
+       for (@rows){
+           delete $rows[$inc] unless $_->{meta_number} eq $request->{meta_number};
+           ++$inc;
        }
-       $report->rows($rows);
+       $report->rows(..hidden..);
     }
 
     # Business settings for 1099

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


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits