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

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



Revision: 5232
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5232&view=rev
Author:   einhverfr
Date:     2012-11-22 01:56:10 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
Profit/Loss reports for customers and vendors now working

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/pnl.pm
    trunk/UI/Contact/divs/credit.html
    trunk/UI/Reports/filters/income_statement.html

Modified: trunk/LedgerSMB/Scripts/pnl.pm
===================================================================
--- trunk/LedgerSMB/Scripts/pnl.pm	2012-11-21 15:26:42 UTC (rev 5231)
+++ trunk/LedgerSMB/Scripts/pnl.pm	2012-11-22 01:56:10 UTC (rev 5232)
@@ -26,11 +26,25 @@
 package LedgerSMB::Scripts::pnl;
 
 use LedgerSMB::Report::PNL::Income_Statement;
+use LedgerSMB::Report::PNL::Product;
+use LedgerSMB::Report::PNL::ECA;
+use LedgerSMB::Report::PNL::Invoice;
+use LedgerSMB::Report;
+use LedgerSMB::App_State;
 
 
 sub generate_income_statement {
     my ($request) = @_;
-    my $rpt =LedgerSMB::Report::PNL::Income_Statement->new(%$request);
+    my $rpt;
+    if ($request->{pnl_type} eq 'invoice'){
+        $rpt = LedgerSMB::Report::PNL::Invoice->new(%$request);
+    } elsif ($request->{pnl_type} eq 'eca'){
+        $rpt = LedgerSMB::Report::PNL::ECA->new(%$request);
+    } elsif ($request->{pnl_type} eq 'product'){
+        $rpt = LedgerSMB::Report::PNL::Product->new(%$request);
+    } else {
+        my $rpt =LedgerSMB::Report::PNL::Income_Statement->new(%$request);
+    }
     $rpt->render($request);
 }
 

Modified: trunk/UI/Contact/divs/credit.html
===================================================================
--- trunk/UI/Contact/divs/credit.html	2012-11-21 15:26:42 UTC (rev 5231)
+++ trunk/UI/Contact/divs/credit.html	2012-11-22 01:56:10 UTC (rev 5232)
@@ -212,7 +212,7 @@
 
 	<tr id="taxform-threshold-row">
 	 <td> <?lsmb IF taxform_list.size > 0 ?>
-              <?lsmb taxform_list.unshift({})
+              <?lsmb taxform_list.unshift({});
                      INCLUDE select element_data = {
 			name = "taxform_id"
 			options = taxform_list
@@ -326,4 +326,31 @@
 	
     </form>
 </div>
+<?lsmb IF credit_act.id ?>
+<div class="listtop"><?lsmb text('Profit and Loss') ?></div>
+<form action="pnl.pl" method="GET"?>
+<div class="inputrow">
+<?lsmb
+PROCESS 'report_base.html'; 
+PROCESS input element_data = {
+     type = "hidden"
+     name = "id"
+    value = credit_act.id
+};
+PROCESS input element_data = {
+     type = "hidden"
+     name = "pnl_type"
+    value = "eca"
+}; 
+PROCESS date_row_div; 
+PROCESS button element_data = {
+     text = text('Continue')
+     type = 'submit'
+    class = 'submit'
+     name = 'action'
+    value = 'generate_income_statement'
+};
+?>
 </div>
+</form>
+<?lsmb END # IF credit_act.id ?>

Modified: trunk/UI/Reports/filters/income_statement.html
===================================================================
--- trunk/UI/Reports/filters/income_statement.html	2012-11-21 15:26:42 UTC (rev 5231)
+++ trunk/UI/Reports/filters/income_statement.html	2012-11-22 01:56:10 UTC (rev 5232)
@@ -15,47 +15,8 @@
     <td>
       <table>
        <?lsmb PROCESS business_classes;
-       PROCESS date_row; # TODO add comparisons
-      IF pnl_type == 'eca' ?>
-       <tr>
-       <th><?lsmb text('Name') ?></th>
-       <td colspan=3><?lsmb PROCESS input element_data = {
-                 name = 'name'
-                value = name
-                 type = 'text'
-                class = 'name'
-       } ?></td>
+       PROCESS date_row; # TODO add comparisons ?>
        </tr>
-       <tr>
-       <th><?lsmb text('Account Number') ?></th>
-       <td colspan=3><?lsmb PROCESS input element_data = {
-                 name = 'meta_number'
-                value = meta_number
-                 type = 'text'
-                class = 'control_code'
-       } ?></td>
-      </tr>
-      <?lsmb END;
-      IF pnl_type == 'product'; ?>
-       <tr>
-       <th><?lsmb text('Part Number') ?></th>
-       <td colspan=3><?lsmb PROCESS input element_data = {
-                 name = 'partnumber'
-                value = partnumber
-                 type = 'text'
-                class = 'name'
-       } ?></td>
-       </tr>
-       <tr>
-       <th><?lsmb text('Account Number') ?></th>
-       <td colspan=3><?lsmb PROCESS input element_data = {
-                 name = 'meta_number'
-                value = meta_number
-                 type = 'text'
-                class = 'control_code'
-       } ?></td>
-       </tr>
-      <?lsmb END; ?>
     </table>
   </td>
 </tr>

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