projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f610d69
)
Fixed bug in journal related part of sql upgrade script.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Sun, 22 Mar 2015 06:54:03 +0000
(07:54 +0100)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Wed, 25 Mar 2015 11:49:48 +0000
(12:49 +0100)
sql/alter2.4.sql
patch
|
blob
|
history
diff --git
a/sql/alter2.4.sql
b/sql/alter2.4.sql
index cebe4e203f59925fd8897c64699794d2b65e72b1..e2bf6278ca48e068b41b182828db9c393f0bee2c 100644
(file)
--- a/
sql/alter2.4.sql
+++ b/
sql/alter2.4.sql
@@
-148,7
+148,7
@@
ALTER TABLE `0_supp_invoice_items` ADD COLUMN `dimension2_id` int(11) NOT NULL D
UPDATE `0_supp_invoice_items` si
LEFT JOIN `0_gl_trans` gl ON si.supp_trans_type=gl.`type` AND si.supp_trans_no=gl.type_no AND si.gl_code=gl.account
SET si.dimension_id=gl.dimension_id, si.dimension2_id=gl.dimension2_id
UPDATE `0_supp_invoice_items` si
LEFT JOIN `0_gl_trans` gl ON si.supp_trans_type=gl.`type` AND si.supp_trans_no=gl.type_no AND si.gl_code=gl.account
SET si.dimension_id=gl.dimension_id, si.dimension2_id=gl.dimension2_id
-WHERE si.grn_item_id=-1 AND (gl.dimension_id OR gl.dimension2_id)
+WHERE si.grn_item_id=-1 AND (gl.dimension_id OR gl.dimension2_id)
;
ALTER TABLE `0_quick_entries` ADD COLUMN `usage` varchar(120) NULL AFTER `description`;
ALTER TABLE `0_quick_entry_lines` ADD COLUMN `memo` tinytext NOT NULL AFTER `amount`;
ALTER TABLE `0_quick_entries` ADD COLUMN `usage` varchar(120) NULL AFTER `description`;
ALTER TABLE `0_quick_entry_lines` ADD COLUMN `memo` tinytext NOT NULL AFTER `amount`;
@@
-185,8
+185,8
@@
CREATE TABLE `0_journal` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
INSERT INTO `0_journal` (`type`, `trans_no`, `tran_date`, `reference`, `event_date`,`doc_date`,`currency`,`amount`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
INSERT INTO `0_journal` (`type`, `trans_no`, `tran_date`, `reference`, `event_date`,`doc_date`,`currency`,`amount`)
- SELECT `gl`.`type`, `gl`.`type_no`, `gl`.`tran_date`, `ref`.`reference`, `gl`.`
event
_date`,
- `gl`.`
doc
_date`, `sys_curr`.`value`, SUM(IF(`gl`.`amount`>0,`gl`.`amount`,0))
+ SELECT `gl`.`type`, `gl`.`type_no`, `gl`.`tran_date`, `ref`.`reference`, `gl`.`
tran
_date`,
+ `gl`.`
tran
_date`, `sys_curr`.`value`, SUM(IF(`gl`.`amount`>0,`gl`.`amount`,0))
FROM `0_gl_trans` gl LEFT JOIN `0_refs` ref ON gl.type = ref.type AND gl.type_no=ref.id
LEFT JOIN `0_sys_prefs` sys_curr ON `sys_curr`.`name`='curr_default'
WHERE `gl`.`type` IN(0, 35)
FROM `0_gl_trans` gl LEFT JOIN `0_refs` ref ON gl.type = ref.type AND gl.type_no=ref.id
LEFT JOIN `0_sys_prefs` sys_curr ON `sys_curr`.`name`='curr_default'
WHERE `gl`.`type` IN(0, 35)