1
select account_id,amn.date,amn.journal_id,amn.id,'neutral',amn.period_id,credit,'valid'
2
select aj.name,sum(credit)
3
from account_move_line aml,
6
account_move amn, -- neutral move
8
where aj.id = am.journal_id
9
and aj.name != 'Deloitte'
10
and aml.move_id = am.id
11
and am.period_id = amn.period_id
12
and ajn.name = 'Deloitte neutral'
13
and ajn.id = amn.journal_id
14
and aml.state='valid' and account_id=18 and am.period_id=42
17
select account_id,amn.date,amn.journal_id,amn.id,'neutral',amn.period_id,credit,am.state,aj.name,am.to_check,am.type,aml.move_id
18
--select aj.name,sum(credit)
19
from account_move_line aml,
22
account_move amn, -- neutral move
24
where aj.id = am.journal_id
25
and aj.name != 'Deloitte'
26
and aml.move_id = am.id
27
and am.period_id = amn.period_id
28
and ajn.name = 'Deloitte neutral'
29
and ajn.id = amn.journal_id
30
-- and am.state='posted'
32
and account_id=18 and am.period_id=42
38
where to_check is null
41
select am.id,am.period_id,am.ref,aml.name , am.date,aml.period_id,aml.date, aml.date- am.date
44
where am.id = aml.move_id
45
and am.period_id != aml.period_id
48
update account_move_line aml
49
set date = (select date from account_move am
50
where aml.move_id = am.id
51
and aml.date != am.date)
52
where id in (select aml.id from account_move am,
54
where am.id = aml.move_id
55
and am.period_id != aml.period_id
56
and aml.date != am.date);
58
update account_move amd
59
set period_id = (select id from account_period where amd.date between date_start and date_stop)
60
where period_id != (select id from account_period where amd.date between date_start and date_stop);
62
update account_move_line amd
63
set period_id = (select id from account_period where amd.date between date_start and date_stop)
64
where period_id != (select id from account_period where amd.date between date_start and date_stop)