credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #06008
[Branch ~credativ/openobject-addons/6.1] Rev 7059: [FIX] * skip refund invoices * search invoices on invoice_date and not create_date
------------------------------------------------------------
revno: 7059
committer: Kinner Vachhani <kin.vachhani@xxxxxxxxx>
branch nick: credativ-openobject
timestamp: Wed 2014-07-16 19:49:21 +0100
message:
[FIX] * skip refund invoices * search invoices on invoice_date and not create_date
modified:
report_intrastat/report_intrastat.py
--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1
Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'report_intrastat/report_intrastat.py'
--- report_intrastat/report_intrastat.py 2011-12-19 16:54:40 +0000
+++ report_intrastat/report_intrastat.py 2014-07-16 18:49:21 +0000
@@ -79,8 +79,8 @@
cr.execute("""
create or replace view report_intrastat as (
select
- to_char(inv.create_date, 'YYYY') as name,
- to_char(inv.create_date, 'MM') as month,
+ to_char(inv.date_invoice, 'YYYY') as name,
+ to_char(inv.date_invoice, 'MM') as month,
min(inv_line.id) as id,
intrastat.id as intrastat_id,
upper(inv_country.code) as code,
@@ -120,7 +120,8 @@
inv.state in ('open','paid')
and inv_line.product_id is not null
and inv_country.intrastat=true
- group by to_char(inv.create_date, 'YYYY'), to_char(inv.create_date, 'MM'),intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id
+ and inv.type in ('out_invoice','in_invoice')
+ group by to_char(inv.date_invoice, 'YYYY'), to_char(inv.date_invoice, 'MM'),intrastat.id,inv.type,pt.intrastat_id, inv_country.code,inv.number, inv.currency_id
)""")
report_intrastat()