[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4656] trunk/sql/modules/COGS.sql
- Subject: SF.net SVN: ledger-smb:[4656] trunk/sql/modules/COGS.sql
- From: ..hidden..
- Date: Wed, 18 Apr 2012 09:01:58 +0000
Revision: 4656
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4656&view=rev
Author: einhverfr
Date: 2012-04-18 09:01:57 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
Changing COGS to avoid issues with business units:
Modified Paths:
--------------
trunk/sql/modules/COGS.sql
Modified: trunk/sql/modules/COGS.sql
===================================================================
--- trunk/sql/modules/COGS.sql 2012-04-17 08:34:11 UTC (rev 4655)
+++ trunk/sql/modules/COGS.sql 2012-04-18 09:01:57 UTC (rev 4656)
@@ -170,12 +170,11 @@
WHERE id = t_inv.id;
INSERT INTO acc_trans
- (chart_id, transdate, amount, invoice, approved, project_id)
+ (chart_id, transdate, amount, invoice, approved)
SELECT expense_accno_id,
CASE WHEN t_inv.transdate > t_cp.end_date THEN t_inv.transdate
ELSE t_cp.end_date + '1 day'::interval
- END, -1 * (in_qty - t_alloc) * in_lastcost, t_inv.id, true,
- t_inv.project_id
+ END, -1 * (in_qty - t_alloc) * in_lastcost, t_inv.id, true
FROM parts
WHERE parts_id = t_inv.parts_id AND inventory_accno_id IS NOT NULL
AND expense_accno_id IS NOT NULL
@@ -183,8 +182,7 @@
SELECT income_accno_id,
CASE WHEN t_inv.transdate > t_cp.end_date THEN t_inv.transdate
ELSE t_cp.end_date + '1 day'::interval
- END, (in_qty - t_alloc) * in_lastcost, t_inv.id, true,
- t_inv.project_id
+ END, (in_qty - t_alloc) * in_lastcost, t_inv.id, true
FROM parts
WHERE parts_id = t_inv.parts_id AND inventory_accno_id IS NOT NULL
AND expense_accno_id IS NOT NULL;
@@ -198,12 +196,12 @@
INSERT INTO acc_trans
- (chart_id, transdate, amount, invoice, approved, project_id)
+ (chart_id, transdate, amount, invoice, approved)
SELECT expense_accno_id,
CASE WHEN t_inv.transdate > t_cp.end_date THEN t_inv.transdate
ELSE t_cp.end_date + '1 day'::interval
END, -1 * (t_inv.qty + t_inv.allocated) * in_lastcost,
- t_inv.id, true, t_inv.project_id
+ t_inv.id, true
FROM parts
WHERE parts_id = t_inv.parts_id AND inventory_accno_id IS NOT NULL
AND expense_accno_id IS NOT NULL
@@ -211,8 +209,7 @@
SELECT income_accno_id,
CASE WHEN t_inv.transdate > t_cp.end_date THEN t_inv.transdate
ELSE t_cp.end_date + '1 day'::interval
- END, (t_inv.qty + t_inv.allocated) * in_lastcost, t_inv.id, true,
- t_inv.project_id
+ END, (t_inv.qty + t_inv.allocated) * in_lastcost, t_inv.id, true
FROM parts
WHERE parts_id = t_inv.parts_id AND inventory_accno_id IS NOT NULL
AND expense_accno_id IS NOT NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.