diff --git a/addons/l10n_sg_gst/__init__.py b/addons/l10n_sg_gst/__init__.py new file mode 100644 index 00000000..3b3d7f92 --- /dev/null +++ b/addons/l10n_sg_gst/__init__.py @@ -0,0 +1,6 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from . import models +from . import report +from . import wizard diff --git a/addons/l10n_sg_gst/__manifest__.py b/addons/l10n_sg_gst/__manifest__.py new file mode 100644 index 00000000..9da7ded7 --- /dev/null +++ b/addons/l10n_sg_gst/__manifest__.py @@ -0,0 +1,41 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +{ + 'name': 'Singapore - GST Report', + 'version': '1.0', + 'category': 'Localization', + 'summary': 'GST Reports for Singapore Localization', + 'description': ''' +GST Reports for Singapore Localization +======================================== + +There are Different type of GST Reports available for Singapore Localization. + * GST5 Report + * GST7 Report + * GST Analysis Report + ''', + "author": "FlectraHQ", + 'website': 'https://flectrahq.com', + 'depends': ['account_invoicing', 'l10n_sg'], + 'data': [ + 'views/res_company_view.xml', + 'views/account_tax_view.xml', + 'report/report_paperformat.xml', + 'wizard/gst5_select_period_view.xml', + 'wizard/gst7_select_period_view.xml', + 'wizard/gst_analysis_view.xml', + 'report/report_gst_menu.xml', + 'views/layouts_gst.xml', + 'views/account_gst_analysis_view.xml', + 'views/account_gst5_report_view.xml', + 'views/account_gst7_report_view.xml', + ], + 'demo': [ + 'demo/demo_account.xml', + 'demo/demo_product.xml' + ], + 'installable': True, + 'application': True, + 'auto_install': False +} diff --git a/addons/l10n_sg_gst/demo/demo_account.xml b/addons/l10n_sg_gst/demo/demo_account.xml new file mode 100644 index 00000000..cbcc9c9b --- /dev/null +++ b/addons/l10n_sg_gst/demo/demo_account.xml @@ -0,0 +1,22 @@ + + + + + Income + + + + X2001 + Product Sales - (test) + + + + + Sales Journal - (test) + TSAJ + sale + + + + + diff --git a/addons/l10n_sg_gst/demo/demo_product.xml b/addons/l10n_sg_gst/demo/demo_product.xml new file mode 100644 index 00000000..58d0a4be --- /dev/null +++ b/addons/l10n_sg_gst/demo/demo_product.xml @@ -0,0 +1,113 @@ + + + + + + Cyril Daufeldt + 1 + Wavre + 1300 + 69 rue de Namur + cyril_daufeldt@daufeldt.com + +32 10 588 558 + http://www.Cyril.com + + + + Sunil Daufeldt + 1 + Shanghai + 1530 + + 69 rue de Namur + sunil_daufeldt@gmail.com + +32 10 588 558 + http://www.Sunil.com + + + + + medical instruments operating table + 2000 + 5000 + consu + + + + Blood Glucose Test Strip + 6000 + 7000 + consu + + + + Diamond Tools + 8000 + 10000 + consu + + + + Mobile Track Pad + 12000 + 150000 + consu + + + + Elevator + 2000 + 8000 + consu + + + + Car blackbox + 1000 + 5000 + consu + + + + Multi Block + 200 + 500 + consu + + + + SuperMax + 5000 + 12500 + consu + + + + Digital Wireless System + 2000 + 7500 + consu + + + + Digital Mobile X-Ray System + 300 + 8000 + consu + + + + Electrical Medical Stimulator + 1000 + 5000 + consu + + + + Hommage-Marble Stone + 700 + 1400 + consu + + + diff --git a/addons/l10n_sg_gst/i18n/l10n_sg_gst.pot b/addons/l10n_sg_gst/i18n/l10n_sg_gst.pot new file mode 100644 index 00000000..4a518ecf --- /dev/null +++ b/addons/l10n_sg_gst/i18n/l10n_sg_gst.pot @@ -0,0 +1,889 @@ +# Translation of Flectra Server. +# This file contains the translation of the following modules: +# * l10n_sg_gst +# +msgid "" +msgstr "" +"Project-Id-Version: Flectra Server 1.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-20 08:53+0000\n" +"PO-Revision-Date: 2018-04-20 08:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "(Attach payment voucher if you are paying by\n" +" cheque)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "(Please Cross)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "10" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "11" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "12" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "13" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "14" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "55 Newton\n" +" Road, Revenue House, Singapore\n" +" 307987" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "APPLICABLE TO TAXABLE PERSONS UNDER\n" +" MAJOR EXPORTER SCHEME ONLY\n" +" " +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "APPLICABLE TO TAXABLE PERSONS UNDER MAJOR EXPORTER SCHEME ONLY" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Before you fill in this form, please read the notes on\n" +" Page 2.\n" +" " +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Before you fill in this form, please read the notes on Page 2." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Company Name :" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "DECLARATION OF ERRORS" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "DECLARATION" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "DID YOU MAKE FOLLOWING CLAIMS IN BOX 7\n" +" ?\n" +" " +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "DID YOU MAKE FOLLOWING CLAIMS IN BOX 7 ?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Equals:" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "GOODS AND SERVICES TAX RETURN" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "Goods And Services Tax act 1993" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Less:" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "REVENUE" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Total" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "
\n" +" Company Address:" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "
\n" +" GST Registration Number :" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "From :" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "GST Analysis" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Purchases" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Sales" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "To :" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "AT" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_2 +#: model:product.template,name:l10n_sg_gst.product_id_2_product_template +msgid "Blood Glucose Test Strip" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "CP" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst_analysis_form +msgid "Cancel" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_6 +#: model:product.template,name:l10n_sg_gst.product_id_6_product_template +msgid "Car blackbox" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_res_company +msgid "Companies" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_company_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_company_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_company_id +msgid "Company" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Complete all boxes clearly in ink.\n" +" Please enter a '0' (Zero) if the item is not applicable.\n" +" Exclude GST amount and disregard cents for items 1 to 5." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Complete all boxes clearly in ink. Please enter a '0' (Zero) if the item\n" +" is not applicable. Exclude GST amount and disregard cents for items 1 to 5." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "Comptroller Of Goods and Service\n" +" Tax" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_res_partner +msgid "Contact" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Contact Telephone No." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_create_uid +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_create_uid +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_create_date +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_create_date +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_create_date +msgid "Created on" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Date" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "Declaration Of Errors" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_declaration_of_error +msgid "Declaration of Errors" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Designation:" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_3 +#: model:product.template,name:l10n_sg_gst.product_id_3_product_template +msgid "Diamond Tools" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Did you claim for GST you had refunded to\n" +" tourists?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "Did you claim for GST you had refunded to tourists?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "Did you make any bad debt relief claims?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "Did you make any pre-registration claims?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "Did you make following claims in BOX 7 ?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Difference to be paid to IRAS" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_10 +#: model:product.template,name:l10n_sg_gst.product_id_10_product_template +msgid "Digital Mobile X-Ray System" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_9 +#: model:product.template,name:l10n_sg_gst.product_id_9_product_template +msgid "Digital Wireless System" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst5_report_view_display_name +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst7_report_view_display_name +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst_analysis_view_display_name +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_display_name +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_display_name +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_11 +#: model:product.template,name:l10n_sg_gst.product_id_11_product_template +msgid "Electrical Medical Stimulator" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_5 +#: model:product.template,name:l10n_sg_gst.product_id_5_product_template +msgid "Elevator" +msgstr "" + +#. module: l10n_sg_gst +#: selection:account.tax,tax_group:0 +#: selection:account.tax.template,tax_group:0 +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Exempted" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst_analysis_form +msgid "Filter on Date" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "For Office Use" +msgstr "" + +#. module: l10n_sg_gst +#: code:addons/l10n_sg_gst/report/account_gst5_report.py:110 +#: code:addons/l10n_sg_gst/report/account_gst7_report.py:34 +#: code:addons/l10n_sg_gst/report/account_gst_analysis_report.py:113 +#, python-format +msgid "Form content is missing, this report cannot be printed." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_date_from +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_date_from +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_date_from +msgid "From" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "GST %" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "GST Amount" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.actions.act_window,name:l10n_sg_gst.action_wiz_gst_analysis +#: model:ir.actions.report,name:l10n_sg_gst.action_account_gst_analysis +#: model:ir.model,name:l10n_sg_gst.model_wiz_gst_analysis +#: model:ir.ui.menu,name:l10n_sg_gst.menu_action_wiz_gst_analysis +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst_analysis_form +msgid "GST Analysis" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "GST F5 Summary Report" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "GST F7 Summary Report" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_company_gst_number +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_partner_gst_number +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_users_gst_number +msgid "GST Number" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.menu,name:l10n_sg_gst.menu_account_gst_report +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "GST Report" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.actions.act_window,name:l10n_sg_gst.action_wiz_gst5_report +#: model:ir.actions.report,name:l10n_sg_gst.action_account_gst5_report_id +#: model:ir.model,name:l10n_sg_gst.model_wiz_gst5_report +#: model:ir.ui.menu,name:l10n_sg_gst.menu_action_wiz_gst5_report +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +msgid "GST5 Report" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.actions.act_window,name:l10n_sg_gst.action_wiz_gst7_report +#: model:ir.actions.report,name:l10n_sg_gst.action_account_gst7_report_id +#: model:ir.model,name:l10n_sg_gst.model_wiz_gst7_report +#: model:ir.ui.menu,name:l10n_sg_gst.menu_action_wiz_gst7_report +msgid "GST7 Report" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Gross Amount" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_12 +#: model:product.template,name:l10n_sg_gst.product_id_12_product_template +msgid "Hommage-Marble Stone" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "I declare that the information given above is\n" +" true and complete." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "I declare that the information given above is true and complete." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst5_report_view_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst7_report_view_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst_analysis_view_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_id +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_id +msgid "ID" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "If you\n" +" have changed your postal adddress, please\n" +" update the address printed below." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "If you have changed your postal adddress,\n" +" please update the address printed below." +msgstr "" + +#. module: l10n_sg_gst +#: model:account.account.type,name:l10n_sg_gst.test_data_account_type_income +msgid "Income" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Input tax and refunds claimed" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_company_is_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_partner_is_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_res_users_is_gst +msgid "Is GST Applicable?" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst5_report_view___last_update +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst7_report_view___last_update +#: model:ir.model.fields,field_description:l10n_sg_gst.field_report_l10n_sg_gst_account_gst_analysis_view___last_update +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report___last_update +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report___last_update +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis___last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_write_uid +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_write_uid +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_write_date +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_write_date +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_sg_gst +#: selection:account.tax,tax_group:0 +#: selection:account.tax.template,tax_group:0 +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "MES" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_4 +#: model:product.template,name:l10n_sg_gst.product_id_4_product_template +msgid "Mobile Track Pad" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_7 +#: model:product.template,name:l10n_sg_gst.product_id_7_product_template +msgid "Multi Block" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "NS" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Name Of Declarant:" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Net GST To be claimed for IRAS" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Net GST paid previously for this accounting period" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Net GST to be paid to IRAS" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer1_no +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer2_no +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer3_no +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer1_no +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer2_no +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer3_no +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "No" +msgstr "" + +#. module: l10n_sg_gst +#: code:addons/l10n_sg_gst/wizard/gst7_select_period.py:43 +#, python-format +msgid "Number of characters must on exceed 200" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "OR" +msgstr "" + +#. module: l10n_sg_gst +#: selection:account.tax,tax_group:0 +#: selection:account.tax.template,tax_group:0 +msgid "Out Of Scope" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Output Of Scope" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Output tax due" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "PR" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Particulars" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Period covered by this return :" +msgstr "" + +#. module: l10n_sg_gst +#: constraint:wiz.gst7.report:0 +msgid "Please do not enter any symbol in this field\"." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst_analysis_form +msgid "Print" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Revenue for the accounting period" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Revised Input tax and refunds claimed(exclude disallowed input tax)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Revised output tax due" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Signature" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Standard" +msgstr "" + +#. module: l10n_sg_gst +#: selection:account.tax,tax_group:0 +#: selection:account.tax.template,tax_group:0 +msgid "Standard Rates" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_8 +#: model:product.template,name:l10n_sg_gst.product_id_8_product_template +msgid "SuperMax" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_account_tax +msgid "Tax" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_account_tax_tax_group +#: model:ir.model.fields,field_description:l10n_sg_gst.field_account_tax_template_tax_group +msgid "Tax Group" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.custom_layout_gst +msgid "Tel:1800-3568633" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_account_tax_template +msgid "Templates for Taxes" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "The due date for\n" +" submission is one month after the end\n" +" of the accountig period.\n" +"
\n" +" Penalties will be imposed if you do not\n" +" submit your Return and make payment\n" +"
\n" +" by the due date." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "The due date for submission is one month after the\n" +" end of the accountig period.\n" +"
\n" +" Penalties will be imposed if you do not submit your Return and make payment\n" +"
\n" +" by the due date." +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +msgid "This is compulsory field, Please provide a brief description of the errors made. Please do not enter any symbol in this field or exceed the word limit of 200 characters. If you are consolidating the errors for more than one accounting period(up till one year), Please state so in this box,For example: *The error declared aboved is for the period _______ to ________" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_date_to +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_date_to +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst_analysis_date_to +msgid "To" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total revised value of exempt supplies" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total revised value of standard-rated supplies (excluding GST)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total revised value of taxable purchases (exclude expenses where input tax is\n" +" disallowed)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total revised value of zero-rated supplies" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total value of (1) + (2) + (3)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Total value of exempt supplies" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Total value of goods imported under this scheme" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Total value of standard-rated supplies\n" +" (excluding GST)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Total value of taxable purchases (excluding\n" +" GST)" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +msgid "Total value of zero-rated supplies" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer1_yes +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer2_yes +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst5_report_answer3_yes +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer1_yes +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer2_yes +#: model:ir.model.fields,field_description:l10n_sg_gst.field_wiz_gst7_report_answer3_yes +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "Yes" +msgstr "" + +#. module: l10n_sg_gst +#: selection:account.tax,tax_group:0 +#: selection:account.tax.template,tax_group:0 +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst_analysis_view +msgid "Zeroed" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "_____________________" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst5_report_view +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "____________________________________________________________________________________________________________________________________" +msgstr "" + +#. module: l10n_sg_gst +#: model:product.product,name:l10n_sg_gst.product_id_1 +#: model:product.template,name:l10n_sg_gst.product_id_1_product_template +msgid "medical instruments operating table" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst5_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst7_report_form +#: model:ir.ui.view,arch_db:l10n_sg_gst.wiz_gst_analysis_form +msgid "or" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_report_l10n_sg_gst_account_gst5_report_view +msgid "report.l10n_sg_gst.account_gst5_report_view" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_report_l10n_sg_gst_account_gst7_report_view +msgid "report.l10n_sg_gst.account_gst7_report_view" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.model,name:l10n_sg_gst.model_report_l10n_sg_gst_account_gst_analysis_view +msgid "report.l10n_sg_gst.account_gst_analysis_view" +msgstr "" + +#. module: l10n_sg_gst +#: model:ir.ui.view,arch_db:l10n_sg_gst.account_gst7_report_view +msgid "to" +msgstr "" + diff --git a/addons/l10n_sg_gst/models/__init__.py b/addons/l10n_sg_gst/models/__init__.py new file mode 100644 index 00000000..33fc99c4 --- /dev/null +++ b/addons/l10n_sg_gst/models/__init__.py @@ -0,0 +1,5 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from . import account_tax +from . import res_company diff --git a/addons/l10n_sg_gst/models/account_tax.py b/addons/l10n_sg_gst/models/account_tax.py new file mode 100644 index 00000000..dd868bb1 --- /dev/null +++ b/addons/l10n_sg_gst/models/account_tax.py @@ -0,0 +1,32 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from flectra import models, fields, api + + +class AccountTax(models.Model): + _inherit = 'account.tax' + + tax_group = fields.Selection([('standard_rates', 'Standard Rates'), + ('zeroed', 'Zeroed'), + ('exempted', 'Exempted'), ('MES', 'MES'), + ('out_of_scope', 'Out Of Scope')], + string='Tax Group') + + +class AccountTaxTemplate(models.Model): + _inherit = 'account.tax.template' + + tax_group = fields.Selection([('standard_rates', 'Standard Rates'), + ('zeroed', 'Zeroed'), + ('exempted', 'Exempted'), ('MES', 'MES'), + ('out_of_scope', 'Out Of Scope')], + string='Tax Group') + + @api.multi + def _get_tax_vals(self, company, tax_template_to_tax): + res = super(AccountTaxTemplate, self)._get_tax_vals( + company, tax_template_to_tax) + if self.tax_group: + res.update({'tax_group': self.tax_group}) + return res diff --git a/addons/l10n_sg_gst/models/res_company.py b/addons/l10n_sg_gst/models/res_company.py new file mode 100644 index 00000000..e521fef3 --- /dev/null +++ b/addons/l10n_sg_gst/models/res_company.py @@ -0,0 +1,18 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from flectra import models, fields + + +class ResCompany(models.Model): + _inherit = 'res.company' + + is_gst = fields.Boolean(string='Is GST Applicable?', default=False) + gst_number = fields.Char(string='GST Number', size=256) + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + is_gst = fields.Boolean(string='Is GST Applicable?', default=False) + gst_number = fields.Char(string='GST Number', size=256) diff --git a/addons/l10n_sg_gst/report/__init__.py b/addons/l10n_sg_gst/report/__init__.py new file mode 100644 index 00000000..41c5179c --- /dev/null +++ b/addons/l10n_sg_gst/report/__init__.py @@ -0,0 +1,6 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from . import account_gst5_report +from . import account_gst_analysis_report +from . import account_gst7_report diff --git a/addons/l10n_sg_gst/report/account_gst5_report.py b/addons/l10n_sg_gst/report/account_gst5_report.py new file mode 100644 index 00000000..e6498ce8 --- /dev/null +++ b/addons/l10n_sg_gst/report/account_gst5_report.py @@ -0,0 +1,122 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +import time +from datetime import datetime + +from flectra import api, models, _ +from flectra.exceptions import UserError + +taxes_query = """SELECT l.tax_line_id, \ + COALESCE(SUM(l.debit-l.credit), 0) + FROM account_move as m, account_move_line as l + WHERE (l.move_id=m.id) AND \ + ((((l.date <= '%s') AND \ + ((l.date >= '%s'))) AND \ + (m.state = 'posted')) AND \ + (l.company_id = '%s')) \ + GROUP BY l.tax_line_id \ + """ +gst_taxes_query = """SELECT r.account_tax_id,\ + COALESCE(SUM(l.debit-l.credit), 0) + FROM account_move as m, account_move_line as l\ + INNER JOIN account_move_line_account_tax_rel r ON \ + (l.id = r.account_move_line_id)\ + INNER JOIN account_tax t ON (r.account_tax_id = t.id)\ + WHERE (l.move_id=m.id) AND \ + ((l.date <= '%s') AND \ + ((l.date >= '%s') AND \ + (m.state = 'posted'))\ + ) group by r.account_tax_id""" + +class AccountGst5Report(models.AbstractModel): + _name = 'report.l10n_sg_gst.account_gst5_report_view' + + def get_boolean_data(self, data): + res = {} + if data['form']: + res = { + 'answer1_yes': data['form']['answer1_yes'] and '◉' or '○', + 'answer1_no': data['form']['answer1_no'] and '◉' or '○', + 'answer2_yes': data['form']['answer2_yes'] and '◉' or '○', + 'answer2_no': data['form']['answer2_no'] and '◉' or '○', + 'answer3_yes': data['form']['answer3_yes'] and '◉' or '○', + 'answer3_no': data['form']['answer3_no'] and '◉' or '○', + + } + return res + + def get_tax(self, data, tax_group): + total = 0.0 + flag = 0 + final_domain = [] + date_start = data['date_from'] + date_stop = data['date_to'] + self._cr.execute(taxes_query % (date_stop, date_start, self.env.user.company_id.id)) + taxes_result = self._cr.fetchall() + self._cr.execute(gst_taxes_query % (date_stop, date_start)) + final_sale_domain = [('type_tax_use', '=', 'sale')] + final_purchase_domain = [('type_tax_use', '=', 'purchase')] + gst_taxes_results = self._cr.fetchall() + if tax_group == 'MES': + final_domain = final_purchase_domain + [('tax_group', '=', 'MES')] + elif tax_group == 'purchase': + final_domain = final_purchase_domain + [('tax_group', '!=', 'MES')] + elif tax_group == 'purchase-tax': + flag = 1 + final_domain = final_purchase_domain + if tax_group == 'standard_rates': + final_domain = final_sale_domain + [('tax_group', '=', 'standard_rates')] + elif tax_group == 'zeroed': + final_domain = final_sale_domain + [('tax_group', '=', 'zeroed')] + elif tax_group == 'exempted': + final_domain = final_sale_domain + [('tax_group', '=', 'exempted')] + elif tax_group == 'sales-tax': + flag = 1 + final_domain = final_sale_domain + elif tax_group == 'sales': + final_domain = final_sale_domain + tax_ids = self.env['account.tax'].search(final_domain) + + if flag: + for i in range(len(taxes_result)): + for tax in tax_ids: + if tax.id == taxes_result[i][0]: + total += taxes_result[i][1] + return abs(total) + + for i in range(len(gst_taxes_results)): + for tax in tax_ids: + if tax.id == gst_taxes_results[i][0]: + total += gst_taxes_results[i][1] + return abs(total) + + def get_company(self, data): + res = {} + company_id = self.env['res.company'].browse( + data['form']['company_id'][0]) + if company_id: + res.update({ + 'contact_address': + company_id.partner_id.contact_address or '', + 'name': company_id.name, + 'gst_number': company_id.gst_number}) + return res + + @api.model + def get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get( + 'active_model'): + raise UserError(_( + "Form content is missing, this report cannot be printed.")) + tax_ids = self.env['account.tax'].browse(self.env.context.get('active_ids', [])) + return { + 'doc_ids': docids, + 'doc_model': 'account.tax', + 'docs': tax_ids, + 'data': data, + 'datetime': datetime, + 'get_tax': self.get_tax, + 'get_boolean_data': self.get_boolean_data, + 'get_company': self.get_company, + } diff --git a/addons/l10n_sg_gst/report/account_gst7_report.py b/addons/l10n_sg_gst/report/account_gst7_report.py new file mode 100644 index 00000000..cf1239ae --- /dev/null +++ b/addons/l10n_sg_gst/report/account_gst7_report.py @@ -0,0 +1,49 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +import time +from datetime import datetime +from flectra.addons.l10n_sg_gst.report.account_gst5_report import \ + taxes_query, gst_taxes_query, AccountGst5Report + +from flectra import api, models, _ +from flectra.exceptions import UserError + + +class AccountGst7Report(models.AbstractModel): + _name = 'report.l10n_sg_gst.account_gst7_report_view' + + def get_boolean_data(self, data): + return AccountGst5Report.get_boolean_data(self, data) + + def get_tax(self, data, tax_group): + return AccountGst5Report.get_tax(self, data, tax_group) + # + def get_company(self, data): + res = AccountGst5Report.get_company(self, data) + return res + + @api.constrains('declaration_of_error') + def _get_declaration_of_error(self, data): + return data['form']['declaration_of_error'] + + @api.model + def get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get( + 'active_model'): + raise UserError(_( + "Form content is missing, this report cannot be printed.")) + tax_ids = self.env['account.tax'].browse(self.env.context.get('active_ids', [])) + + return { + 'doc_ids': docids, + 'doc_model': 'account.tax', + 'docs': tax_ids, + 'data': data, + 'time': time, + 'datetime': datetime, + 'get_tax': self.get_tax, + 'get_boolean_data': self.get_boolean_data, + 'get_company': self.get_company, + 'get_declaration_of_error': self._get_declaration_of_error + } diff --git a/addons/l10n_sg_gst/report/account_gst_analysis_report.py b/addons/l10n_sg_gst/report/account_gst_analysis_report.py new file mode 100644 index 00000000..2692b07b --- /dev/null +++ b/addons/l10n_sg_gst/report/account_gst_analysis_report.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +import time + +from flectra import api, models, _ +from flectra.exceptions import UserError +from flectra.addons.l10n_sg_gst.report.account_gst5_report import taxes_query, \ + gst_taxes_query + +class AccountGstAnalysisView(models.AbstractModel): + _name = 'report.l10n_sg_gst.account_gst_analysis_view' + + def compute_group_total(self, tax_browse, gst_taxes_result, group_name): + amount = 0.00 + for i in range(len(gst_taxes_result)): + if tax_browse.id == gst_taxes_result[i][0]: + if tax_browse.tax_group in group_name: + amount += gst_taxes_result[i][1] + return abs(amount) or 0.00 + + def compute_gst_total(self, tax_browse, texes_result, group_name): + tax_amount = 0.00 + for i in range(len(texes_result)): + if tax_browse.id == texes_result[i][0]: + if tax_browse.tax_group in group_name: + tax_amount += texes_result[i][1] + return abs(tax_amount) or 0.00 + + def get_common_data(self, tax_ids, data): + result = [] + gst_perc = standard_total = zeroed_total = exempted_total = mes_total \ + = out_scope_total = gross_amount_total = gst_amount_total = 0.0 + for tax_browse in tax_ids: + date_start = data['form']['date_from'] + date_stop = data['form']['date_to'] + self._cr.execute(taxes_query % ( + date_stop, date_start, self.env.user.company_id.id)) + texes_result = self._cr.fetchall() + self._cr.execute(gst_taxes_query % (date_stop, date_start)) + gst_taxes_result = self._cr.fetchall() + if tax_browse.amount_type == 'fixed': + gst_perc = tax_browse.amount * 100 + elif tax_browse.amount_type == 'percent': + gst_perc = tax_browse.amount + elif tax_browse.amount_type == 'group': + tax = [(6, 0, tax_browse.children_tax_ids)] + gst_perc += tax.amount + else: + gst_perc = tax_browse.amount + + standard = self.compute_group_total(tax_browse, + gst_taxes_result, ['standard_rates']) + standard_total += standard + zeroed = self.compute_group_total(tax_browse, + gst_taxes_result, ['zeroed']) + zeroed_total += zeroed + exempted = self.compute_group_total(tax_browse, + gst_taxes_result, ['exempted']) + exempted_total += exempted + mes = self.compute_group_total(tax_browse, + gst_taxes_result, ['MES']) + mes_total += mes + out_scope = self.compute_group_total(tax_browse, + gst_taxes_result, ['out_of_scope']) + out_scope_total += out_scope + gross_amount = self.compute_group_total(tax_browse, + gst_taxes_result, + ['standard_rates', 'zeroed', 'exempted', 'MES', + 'out_of_scope']) + gross_amount_total += gross_amount + gst_amount = self.compute_gst_total(tax_browse, + texes_result, + ['standard_rates', 'zeroed', 'exempted', 'MES', + 'out_of_scope']) + gst_amount_total += gst_amount + result.append({ + 'tax_name': tax_browse.name, + 'standard': standard, + 'zeroed': zeroed, + 'exempted': exempted, + 'mes': mes, + 'out_scope': out_scope, + 'gross_amount': gross_amount, + 'gst_amount': gst_amount, + 'gst_perc': gst_perc, + }) + total = { + 'standard_total': standard_total, + 'zeroed_total': zeroed_total, + 'exempted_total': exempted_total, + 'mes_total': mes_total, + 'out_scope_total': out_scope_total, + 'gross_amount_total': gross_amount_total, + 'gst_amount_total': gst_amount_total + } + return result, total + + def get_purchase_data(self, data): + tax_ids = self.env['account.tax'].search([('type_tax_use', '=', 'purchase')]) + return self.get_common_data(tax_ids, data) + + + def get_sale_data(self, data): + tax_ids = self.env['account.tax'].search([('type_tax_use', '=', 'sale')]) + return self.get_common_data(tax_ids, data) + + @api.model + def get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get( + 'active_model'): + raise UserError(_( + "Form content is missing, this report cannot be printed.")) + + model = self.env.context.get('active_model') + docs = self.env[model].browse(self.env.context.get('active_ids', [])) + + purchase_data, purchase_total = self.get_purchase_data(data) + sale_data, sale_total = self.get_sale_data(data) + return { + 'doc_ids': docids, + 'doc_model': model, + 'data': data, + 'docs': docs, + 'time': time, + 'get_sale_data': sale_data, + 'get_purchase_data': purchase_data, + 'get_sale_standard_total': sale_total['standard_total'], + 'get_sale_zeroed_total': sale_total['zeroed_total'], + 'get_sale_exempted_total': sale_total['exempted_total'], + 'get_sale_mes_total': sale_total['mes_total'], + 'get_sale_out_scope_total': sale_total['out_scope_total'], + 'get_sale_gross_amount_total': sale_total['gross_amount_total'], + 'get_sale_gst_amount_total': sale_total['gst_amount_total'], + 'get_purchase_standard_total': purchase_total['standard_total'], + 'get_purchase_zeroed_total': purchase_total['zeroed_total'], + 'get_purchase_exempted_total': purchase_total['exempted_total'], + 'get_purchase_mes_total': purchase_total['mes_total'], + 'get_purchase_out_scope_total': purchase_total['out_scope_total'], + 'get_purchase_gross_amount_total': purchase_total[ + 'gross_amount_total'], + 'get_purchase_gst_amount_total': purchase_total[ + 'gst_amount_total'], + } diff --git a/addons/l10n_sg_gst/report/report_gst_menu.xml b/addons/l10n_sg_gst/report/report_gst_menu.xml new file mode 100644 index 00000000..f8ec6af9 --- /dev/null +++ b/addons/l10n_sg_gst/report/report_gst_menu.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_sg_gst/report/report_paperformat.xml b/addons/l10n_sg_gst/report/report_paperformat.xml new file mode 100644 index 00000000..22979c6e --- /dev/null +++ b/addons/l10n_sg_gst/report/report_paperformat.xml @@ -0,0 +1,36 @@ + + + + + GST Report + + custom + 297 + 210 + Portrait + 30 + 20 + 5 + 5 + + 27 + 90 + + + + GST Report + + custom + 297 + 210 + Portrait + 35 + 28 + 7 + 7 + + 35 + 90 + + + diff --git a/addons/l10n_sg_gst/static/description/icon.png b/addons/l10n_sg_gst/static/description/icon.png new file mode 100644 index 00000000..809be7ad Binary files /dev/null and b/addons/l10n_sg_gst/static/description/icon.png differ diff --git a/addons/l10n_sg_gst/tests/__init__.py b/addons/l10n_sg_gst/tests/__init__.py new file mode 100644 index 00000000..76554a09 --- /dev/null +++ b/addons/l10n_sg_gst/tests/__init__.py @@ -0,0 +1,4 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from . import test_gst_summary_report diff --git a/addons/l10n_sg_gst/tests/test_gst_summary_report.py b/addons/l10n_sg_gst/tests/test_gst_summary_report.py new file mode 100644 index 00000000..aac317b9 --- /dev/null +++ b/addons/l10n_sg_gst/tests/test_gst_summary_report.py @@ -0,0 +1,262 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +import time + +from flectra.tests.common import TransactionCase + + +class TestGstF5(TransactionCase): + def setUp(self): + super(TestGstF5, self).setUp() + self.res_partner_model = self.env['res.partner'] + self.product_model = self.env['product.product'] + self.account_tax = self.env['account.tax'] + self.account_invoice_model = self.env['account.invoice'] + self.account_invoice_line_model = self.env['account.invoice.line'] + self.currency_id = self.env.ref('base.SGD') + self.product1 = self.env.ref('product.product_product_3') + self.product2 = self.env.ref('product.product_product_4') + self.product3 = self.env.ref('product.product_product_5b') + self.product4 = self.env.ref('product.product_product_5') + self.product5 = self.env.ref('product.product_product_6') + self.product6 = self.env.ref('product.product_product_7') + self.product7 = self.env.ref('product.product_product_8') + self.product8 = self.env.ref('product.product_product_9') + self.product9 = self.env.ref('product.product_product_10') + + self.gst_customer_id_1 = self.res_partner_model.create(dict( + name="Cyril", + email="cyril_daufeldt@aufeldt.com", + )) + + self.gst_supplier_id_1 = self.res_partner_model.create(dict( + name="Ritz", + email="ritz_daufeldt@yahoo.com", + supplier=True + )) + + self.sale_tax_id_1 = self.account_tax.search( + [('name', '=', 'Sales Tax 7% SR')]) + self.sale_tax_id_1.write({'tax_group': 'standard_rates'}) + + self.sale_tax_id_2 = self.account_tax.search( + [('name', '=', 'Sales Tax 0% ZR')]) + self.sale_tax_id_2.write({'tax_group': 'zeroed'}) + + self.sale_tax_id_3 = self.account_tax.search( + [('name', '=', 'Sales Tax 0% OS')]) + self.sale_tax_id_3.write({'tax_group': 'out_of_scope'}) + + self.sale_tax_id_4 = self.account_tax.search( + [('name', '=', 'Sales Tax 0% ESN33')]) + self.sale_tax_id_4.write({'tax_group': 'exempted'}) + + self.sale_tax_id_5 = self.account_tax.search( + [('name', '=', 'Sales Tax 7% DS')]) + self.sale_tax_id_5.write({'tax_group': 'standard_rates'}) + + self.sale_tax_id_6 = self.account_tax.search( + [('name', '=', 'Sales Tax 0% ES33')]) + self.sale_tax_id_6.write({'tax_group': 'exempted'}) + + self.purchase_tax_id_1 = self.account_tax.search( + [('name', '=', 'Purchase Tax 7% TX-N33')]) + self.purchase_tax_id_1.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_2 = self.account_tax.search( + [('name', '=', 'Purchase Tax 7% BL')]) + self.purchase_tax_id_2.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_3 = self.account_tax.search( + [('name', '=', 'Purchase Tax 7% IM')]) + self.purchase_tax_id_3.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_4 = self.account_tax.search( + [('name', '=', 'Purchase Tax 7% TX-RE')]) + self.purchase_tax_id_4.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_5 = self.account_tax.search( + [('name', '=', 'Purchase Tax 0% ME')]) + self.purchase_tax_id_5.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_6 = self.account_tax.search( + [('name', '=', 'Purchase Tax 0% NR')]) + self.purchase_tax_id_6.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_7 = self.account_tax.search( + [('name', '=', 'Purchase Tax 0% ZP')]) + self.purchase_tax_id_7.write({'tax_group': 'standard_rates'}) + + self.purchase_tax_id_8 = self.account_tax.search( + [('name', '=', 'Purchase Tax 0% OP')]) + self.purchase_tax_id_8.write({'tax_group': 'out_of_scope'}) + + self.purchase_tax_id_9 = self.account_tax.search( + [('name', '=', 'Purchase Tax 0% EP')]) + self.purchase_tax_id_9.write({'tax_group': 'exempted'}) + + self.purchase_tax_id_10 = self.account_tax.search( + [('name', '=', 'Purchase Tax MES')]) + self.purchase_tax_id_10.write({'tax_group': 'MES'}) + + self.purchase_tax_id_11 = self.account_tax.search( + [('name', '=', 'Purchase Tax 7% TX7')]) + self.purchase_tax_id_11.write({'tax_group': 'standard_rates'}) + + def test_create_customer_invoice(self): + customer_invoice = self.account_invoice_model.create( + {'partner_id': self.gst_customer_id_1.id, + 'reference_type': 'none', + 'currency_id': self.currency_id.id, + 'type': 'out_invoice', + 'date_invoice': time.strftime('%Y') + '-07-01', + }) + account_id = self.env['account.account'].search( + [('code', '=', '300004')]) + self.env['account.invoice.line'].create({ + 'product_id': self.product1.id, + 'quantity': 1, + 'invoice_id': customer_invoice.id, + 'name': 'something', + 'price_unit': 2000, + 'account_id': account_id.id, + 'invoice_line_tax_ids': [(6, 0, [self.sale_tax_id_1.id])] + }) + self.env['account.invoice.line'].create({ + 'product_id': self.product2.id, + 'quantity': 2, + 'invoice_id': customer_invoice.id, + 'name': 'something', + 'price_unit': 2000, + 'account_id': account_id.id, + 'invoice_line_tax_ids': [(6, 0, [self.sale_tax_id_2.id])] + }) + self.env['account.invoice.line'].create({ + 'product_id': self.product3.id, + 'quantity': 2, + 'invoice_id': customer_invoice.id, + 'name': 'something', + 'price_unit': 3000, + 'account_id': account_id.id, + 'invoice_line_tax_ids': [(6, 0, [self.sale_tax_id_3.id])] + }) + + customer_invoice._onchange_invoice_line_ids() + + # I check that Initially customer invoice is in the "Draft" state + self.assertEquals(customer_invoice.state, 'draft') + + # I check that there is no move attached to the invoice + self.assertEquals(len(customer_invoice.move_id), 0) + + # I validate invoice by creating on + customer_invoice.action_invoice_open() + + # I check that the invoice state is "Open" + self.assertEquals(customer_invoice.state, 'open') + + # I check that now there is a move attached to the invoice + assert customer_invoice.move_id, "Move not created " \ + "for open invoice" + + def test_create_supplier_invoice(self): + supplier_invoice = self.account_invoice_model.create( + {'partner_id': self.gst_supplier_id_1.id, + 'reference_type': 'none', + 'currency_id': self.currency_id.id, + 'type': 'in_invoice', + 'date_invoice': time.strftime('%Y') + '-07-01', + 'state': 'draft' + }) + default_fields = supplier_invoice.fields_view_get( + view_id=None, + view_type='form', + toolbar=False, submenu=False) + invoice_dic = self.env['account.account'].default_get( + default_fields) + journal_id = \ + self.env['account.journal'].search( + [('type', '=', 'purchase')])[0] + account_id = self.env['account.account'].search( + [('code', '=', '202001')]) + invoice_dic.update({'journal_id': journal_id.id, + 'account_id': account_id.id, + 'type': 'in_invoice'}) + supplier_invoice.update(invoice_dic) + default_fields = self.account_invoice_line_model.fields_view_get( + view_id=None, + view_type='tree', + toolbar=False, submenu=False) + invoice_line_dic = self.account_invoice_line_model.default_get( + default_fields) + account_id = self.env['account.account'].search( + [('code', '=', '401005')]) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_1.id])], + 'product_id': self.product4.id, + 'name': 'Multi Block', + 'price_unit': 4090.0, + 'quantity': 50.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_2.id])], + 'product_id': self.product5.id, + 'name': 'SuperMax', + 'price_unit': 2190.0, + 'quantity': 210.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_3.id])], + 'product_id': self.product6.id, + 'name': 'Digital Wireless System', + 'price_unit': 2000.0, + 'quantity': 32.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_4.id])], + 'product_id': self.product7.id, + 'name': 'Digital Mobile X-Ray System', + 'price_unit': 3002.0, + 'quantity': 45.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_5.id])], + 'product_id': self.product8.id, + 'name': 'Electrical Medical Stimulator', + 'price_unit': 5037.0, + 'quantity': 12.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + invoice_line_dic.update( + {'invoice_line_tax_ids': [(6, 0, [self.purchase_tax_id_6.id])], + 'product_id': self.product9.id, + 'name': 'Hommage-Marble Stone', + 'price_unit': 2300.0, + 'quantity': 25.0, + 'invoice_id': supplier_invoice.id, + 'account_id': account_id.id or False}) + self.account_invoice_line_model.create(invoice_line_dic) + + supplier_invoice._onchange_invoice_line_ids() + + # I check that Initially customer invoice is in the "Draft" state + self.assertEquals(supplier_invoice.state, 'draft') + + # I check that there is no move attached to the invoice + self.assertEquals(len(supplier_invoice.move_id), 0) + + # I validate invoice by creating on + supplier_invoice.action_invoice_open() + + # I check that the invoice state is "Open" + self.assertEquals(supplier_invoice.state, 'open') diff --git a/addons/l10n_sg_gst/views/account_gst5_report_view.xml b/addons/l10n_sg_gst/views/account_gst5_report_view.xml new file mode 100644 index 00000000..284898e0 --- /dev/null +++ b/addons/l10n_sg_gst/views/account_gst5_report_view.xml @@ -0,0 +1,850 @@ + + + + + diff --git a/addons/l10n_sg_gst/views/account_gst7_report_view.xml b/addons/l10n_sg_gst/views/account_gst7_report_view.xml new file mode 100644 index 00000000..25926904 --- /dev/null +++ b/addons/l10n_sg_gst/views/account_gst7_report_view.xml @@ -0,0 +1,847 @@ + + + + + diff --git a/addons/l10n_sg_gst/views/account_gst_analysis_view.xml b/addons/l10n_sg_gst/views/account_gst_analysis_view.xml new file mode 100644 index 00000000..61405459 --- /dev/null +++ b/addons/l10n_sg_gst/views/account_gst_analysis_view.xml @@ -0,0 +1,214 @@ + + + + + + diff --git a/addons/l10n_sg_gst/views/account_tax_view.xml b/addons/l10n_sg_gst/views/account_tax_view.xml new file mode 100644 index 00000000..41c0ea08 --- /dev/null +++ b/addons/l10n_sg_gst/views/account_tax_view.xml @@ -0,0 +1,15 @@ + + + + + account.tax.inherit.form + account.tax + + + + + + + + + diff --git a/addons/l10n_sg_gst/views/layouts_gst.xml b/addons/l10n_sg_gst/views/layouts_gst.xml new file mode 100644 index 00000000..899fdbdb --- /dev/null +++ b/addons/l10n_sg_gst/views/layouts_gst.xml @@ -0,0 +1,91 @@ + + + + + + + diff --git a/addons/l10n_sg_gst/views/res_company_view.xml b/addons/l10n_sg_gst/views/res_company_view.xml new file mode 100644 index 00000000..2716fa3c --- /dev/null +++ b/addons/l10n_sg_gst/views/res_company_view.xml @@ -0,0 +1,30 @@ + + + + + + res.company.form + res.company + + + + + + + + + + + + res.partner.form + res.partner + + + + + + + + + + diff --git a/addons/l10n_sg_gst/wizard/__init__.py b/addons/l10n_sg_gst/wizard/__init__.py new file mode 100644 index 00000000..eb966874 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/__init__.py @@ -0,0 +1,6 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + +from . import gst5_select_period +from . import gst7_select_period +from . import gst_analysis diff --git a/addons/l10n_sg_gst/wizard/gst5_select_period.py b/addons/l10n_sg_gst/wizard/gst5_select_period.py new file mode 100644 index 00000000..d7773e0c --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst5_select_period.py @@ -0,0 +1,37 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + + +from flectra import models, fields, api + + +class WizGst5Report(models.TransientModel): + _name = 'wiz.gst5.report' + _description = 'GST5 Report' + + company_id = fields.Many2one('res.company', string='Company', + required=True, + default=lambda self: self.env.user.company_id) + date_from = fields.Date(string="From", required=True) + date_to = fields.Date(string="To", required=True) + answer1_yes = fields.Boolean(string='Yes', default=False) + answer1_no = fields.Boolean(string='No', default=True) + answer2_yes = fields.Boolean(string='Yes', default=False) + answer2_no = fields.Boolean(string='No', default=True) + answer3_yes = fields.Boolean(string='Yes', default=False) + answer3_no = fields.Boolean(string='No', default=True) + + @api.multi + def print_report(self): + self.ensure_one() + [data] = self.read() + data['taxes'] = self.env.context.get('active_ids', []) + account_taxes = self.env['account.tax'].browse(data['taxes']) + data.update({'declaration_of_error': ''}) + datas = { + 'ids': [], + 'model': 'account.tax', + 'form': data + } + return self.env.ref('l10n_sg_gst.action_account_gst5_report_id').\ + report_action(account_taxes, data=datas) diff --git a/addons/l10n_sg_gst/wizard/gst5_select_period_view.xml b/addons/l10n_sg_gst/wizard/gst5_select_period_view.xml new file mode 100644 index 00000000..4dee9328 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst5_select_period_view.xml @@ -0,0 +1,73 @@ + + + + + wiz.gst5.report.form + wiz.gst5.report + form + +
+ + + + + + + + + + + + + + +
+ +
+
+
+
+ + + GST5 Report + wiz.gst5.report + ir.actions.act_window + form + form + + new + + + + + + +
diff --git a/addons/l10n_sg_gst/wizard/gst7_select_period.py b/addons/l10n_sg_gst/wizard/gst7_select_period.py new file mode 100644 index 00000000..2635c4a1 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst7_select_period.py @@ -0,0 +1,65 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + + +import re + +from flectra import models, fields, api, _ +from flectra.exceptions import ValidationError + + +class WizGst7Report(models.TransientModel): + _name = 'wiz.gst7.report' + _description = 'GST7 Report' + + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id) + date_from = fields.Date(string="From", required=True) + date_to = fields.Date(string="To", required=True) + answer1_yes = fields.Boolean(string='Yes', default=False) + answer1_no = fields.Boolean(string='No', default=True) + answer2_yes = fields.Boolean(string='Yes', default=False) + answer2_no = fields.Boolean(string='No', default=True) + answer3_yes = fields.Boolean(string='Yes', default=False) + answer3_no = fields.Boolean(string='No', default=True) + declaration_of_error = fields.Text(string="Declaration of Errors", + size=200) + + @api.constrains('declaration_of_error') + def check_declaration_of_error(self): + if len(self.declaration_of_error) > 200: + raise ValidationError( + 'Number of characters must on exceed 200') + + def _check_value(self): + pattern = "^[a-z A-Z]*$" + for data in self: + if re.match(pattern, data.declaration_of_error): + return True + else: + return False + if len(self.declaration_of_error) > 200: + raise ValidationError(_( + 'Number of characters must on exceed 200')) + return {} + + _constraints = [ + (_check_value, 'Please do not enter any symbol in this field".', + ['declaration_of_error']), + ] + + @api.multi + def print_report(self): + self.ensure_one() + [data] = self.read() + data['taxes'] = self.env.context.get('active_ids', []) + account_taxes = self.env['account.tax'].browse(data['taxes']) + datas = { + 'ids': [], + 'model': 'account.tax', + 'form': data + } + return self.env.ref( + 'l10n_sg_gst.action_account_gst7_report_id').report_action( + account_taxes, data=datas) diff --git a/addons/l10n_sg_gst/wizard/gst7_select_period_view.xml b/addons/l10n_sg_gst/wizard/gst7_select_period_view.xml new file mode 100644 index 00000000..e15677f8 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst7_select_period_view.xml @@ -0,0 +1,71 @@ + + + + + wiz.gst7.report.form + wiz.gst7.report + form + +
+ + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + GST7 Report + wiz.gst7.report + ir.actions.act_window + form + form + + new + + + + +
diff --git a/addons/l10n_sg_gst/wizard/gst_analysis.py b/addons/l10n_sg_gst/wizard/gst_analysis.py new file mode 100644 index 00000000..5cf06286 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst_analysis.py @@ -0,0 +1,27 @@ +# Part of Flectra. See LICENSE file for full copyright and licensing +# details. + + +from flectra import models, fields, api + + +class WizGstAnalysis(models.TransientModel): + _name = 'wiz.gst.analysis' + _description = 'GST Analysis' + + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id) + date_from = fields.Date(string="From", required=True) + date_to = fields.Date(string="To", required=True) + + @api.multi + def print_report(self): + datas = {'ids': self.env.context.get('active_ids', [])} + res = self.read( + ['company_id', 'date_from', 'date_to']) + res = res and res[0] or {} + datas['form'] = res + return self.env.ref( + 'l10n_sg_gst.action_account_gst_analysis').report_action([], + data=datas) diff --git a/addons/l10n_sg_gst/wizard/gst_analysis_view.xml b/addons/l10n_sg_gst/wizard/gst_analysis_view.xml new file mode 100644 index 00000000..724fbcb9 --- /dev/null +++ b/addons/l10n_sg_gst/wizard/gst_analysis_view.xml @@ -0,0 +1,46 @@ + + + + + wiz.gst.analysis.form + wiz.gst.analysis + form + +
+ + + + + + + + +
+ +
+
+
+
+ + + GST Analysis + wiz.gst.analysis + ir.actions.act_window + form + form + + new + + + + +