From ca26e9c119443c16e222d8bd0ff7621dba3b6c7d Mon Sep 17 00:00:00 2001 From: kk Date: Fri, 10 Nov 2017 15:20:33 +0530 Subject: [PATCH 1/3] added migration for reversecharge --- gkcore/views/api_organisation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gkcore/views/api_organisation.py b/gkcore/views/api_organisation.py index 649ae4f..1dcb32c 100644 --- a/gkcore/views/api_organisation.py +++ b/gkcore/views/api_organisation.py @@ -80,6 +80,7 @@ class api_organisation(object): self.con.execute(select(gkdb.organisation.c.billflag)) self.con.execute(select([func.count(gkdb.billwise.c.billid)])) except: + self.con.execute("update invoice set reversecharge = '1' where reversecharge is not null or reversecharge != ''") self.con.execute("alter table invoice add orgstategstin text") self.con.execute("alter table invoice add cess jsonb") self.con.execute("alter table product add UNIQUE(productdesc,orgcode)") -- GitLab From eec38d50b2a2bd538b8d1ae3b2b1697f10f540d8 Mon Sep 17 00:00:00 2001 From: kk Date: Fri, 10 Nov 2017 18:11:31 +0530 Subject: [PATCH 2/3] finally setting all previous reversecharge to '0' --- gkcore/views/api_organisation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gkcore/views/api_organisation.py b/gkcore/views/api_organisation.py index 1dcb32c..97cc06e 100644 --- a/gkcore/views/api_organisation.py +++ b/gkcore/views/api_organisation.py @@ -80,7 +80,7 @@ class api_organisation(object): self.con.execute(select(gkdb.organisation.c.billflag)) self.con.execute(select([func.count(gkdb.billwise.c.billid)])) except: - self.con.execute("update invoice set reversecharge = '1' where reversecharge is not null or reversecharge != ''") + self.con.execute("update invoice set reversecharge = '0' ) self.con.execute("alter table invoice add orgstategstin text") self.con.execute("alter table invoice add cess jsonb") self.con.execute("alter table product add UNIQUE(productdesc,orgcode)") -- GitLab From 8b0e873a3fbff0c6ad3b5565979e5ca4ca7cce78 Mon Sep 17 00:00:00 2001 From: kk Date: Fri, 10 Nov 2017 18:17:31 +0530 Subject: [PATCH 3/3] completed quite --- gkcore/views/api_organisation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gkcore/views/api_organisation.py b/gkcore/views/api_organisation.py index 97cc06e..890f472 100644 --- a/gkcore/views/api_organisation.py +++ b/gkcore/views/api_organisation.py @@ -80,7 +80,7 @@ class api_organisation(object): self.con.execute(select(gkdb.organisation.c.billflag)) self.con.execute(select([func.count(gkdb.billwise.c.billid)])) except: - self.con.execute("update invoice set reversecharge = '0' ) + self.con.execute("update invoice set reversecharge = '0'" ) self.con.execute("alter table invoice add orgstategstin text") self.con.execute("alter table invoice add cess jsonb") self.con.execute("alter table product add UNIQUE(productdesc,orgcode)") -- GitLab