Hi;

I am not sure what is causing this.

Could you send me specific information regarding what you are typing in and
which screen you are on (also whether it is a summary or detail report)?

Also the attached patch may resolve the issue but I would like to be able
to try to reproduce.

Best Wishes.,
Chris Travers


On Fri, Jan 24, 2014 at 4:50 AM, Klavs Klavsen <k...@vsen.dk> wrote:

> When trying to search on transactions (I only have one - just created) -
> I'm used to just having to fill out a "from date" field - or even
> nothing - and then SL will search with default settings.
>
> with ledgersmb 1.3.36 - I get an error:
> SELECT a.id, a.invnumber, a.ordnumber, a.transdate, a.crdate,
> a.duedate, a.netamount, a.amount,
> (a.amount - pd.due) AS paid,
> a.invoice, a.datepaid, a.terms, a.notes,
> a.shipvia, a.shippingpoint, ee.name AS employee,
> vce.name, vc.meta_number,
> vc.entity_id, a.till, me.name AS manager, a.curr,
> ex.sell AS exchangerate,
> d.description AS department,
> a.ponumber, as_array(p.projectnumber) as ac_projects,
> as_array(ip.projectnumber) as inv_projects
>
> FROM ap a
> JOIN entity_credit_account vc ON (a.entity_credit_account = vc.id)
> JOIN acc_trans ac ON (a.id = ac.trans_id)
> JOIN chart c ON (c.id = ac.chart_id)
> LEFT JOIN (SELECT acc_trans.trans_id,
> sum(CASE WHEN 'ap' = 'ap' THEN amount
> WHEN 'ap' = 'ar'
> THEN amount * -1
> END) AS due
> FROM acc_trans
> JOIN account coa ON (coa.id = acc_trans.chart_id)
> JOIN account_link al ON (al.account_id = coa.id)
> WHERE ((al.description = 'AP' AND 'ap' = 'ap')
> OR (al.description = 'AR' AND 'ap' = 'ar'))
> AND (approved IS TRUE)
> GROUP BY acc_trans.trans_id) pd ON (a.id = pd.trans_id)
> LEFT JOIN entity_employee e ON (a.person_id = e.entity_id)
> LEFT JOIN entity_employee m ON (e.manager_id = m.entity_id)
> LEFT JOIN entity ee ON (e.entity_id = ee.id)
> LEFT JOIN entity me ON (m.entity_id = me.id)
> JOIN entity vce ON (vc.entity_id = vce.id)
> LEFT JOIN exchangerate ex ON (ex.curr = a.curr
> AND ex.transdate = a.transdate)
> LEFT JOIN department d ON (a.department_id = d.id)
> LEFT JOIN invoice i ON (i.trans_id = a.id)
> LEFT JOIN project ip ON (i.project_id = ip.id)
> LEFT JOIN project p ON ac.project_id = p.id WHERE (FALSE OR a.approved)
> AND 1 = 1 AND a.transdate >= '01-01-2010' AND pd.due <> 0
> AND a.id IN (SELECT ac.trans_id
> FROM acc_trans ac
> JOIN chart c ON (c.id = ac.chart_id AND charttype = 'A')
> WHERE a.id = ac.trans_id
> AND c.accno = '2100')
>
> GROUP BY a.id, a.invnumber, a.ordnumber, a.transdate,
> a.duedate, a.netamount, a.amount,
> a.invoice, a.datepaid, a.terms, a.notes,
> a.shipvia, a.shippingpoint, ee.name ,
> vce.name, vc.meta_number, a.amount, pd.due,
> vc.entity_id, a.till, me.name, a.curr,
> ex.sell, a.ponumber,
> d.description
> ORDER BY 4 ASC,2,16
> ERROR: column "a.crdate" must appear in the GROUP BY clause or be used
> in an aggregate function
> LINE 2: ...ELECT a.id, a.invnumber, a.ordnumber, a.transdate, a.crdate,
> --
> Regards,
> Klavs Klavsen, GSEC - k...@vsen.dk - http://www.vsen.dk - Tlf. 61281200
>
> "Those who do not understand Unix are condemned to reinvent it, poorly."
>   --Henry Spencer
>
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Ledger-smb-users mailing list
> Ledger-smb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
>



-- 
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor
lock-in.
http://www.efficito.com/learn_more.shtml
Index: LedgerSMB/AA.pm
===================================================================
--- LedgerSMB/AA.pm	(revision 6613)
+++ LedgerSMB/AA.pm	(working copy)
@@ -909,7 +909,7 @@
         # detail report query can be inlined in the summary report query. -CT
         my $p = $LedgerSMB::Sysconfig::decimal_places;
 
-        my $cols = qq|a.id, a.invnumber, a.ordnumber, a.transdate, a.crdate,
+        my $cols = qq|a.id, a.invnumber, a.ordnumber, a.transdate, 
 		          a.duedate, a.netamount, a.amount::numeric(20,$p), 
 		          a.amount::numeric(20,$p) - (sum(acs.amount::numeric(20,$p)) * CASE WHEN '$table' = 'ar' THEN -1 ELSE 1 END) AS paid,
 		          a.invoice, a.datepaid, a.terms, a.notes,
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-users mailing list
Ledger-smb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users

Reply via email to