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

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



Revision: 6701
          http://sourceforge.net/p/ledger-smb/code/6701
Author:   einhverfr
Date:     2014-01-29 06:17:02 +0000 (Wed, 29 Jan 2014)
Log Message:
-----------
Fixing bug 986, ar/ap transaction reports
also fixed vendor history coming out negative

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Contact/History.pm
    trunk/sql/modules/Company.sql

Modified: trunk/LedgerSMB/Report/Contact/History.pm
===================================================================
--- trunk/LedgerSMB/Report/Contact/History.pm	2014-01-29 06:03:52 UTC (rev 6700)
+++ trunk/LedgerSMB/Report/Contact/History.pm	2014-01-29 06:17:02 UTC (rev 6701)
@@ -56,7 +56,7 @@
             type => 'text',
             name => LedgerSMB::Report::text('Account Number') }];
 
-    if ($self->is_summary){
+    if (!$self->is_summary){
      
       push @$cols,
          {col_id => 'invnumber',
@@ -85,13 +85,15 @@
 
          {col_id => 'unit',
             type => 'text',
-            name => LedgerSMB::Report::text('Unit') },
-
+            name => LedgerSMB::Report::text('Unit') };
+      
+   push @$cols, 
          {col_id => 'sellprice',
             type => 'text',
            money => 1,
-            name => LedgerSMB::Report::text('Sell Price') },
+            name => LedgerSMB::Report::text('Sell Price') };
 
+   push @$cols, 
          {col_id => 'discount',
             type => 'text',
             name => LedgerSMB::Report::text('Disc') },
@@ -102,7 +104,8 @@
 
          {col_id => 'serialnumber',
             type => 'text',
-            name => LedgerSMB::Report::text('Serial Number') };
+            name => LedgerSMB::Report::text('Serial Number') }
+          unless $self->is_summary;
     
     push @$cols, 
          {col_id => 'exchangerate',

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2014-01-29 06:03:52 UTC (rev 6700)
+++ trunk/sql/modules/Company.sql	2014-01-29 06:17:02 UTC (rev 6701)
@@ -71,8 +71,6 @@
    sellprice numeric,
    discount numeric,
    delivery_date date,
-   project_id int,
-   projectnumber text,
    serialnumber text,
    exchangerate numeric,
    salesperson_id int,
@@ -98,8 +96,10 @@
      SELECT eca.id, e.name, eca.meta_number, 
             a.id as invoice_id, a.invnumber, a.curr::text, 
             p.id AS parts_id, p.partnumber, 
-            i.description, i.qty, i.unit::text, i.sellprice, i.discount, 
-            i.deliverydate, null::int as project_id, null::text as projectnumber,
+            i.description, 
+            i.qty * case when eca.entity_class = 1 THEN -1 ELSE 1 END, 
+            i.unit::text, i.sellprice, i.discount, 
+            i.deliverydate,
             i.serialnumber, 
             case when $16 = 1 then ex.buy else ex.sell end as exchange_rate,
             ee.id as salesperson_id, 
@@ -215,11 +215,12 @@
 $$
 SELECT id, name, meta_number, null::int, null::text, curr, parts_id, partnumber,
        description, sum(qty), unit, null::numeric, null::numeric, null::date, 
-       null::int, null::text, null::text, null::numeric,
+       null::text, null::numeric,
        null::int, null::text
 FROM   eca__history($1, $2, $3, $4, $5, $6, $7, $8, $9,
                    $10, $11, $12, $13, $14, $15, $16, $17, $18)
- group by id, name, meta_number, curr, parts_id, partnumber, description, unit
+ group by id, name, meta_number, curr, parts_id, partnumber, description, unit,
+          sellprice
  order by meta_number;
 $$ LANGUAGE SQL;
 

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


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits