From 2d4ec5c0f704c22bc4383253496c1bc8790ccc1e Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 14 Mar 2013 18:54:17 +0530 Subject: [PATCH 01/43] [IMP] l10n_in: improve dat of tax codes bzr revid: tpa@tinyerp.com-20130314132417-g02a9j5cf6s112bh --- addons/l10n_in/l10n_in_tax_code_template.xml | 269 ++++++++++++++++++- 1 file changed, 265 insertions(+), 4 deletions(-) diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index 94217d79c3c..a5bcfd8524a 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -4,7 +4,7 @@ - Tax + Your Company @@ -27,16 +27,277 @@ - - Base of Taxed Sales + Taxable Sale Bases - Base of Taxed Purchases + Taxable Purchase Bases + + Cst 5% on Purchase + + CSTP5 + + + + Purchase CST 5% + + PCST5 + + + + Education Cess 2% + + + + + Education Cess 2% - Purchase + + + + + Input Credit - Import Duty + + + + + Input Credit On Capital Goods - Edu. Cess + + + + + Input Credit on Capital Goods - Modvate + + + + + Input Credit on Capital Goods - Seco. & HEC + + + + + Input Credit - Service Tax + + + + + Input Credit - Service Tax Edu. Cess. + + + + + Input Credit - Service Tax Seco. & HEC + + + + + Seco. & Higher Edu. Cess 1% - Purchase + + + + + Seco. & Higher Edu. Cess 1% - Sales + + + + + CST 2% on Sales + + + + + CST 5% on Sales + + + + + Input Additional Vat 1% + + + + + Input Additional Vat 2.5% + + + + + Input VAT 12.5% + + + + + Input Vat 15% + + + + + Input Vat 4% + + + + + Output Adi. Vat @1% + + + + + Output Vat @4% + + + + + Cst 2% on Purchase + + + + + Excise Duty 12% - Purchase + + + + + Excise Duty - 12% - Sales + + + + + Excise Duty 5% - Purchase + + + + + Excise Duty 6% on Purchase + + + + + Input Credit - URD + + + + + Tds on Audit Fees - 94J + + + + + TDS on Commission Or Brokerage- 94H + + + + + TDS on Contractor-94C + + + + + TDS On Director's Interest + + + + + TDS on Director's Remuneration - 92B + + + + + TDS on Interest + + + + + TDS on Professional Fees - 94J + + + + + TDS on Rent-94I + + + + + TDS on Salary - 92B + + + + + Import Purchase + + + + + Purchase Vat 4% / Vat12.5% / Vat15% / Cst2% / Cst5% + + + + + Plant & Machinery + + + + + Expense Accounts + + + + + Sales Vat 4% / Sales CST2% / Sales CST5% + + + + + Sales CST2% + + + + + Sales CST5% + + + + + Purchase Vat 4% + + + + + Purchase Vat12.5% / Vat15% + + + + + Purchase Vat12.5% + + + + + Purchase Vat15% + + + + + Sales Vat 4% + + + + + Purchase Cst2% + + + + + Purchase URD + + + + + Base Expenses for TDS + + + From 96aa7aa6ea79c4927e8a7f65624cf7480d7356c9 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 15 Mar 2013 16:28:46 +0530 Subject: [PATCH 02/43] [IMP] l10n_in:improved demo data of account tax bzr revid: tpa@tinyerp.com-20130315105846-sgdli94fp6d8i8dp --- .../l10n_in/l10n_in_public_tax_template.xml | 772 ++++++++++++------ addons/l10n_in/l10n_in_tax_code_template.xml | 7 +- 2 files changed, 513 insertions(+), 266 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 03dbfa7cc75..79472c3e4b9 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -1,295 +1,537 @@ - - - - - Sale Tax-15% - - - - 0.15 - percent - sale - - - - - - - - - Sale Tax-12% - - - - 0.12 - percent - sale - - - - - - - - - Sale Tax-4% - - - - 0.04 - percent - sale - - - - - - - - - - - Purchase Tax-15% - - - - 0.15 - percent + + + CST 5% - Purchase + CST 5% - Purchase purchase - - - - - - - - - - - - - VAT-5%(4% VAT+1% Add. Tax.) - - - - 0.05 percent - all - - 1 - - 1 - - 1 - - 1 - + 0.01 + + + + + - - VAT-15% (12.5% VAT + 2.5% Add. Tax.) - - - - 0.15 + + Input Credit - Service Tax Seco. & HEC + Input Credit - Service Tax Seco. & HEC + purchase percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - VAT-8% - - - - 0.08 - percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - VAT-10% - - - - 0.10 - percent - all - - 1 - - 1 - - 1 - - 1 - + 0.0100 + + + - - VAT-12.5% - - - - 12.5 + + Input Credit - URD + Input Credit - URD + purchase percent - all - - 1 - - 1 - - 1 - - 1 - + 0.0400 + + + - - - - Service Tax-12.30% - - + + Tds on Audit Fees - 94J + Tds on Audit Fees - 94J + purchase + percent + 0.1000 + + + + + + + + TDS on Commission Or Brokerage- 94H + TDS on Commission Or Brokerage- 94H + purchase + percent + 0.1000 + + + + + + + + Input Credit - Import Duty + Input Credit - Import Duty + purchase + percent + 0.0750 + 1 + + + + + + + + Additional Duty (Imports) 4% + Additional Duty (Imports) 4% + purchase + percent + 0.0400 + 1 + + + + + + + + Input Credit - Service Tax + Input Credit - Service Tax + purchase + percent + 0.1200 + 1 + + + + + + + + Input Credit - Service Tax Edu. Cess. + Input Credit - Service Tax Edu. Cess. + purchase + percent + 0.0200 + + + + + + + + TDS on Salary - 92B + TDS on Salary - 92B + purchase + percent + 0.3000 + + + + + + + + Excise Duty 6% on Purchase + Excise Duty 6% on Purchase + purchase + percent + 0.0600 + + + + + + + + Excise Duty 5% - Purchase + + purchase + percent + 0.0500 + + + + + + + + Excise Duty 12% - Purchase + Excise Duty 12% - Purchase + purchase + percent + 0.1200 + + + + + + + + Education Cess 2% - Purchase + Education Cess 2% - Purchase + all + percent + 0.0200 + 21 + + + + + + + + + Seco. & Higher Edu. Cess 1% - Purchase + Seco. & Higher Edu. Cess 1% - Purchase + all + percent + 0.0100 + 22 + + + + + + + + + Excise Duty - 12% - Sales + Excise Duty - 12% - Sales + sale + percent + 0.1200 + + + + + + + + + Education Cess 2% + Education Cess 2% + all + percent + 0.0200 + 2 + + + + + + + + + Seco. & Higher Edu. Cess 1% - Sales + Seco. & Higher Edu. Cess 1% - Sales + all + percent + 0.0100 + 3 + + + + + + + + + CST + CST + all + percent + 0.0000 + + + + + + ADV + ADV + all + percent + 0.0 + + + + + + Input Credit on Capital Goods - Seco. & HEC + Input Credit on Capital Goods - Seco. & HEC + purchase + percent + 0.01 + + + + + + + + TDS on Contractor-94C + TDS on Contractor-94C + purchase + percent + 0.0200 + + + + + + + + TDS On Director's Interest + TDS On Director's Interest + purchase + percent + 0.1 + + + + + + + + TDS on Director's Remuneration - 92B + TDS on Director's Remuneration - 92B + purchase + percent + 0.3 + + + + + + + + TDS on Interest + TDS on Interest + purchase + percent + 0.1 + + + + + + + + TDS on Professional Fees - 94J + TDS on Professional Fees - 94J + purchase + percent + 0.1 + 1 + + + + + + + + TDS on Rent-94I + TDS on Rent-94I + purchase + percent + 0.1 + + + + + + + + Input Credit On Capital Goods - Edu. Cess + Input Credit On Capital Goods - Edu. Cess + purchase + percent + 0.02 + + + + + + + + Input Credit on Capital Goods - Modvate + + purchase + percent 0.12 - percent - all - - 1 - - 1 - - 1 - - 1 - + + + - - Service Tax-%2 - - - - - 1 - - 1 - - 1 - - 1 - 0.02 - percent - all - - - - - - Service Tax-%1 - 0.01 - - - - - 1 - - 1 - - 1 - - 1 - percent - all - - - - - - - Excise Duty-10.30% - - - - 0.10 + + Input Vat 4% + Input Vat 4% + purchase percent - sale - - 1 - - 1 - - 1 - - 1 - + 0.04 + 4 + + + + - - - Excise Duty-2% - 0.02 + + + Input Additional Vat 1% + Input Additional Vat 1% + purchase percent - sale - - - - 1 - - 1 - - 1 - - 1 - - - - - - Excise Duty-1% 0.01 - percent - sale - - - - 1 - - 1 - - 1 - - 1 - + 5 + + + - + + + Input Vat 15% + Input Vat 15% + purchase + percent + 0.15 + 7 + + + + + + + + Output Vat @4% + Output Vat @4% + sale + percent + 0.04 + 11 + + + + + + + + Output Adi. Vat @1% + Output Adi. Vat @1% + sale + percent + 0.01 + 12 + + + + + + + + CST 2% on Sales + CST 2% on Sales + sale + percent + 0.02 + 13 + + + + + + + + + CST 5% on Sales + CST 5% on Sales + sale + percent + 0.05 + 14 + + + + + + + + Input VAT 12.5% + Input VAT 12.5% + purchase + percent + 0.1250 + 60 + + + + + + + + Input Additional Vat 2.5% + Input Additional Vat 2.5% + purchase + percent + 0.0250 + 80 + + + + + + + + Cst 2% on Purchase + Cst 2% on Purchase + purchase + percent + 0.02 + 9333 + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index a5bcfd8524a..ff2cd352bbf 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -199,7 +199,7 @@ - + TDS on Director's Remuneration - 92B @@ -299,5 +299,10 @@ + + Additional Duty (Imports) 4% + + + From 4a0e878584bff40db03c78cb8e9a4d13538261a1 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 18 Mar 2013 12:02:24 +0530 Subject: [PATCH 03/43] [IMP] addd data of related accounts bzr revid: tpa@tinyerp.com-20130318063224-0lefhgsq3l1ddd1q --- addons/l10n_in/l10n_in_public_chart.xml | 299 +++++++++++++++++- .../l10n_in/l10n_in_public_tax_template.xml | 154 +++++---- 2 files changed, 373 insertions(+), 80 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_chart.xml b/addons/l10n_in/l10n_in_public_chart.xml index 9612afddc39..49568826c4b 100644 --- a/addons/l10n_in/l10n_in_public_chart.xml +++ b/addons/l10n_in/l10n_in_public_chart.xml @@ -658,7 +658,304 @@ - + + + CST 5% on Purchase + 21000102 + other + + + + + + Input Credit - Service Tax Seco. & HEC + 121101010 + other + + + + + + Input Credit - URD + 121102012 + other + + + + + + Tds on Audit Fees - 94J + 121103001 + other + + + + + + TDS on Commission Or Brokerage- 94H + 121103002 + other + + + + + + Input Credit - Import Duty - CVD + 121101004 + other + + + + + + Input Credit Additional Duty on Imports 4% + 121101001 + other + + + + + + Input Credit - Service Tax + 121101008 + other + + + + + + Input Credit - Service Tax Edu. Cess. + 121101009 + other + + + + + + TDS on Salary - 92B + 121103009 + other + + + + + + Excise Duty 6% on Purchase + 121101015 + other + + + + + + Excise Duty 5% - Purchase + 1211010131 + other + + + + + + Excise Duty 12% - Purchase + 121101013 + other + + + + + + Education Cess 2% - Purchase + 121101003 + other + + + + + + Seco. & Higher Edu. Cess 1% - Purchase + 121101011 + other + + + + + + Excise Duty - 12% - Sales + 121101014 + other + + + + + + Education Cess 2% + 121101002 + other + + + + + + Seco. & Higher Edu. Cess 1% - Sales + 121101012 + other + + + + + + + Input Credit on Capital Goods - Seco. & HEC + 121101007 + other + + + + + + TDS on Contractor-94C + 121103003 + other + + + + + + TDS On Director's Interest + 121103004 + other + + + + + + TDS on Director's Remuneration - 92B + 121103005 + other + + + + + + TDS on Interest + 121103006 + other + + + + + + TDS on Professional Fees - 94J + 121103007 + other + + + + + + TDS on Rent-94I + 121103008 + other + + + + + + Input Credit On Capital Goods - Edu. Cess + 121101005 + other + + + + + + Input Credit on Capital Goods - Modvate + 121101006 + other + + + + + + Input Vat 4% + 121102007 + other + + + + + + Input Additional Vat 1% + 121102003 + other + + + + + + Input Vat 15% + 121102006 + other + + + + + + Output Vat @4% + 121102009 + other + + + + + + Output Adi. Vat @1% + 121102008 + other + + + + + + CST 2% on Sales + 121102001 + other + + + + + + CST 5% on Sales + 121102002 + other + + + + + + Input VAT 12.5% + 121102005 + other + + + + + + Input Additional Vat 2.5% + 121102004 + other + + + + + + Cst 2% on Purchase - New + 121102011 + other + + + + India - Chart of Accounts for Public Ltd diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 79472c3e4b9..db77a63bdca 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -8,8 +8,8 @@ purchase percent 0.01 - + + @@ -23,8 +23,8 @@ purchase percent 0.0100 - + + @@ -36,8 +36,8 @@ purchase percent 0.0400 - + + @@ -49,8 +49,8 @@ purchase percent 0.1000 - + + @@ -62,8 +62,8 @@ purchase percent 0.1000 - + + @@ -76,8 +76,8 @@ percent 0.0750 1 - + + @@ -90,8 +90,8 @@ percent 0.0400 1 - + + @@ -104,8 +104,8 @@ percent 0.1200 1 - + + @@ -117,8 +117,8 @@ purchase percent 0.0200 - + + @@ -130,8 +130,8 @@ purchase percent 0.3000 - + + @@ -143,8 +143,8 @@ purchase percent 0.0600 - + + @@ -156,8 +156,8 @@ purchase percent 0.0500 - + + @@ -170,8 +170,8 @@ percent 0.1200 - + + @@ -184,8 +184,8 @@ percent 0.0200 21 - + + @@ -199,8 +199,8 @@ percent 0.0100 22 - + + @@ -214,8 +214,8 @@ percent 0.1200 - + + @@ -228,8 +228,8 @@ percent 0.0200 2 - + + @@ -243,8 +243,8 @@ percent 0.0100 3 - + + @@ -257,8 +257,6 @@ all percent 0.0000 - @@ -268,8 +266,6 @@ all percent 0.0 - @@ -279,8 +275,8 @@ purchase percent 0.01 - + + @@ -292,8 +288,8 @@ purchase percent 0.0200 - + + @@ -305,8 +301,8 @@ purchase percent 0.1 - + + @@ -318,8 +314,8 @@ purchase percent 0.3 - + + @@ -331,8 +327,8 @@ purchase percent 0.1 - + + @@ -345,8 +341,8 @@ percent 0.1 1 - + + @@ -358,8 +354,8 @@ purchase percent 0.1 - + + @@ -371,8 +367,8 @@ purchase percent 0.02 - + + @@ -380,12 +376,12 @@ Input Credit on Capital Goods - Modvate - + Input Credit on Capital Goods - Modvate purchase percent 0.12 - + + @@ -398,8 +394,8 @@ percent 0.04 4 - + + @@ -413,8 +409,8 @@ percent 0.01 5 - + + @@ -427,8 +423,8 @@ percent 0.15 7 - + + @@ -441,8 +437,8 @@ percent 0.04 11 - + + @@ -455,8 +451,8 @@ percent 0.01 12 - + + @@ -470,8 +466,8 @@ 0.02 13 - + + @@ -484,8 +480,8 @@ percent 0.05 14 - + + @@ -498,8 +494,8 @@ percent 0.1250 60 - + + @@ -512,8 +508,8 @@ percent 0.0250 80 - + + @@ -526,8 +522,8 @@ percent 0.02 9333 - + + From df42be7f5d873fe7003dfd6a155b5ce6cf23571b Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 18 Mar 2013 16:20:27 +0530 Subject: [PATCH 04/43] [IMP] new improved data of tax code bzr revid: tpa@tinyerp.com-20130318105027-r9vf27o3sx8lw9g7 --- .../l10n_in/l10n_in_public_tax_template.xml | 64 ++-- addons/l10n_in/l10n_in_tax_code_template.xml | 288 ++++++++++++------ 2 files changed, 221 insertions(+), 131 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 92b154643f2..1cfc0cf5d5a 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -26,7 +26,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -217,7 +217,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -278,7 +278,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -317,7 +317,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -344,7 +344,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -426,7 +426,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -497,7 +497,7 @@ - + @@ -511,7 +511,7 @@ - + @@ -525,7 +525,7 @@ - + diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index ff2cd352bbf..1d721c76a94 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -39,7 +39,7 @@ Cst 5% on Purchase - + CSTP5 @@ -49,179 +49,179 @@ PCST5 - - Education Cess 2% - - - + Education Cess 2% + + + + Education Cess 2% - Purchase - + - + Input Credit - Import Duty - + - + Input Credit On Capital Goods - Edu. Cess - + - + Input Credit on Capital Goods - Modvate - + - + Input Credit on Capital Goods - Seco. & HEC - + - + Input Credit - Service Tax - + - + Input Credit - Service Tax Edu. Cess. - + - + Input Credit - Service Tax Seco. & HEC - + - + Seco. & Higher Edu. Cess 1% - Purchase - + - + Seco. & Higher Edu. Cess 1% - Sales - - - - - CST 2% on Sales - - - - - CST 5% on Sales - - - - - Input Additional Vat 1% - - - - - Input Additional Vat 2.5% - - - - - Input VAT 12.5% - - - - - Input Vat 15% - - - - - Input Vat 4% - - - - - Output Adi. Vat @1% - - - - - Output Vat @4% - Cst 2% on Purchase + CST 2% on Sales - - Excise Duty 12% - Purchase + + CST 5% on Sales - - Excise Duty - 12% - Sales + + Input Additional Vat 1% - + + Input Additional Vat 2.5% + + + + + Input VAT 12.5% + + + + + Input Vat 15% + + + + + Input Vat 4% + + + + + Output Adi. Vat @1% + + + + + Output Vat @4% + + + + + Cst 2% on Purchase + + + + + Excise Duty 12% - Purchase + + + + + Excise Duty - 12% - Sales + + + + Excise Duty 5% - Purchase - + - + Excise Duty 6% on Purchase - + - + Input Credit - URD - + - + Tds on Audit Fees - 94J - + - + TDS on Commission Or Brokerage- 94H - + - + TDS on Contractor-94C - + - + TDS On Director's Interest - + - + TDS on Director's Remuneration - 92B - + - + TDS on Interest - + - + TDS on Professional Fees - 94J - + - + TDS on Rent-94I - + - + TDS on Salary - 92B - + @@ -299,10 +299,100 @@ - + Additional Duty (Imports) 4% + + + + + Sales Export - Form H - With Tax + + + + + CST 2% on Sales CT3 + + Sales CT3 VAT + + + + + Output VAT 4% on Sales CT3 + + + + + Output Adi. Vat 1% on Sales CT3 + + + + + Sales CT3 CST + + + + + Sales Export - Form H - With CT1 + + + + + Sales Export - SEZ - Out of Gujarat + + + + + Sales Export - SEZ - In Gujarat + + + + + No Tax SEZ OGS + + + + + No Tax SEZ Gujarat + + + + + Sales Export - Out of Country + + + + + Sales Others (Projects) + + + + + No Tax Form H with BED + + + + + No Tax Form H + + + + + No Tax Export Out of Country + + + + + No Tax Projects + + + + + Base for Input Service + + + From f5800836f29247953b67564e4a39ff5acace15b0 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 18 Mar 2013 18:38:21 +0530 Subject: [PATCH 05/43] [IMP] improved taxes bzr revid: tpa@tinyerp.com-20130318130821-07ylst5u9iogaa3z --- addons/l10n_in/l10n_in_public_chart.xml | 28 ++- .../l10n_in/l10n_in_public_tax_template.xml | 170 ++++++++++++++---- 2 files changed, 161 insertions(+), 37 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_chart.xml b/addons/l10n_in/l10n_in_public_chart.xml index 49568826c4b..67093812c63 100644 --- a/addons/l10n_in/l10n_in_public_chart.xml +++ b/addons/l10n_in/l10n_in_public_chart.xml @@ -901,7 +901,7 @@ - Output Vat @4% + Output Vat 4% 121102009 other @@ -909,7 +909,7 @@ - Output Adi. Vat @1% + Output Adi. Vat 1% 121102008 other @@ -956,6 +956,30 @@ + + CST 2% on Sales - CT3 Against Form C + 121102017 + other + + + + + + Output Vat 4% on Sales - CT3 + 121102018 + other + + + + + + Output Adi. Vat 1% Sales CT3 + 121102019 + other + + + + India - Chart of Accounts for Public Ltd diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 1cfc0cf5d5a..03c2cfd2d23 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -3,8 +3,8 @@ - CST 5% - Purchase - CST 5% - Purchase + Input CST 5% + Input CST 5% purchase percent 0.01 @@ -18,8 +18,8 @@ - Input Credit - Service Tax Seco. & HEC - Input Credit - Service Tax Seco. & HEC + Input Sec. & HEC - Service Tax + Input Sec. & HEC - Service Tax purchase percent 0.0100 @@ -98,8 +98,8 @@ - Input Credit - Service Tax - Input Credit - Service Tax + Input Credit - Service Tax 12.36% + Input Credit - Service Tax 12.36% purchase percent 0.1200 @@ -111,9 +111,9 @@ - - Input Credit - Service Tax Edu. Cess. - Input Credit - Service Tax Edu. Cess. + + Input Edu. Cess - Service Tax + Input Edu. Cess - Service Tax purchase percent 0.0200 @@ -138,8 +138,8 @@ - Excise Duty 6% on Purchase - Excise Duty 6% on Purchase + Input Excise Duty 6% + Input Excise Duty 6% purchase percent 0.0600 @@ -151,8 +151,8 @@ - Excise Duty 5% - Purchase - + Input Excise Duty 5% + Input Excise Duty 5% purchase percent 0.0500 @@ -164,8 +164,8 @@ - Excise Duty 12% - Purchase - Excise Duty 12% - Purchase + Input Excise Duty 12% + Input Excise Duty 12% purchase percent 0.1200 @@ -208,8 +208,8 @@ - Excise Duty - 12% - Sales - Excise Duty - 12% - Sales + Excise Duty - 12.36% - Sales + Excise Duty - 12.36% - Sales sale percent 0.1200 @@ -269,9 +269,9 @@ - - Input Credit on Capital Goods - Seco. & HEC - Input Credit on Capital Goods - Seco. & HEC + + Input Sec. & HEC - Capital Goods + Input Sec. & HEC - Capital Goods purchase percent 0.01 @@ -362,8 +362,8 @@ - Input Credit On Capital Goods - Edu. Cess - Input Credit On Capital Goods - Edu. Cess + Input Edu. Cess - Capital Goods + Input Edu. Cess - Capital Goods purchase percent 0.02 @@ -374,9 +374,9 @@ - - Input Credit on Capital Goods - Modvate - Input Credit on Capital Goods - Modvate + + Input Excise Duty 12% - Capital Goods + Input Excise Duty 12% - Capital Goods purchase percent 0.12 @@ -423,16 +423,16 @@ percent 0.15 7 - - + + - Output Vat @4% - Output Vat @4% + Output Vat 4% + Output Vat 4% sale percent 0.04 @@ -445,8 +445,8 @@ - Output Adi. Vat @1% - Output Adi. Vat @1% + Output Adi. Vat 1% + Output Adi. Vat 1% sale percent 0.01 @@ -459,8 +459,8 @@ - CST 2% on Sales - CST 2% on Sales + CST 2% on Sales - Against Form - C + CST 2% on Sales - Against Form - C sale percent 0.02 @@ -516,8 +516,8 @@ - Cst 2% on Purchase - Cst 2% on Purchase + Input CST 2% + Input CST 2% purchase percent 0.02 @@ -529,5 +529,105 @@ + + No Tax Form H + No Tax Form H + purchase + percent + 0.02 + + + + + + + CST 2% on Sales - CT3 Against Form - C + CST 2% on Sales - CT3 Against Form - C + purchase + percent + 0.02 + + + + + + + + + Output Vat 4% on Sales - CT3 + Output Vat 4% on Sales - CT3 + purchase + percent + 0.04 + + + + + + + + + Output Adi. Vat 1% Sales CT3 + Output Adi. Vat 1% Sales CT3 + purchase + percent + 0.01 + + + + + + + + + No Tax SEZ OGS + No Tax SEZ OGS + purchase + fixed + + + + + + + No Tax SEZ Gujarat + No Tax SEZ Gujarat + purchase + percent + + + + + + + No Tax Form H with BED + No Tax Form H with BED + purchase + percent + + + + + + + No Tax Exports - Out of Country + No Tax Exports - Out of Country + purchase + percent + + + + + + + No Tax Projects + No Tax Projects + purchase + percent + + + + + \ No newline at end of file From 10d8c8d8fbea100fc05948a6ce8d33157c7954aa Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 20 Mar 2013 14:39:34 +0530 Subject: [PATCH 06/43] [IMP] l10n_in : improved parent_id of accounts, and improved typo bzr revid: tpa@tinyerp.com-20130320090934-0f3w2v7uq3cikmeb --- addons/l10n_in/l10n_in_public_chart.xml | 273 +++++++++--------- .../l10n_in/l10n_in_public_tax_template.xml | 236 +++++++-------- addons/l10n_in/l10n_in_tax_code_template.xml | 53 ++-- 3 files changed, 268 insertions(+), 294 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_chart.xml b/addons/l10n_in/l10n_in_public_chart.xml index 67093812c63..477df493bf6 100644 --- a/addons/l10n_in/l10n_in_public_chart.xml +++ b/addons/l10n_in/l10n_in_public_chart.xml @@ -116,7 +116,7 @@ Tax Receivable 15400 - other + view @@ -659,325 +659,324 @@ - + CST 5% on Purchase - 21000102 + 154001 other - + - + Input Credit - Service Tax Seco. & HEC - 121101010 + 154002 other - + - + Input Credit - URD - 121102012 + 154003 other - + - - Tds on Audit Fees - 94J - 121103001 + + TDS on Audit Fees - 94J + 154004 other - + - - TDS on Commission Or Brokerage- 94H - 121103002 + + TDS on Commission Or Brokerage - 94H + 154005 other - + - + Input Credit - Import Duty - CVD - 121101004 + 154006 other - + - + Input Credit Additional Duty on Imports 4% - 121101001 + 154007 other - + - + Input Credit - Service Tax - 121101008 + 154008 other - + - + Input Credit - Service Tax Edu. Cess. - 121101009 + 154009 other - + - + TDS on Salary - 92B - 121103009 + 154010 other - + - + Excise Duty 6% on Purchase - 121101015 + 154011 other - + - + Excise Duty 5% - Purchase - 1211010131 + 154012 other - + - + Excise Duty 12% - Purchase - 121101013 + 154013 other - + - + Education Cess 2% - Purchase - 121101003 + 154014 other - + - + Seco. & Higher Edu. Cess 1% - Purchase - 121101011 + 154015 other - + - + Excise Duty - 12% - Sales - 121101014 + 247001 other - + - + Education Cess 2% - 121101002 + 247010 other - + - + Seco. & Higher Edu. Cess 1% - Sales - 121101012 + 247002 other - - + - + Input Credit on Capital Goods - Seco. & HEC - 121101007 + 154016 other - + - - TDS on Contractor-94C - 121103003 + + TDS on Contractor - 94C + 154017 other - + - + TDS On Director's Interest - 121103004 + 154018 other - + - + TDS on Director's Remuneration - 92B - 121103005 + 154019 other - + - + TDS on Interest - 121103006 + 154020 other - + - + TDS on Professional Fees - 94J - 121103007 + 154021 other - + - - TDS on Rent-94I - 121103008 + + TDS on Rent - 94I + 154022 other - + - + Input Credit On Capital Goods - Edu. Cess - 121101005 + 154023 other - + - - Input Credit on Capital Goods - Modvate - 121101006 + + Input Excise Duty 12% - Capital Goods + 154024 other - + - - Input Vat 4% - 121102007 + + Input VAT 4% + 154025 other - + - - Input Additional Vat 1% - 121102003 + + Input Additional VAT 1% + 154026 other - + - - Input Vat 15% - 121102006 + + Input VAT 15% + 154027 other - + - - Output Vat 4% - 121102009 + + Output VAT 4% + 247003 other - + - - Output Adi. Vat 1% - 121102008 + + Output Adi. VAT 1% + 247004 other - + - + CST 2% on Sales - 121102001 + 247005 other - + - + CST 5% on Sales - 121102002 + 247006 other - + - + Input VAT 12.5% - 121102005 + 154028 other - + - - Input Additional Vat 2.5% - 121102004 + + Input Additional VAT 2.5% + 154029 other - + - - Cst 2% on Purchase - New - 121102011 + + CST 2% on Purchase + 154030 other - - + + - + CST 2% on Sales - CT3 Against Form C - 121102017 + 247007 other - + - - Output Vat 4% on Sales - CT3 - 121102018 + + Output VAT 4% on Sales - CT3 + 247008 other - + - - Output Adi. Vat 1% Sales CT3 - 121102019 + + Output Adi. VAT 1% Sales CT3 + 247009 other - + diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 03c2cfd2d23..09b2c41d7aa 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -8,8 +8,8 @@ purchase percent 0.01 - - + + @@ -23,8 +23,8 @@ purchase percent 0.0100 - - + + @@ -36,21 +36,21 @@ purchase percent 0.0400 - - + + - Tds on Audit Fees - 94J - Tds on Audit Fees - 94J + TDS on Audit Fees - 94J + TDS on Audit Fees - 94J purchase percent 0.1000 - - + + @@ -62,8 +62,8 @@ purchase percent 0.1000 - - + + @@ -76,8 +76,8 @@ percent 0.0750 1 - - + + @@ -90,22 +90,22 @@ percent 0.0400 1 - - + + - Input Credit - Service Tax 12.36% - Input Credit - Service Tax 12.36% + Input Credit - Service Tax 12% + Input Credit - Service Tax 12% purchase percent 0.1200 1 - - + + @@ -117,8 +117,8 @@ purchase percent 0.0200 - - + + @@ -130,8 +130,8 @@ purchase percent 0.3000 - - + + @@ -143,8 +143,8 @@ purchase percent 0.0600 - - + + @@ -156,8 +156,8 @@ purchase percent 0.0500 - - + + @@ -170,8 +170,8 @@ percent 0.1200 - - + + @@ -184,8 +184,8 @@ percent 0.0200 21 - - + + @@ -199,8 +199,8 @@ percent 0.0100 22 - - + + @@ -208,14 +208,14 @@ - Excise Duty - 12.36% - Sales - Excise Duty - 12.36% - Sales + Excise Duty - 12% - Sales + Excise Duty - 12% - Sales sale percent 0.1200 - - + + @@ -224,12 +224,12 @@ Education Cess 2% Education Cess 2% - all + sale percent 0.0200 2 - - + + @@ -239,57 +239,39 @@ Seco. & Higher Edu. Cess 1% - Sales Seco. & Higher Edu. Cess 1% - Sales - all + sale percent 0.0100 3 - - + + - + - - CST - CST - all - percent - 0.0000 - - - - - ADV - ADV - all - percent - 0.0 - - - Input Sec. & HEC - Capital Goods Input Sec. & HEC - Capital Goods purchase percent 0.01 - - + + - TDS on Contractor-94C - TDS on Contractor-94C + TDS on Contractor - 94C + TDS on Contractor - 94C purchase percent 0.0200 - - + + @@ -301,8 +283,8 @@ purchase percent 0.1 - - + + @@ -314,8 +296,8 @@ purchase percent 0.3 - - + + @@ -327,8 +309,8 @@ purchase percent 0.1 - - + + @@ -341,21 +323,21 @@ percent 0.1 1 - - + + - TDS on Rent-94I + TDS on Rent - 94I TDS on Rent-94I purchase percent 0.1 - - + + @@ -367,8 +349,8 @@ purchase percent 0.02 - - + + @@ -380,22 +362,22 @@ purchase percent 0.12 - - + + - + - Input Vat 4% - Input Vat 4% + Input VAT 4% + Input VAT 4% purchase percent 0.04 4 - - + + @@ -403,56 +385,56 @@ - Input Additional Vat 1% - Input Additional Vat 1% + Input Additional VAT 1% + Input Additional VAT 1% purchase percent 0.01 5 - - + + - Input Vat 15% - Input Vat 15% + Input VAT 15% + Input VAT 15% purchase percent 0.15 7 - - + + - Output Vat 4% - Output Vat 4% + Output VAT 4% + Output VAT 4% sale percent 0.04 11 - - + + - Output Adi. Vat 1% - Output Adi. Vat 1% + Output Adi. VAT 1% + Output Adi. VAT 1% sale percent 0.01 12 - - + + @@ -466,8 +448,8 @@ 0.02 13 - - + + @@ -480,8 +462,8 @@ percent 0.05 14 - - + + @@ -494,22 +476,22 @@ percent 0.1250 60 - - + + - Input Additional Vat 2.5% - Input Additional Vat 2.5% + Input Additional VAT 2.5% + Input Additional VAT 2.5% purchase percent 0.0250 80 - - + + @@ -522,8 +504,8 @@ percent 0.02 9333 - - + + @@ -546,34 +528,34 @@ purchase percent 0.02 - - + + - Output Vat 4% on Sales - CT3 - Output Vat 4% on Sales - CT3 + Output VAT 4% on Sales - CT3 + Output VAT 4% on Sales - CT3 purchase percent 0.04 - - + + - Output Adi. Vat 1% Sales CT3 - Output Adi. Vat 1% Sales CT3 + Output Adi. VAT 1% Sales CT3 + Output Adi. VAT 1% Sales CT3 purchase percent 0.01 - - + + diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index 1d721c76a94..1abccc181bb 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -38,15 +38,13 @@ - Cst 5% on Purchase + CST 5% on Purchase - CSTP5 Purchase CST 5% - PCST5 @@ -69,8 +67,8 @@ - - Input Credit on Capital Goods - Modvate + + Input Excise Duty 12% - Capital Goods @@ -99,9 +97,9 @@ - + Seco. & Higher Edu. Cess 1% - Sales - + @@ -115,7 +113,7 @@ - Input Additional Vat 1% + Input Additional VAT 1% @@ -130,7 +128,7 @@ - Input Vat 15% + Input VAT 15% @@ -140,17 +138,17 @@ - Output Adi. Vat @1% + Output Adi. VAT 1% - Output Vat @4% + Output VAT 4% - Cst 2% on Purchase + CST 2% on Purchase @@ -180,7 +178,7 @@ - Tds on Audit Fees - 94J + TDS on Audit Fees - 94J @@ -230,7 +228,7 @@ - Purchase Vat 4% / Vat12.5% / Vat15% / Cst2% / Cst5% + Purchase VAT 4% / VAT 12.5% / VAT 15% / CST 2% / CST 5% @@ -245,47 +243,47 @@ - Sales Vat 4% / Sales CST2% / Sales CST5% - + Sales VAT 4% / Sales CST 2% / Sales CST 5% + - Sales CST2% + Sales CST 2% - Sales CST5% + Sales CST 5% - Purchase Vat 4% + Purchase VAT 4% - Purchase Vat12.5% / Vat15% + Purchase VAT 12.5% / VAT 15% - Purchase Vat12.5% + Purchase VAT 12.5% - Purchase Vat15% + Purchase VAT 15% - Sales Vat 4% + Sales VAT 4% - Purchase Cst2% + Purchase CST 2% @@ -325,7 +323,7 @@ - Output Adi. Vat 1% on Sales CT3 + Output Adi. VAT 1% on Sales CT3 @@ -389,10 +387,5 @@ - - Base for Input Service - - - From 6624bf9675a54e93be5983163722e183b8e3cefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 27 Mar 2013 15:14:26 +0100 Subject: [PATCH 07/43] [FIX] point_of_sale: add scrollbar when there are too much payment methods bzr revid: fva@openerp.com-20130327141426-ivgfxlsxlpazehar --- addons/point_of_sale/static/src/css/pos.css | 7 ++++++- addons/point_of_sale/static/src/xml/pos.xml | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index d9a4d6d00a9..16355240f25 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -291,10 +291,15 @@ display: inline-block; text-align: center; vertical-align: top; + width: 205px; + max-height: 232px; + overflow-y: auto; + overflow-x: hidden; } .point-of-sale #paypad button { height: 50px; - width: 208px; + display: block; + width: 100%; margin: 0px -6px 4px -2px; font-weight: bold; vertical-align: middle; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 3da76ec12d8..1dce368b9cb 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -538,7 +538,6 @@ -
From 28ed62fd7e22fe79d856926e6ce91aba5f0dd429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 27 Mar 2013 16:15:18 +0100 Subject: [PATCH 08/43] [IMP] point_of_sale: adding visual feedback when clicking on buttons bzr revid: fva@openerp.com-20130327151518-t4h67hqn02s80tai --- addons/point_of_sale/static/src/css/pos.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 16355240f25..e328054aa28 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -307,6 +307,17 @@ border-top: 1px solid #efefef; font-size: 14px; } +.point-of-sale #paypad button, .point-of-sale #numpad button, .point-of-sale .popup button{ + position: relative; + top: 0; + -webkit-transition: top 150ms linear; + -moz-transition: top 150ms linear; + -ms-transition: top 150ms linear; + transition: top 150ms linear; +} +.point-of-sale #paypad button:active, .point-of-sale #numpad button:active, .point-of-sale .popup button:active{ + top:3px; +} .point-of-sale #paypad button:hover, .point-of-sale #numpad button:hover, .point-of-sale #numpad .selected-mode, .point-of-sale .popup button:hover { border: none; color: white; From 74b3538dd17b291c47fcb5697484506c66d6429d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 27 Mar 2013 16:40:54 +0100 Subject: [PATCH 09/43] [IMP] point_of_sale: add an invoice button (does nothing yet) bzr revid: fva@openerp.com-20130327154054-nhfy6ak73v1gwj09 --- .../static/src/img/icons/png48/invoice.png | Bin 0 -> 2086 bytes addons/point_of_sale/static/src/js/screens.js | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 addons/point_of_sale/static/src/img/icons/png48/invoice.png diff --git a/addons/point_of_sale/static/src/img/icons/png48/invoice.png b/addons/point_of_sale/static/src/img/icons/png48/invoice.png new file mode 100644 index 0000000000000000000000000000000000000000..e65d2ec5a67398a6aa245c89d66355ae3e5a0d46 GIT binary patch literal 2086 zcmV+>2-)|EP)3$g6o3^(HlyMaw}_JX0}^BWW6(b){xLDe#69s3KTTXhkf3a>RIF5r#a2ppT9Cp( zX**@6oo>(~2BX!1(q-Cdk)@Sx)0w_5vrp%E&h6>Dym>5nbq1ri`7+a)dGDR?oOADe zGj{;Mf13ZVKy!1=qbHi{iyE71{S7B=K-8b8(NNb|t)aHTs$#1rEGjj1$B9T?qxFid z!D_SCR;{&KtxFOn(AZ?l86Fv$hB%IJBn)2P6bug!z}Yst-&R*WQC(+FZf00aVl@C$t4^LxSP^NK*Gyu>6-PE8==Fflm};}Z%p2Fkbx#t@I<2G7_i zxRFth3&s==p2LUd4T2m0x1VqESJzhkQr1{@Ut9%h8>++jD1!F;IdB96Cn#`z@RN!V zP-X=bLJCm8qwW!KxrgyJHw1$Lah#*OJ!G+&`z)5S6>$^5z7+y8Xc@SG0%tG?L;;z7 zf`cb!gBQ#Q3=aPVSNbkN043-cXRl+rs=8dMtSoyeE&|oH$A!R@ZzkXi7cM}1dwbky zYiol}M>`A-4UmM8?ETXTW=pxZqT z(BWtk0yM-D>lzXgzx?)d;8>;U=$r-2mSZHKwntBoGwv0z+wE}r^l3PC>JKkgj2M_Q6U`_%RRYyrcW|$e%AhRwrKT4SwxCPkzoP7aT0Kp*p!P(OV zzuSL<=ATZ2#aac2O{HM2s({{$Jz_qXj+OQUz@3H#um@2f3JR^|h%*5dXl-qUGiS~~ zeSJNc&1NV)REh$JplDwK6c!c0#Y??VQ+s^kK3=5Q1m`FfwMk<Am zM`izO=KwT6}YBZfX0Y{FRQ0O3>J8y@Bhl&pv7C2gdC>$jL z4wNg9a5_6X#T*zK8Gyd4mua&@fs)IH1x#h7BtRLaYzjOQ{r?(V-1`Dq1^4V6kbA+1 zUx!xAh|Se$2E0M}j?a3#C~ z-2c=*ETAF;@{4ke3+(@~P$MAFXPV%BK<*6$?-zvJCloz=en!7<&_a?|xYxMAz5@lC z7V7G9+>TXrkF`$>Uu~a8hiF;Mp9A? z3gqPNApz=1UEunlwE@%pix&Dt<0jzyF~_LqqLG!o+qgh>ZWi4OsgsevktH05!$AV7 z6phRuGK>rC$;l)E%D5)$+}FBn%Z!R2z!)F+iNGxW8{m^apvC-%Mq_u@F5?1NwlD|* zu}WYCdTv_B`!s2K3NF*Ydo|Z(22q8WbBQhgFW9P0N#s$9Hy%PmM73k^hxgFn! zDFM`4Y9(l-?MyW;ke-po0=iX4_C8NG+4s8aQ+7G?(=Z*K7PrSV=#dbwb0uUIv;sT6 z{o1$ymW^9TSAm4n-QBGbNKO07m;jDD)6!E(;1(;8S6hW3!Yhxgf}96j4T-M*^%I%K z*WYZ5tY5!=@y!J|aAy9FZ>7Na+*cvGi>01s89gCQ;DmN5rIC`F99gqw%~FhO9>u2@ z;NbZKcOi>X)3yr%1qE)s1AA}27x3KB5gW7&T-}*zZ2KxHvU>IE2QjX@DY-167vSI* zBM*F&w%tn;i~?75w-Gnk(5@BH%CHc_fvN;JXc@S=JV)^_Ib~~j*|KHJF|K=&g;GK* zFpmxILzaKOX@jNp{JAI&_%}zlvkTUJ_Ng6XdJcI6S;C3d3$We&$WyDHUG?_bb)WpY zZF^GW%apCaU^ccu^0pb01e+o0%Ne#3$(vNR5J?+VHWORF5Nsm0e6F&Q*t|jT1%uC{ zAAS5`$I6u}*J4c1Bab3WZziySKkzW}4Dtf<3i2BA2J$BIF7h7pe%z4fe21^|I`S&= zG6(-8vJ6>t{TAZYhudfgSK=YIewhpD;Kpx|^d64^mF=u~XjDUV6 zVv&VxyqKi8I`<@)rOXn(?jnw30Vh}uUJB?WSVS^kf^vyvz7~#w 0); + this.pos_widget.action_bar.set_button_disabled('invoice', remaining > 0); } }, set_numpad_state: function(numpadState) { From 0fdf9066ddb12b5058b055433b9b98e62189c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 28 Mar 2013 16:07:18 +0100 Subject: [PATCH 10/43] [FIX] point_of_sale: fixing potential timeout issues when sending orders over bad connection bzr revid: fva@openerp.com-20130328150718-zj91ljrlkvv59tkj --- addons/point_of_sale/static/src/js/db.js | 16 ++- addons/point_of_sale/static/src/js/models.js | 133 +++++++++++++------ 2 files changed, 109 insertions(+), 40 deletions(-) diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index a79b111b5c5..c28c08950db 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -267,11 +267,12 @@ function openerp_pos_db(instance, module){ return results; }, add_order: function(order){ - var last_id = this.load('last_order_id',0); + var order_id = this.load('last_order_id',0) + 1; var orders = this.load('orders',[]); - orders.push({id: last_id + 1, data: order}); - this.save('last_order_id',last_id+1); + orders.push({id: order_id, data: order}); + this.save('last_order_id', order_id); this.save('orders',orders); + return order_id; }, remove_order: function(order_id){ var orders = this.load('orders',[]); @@ -283,5 +284,14 @@ function openerp_pos_db(instance, module){ get_orders: function(){ return this.load('orders',[]); }, + get_order: function(order_id){ + var orders = this.get_orders(); + for(var i = 0, len = orders.length; i < len; i++){ + if(orders[i].id === order_id){ + return orders[i]; + } + } + return undefined; + }, }); } diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 660434ba53e..ac86ee852e0 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -120,7 +120,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('company').currency_id[0]]]); }).then(function(currencies){ - console.log('Currency:',currencies[0]); self.set('currency',currencies[0]); return self.fetch('product.uom', null, null); @@ -256,12 +255,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal } }, - // saves the order locally and try to send it to the backend. 'record' is a bizzarely defined JSON version of the Order - push_order: function(record) { - this.db.add_order(record); - this.flush(); - }, - //creates a new empty order and sets it as the current order add_new_order: function(){ var order = new module.Order({pos:this}); @@ -269,45 +262,111 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal this.set('selectedOrder', order); }, + // saves the order locally and try to send it to the backend. 'record' is a bizzarely defined JSON version of the Order + // it returns a deferred that succeeds or fail when the pushed order is successfully posted on the server, previously failed orders + // will try to be re-sent but don't make this method return false if they fail. ( So that in the unlikely case of an order making + // the server crash, the other orders can still be sent ) + // payment process ) + push_order: function(record) { + var self = this; + var order_id = this.db.add_order(record); + var pushed = new $.Deferred(); + + this.set('nbr_pending_operations',self.db.get_orders().length); + + this.flush_mutex.exec(function(){ + + //first we try to push all orders (the one we added and the one that were not sent) + var tried_all = self._flush_all_orders(); + var done = new $.Deferred(); + + tried_all.always(function(){ + // then we verify that the one we just added has been sent successfuly. + self._flush_order(order_id) + .done( function(){ pushed.resolve();}) + .fail( function(){ pushed.reject(); }) + .always( function(){ done.resolve(); }); + }); + + return done; + }); + + return pushed; + }, + + // attemps to send all pending orders ( stored in the pos_db ) to the server, // and remove the successfully sent ones from the db once // it has been confirmed that they have been sent correctly. flush: function() { - //TODO make the mutex work - //this makes sure only one _int_flush is called at the same time - /* - return this.flush_mutex.exec(_.bind(function() { - return this._flush(0); - }, this)); - */ - this._flush(0); + var self = this; + var flushed = new $.Deferred(); + + this.flush_mutex.exec(function(){ + var done = new $.Deferred(); + + self._flush_all_orders() + .done( function(){ flushed.resolve();}) + .fail( function(){ flushed.reject(); }) + .always(function(){ done.resolve(); }); + + return done; + }); + + return flushed; }, - // attempts to send an order of index 'index' in the list of order to send. The index - // is used to skip orders that failed. do not call this method outside the mutex provided - // by flush() - _flush: function(index){ + + // attempts to send the locally stored order of id 'order_id' + // the sending is asynchronous and can take a long time to decide if it is successful or not (60s) + // it is therefore important to only call this method from inside a mutex + // this method returns a deferred indicating wether the sending was successful or not + _flush_order: function(order_id){ + var self = this; + var order = this.db.get_order(order_id); + + if(!order){ + // flushing a non existing order always succeeds + return (new $.Deferred()).resolve(); + } + + //we try to send the order. shadow prevents a spinner if it takes too long. + var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: true, timeout: 2000}); + + rpc.fail(function(unused,event){ + //prevent an error popup creation by the rpc failure + event.preventDefault(); + console.error('Failed to send order:',order); + }); + + rpc.done(function(){ + self.db.remove_order(order_id); + self.set('nbr_pending_operations',self.db.get_orders().length); + }); + + return rpc; + }, + + // attempts to send all the locally stored orders. As with _flush_order, it should only be + // called from within a mutex. + // this method returns a deferred that always succeeds when all orders have been tried to be sent, + // even if none of them could actually be sent. + _flush_all_orders: function(){ var self = this; var orders = this.db.get_orders(); - self.set('nbr_pending_operations',orders.length); + var tried_all = new $.Deferred(); - var order = orders[index]; - if(!order){ - return; + function rec_flush(index){ + if(index < orders.length){ + self._flush_order(orders[index].id).always(function(){ + rec_flush(index+1); + }) + }else{ + tried_all.resolve(); + } } - //try to push an order to the server - // shadow : true is to prevent a spinner to appear in case of timeout - (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{ shadow:true }) - .fail(function(unused, event){ - //don't show error popup if it fails - event.preventDefault(); - console.error('Failed to send order:',order); - self._flush(index+1); - }) - .done(function(){ - //remove from db if success - self.db.remove_order(order.id); - self._flush(index); - }); + rec_flush(0); + + return tried_all; }, scan_product: function(parsed_ean){ From 96a74ae6ad1872a519cbe70d07fe2fbc00b40cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 28 Mar 2013 16:35:37 +0100 Subject: [PATCH 11/43] [IMP] point_of_sale: ... bzr revid: fva@openerp.com-20130328153537-ohdc3243lcu3dgbj --- addons/point_of_sale/static/src/js/models.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index ac86ee852e0..6a9d54ce608 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -294,7 +294,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return pushed; }, - // attemps to send all pending orders ( stored in the pos_db ) to the server, // and remove the successfully sent ones from the db once // it has been confirmed that they have been sent correctly. From 703039f7c6cd660210e2d1cf4b59c19323557956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 28 Mar 2013 16:39:51 +0100 Subject: [PATCH 12/43] [IMP] web corelib: adding timeout option to the rpc api bzr revid: fva@openerp.com-20130328153951-om7hrs5l10oc0vm2 --- addons/web/static/src/js/corelib.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index bfde707312c..c31b4ff5606 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -1011,6 +1011,9 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { var deferred = $.Deferred(); if (! options.shadow) this.trigger('request', url, payload); + + if (options.timeout) + url.timeout = options.timeout; this.rpc_function(url, payload).then( function (response, textStatus, jqXHR) { From cae96ed4543abc9f05dbc4398a1832a1468639c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 29 Mar 2013 12:00:48 +0100 Subject: [PATCH 13/43] [FIX] point_of_sale: correctly set the customer on the order bzr revid: fva@openerp.com-20130329110048-1cx2sr4hp98cue0f --- addons/point_of_sale/point_of_sale.py | 3 ++- addons/point_of_sale/static/src/js/models.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 44139f7a499..9ee5b944718 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -489,7 +489,8 @@ class pos_order(osv.osv): 'user_id': order['user_id'] or False, 'session_id': order['pos_session_id'], 'lines': order['lines'], - 'pos_reference':order['name'] + 'pos_reference':order['name'], + 'partner_id': order['partner_id'] or False }, context) for payments in order['statement_ids']: diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 6a9d54ce608..426bea9a9b7 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -330,7 +330,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal //we try to send the order. shadow prevents a spinner if it takes too long. var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: true, timeout: 2000}); - + rpc.fail(function(unused,event){ //prevent an error popup creation by the rpc failure event.preventDefault(); @@ -863,7 +863,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal lines: orderLines, statement_ids: paymentLines, pos_session_id: this.pos.get('pos_session').id, - partner_id: this.pos.get('client') ? this.pos.get('client').id : undefined, + partner_id: this.get_client() ? this.get_client().id : false, user_id: this.pos.get('cashier') ? this.pos.get('cashier').id : this.pos.get('user').id, }; }, From 4822b6332ee01685fdbced96c37d54e8d615dfe6 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 4 Apr 2013 13:02:53 +0530 Subject: [PATCH 14/43] [IMP] improved code bzr revid: tpa@tinyerp.com-20130404073253-6bxc9rnc94q80cd5 --- addons/l10n_in/l10n_in_public_chart.xml | 2 +- .../l10n_in/l10n_in_public_tax_template.xml | 86 +++++++++++++++++-- addons/l10n_in/l10n_in_tax_code_template.xml | 75 +++++++++++----- 3 files changed, 136 insertions(+), 27 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_chart.xml b/addons/l10n_in/l10n_in_public_chart.xml index 477df493bf6..f39a42c0f53 100644 --- a/addons/l10n_in/l10n_in_public_chart.xml +++ b/addons/l10n_in/l10n_in_public_chart.xml @@ -820,7 +820,7 @@
- TDS On Director's Interest + TDS on Director's Interest 154018 other diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 09b2c41d7aa..4bfe26a3e01 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -150,6 +150,36 @@ + + Education Cess 2% -Purchase + Education Cess 2% -Purchase + purchase + percent + 0.0200 + 21 + + + + + + + + + + Seco. & Higher Edu. Cess 1% -Purchase + Seco. & Higher Edu. Cess 1% -Purchase + all + percent + 0.0100 + 22 + + + + + + + + Input Excise Duty 5% Input Excise Duty 5% @@ -180,7 +210,7 @@ Education Cess 2% - Purchase Education Cess 2% - Purchase - all + purchase percent 0.0200 21 @@ -222,8 +252,8 @@ - Education Cess 2% - Education Cess 2% + Education Cess 2% - Sales + Education Cess 2% - Sales sale percent 0.0200 @@ -231,7 +261,7 @@ - + @@ -278,8 +308,8 @@ - TDS On Director's Interest - TDS On Director's Interest + TDS on Director's Interest + TDS on Director's Interest purchase percent 0.1 @@ -611,5 +641,49 @@ + + Service Tax 12% - Sales + Service Tax 12% - Sales + sale + percent + 0.12 + 1 + + + + + + + + + Service Tax 2% - Sales + Service Tax 2% - Sales + sale + percent + 0.02 + 1 + + + + + + + + + + Service Tax 1% - Sales + Service Tax 1% - Sales + sale + percent + 0.01 + 1 + + + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index 1abccc181bb..b230600d640 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -47,14 +47,34 @@
- - Education Cess 2% + + Excise Duty - (12% + 2% +1%) Sales + + Excise Duty - 12% - Sales + + + + + Input Credit - Service Tax (12% + 2% + 1%) purchase + + + + + Excise Duty 12% - Purchase + + + + + Education Cess 2% - Sales + + + Education Cess 2% - Purchase - + @@ -77,29 +97,34 @@ + + Input Credit - Service Tax (12% + 2% + 1%) + + + Input Credit - Service Tax - + Input Credit - Service Tax Edu. Cess. - + Input Credit - Service Tax Seco. & HEC - + Seco. & Higher Edu. Cess 1% - Purchase - + Seco. & Higher Edu. Cess 1% - Sales - + @@ -133,7 +158,7 @@ - Input Vat 4% + Input VAT 4% @@ -152,16 +177,6 @@ - - Excise Duty 12% - Purchase - - - - - Excise Duty - 12% - Sales - - - Excise Duty 5% - Purchase @@ -193,7 +208,7 @@ - TDS On Director's Interest + TDS on Director's Interest @@ -387,5 +402,25 @@
+ + Service Tax (12% + 2% + 1%) Sales + + + + + Service Tax 12% - Sales + + + + + Service Tax 2% - Sales + + + + + Service Tax 1% - Sales + + + From f5ff7acbb62ba0980e368ed2d38a43b0d7c2500d Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 5 Apr 2013 12:25:19 +0530 Subject: [PATCH 15/43] [IMP] improved code bzr revid: tpa@tinyerp.com-20130405065519-jfb6rbtdts616uy7 --- addons/l10n_in/l10n_in_public_chart.xml | 30 +++++----- .../l10n_in/l10n_in_public_tax_template.xml | 60 ++++++++++--------- addons/l10n_in/l10n_in_tax_code_template.xml | 22 +++---- 3 files changed, 57 insertions(+), 55 deletions(-) diff --git a/addons/l10n_in/l10n_in_public_chart.xml b/addons/l10n_in/l10n_in_public_chart.xml index f39a42c0f53..9a743dfd080 100644 --- a/addons/l10n_in/l10n_in_public_chart.xml +++ b/addons/l10n_in/l10n_in_public_chart.xml @@ -660,7 +660,7 @@
- CST 5% on Purchase + Input CST 5% 154001 other @@ -668,7 +668,7 @@ - Input Credit - Service Tax Seco. & HEC + Input Credit - Service Tax Seco. & HEC 1% 154002 other @@ -700,7 +700,7 @@ - Input Credit - Import Duty - CVD + Input Credit - Import Duty 154006 other @@ -708,7 +708,7 @@ - Input Credit Additional Duty on Imports 4% + Additional Duty (Imports) 4% 154007 other @@ -716,7 +716,7 @@ - Input Credit - Service Tax + Input Credit - Service Tax 12% 154008 other @@ -724,7 +724,7 @@ - Input Credit - Service Tax Edu. Cess. + Input Credit - Service Tax Edu. Cess. 2% 154009 other @@ -740,7 +740,7 @@ - Excise Duty 6% on Purchase + Input Excise Duty 6% 154011 other @@ -748,7 +748,7 @@ - Excise Duty 5% - Purchase + Input Excise Duty 5% 154012 other @@ -756,7 +756,7 @@ - Excise Duty 12% - Purchase + Input Excise Duty 12% 154013 other @@ -780,7 +780,7 @@ - Excise Duty - 12% - Sales + Excise Duty 12% - Sales 247001 other @@ -788,7 +788,7 @@ - Education Cess 2% + Education Cess 2% - Sales 247010 other @@ -804,7 +804,7 @@ - Input Credit on Capital Goods - Seco. & HEC + Input Sec. & HEC - Capital Goods 154016 other @@ -860,7 +860,7 @@ - Input Credit On Capital Goods - Edu. Cess + Input Edu. Cess - Capital Goods 154023 other @@ -916,7 +916,7 @@ - CST 2% on Sales + CST 2% on Sales - Against Form - C 247005 other @@ -948,7 +948,7 @@ - CST 2% on Purchase + Input CST 2% 154030 other diff --git a/addons/l10n_in/l10n_in_public_tax_template.xml b/addons/l10n_in/l10n_in_public_tax_template.xml index 4bfe26a3e01..6c0a63f0090 100644 --- a/addons/l10n_in/l10n_in_public_tax_template.xml +++ b/addons/l10n_in/l10n_in_public_tax_template.xml @@ -17,19 +17,6 @@ - - Input Sec. & HEC - Service Tax - Input Sec. & HEC - Service Tax - purchase - percent - 0.0100 - - - - - - - Input Credit - URD Input Credit - URD @@ -104,16 +91,16 @@ percent 0.1200 1 - - + + - Input Edu. Cess - Service Tax - Input Edu. Cess - Service Tax + Input Credit - Service Tax Edu. Cess. 2% + Input Credit - Service Tax Edu. Cess. 2% purchase percent 0.0200 @@ -121,6 +108,21 @@ + + + + + + Input Credit - Service Tax Seco. & HEC 1% + Input Credit - Service Tax Seco. & HEC 1% + purchase + percent + 0.0100 + + + + + @@ -138,8 +140,8 @@
- Input Excise Duty 6% - Input Excise Duty 6% + Input Excise Duty 6% + Input Excise Duty 6% purchase percent 0.0600 @@ -151,8 +153,8 @@ - Education Cess 2% -Purchase - Education Cess 2% -Purchase + Education Cess 2% Purchase + Education Cess 2% Purchase purchase percent 0.0200 @@ -166,8 +168,8 @@ - Seco. & Higher Edu. Cess 1% -Purchase - Seco. & Higher Edu. Cess 1% -Purchase + Seco. & Higher Edu. Cess 1% Purchase + Seco. & Higher Edu. Cess 1% Purchase all percent 0.0100 @@ -181,8 +183,8 @@ - Input Excise Duty 5% - Input Excise Duty 5% + Input Excise Duty 5% + Input Excise Duty 5% purchase percent 0.0500 @@ -238,8 +240,8 @@ - Excise Duty - 12% - Sales - Excise Duty - 12% - Sales + Excise Duty 12% - Sales + Excise Duty 12% - Sales sale percent 0.1200 @@ -579,8 +581,8 @@ - Output Adi. VAT 1% Sales CT3 - Output Adi. VAT 1% Sales CT3 + Output Adi. VAT 1% on Sales - CT3 + Output Adi. VAT 1% on Sales - CT3 purchase percent 0.01 diff --git a/addons/l10n_in/l10n_in_tax_code_template.xml b/addons/l10n_in/l10n_in_tax_code_template.xml index b230600d640..e9bbcc28faa 100644 --- a/addons/l10n_in/l10n_in_tax_code_template.xml +++ b/addons/l10n_in/l10n_in_tax_code_template.xml @@ -38,7 +38,7 @@ - CST 5% on Purchase + Input CST 5% @@ -53,12 +53,12 @@
- Excise Duty - 12% - Sales + Excise Duty 12% - Sales - Input Credit - Service Tax (12% + 2% + 1%) purchase + Input Credit - Service Tax (12% + 2% + 1%) Purchase @@ -103,17 +103,17 @@
- Input Credit - Service Tax + Input Credit - Service Tax 12% - Input Credit - Service Tax Edu. Cess. + Input Credit - Service Tax Edu. Cess. 2% - Input Credit - Service Tax Seco. & HEC + Input Credit - Service Tax Seco. & HEC 1% @@ -178,12 +178,12 @@
- Excise Duty 5% - Purchase + Input Excise Duty 5% - Excise Duty 6% on Purchase + Input Excise Duty 6% @@ -228,7 +228,7 @@
- TDS on Rent-94I + TDS on Rent - 94I @@ -268,7 +268,7 @@
- Sales CST 5% + CST 5% on Sales @@ -298,7 +298,7 @@
- Purchase CST 2% + Input CST 2% From 3aa6f4add577b153df2518f8681d0fbe2a84e8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 11 Apr 2013 14:07:19 +0200 Subject: [PATCH 16/43] [IMP] point_of_sale: the invoicing should now work reliably and validate the orders bzr revid: fva@openerp.com-20130411120719-colzjq4l8eaiotdf --- addons/point_of_sale/point_of_sale.py | 11 ++ addons/point_of_sale/static/src/js/db.js | 13 ++- addons/point_of_sale/static/src/js/models.js | 105 +++++++++++++----- addons/point_of_sale/static/src/js/screens.js | 74 ++++++++++-- addons/point_of_sale/static/src/js/widgets.js | 9 ++ addons/point_of_sale/static/src/xml/pos.xml | 37 +++++- 6 files changed, 206 insertions(+), 43 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 9ee5b944718..9363afe01ea 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -483,7 +483,10 @@ class pos_order(osv.osv): #_logger.info("orders: %r", orders) order_ids = [] for tmp_order in orders: + to_invoice = tmp_order['to_invoice'] order = tmp_order['data'] + + order_id = self.create(cr, uid, { 'name': order['name'], 'user_id': order['user_id'] or False, @@ -522,6 +525,13 @@ class pos_order(osv.osv): order_ids.append(order_id) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'pos.order', order_id, 'paid', cr) + + if to_invoice: + self.action_invoice(cr, uid, [order_id], context) + order_obj = self.browse(cr, uid, order_id, context) + wf_service = netsvc.LocalService('workflow') + wf_service.trg_validate(uid,'account.invoice', order_obj.invoice_id.id,'invoice_open',cr) + return order_ids def unlink(self, cr, uid, ids, context=None): @@ -859,6 +869,7 @@ class pos_order(osv.osv): inv_line_ref.create(cr, uid, inv_line, context=context) inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context) wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr) + wf_service.trg_validate(uid, 'account.invoice', inv_id, 'validate', cr) if not inv_ids: return {} diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index c28c08950db..aad6ed8ca69 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -267,10 +267,19 @@ function openerp_pos_db(instance, module){ return results; }, add_order: function(order){ - var order_id = this.load('last_order_id',0) + 1; + var order_id = order.uid; var orders = this.load('orders',[]); + + // if the order was already stored, we overwrite its data + for(var i = 0, len = orders.length; i < len; i++){ + if(orders[i].id === order_id){ + orders[i].data = order; + this.save('orders',orders); + return order_id; + } + } + orders.push({id: order_id, data: order}); - this.save('last_order_id', order_id); this.save('orders',orders); return order_id; }, diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 426bea9a9b7..ec4924c6068 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -262,36 +262,80 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal this.set('selectedOrder', order); }, - // saves the order locally and try to send it to the backend. 'record' is a bizzarely defined JSON version of the Order - // it returns a deferred that succeeds or fail when the pushed order is successfully posted on the server, previously failed orders - // will try to be re-sent but don't make this method return false if they fail. ( So that in the unlikely case of an order making - // the server crash, the other orders can still be sent ) - // payment process ) - push_order: function(record) { + // saves the order locally and try to send it to the backend. + // it returns a deferred that succeeds after having tried to send the order and all the other pending orders. + push_order: function(order) { var self = this; - var order_id = this.db.add_order(record); + var order_id = this.db.add_order(order.export_as_JSON()); var pushed = new $.Deferred(); this.set('nbr_pending_operations',self.db.get_orders().length); this.flush_mutex.exec(function(){ + var flushed = self._flush_all_orders(); - //first we try to push all orders (the one we added and the one that were not sent) - var tried_all = self._flush_all_orders(); - var done = new $.Deferred(); + flushed.always(function(){ + pushed.resolve(); + }); - tried_all.always(function(){ - // then we verify that the one we just added has been sent successfuly. - self._flush_order(order_id) - .done( function(){ pushed.resolve();}) - .fail( function(){ pushed.reject(); }) - .always( function(){ done.resolve(); }); + return flushed; + }); + return pushed; + }, + + // saves the order locally and try to send it to the backend and make an invoice + // returns a deferred that succeeds when the order has been posted and successfully generated + // an invoice. This method can fail in various ways: + // error-no-client: the order must have an associated partner_id. You can retry to make an invoice once + // this error is solved + // error-transfer: there was a connection error during the transfer. You can retry to make the invoice once + // the network connection is up + + push_and_invoice_order: function(order){ + var self = this; + var invoiced = new $.Deferred(); + + if(!order.get_client()){ + invoiced.reject('error-no-client'); + return invoiced; + } + + var order_id = this.db.add_order(order.export_as_JSON()); + + this.set('nbr_pending_operations',self.db.get_orders().length); + + this.flush_mutex.exec(function(){ + var done = new $.Deferred(); // holds the mutex + + // send the order to the server + // we have a 30 seconds timeout on this push. + // FIXME: if the server takes more than 30 seconds to accept the order, + // the client will believe it wasn't successfully sent, and very bad + // things will happen as a duplicate will be sent next time + // so we must make sure the server detects and ignores duplicated orders + + var transfer = self._flush_order(order_id, {timeout:30000, to_invoice:true}); + + transfer.fail(function(){ + invoiced.reject('error-transfer'); + done.reject(); + }); + + // on success, get the order id generated by the server + transfer.pipe(function(order_server_id){ + // generate the pdf and download it + self.pos_widget.do_action('point_of_sale.pos_invoice_report',{additional_context:{ + active_ids:order_server_id, + }}); + invoiced.resolve(); + done.resolve(); }); return done; + }); - return pushed; + return invoiced; }, // attemps to send all pending orders ( stored in the pos_db ) to the server, @@ -316,23 +360,30 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal }, // attempts to send the locally stored order of id 'order_id' - // the sending is asynchronous and can take a long time to decide if it is successful or not (60s) + // the sending is asynchronous and can take some time to decide if it is successful or not // it is therefore important to only call this method from inside a mutex // this method returns a deferred indicating wether the sending was successful or not - _flush_order: function(order_id){ + // there is a timeout parameter which is set to 2 seconds by default. + _flush_order: function(order_id, options){ var self = this; + options = options || {}; + timeout = typeof options.timeout === 'number' ? options.timeout : 5000; + var order = this.db.get_order(order_id); + order.to_invoice = options.to_invoice || false; if(!order){ - // flushing a non existing order always succeeds - return (new $.Deferred()).resolve(); + // flushing a non existing order always fails + return (new $.Deferred()).reject(); } - //we try to send the order. shadow prevents a spinner if it takes too long. - var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: true, timeout: 2000}); + // we try to send the order. shadow prevents a spinner if it takes too long. (unless we are sending an invoice, + // then we want to notify the user that we are waiting on something ) + var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: !options.to_invoice, timeout:timeout}); rpc.fail(function(unused,event){ - //prevent an error popup creation by the rpc failure + // prevent an error popup creation by the rpc failure + // we want the failure to be silent as we send the orders in the background event.preventDefault(); console.error('Failed to send order:',order); }); @@ -664,11 +715,12 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal module.Order = Backbone.Model.extend({ initialize: function(attributes){ Backbone.Model.prototype.initialize.apply(this, arguments); + this.uid = this.generateUniqueId(); this.set({ creationDate: new Date(), orderLines: new module.OrderlineCollection(), paymentLines: new module.PaymentlineCollection(), - name: "Order " + this.generateUniqueId(), + name: "Order " + this.uid, client: null, }); this.pos = attributes.pos; @@ -844,7 +896,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal currency: this.pos.get('currency'), }; }, - exportAsJSON: function() { + export_as_JSON: function() { var orderLines, paymentLines; orderLines = []; (this.get('orderLines')).each(_.bind( function(item) { @@ -865,6 +917,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal pos_session_id: this.pos.get('pos_session').id, partner_id: this.get_client() ? this.get_client().id : false, user_id: this.pos.get('cashier') ? this.pos.get('cashier').id : this.pos.get('user').id, + uid: this.uid, }; }, getSelectedLine: function(){ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index a99de66988d..6c96d51748b 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -433,6 +433,14 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa template:'ErrorNegativePricePopupWidget', }); + module.ErrorNoClientPopupWidget = module.ErrorPopupWidget.extend({ + template: 'ErrorNoClientPopupWidget', + }); + + module.ErrorInvoiceTransferPopupWidget = module.ErrorPopupWidget.extend({ + template: 'ErrorInvoiceTransferPopupWidget', + }); + module.ScaleInviteScreenWidget = module.ScreenWidget.extend({ template:'ScaleInviteScreenWidget', @@ -639,7 +647,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var cashregister = selfCheckoutRegisters[0] || self.pos.get('cashRegisters').models[0]; currentOrder.addPaymentLine(cashregister); - self.pos.push_order(currentOrder.exportAsJSON()) + self.pos.push_order(currentOrder) currentOrder.destroy(); self.pos.proxy.transaction_end(); self.pos_widget.screen_selector.set_current_screen(self.next_screen); @@ -807,19 +815,40 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this._super(); var self = this; - this.add_action_button({ + var print_button = this.add_action_button({ label: 'Print', icon: '/point_of_sale/static/src/img/icons/png48/printer.png', click: function(){ self.print(); }, }); - this.add_action_button({ + var finish_button = this.add_action_button({ label: 'Next Order', icon: '/point_of_sale/static/src/img/icons/png48/go-next.png', click: function() { self.finishOrder(); }, }); window.print(); + + // THIS IS THE HACK OF THE CENTURY + // + // The problem is that in chrome the print() is asynchronous and doesn't + // execute until all rpc are finished. So it conflicts with the rpc used + // to send the orders to the backend, and the user is able to go to the next + // screen before the printing dialog is opened. The problem is that what's + // printed is whatever is in the page when the dialog is opened and not when it's called, + // and so you end up printing the product list instead of the receipt... + // + // Fixing this would need a re-architecturing + // of the code to postpone sending of orders after printing. + // + // But since the print dialog also blocks the other asynchronous calls, the + // button enabling in the setTimeout() is blocked until the printing dialog is + // closed. But this is not reliable ... if the timeout is too slow it doesn't work + + finish_button.set_disabled(true); + setTimeout(function(){ + finish_button.set_disabled(false); + }, 2000); }, print: function() { window.print(); @@ -896,7 +925,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); this.updatePaymentSummary(); - this.line_refocus(); + this.line_refocus();this }, close: function(){ this._super(); @@ -907,18 +936,43 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.pos_widget.screen_selector.set_current_screen(self.back_screen); }, validateCurrentOrder: function(options) { + var self = this; options = options || {}; var currentOrder = this.pos.get('selectedOrder'); - this.pos.push_order(currentOrder.exportAsJSON()) + if(options.invoice){ - console.log('send invoice'); - }else if(this.pos.iface_print_via_proxy){ - this.pos.proxy.print_receipt(currentOrder.export_for_printing()); - this.pos.get('selectedOrder').destroy(); //finish order and go back to scan screen + // deactivate the validation button while we try to send the order + this.pos_widget.action_bar.set_button_disabled('validation',true); + this.pos_widget.action_bar.set_button_disabled('invoice',true); + + var invoiced = this.pos.push_and_invoice_order(currentOrder); + + invoiced.fail(function(error){ + if(error === 'error-no-client'){ + self.pos_widget.screen_selector.show_popup('error-no-client'); + }else{ + self.pos_widget.screen_selector.show_popup('error-invoice-transfer'); + } + self.pos_widget.action_bar.set_button_disabled('validation',false); + self.pos_widget.action_bar.set_button_disabled('invoice',false); + }); + + invoiced.done(function(){ + self.pos_widget.action_bar.set_button_disabled('validation',false); + self.pos_widget.action_bar.set_button_disabled('invoice',false); + self.pos.get('selectedOrder').destroy(); + }); + }else{ - this.pos_widget.screen_selector.set_current_screen(this.next_screen); + this.pos.push_order(currentOrder) + if(this.pos.iface_print_via_proxy){ + this.pos.proxy.print_receipt(currentOrder.export_for_printing()); + this.pos.get('selectedOrder').destroy(); //finish order and go back to scan screen + }else{ + this.pos_widget.screen_selector.set_current_screen(this.next_screen); + } } }, bindPaymentLineEvents: function() { diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index cec48dbe72f..6a606652a8e 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -828,6 +828,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa instance.web.blockUI(); this.pos = new module.PosModel(this.session); + this.pos.pos_widget = this; this.pos_widget = this; //So that pos_widget's childs have pos_widget set automatically this.numpad_visible = true; @@ -942,6 +943,12 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.error_negative_price_popup = new module.ErrorNegativePricePopupWidget(this, {}); this.error_negative_price_popup.appendTo($('.point-of-sale')); + this.error_no_client_popup = new module.ErrorNoClientPopupWidget(this, {}); + this.error_no_client_popup.appendTo($('.point-of-sale')); + + this.error_invoice_transfer_popup = new module.ErrorInvoiceTransferPopupWidget(this, {}); + this.error_invoice_transfer_popup.appendTo($('.point-of-sale')); + // -------- Misc --------- this.notification = new module.SynchNotificationWidget(this,{}); @@ -1003,6 +1010,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa 'error-session': this.error_session_popup, 'error-negative-price': this.error_negative_price_popup, 'choose-receipt': this.choose_receipt_popup, + 'error-no-client': this.error_no_client_popup, + 'error-invoice-transfer': this.error_invoice_transfer_popup, }, default_client_screen: 'welcome', default_cashier_screen: 'products', diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 1dce368b9cb..e28ea1c06b0 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -336,11 +336,11 @@ - @@ -361,6 +361,33 @@ + + + + + + + + diff --git a/addons/account_voucher/static/description/index.html b/addons/account_voucher/static/description/index.html index d59c110dde5..a363291f12e 100644 --- a/addons/account_voucher/static/description/index.html +++ b/addons/account_voucher/static/description/index.html @@ -17,7 +17,7 @@ automatically based on your activities.

diff --git a/addons/crm/static/description/index.html b/addons/crm/static/description/index.html index 5ae542f5c91..70f52d0ca87 100644 --- a/addons/crm/static/description/index.html +++ b/addons/crm/static/description/index.html @@ -17,7 +17,7 @@ Manage your sales funnel with no effort. Attract leads, follow-up on phone calls and meetings. Analyse the quality of your leads to make informed decisions and save time by integrating emails directly into the application.

diff --git a/addons/hr/static/description/index.html b/addons/hr/static/description/index.html index 0bc3db084a4..f97cb462fe3 100644 --- a/addons/hr/static/description/index.html +++ b/addons/hr/static/description/index.html @@ -17,7 +17,7 @@ Get all your HR operations managed easily: knowledge sharing, recruitments, appr Each need is provided by a specific app that you activate on demand.

diff --git a/addons/mail/static/description/index.html b/addons/mail/static/description/index.html index b564cf3ab1e..aa55e63008d 100644 --- a/addons/mail/static/description/index.html +++ b/addons/mail/static/description/index.html @@ -21,7 +21,7 @@ email overload.

diff --git a/addons/mrp/static/description/index.html b/addons/mrp/static/description/index.html index 5777eb5f147..d44da3f37b1 100644 --- a/addons/mrp/static/description/index.html +++ b/addons/mrp/static/description/index.html @@ -20,7 +20,7 @@ planning with the smart kanban and gantt views. Use the advanced analytics features to detect bottleneck in resources capacities and inventory locations.

diff --git a/addons/note/static/description/index.html b/addons/note/static/description/index.html index 7ef37c646e9..dc688859334 100644 --- a/addons/note/static/description/index.html +++ b/addons/note/static/description/index.html @@ -15,7 +15,7 @@ Organize yourself with efficient todo lists and notes. From personnal tasks to collaborative meeting minutes, increase your user's productivity by giving them the tools to prioritize their work, share their ideas and collaborate on documents.

diff --git a/addons/point_of_sale/static/description/index.html b/addons/point_of_sale/static/description/index.html index 130806ddb11..7f1b7a5c097 100644 --- a/addons/point_of_sale/static/description/index.html +++ b/addons/point_of_sale/static/description/index.html @@ -22,7 +22,7 @@ consolidations amongst all shops without the hassle of integrating several applications.

diff --git a/addons/project/static/description/index.html b/addons/project/static/description/index.html index 93f1be8a41d..2a1574c5d68 100644 --- a/addons/project/static/description/index.html +++ b/addons/project/static/description/index.html @@ -17,7 +17,7 @@ work done. Keep track of everything, from the big picture to the minute details, from the customer contract to the billing.

diff --git a/addons/purchase/static/description/index.html b/addons/purchase/static/description/index.html index 67b122ac557..ecf9028ce33 100644 --- a/addons/purchase/static/description/index.html +++ b/addons/purchase/static/description/index.html @@ -17,7 +17,7 @@ Automate procurement propositions, launch request for quotations, track purchase orders, manage suppliers' information, control products reception and check suppliers' invoices.

diff --git a/addons/sale/static/description/index.html b/addons/sale/static/description/index.html index 1eb6215db2f..52c84b82f12 100644 --- a/addons/sale/static/description/index.html +++ b/addons/sale/static/description/index.html @@ -17,7 +17,7 @@ you need, easily accessible. Keep track of long term contracts, automate invoici and notify sales when they have things to do.

diff --git a/addons/stock/static/description/index.html b/addons/stock/static/description/index.html index aac71e529ae..dd7fbe568f7 100644 --- a/addons/stock/static/description/index.html +++ b/addons/stock/static/description/index.html @@ -17,7 +17,7 @@ Decrease your process times, automate transactions, reduce your stock levels and get complete traceability on all operations with the OpenERP double entry inventory system.