From 1ca3b3df3421961caec3b747a364071c80f5c7da Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 17:14:58 +0700 Subject: initial commit --- vit_efaktur/__init__.py | 2 + vit_efaktur/__manifest__.py | 85 ++++++ vit_efaktur/__openerp__.py | 68 +++++ vit_efaktur/data/context_menu.xml | 22 ++ vit_efaktur/data/cron.xml | 19 ++ vit_efaktur/data/ir_sequence.xml | 147 +++++++++ vit_efaktur/data/parameters.xml | 24 ++ vit_efaktur/model/__init__.py | 4 + vit_efaktur/model/efaktur.py | 22 ++ vit_efaktur/model/invoice.py | 50 +++ vit_efaktur/model/partner.py | 53 ++++ vit_efaktur/model/product.py | 9 + vit_efaktur/report/invoice.xml | 20 ++ vit_efaktur/security/ir.model.access.csv | 9 + vit_efaktur/static/description/icon.png | Bin 0 -> 11996 bytes vit_efaktur/static/description/images/auto.png | Bin 0 -> 164062 bytes vit_efaktur/static/description/images/efaktur.png | Bin 0 -> 11996 bytes .../static/description/images/export-barang.png | Bin 0 -> 101229 bytes .../static/description/images/export-fpk.png | Bin 0 -> 95315 bytes .../static/description/images/export-partner.png | Bin 0 -> 131684 bytes .../static/description/images/input-nsfp.png | Bin 0 -> 36016 bytes vit_efaktur/static/description/images/intro.png | Bin 0 -> 108800 bytes .../static/description/images/main_screenshot.jpg | Bin 0 -> 22422 bytes .../static/description/images/main_screenshot.png | Bin 0 -> 171441 bytes vit_efaktur/static/description/index.html | 137 +++++++++ vit_efaktur/static/fpk.csv | 163 ++++++++++ vit_efaktur/static/fpm.csv | 2 + vit_efaktur/static/partner.csv | 0 vit_efaktur/static/pk.csv | 6 + vit_efaktur/static/product.csv | 0 vit_efaktur/static/src/img/export.png | Bin 0 -> 1758 bytes vit_efaktur/static/src/img/icontax.png | Bin 0 -> 15586 bytes vit_efaktur/static/src/img/newtaxicon.jpg | Bin 0 -> 34442 bytes vit_efaktur/view/efaktur.xml | 160 ++++++++++ vit_efaktur/view/invoice.xml | 45 +++ vit_efaktur/view/invoice_supplier.xml | 45 +++ vit_efaktur/view/partner.xml | 42 +++ vit_efaktur/view/product.xml | 29 ++ vit_efaktur/wizard/__init__.py | 7 + vit_efaktur/wizard/assign.py | 35 +++ vit_efaktur/wizard/assign.xml | 31 ++ vit_efaktur/wizard/auto.py | 52 ++++ vit_efaktur/wizard/auto.xml | 42 +++ vit_efaktur/wizard/generate.py | 28 ++ vit_efaktur/wizard/generate.xml | 36 +++ vit_efaktur/wizard/partner.py | 96 ++++++ vit_efaktur/wizard/partner.xml | 54 ++++ vit_efaktur/wizard/pk.py | 340 +++++++++++++++++++++ vit_efaktur/wizard/pk.xml | 58 ++++ vit_efaktur/wizard/pm.py | 115 +++++++ vit_efaktur/wizard/pm.xml | 51 ++++ vit_efaktur/wizard/product.py | 72 +++++ vit_efaktur/wizard/product.xml | 56 ++++ 53 files changed, 2236 insertions(+) create mode 100644 vit_efaktur/__init__.py create mode 100644 vit_efaktur/__manifest__.py create mode 100644 vit_efaktur/__openerp__.py create mode 100644 vit_efaktur/data/context_menu.xml create mode 100644 vit_efaktur/data/cron.xml create mode 100644 vit_efaktur/data/ir_sequence.xml create mode 100644 vit_efaktur/data/parameters.xml create mode 100644 vit_efaktur/model/__init__.py create mode 100644 vit_efaktur/model/efaktur.py create mode 100644 vit_efaktur/model/invoice.py create mode 100644 vit_efaktur/model/partner.py create mode 100644 vit_efaktur/model/product.py create mode 100644 vit_efaktur/report/invoice.xml create mode 100644 vit_efaktur/security/ir.model.access.csv create mode 100644 vit_efaktur/static/description/icon.png create mode 100644 vit_efaktur/static/description/images/auto.png create mode 100644 vit_efaktur/static/description/images/efaktur.png create mode 100644 vit_efaktur/static/description/images/export-barang.png create mode 100644 vit_efaktur/static/description/images/export-fpk.png create mode 100644 vit_efaktur/static/description/images/export-partner.png create mode 100644 vit_efaktur/static/description/images/input-nsfp.png create mode 100644 vit_efaktur/static/description/images/intro.png create mode 100644 vit_efaktur/static/description/images/main_screenshot.jpg create mode 100644 vit_efaktur/static/description/images/main_screenshot.png create mode 100644 vit_efaktur/static/description/index.html create mode 100644 vit_efaktur/static/fpk.csv create mode 100644 vit_efaktur/static/fpm.csv create mode 100644 vit_efaktur/static/partner.csv create mode 100644 vit_efaktur/static/pk.csv create mode 100644 vit_efaktur/static/product.csv create mode 100644 vit_efaktur/static/src/img/export.png create mode 100644 vit_efaktur/static/src/img/icontax.png create mode 100644 vit_efaktur/static/src/img/newtaxicon.jpg create mode 100644 vit_efaktur/view/efaktur.xml create mode 100644 vit_efaktur/view/invoice.xml create mode 100644 vit_efaktur/view/invoice_supplier.xml create mode 100644 vit_efaktur/view/partner.xml create mode 100644 vit_efaktur/view/product.xml create mode 100644 vit_efaktur/wizard/__init__.py create mode 100644 vit_efaktur/wizard/assign.py create mode 100644 vit_efaktur/wizard/assign.xml create mode 100644 vit_efaktur/wizard/auto.py create mode 100644 vit_efaktur/wizard/auto.xml create mode 100644 vit_efaktur/wizard/generate.py create mode 100644 vit_efaktur/wizard/generate.xml create mode 100644 vit_efaktur/wizard/partner.py create mode 100644 vit_efaktur/wizard/partner.xml create mode 100644 vit_efaktur/wizard/pk.py create mode 100644 vit_efaktur/wizard/pk.xml create mode 100644 vit_efaktur/wizard/pm.py create mode 100644 vit_efaktur/wizard/pm.xml create mode 100644 vit_efaktur/wizard/product.py create mode 100644 vit_efaktur/wizard/product.xml (limited to 'vit_efaktur') diff --git a/vit_efaktur/__init__.py b/vit_efaktur/__init__.py new file mode 100644 index 0000000..3143231 --- /dev/null +++ b/vit_efaktur/__init__.py @@ -0,0 +1,2 @@ +from . import model +from . import wizard \ No newline at end of file diff --git a/vit_efaktur/__manifest__.py b/vit_efaktur/__manifest__.py new file mode 100644 index 0000000..c10eaa9 --- /dev/null +++ b/vit_efaktur/__manifest__.py @@ -0,0 +1,85 @@ +{ + "name": "E-Faktur Management for Indonesia Tax", + "version": "1.11", + "depends": [ + "account", + "stock", + "vit_kelurahan", + ], + 'images': ['static/description/images/main_screenshot.png'], + "author": "vitraining.com", + "website": "www.vitraining.com", + 'category': 'Accounting', + 'price':'30', + 'currency': 'USD', + "category": "Accounting", + "summary": "Manage, Export and Import, Tag Invoice with E-Faktur, the online tax management system for Indonesian companies", + "description": """\ + + +Version 1.11 +* bug fixed Export Product CSV +* bug fixed Export Partner CSV +* bug fixed Export FP. Masukan CSV + +Version 1.10 +* bug fixed invoice_date +* bug fixed on download CSV + + +Version 1.9 +* menu position +* bug fixes invoice view + +Version 1.8 +* inv.invoice_date.month + +Version 1.7 +* Bugs fix on combined efaktur total DPP, referene invoice +* Save file to binary field, not file on static folder + +Version 1.6 +* Bugs fix on combined efaktur total DPP + +Version 1.5 +* Bugs fix on combined efaktur + +Version 1.4 +* Multi invoice single efaktur + +Version 1.3 +* Encode utf8 + +Version 1.2 +* Kawasan berikat + +Version 1.0 +* Pengelolaan eFaktur Pajak Indonesia +* created menu: +* created object +* created views +* logic: + +""", + "data": [ + "security/ir.model.access.csv", + "wizard/generate.xml", + "wizard/product.xml", + "wizard/partner.xml", + "wizard/pk.xml", + "wizard/auto.xml", + "wizard/pm.xml", + "wizard/assign.xml", + "view/product.xml", + "view/efaktur.xml", + "view/partner.xml", + "view/invoice.xml", + "view/invoice_supplier.xml", + "report/invoice.xml", + + + ], + "application": True, + "installable": True, + "auto_install": False, +} \ No newline at end of file diff --git a/vit_efaktur/__openerp__.py b/vit_efaktur/__openerp__.py new file mode 100644 index 0000000..6b5c81f --- /dev/null +++ b/vit_efaktur/__openerp__.py @@ -0,0 +1,68 @@ +{ + "name": "E-Faktur Management for Indonesia Tax", + "version": "1.7", + "depends": [ + "account", + "stock", + "vit_kelurahan", + ], + 'images': ['static/description/images/main_screenshot.png'], + "author": "vitraining.com", + "website": "www.vitraining.com", + 'category': 'Accounting', + 'price':'30', + 'currency': 'USD', + "category": "Accounting", + "summary": "Manage, Export and Import, Tag Invoice with E-Faktur, the online tax management system for Indonesian companies", + "description": """\ + +Version 1.7 +* Bugs fix on combined efaktur total DPP, referene invoice +* Save file to binary field, not file on static folder + +Version 1.6 +* Bugs fix on combined efaktur total DPP + +Version 1.5 +* Bugs fix on combined efaktur + +Version 1.4 +* Multi invoice single efaktur + +Version 1.3 +* Encode utf8 + +Version 1.2 +* Kawasan berikat + +Version 1.0 +* Pengelolaan eFaktur Pajak Indonesia +* created menu: +* created object +* created views +* logic: + +""", + "data": [ + "security/ir.model.access.csv", + "wizard/generate.xml", + "wizard/product.xml", + "wizard/partner.xml", + "wizard/pk.xml", + "wizard/auto.xml", + "wizard/pm.xml", + "wizard/assign.xml", + + "view/product.xml", + "view/efaktur.xml", + "view/partner.xml", + "view/invoice.xml", + "view/invoice_supplier.xml", + "report/invoice.xml", + + + ], + "application": True, + "installable": True, + "auto_install": False, +} \ No newline at end of file diff --git a/vit_efaktur/data/context_menu.xml b/vit_efaktur/data/context_menu.xml new file mode 100644 index 0000000..1769d04 --- /dev/null +++ b/vit_efaktur/data/context_menu.xml @@ -0,0 +1,22 @@ + + + + + + + Assign E-Faktur + True + + code + action = pool.get('account.move').action_assign_efaktur(cr, uid, context) + + + + + + + + + + + diff --git a/vit_efaktur/data/cron.xml b/vit_efaktur/data/cron.xml new file mode 100644 index 0000000..443ba22 --- /dev/null +++ b/vit_efaktur/data/cron.xml @@ -0,0 +1,19 @@ + + + + + + Read ca_pembayaran tabel from MySQL SPC and create payment voucher for the related invoice + True + + 50 + minutes + -1 + + + + + + + + \ No newline at end of file diff --git a/vit_efaktur/data/ir_sequence.xml b/vit_efaktur/data/ir_sequence.xml new file mode 100644 index 0000000..1149ae4 --- /dev/null +++ b/vit_efaktur/data/ir_sequence.xml @@ -0,0 +1,147 @@ + + + + + + Surat UP Type + anggaran.sup + + + + Surat UP + anggaran.sup + UP/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Surat SPP Type + anggaran.spp + + + + Surat SPP + anggaran.spp + SPP/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Surat SPM Type + anggaran.spm + + + + Surat SPM + anggaran.spm + SPM/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Surat SPTB Type + anggaran.sptb + + + + Surat SPTB + anggaran.sptb + SPTB/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Bukti Kas Masuk Type + anggaran.kas.in + + + + Bukti Kas Masuk + anggaran.kas.in + KM/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + Bukti Kas Keluar Type + anggaran.kas.out + + + + Bukti Kas Keluar + anggaran.kas.out + KK/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Biaya Type + anggaran.biaya + + + + Biaya + anggaran.biaya + BI/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Cashflow Type + anggaran.cashflow + + + + Cashflow + anggaran.cashflow + CF/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + + + Investasi Type + anggaran.investasi + + + + Investasi + anggaran.investasi + INV/%(year)s/%(month)s/ + 3 + 1 + 1 + standard + + + \ No newline at end of file diff --git a/vit_efaktur/data/parameters.xml b/vit_efaktur/data/parameters.xml new file mode 100644 index 0000000..8807305 --- /dev/null +++ b/vit_efaktur/data/parameters.xml @@ -0,0 +1,24 @@ + + + + + + spc.hostname + 127.0.0.1 + + + spc.dbname + spc + + + + spc.username + root + + + + spc.password + 1234 + + + diff --git a/vit_efaktur/model/__init__.py b/vit_efaktur/model/__init__.py new file mode 100644 index 0000000..c20b76c --- /dev/null +++ b/vit_efaktur/model/__init__.py @@ -0,0 +1,4 @@ +from . import efaktur +from . import product +from . import invoice +from . import partner diff --git a/vit_efaktur/model/efaktur.py b/vit_efaktur/model/efaktur.py new file mode 100644 index 0000000..64cf430 --- /dev/null +++ b/vit_efaktur/model/efaktur.py @@ -0,0 +1,22 @@ +from odoo import api, fields, models, _ + +class efaktur(models.Model): + _name = 'vit.efaktur' + + name = fields.Char("eFaktur Number", required=True) + year = fields.Integer(string="Year", required=True, ) + + invoice_ids = fields.One2many(comodel_name="account.move", + inverse_name="efaktur_id", + string="Invoices", required=False, ) + + @api.depends('invoice_ids') + def _used(self): + for efaktur in self: + if efaktur.invoice_ids: + efaktur.is_used = True + else: + efaktur.is_used = False + + + is_used = fields.Boolean(string="Is Used", compute="_used", store=True) diff --git a/vit_efaktur/model/invoice.py b/vit_efaktur/model/invoice.py new file mode 100644 index 0000000..0c17058 --- /dev/null +++ b/vit_efaktur/model/invoice.py @@ -0,0 +1,50 @@ +from odoo import api, fields, models, _ + +class AccountMove(models.Model): + _name = 'account.move' + _inherit = 'account.move' + + efaktur_id = fields.Many2one(comodel_name="vit.efaktur", string="Faktur Pajak", required=False, ) + is_efaktur_exported = fields.Boolean(string="Is eFaktur Exported", ) + date_efaktur_exported = fields.Datetime(string="eFaktur Exported Date", required=False, ) + + # masa_pajak = fields.Char(string="Masa Pajak", required=False, compute="_masa_pajak" ) + # tahun_pajak = fields.Char(string="Tahun Pajak", required=False, compute="_tahun_pajak") + + masa_pajak = fields.Char(string="Masa Pajak", required=False) + tahun_pajak = fields.Char(string="Tahun Pajak", required=False) + + efaktur_masukan = fields.Char(string="Nomor Seri Faktur Pajak", required=False, ) + is_berikat = fields.Boolean(string="Kawasan Berikat?", related="partner_id.is_berikat" ) + prefix_berikat = fields.Char(string="Prefix NSFP", compute="_get_prefix_berikat" ) + + @api.depends("is_berikat") + def _get_prefix_berikat(self): + for rec in self: + if rec.is_berikat: + rec.prefix_berikat = '070' + else: + rec.prefix_berikat = '' + + # @api.depends("invoice_date") + # def _masa_pajak(self): + # for inv in self: + # if inv.invoice_date: + # d = inv.invoice_date.month + # # d = inv.invoice_date.split("-") + # inv.masa_pajak = str(d) + + # @api.depends("invoice_date") + # def _tahun_pajak(self): + # for inv in self: + # if inv.invoice_date: + # d = inv.invoice_date.year + # # d = inv.invoice_date.split("-") + # inv.tahun_pajak = str(d) + + # @api.multi + def action_invoice_open(self): + res = super(invoice, self).action_invoice_open() + if self: + self.is_efaktur_exported=False + return res diff --git a/vit_efaktur/model/partner.py b/vit_efaktur/model/partner.py new file mode 100644 index 0000000..fec0729 --- /dev/null +++ b/vit_efaktur/model/partner.py @@ -0,0 +1,53 @@ +from odoo import api, fields, models, _ + +class partner(models.Model): + _name = 'res.partner' + _inherit = 'res.partner' + + is_efaktur_exported = fields.Boolean(string="Is eFaktur Exported", ) + date_efaktur_exported = fields.Datetime(string="eFaktur Exported Date", required=False, ) + + npwp = fields.Char(string="NPWP", required=False) + blok = fields.Char(string="Blok", required=False) + nomor = fields.Char(string="Nomor", required=False) + rt = fields.Char(string="RT", required=False) + rw = fields.Char(string="RW", required=False) + + nama_wajib_pajak = fields.Char(string="Nama Wajib Pajak") + is_berikat = fields.Boolean(string="Kawasan Berikat?", ) + + + @api.depends("street","street2","city","state_id", "country_id","blok","nomor","rt","rw","kelurahan_id","kecamatan_id") + def _alamat_lengkap(self): + for partner in self: + lengkap = partner.street or "" + lengkap += " " + (partner.street2 or '') + + if partner.blok: + lengkap += " Blok: " + partner.blok + ", " + if partner.nomor: + lengkap += " Nomor: " + partner.nomor + ", " + + if partner.rt: + lengkap += " RT: " + partner.rt + if partner.rw: + lengkap += " RW: " + partner.rw + + if partner.kelurahan_id: + lengkap += " Kel: " + partner.kelurahan_id.name + "," + + if partner.kecamatan_id: + lengkap += " Kec: " + partner.kecamatan_id.name + + if partner.kota_id: + lengkap += """ + """ + partner.kota_id.name + "," + + if partner.state_id: + lengkap += " " + partner.state_id.name + + partner.alamat_lengkap = lengkap.upper() + + alamat_lengkap = fields.Char(string="Alamat Lengkap", required=False, compute="_alamat_lengkap") + alamat_lengkap_text = fields.Text(string="Alamat Lengkap", required=False) + diff --git a/vit_efaktur/model/product.py b/vit_efaktur/model/product.py new file mode 100644 index 0000000..5413b09 --- /dev/null +++ b/vit_efaktur/model/product.py @@ -0,0 +1,9 @@ +from odoo import api, fields, models, _ + +class product(models.Model): + _name = 'product.template' + _inherit = 'product.template' + + is_efaktur_exported = fields.Boolean(string="Is eFaktur Exported", ) + date_efaktur_exported = fields.Datetime(string="eFaktur Exported Date", required=False, ) + diff --git a/vit_efaktur/report/invoice.xml b/vit_efaktur/report/invoice.xml new file mode 100644 index 0000000..963e414 --- /dev/null +++ b/vit_efaktur/report/invoice.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/vit_efaktur/security/ir.model.access.csv b/vit_efaktur/security/ir.model.access.csv new file mode 100644 index 0000000..88a3fb0 --- /dev/null +++ b/vit_efaktur/security/ir.model.access.csv @@ -0,0 +1,9 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +access_vit_efaktur,access_vit_efaktur,model_vit_efaktur,,1,0,0,0 +access_vit_efaktur_admin,access_vit_efaktur_admin,model_vit_efaktur,account.group_account_manager,1,1,1,1 +access_vit_assign_wizard_accounting,access_vit_assign_wizard_accounting,model_vit_assign_wizard,account.group_account_manager,1,1,1,1 +access_vit_efaktur_auto_accounting,access_vit_efaktur_auto_accounting,model_vit_efaktur_auto,account.group_account_manager,1,1,1,1 +access_vit_generate_efaktur_accounting,access_vit_generate_efaktur_accounting,model_vit_generate_efaktur,account.group_account_manager,1,1,1,1 +access_vit_efaktur_pk_accounting,access_vit_efaktur_pk_accounting,model_vit_efaktur_pk,account.group_account_manager,1,1,1,1 +access_vit_efaktur_pm_accounting,access_vit_efaktur_pm_accounting,model_vit_efaktur_pm,account.group_account_manager,1,1,1,1 +access_vit_efaktur_product_accounting,access_vit_efaktur_product_accounting,model_vit_efaktur_product,account.group_account_manager,1,1,1,1 diff --git a/vit_efaktur/static/description/icon.png b/vit_efaktur/static/description/icon.png new file mode 100644 index 0000000..45d065b Binary files /dev/null and b/vit_efaktur/static/description/icon.png differ diff --git a/vit_efaktur/static/description/images/auto.png b/vit_efaktur/static/description/images/auto.png new file mode 100644 index 0000000..ed51063 Binary files /dev/null and b/vit_efaktur/static/description/images/auto.png differ diff --git a/vit_efaktur/static/description/images/efaktur.png b/vit_efaktur/static/description/images/efaktur.png new file mode 100644 index 0000000..45d065b Binary files /dev/null and b/vit_efaktur/static/description/images/efaktur.png differ diff --git a/vit_efaktur/static/description/images/export-barang.png b/vit_efaktur/static/description/images/export-barang.png new file mode 100644 index 0000000..6c3f5cc Binary files /dev/null and b/vit_efaktur/static/description/images/export-barang.png differ diff --git a/vit_efaktur/static/description/images/export-fpk.png b/vit_efaktur/static/description/images/export-fpk.png new file mode 100644 index 0000000..0bcd12a Binary files /dev/null and b/vit_efaktur/static/description/images/export-fpk.png differ diff --git a/vit_efaktur/static/description/images/export-partner.png b/vit_efaktur/static/description/images/export-partner.png new file mode 100644 index 0000000..801ec0e Binary files /dev/null and b/vit_efaktur/static/description/images/export-partner.png differ diff --git a/vit_efaktur/static/description/images/input-nsfp.png b/vit_efaktur/static/description/images/input-nsfp.png new file mode 100644 index 0000000..c2a745d Binary files /dev/null and b/vit_efaktur/static/description/images/input-nsfp.png differ diff --git a/vit_efaktur/static/description/images/intro.png b/vit_efaktur/static/description/images/intro.png new file mode 100644 index 0000000..7162992 Binary files /dev/null and b/vit_efaktur/static/description/images/intro.png differ diff --git a/vit_efaktur/static/description/images/main_screenshot.jpg b/vit_efaktur/static/description/images/main_screenshot.jpg new file mode 100644 index 0000000..c98d5f3 Binary files /dev/null and b/vit_efaktur/static/description/images/main_screenshot.jpg differ diff --git a/vit_efaktur/static/description/images/main_screenshot.png b/vit_efaktur/static/description/images/main_screenshot.png new file mode 100644 index 0000000..a0677c7 Binary files /dev/null and b/vit_efaktur/static/description/images/main_screenshot.png differ diff --git a/vit_efaktur/static/description/index.html b/vit_efaktur/static/description/index.html new file mode 100644 index 0000000..6ce1b3e --- /dev/null +++ b/vit_efaktur/static/description/index.html @@ -0,0 +1,137 @@ + +
+
+

Introduction

+ +

+ Module ini gunanya untuk mengeset Invoice dengan Nomor Seri Faktur Pajak + untuk keperluan Export ke Aplikasi E-Faktur DJP + sehingga tidak perlu input ulang untuk mengeluarkan E-Faktur. +

+ +
+ + + +
+ +
+

+ Addons ini bisa anda peroleh secara gratis jika mengikuti Training Odoo + di vitraining.com + maupun di Google Play. +

+
+
+
+ +
+
+

Input Nomor Seri Faktur Pajak

+ + +
+

+ Langkah pertama dalam menggunakan addons E-Faktur adalah memasukkan data Nomor Seri Faktur Pajak yang sudah kita dapatkan dari Kantor Pajak terdekat + dan yang selama ini digunakan untuk menerbitkan Faktur Pajak di aplikasi E-Faktur. +

+
+
+ +
+
+
+ +
+
+

Export Barang/Jasa

+ +
+

+ Sebelum bisa meng-export data faktur pajak, kita perlu export dulu data master barang yang diperlukan pada aplikasi E-Faktur. +

+

+ Addons E-Faktur sudah menyediakan fasilitas export data produk ke file CSV yang formatnya sudah sesuai dengan yang diminta aplikasi E-Faktur. +

+
+
+ +
+ +
+ +
+ +
+
+

Export Lawan Transaksi

+
+

+ Berikutnya, sebelum bisa meng-export data faktur pajak, kita perlu export dulu data master + Partner yang diperlukan pada aplikasi E-Faktur. +

+

+ Addons E-Faktur sudah menyediakan fasilitas export data partner ke file CSV yang + formatnya sudah sesuai dengan yang diminta aplikasi E-Faktur. +

+
+
+ +
+ + +
+
+ +
+
+

Export Faktur Pajak Keluaran

+
+

+ Setelah semua invoice di-link dengan Nomor Seri Faktur Pajak, maka dapat diexport + untuk diimport ke Aplikasi E-Faktur sebagai Faktur Pajak Keluaran. +

+
+
+ +
+ +
+
+ +
+
+

Auto Numbering

+
+

+ Untuk perusahaan yang invoice-nya udah mencapai ratusan atau bahkan ribuan per hari, + adalah tidak mungkin lagi mengeset nomor faktur untuk setiap invoice satu per satu. +

+

+ Oleh karena itu, perlu dibuatkan fasilitas tersendiri untuk bisa secara otomatis mengeset invoice dengan nomor faktur. +

+
+
+ +
+ + +
+
+ +
+
+ +

Contact and Support

+

+ Contact Us: info[at]vitraining.com
+ Facebook : www.facebook.com/trainingOdoo
+ YouTube: www.youtube.com/channel/UCfLiSpb5nKcurnRIZse8zgA
+ Web: shop.vitraining.com +

+ +
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/static/fpk.csv b/vit_efaktur/static/fpk.csv new file mode 100644 index 0000000..97f6c94 --- /dev/null +++ b/vit_efaktur/static/fpk.csv @@ -0,0 +1,163 @@ +FK,KD_JENIS_TRANSAKSI,FG_PENGGANTI,NOMOR_FAKTUR,MASA_PAJAK,TAHUN_PAJAK,TANGGAL_FAKTUR,NPWP,NAMA,ALAMAT_LENGKAP,JUMLAH_DPP,JUMLAH_PPN,JUMLAH_PPNBM,ID_KETERANGAN_TAMBAHAN,FG_UANG_MUKA,UANG_MUKA_DPP,UANG_MUKA_PPN,UANG_MUKA_PPNBM,REFERENSI +LT,NPWP,NAMA,JALAN,BLOK,NOMOR,RT,RW,KECAMATAN,KELURAHAN,KABUPATEN,PROPINSI,KODE_POS,NOMOR_TELEPON,,,,, +OF,KODE_OBJEK,NAMA,HARGA_SATUAN,JUMLAH_BARANG,HARGA_TOTAL,DISKON,DPP,PPN,TARIF_PPNBM,PPNBM,,,,,,,, +FK,01,0,0061802514215,11,2018,30/11/2018,010619963092000,PT. SUZUKI INDOMOBIL MOTOR,JL. RAYA BEKASI KM.19 RT.009 RW.001 RAWA TERATE CAKUNG JAKARTA TIMUR DKI JAKARTA ,287583763,28758376,0,,0,0,0,0,"INV/2018/2216,INV/2018/2103,INV/2018/2238,INV/2018/2093,INV/2018/1946,INV/2018/1947,INV/2018/1921,INV/2018/1918" +FAPR,PT Caturindo Agungjaya Rubber,"JL. RUMAH SAKIT NO. 82 - 88 UJUNGBERUNG, PAKEMITAN, CINAMBO JAWA BARAT",,,,,,,,,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,1080.0,888840.0,0,888840.0,88884.0,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,9999.0,60.0,599940.0,0,599940.0,59994.0,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,10597.0,280.0,2967160.0,0,2967160.0,296716.0,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,12009.0,300.0,3602700.0,0,3602700.0,360270.0,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,11297.0,220.0,2485340.0,0,2485340.0,248534.0,0,0,,,,,,,, +OF,ISI029,17872-73R0#HOSE HTR OUTLET,11543.0,220.0,2539460.0,0,2539460.0,253946.0,0,0,,,,,,,, +OF,ISI017,SIM.35153-65J00#GROMMET REAR COMB LAMP,662.0,480.0,317760.0,0,317760.0,31776.0,0,0,,,,,,,, +OF,SIM020,89445-60G10-00#PROTECTOR TANK FLANGE,1402.0,576.0,807552.0,0,807552.0,80755.20000000001,0,0,,,,,,,, +OF,ISI014,37275-67L00#CAP CGLTR HOLE,700.0,192.0,134400.0,0,134400.0,13440.0,0,0,,,,,,,, +OF,ISI030,09321-07003#CUSHION FRONT HOOD,2928.0,468.0,1370304.0,0,1370304.0,137030.4,0,0,,,,,,,, +OF,ISI031,09321-07003#CUSHION FRONT HOOD (copy),5054.0,468.0,2365272.0,0,2365272.0,236527.2,0,0,,,,,,,, +OF,SIM032,13881-85R00#BOOT AIR CLEANER,11644.0,48.0,558912.0,0,558912.0,55891.200000000004,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,360.0,174240.0,0,174240.0,17424.0,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,324.0,1144692.0,0,1144692.0,114469.20000000001,0,0,,,,,,,, +OF,ISI,09250-30010-000#CAP REAR FLOOR DRAIN,601.0,864.0,519264.0,0,519264.0,51926.4,0,0,,,,,,,, +OF,SIM006,09320-06006#CUSHION SPARE TIRE STOPPER,869.0,1056.0,917664.0,0,917664.0,91766.40000000001,0,0,,,,,,,, +OF,ISI006,18571-65H20-00#CAP CANISTER IR,2051.0,504.0,1033704.0,0,1033704.0,103370.40000000001,0,0,,,,,,,, +OF,SIM004,28393-61J00#GROMMET T/M GEAR CONTROL,1518.0,240.0,364320.0,0,364320.0,36432.0,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,6113.0,1536.0,9389568.0,0,9389568.0,938956.8,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,5614.0,24.0,134736.0,0,134736.0,13473.6,0,0,,,,,,,, +OF,ISI002,ISI.72831-77500#PAD DECK MOUNTING,1261.0,816.0,1028976.0,0,1028976.0,102897.6,0,0,,,,,,,, +OF,ISI003,ISI.73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,384.0,205056.0,0,205056.0,20505.600000000002,0,0,,,,,,,, +OF,ISI007,85299-67L20#CUSHION FR CUSH,1441.0,60.0,86460.0,0,86460.0,8646.0,0,0,,,,,,,, +OF,SIM008,35153-65J00#GROMMET REAR COMB LAMP,662.0,720.0,476640.0,0,476640.0,47664.0,0,0,,,,,,,, +OF,SIM028,18571-65H20#CAP CANISTER IR,2051.0,216.0,443016.0,0,443016.0,44301.600000000006,0,0,,,,,,,, +OF,SIM016,72831-77500#PAD DECK MOUNTING,1261.0,48.0,60528.0,0,60528.0,6052.8,0,0,,,,,,,, +OF,SIM025,34955-70K00#BUSH EPI BRKT,484.0,96.0,46464.0,0,46464.0,4646.400000000001,0,0,,,,,,,, +OF,SIM027,75561-67L00#PAD SPARE TIRE,3533.0,96.0,339168.0,0,339168.0,33916.8,0,0,,,,,,,, +OF,SIM005,73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,192.0,102528.0,0,102528.0,10252.800000000001,0,0,,,,,,,, +OF,ISI004,ISI.77192-50E00#CUSHION TRUNK LID FRONT,344.0,96.0,33024.0,0,33024.0,3302.4,0,0,,,,,,,, +OF,ISI013,ISI.81892-77700#RUBBER STOPPER,4620.0,4356.0,20124720.0,0,20124720.0,2012472.0,0,0,,,,,,,, +OF,ISI002,ISI.72831-77500#PAD DECK MOUNTING,1261.0,1344.0,1694784.0,0,1694784.0,169478.40000000002,0,0,,,,,,,, +OF,ISI004,ISI.77192-50E00#CUSHION TRUNK LID FRONT,344.0,192.0,66048.0,0,66048.0,6604.8,0,0,,,,,,,, +OF,ISI006,18571-65H20-00#CAP CANISTER IR,2051.0,1476.0,3027276.0,0,3027276.0,302727.60000000003,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,648.0,313632.0,0,313632.0,31363.2,0,0,,,,,,,, +OF,ISI,09250-30010-000#CAP REAR FLOOR DRAIN,601.0,1632.0,980832.0,0,980832.0,98083.20000000001,0,0,,,,,,,, +OF,SIM006,09320-06006#CUSHION SPARE TIRE STOPPER,869.0,2016.0,1751904.0,0,1751904.0,175190.40000000002,0,0,,,,,,,, +OF,SIM004,28393-61J00#GROMMET T/M GEAR CONTROL,1518.0,576.0,874368.0,0,874368.0,87436.8,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,6113.0,3072.0,18779136.0,0,18779136.0,1877913.6,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,5614.0,36.0,202104.0,0,202104.0,20210.4,0,0,,,,,,,, +OF,SIM016,72831-77500#PAD DECK MOUNTING,1261.0,336.0,423696.0,0,423696.0,42369.600000000006,0,0,,,,,,,, +OF,SIM005,73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,192.0,102528.0,0,102528.0,10252.800000000001,0,0,,,,,,,, +OF,ISI014,37275-67L00#CAP CGLTR HOLE,700.0,192.0,134400.0,0,134400.0,13440.0,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,648.0,2289384.0,0,2289384.0,228938.40000000002,0,0,,,,,,,, +OF,SIM032,13881-85R00#BOOT AIR CLEANER,11644.0,120.0,1397280.0,0,1397280.0,139728.0,0,0,,,,,,,, +OF,ISI003,ISI.73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,768.0,410112.0,0,410112.0,41011.200000000004,0,0,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,960.0,790080.0,0,790080.0,79008.0,0,0,,,,,,,, +OF,ISI007,85299-67L20#CUSHION FR CUSH,1441.0,768.0,1106688.0,0,1106688.0,110668.8,0,0,,,,,,,, +OF,ISI,11191-73R00-000#HOSE BREATHER,2928.0,156.0,456768.0,0,456768.0,45676.8,0,0,,,,,,,, +OF,ISI,11193-73R00-000#HOSE PCV,5054.0,208.0,1051232.0,0,1051232.0,105123.20000000001,0,0,,,,,,,, +OF,ISI,"17852-73R00#HOSE, RDTR INLET",10597.0,160.0,1695520.0,0,1695520.0,169552.0,0,0,,,,,,,, +OF,ISI,"17854-73R00#HOSE, RDTR OUTLET",12009.0,120.0,1441080.0,0,1441080.0,144108.0,0,0,,,,,,,, +OF,ISI,"17871-73R00#HOSE, HTR INLET",11297.0,140.0,1581580.0,0,1581580.0,158158.0,0,0,,,,,,,, +OF,ISI,"17872-73R00#HOSE, HTR OUTLET",11543.0,140.0,1616020.0,0,1616020.0,161602.0,0,0,,,,,,,, +OF,ISI017,SIM.35153-65J00#GROMMET REAR COMB LAMP,662.0,480.0,317760.0,0,317760.0,31776.0,0,0,,,,,,,, +OF,ISI025,SIM.89445-60G10#PROTECTOR TANK FLANGE,1402.0,624.0,874848.0,0,874848.0,87484.8,0,0,,,,,,,, +OF,SIM014,09250-30003#PLUG INSPECTION TIMING,1051.0,1008.0,1059408.0,0,1059408.0,105940.8,0,0,,,,,,,, +OF,SIM025,34955-70K00#BUSH EPI BRKT,484.0,144.0,69696.0,0,69696.0,6969.6,0,0,,,,,,,, +OF,SIM027,75561-67L00#PAD SPARE TIRE,3533.0,144.0,508752.0,0,508752.0,50875.200000000004,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,10597.0,160.0,1695520.0,0,1695520.0,169552.0,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,12009.0,180.0,2161620.0,0,2161620.0,216162.0,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,11297.0,160.0,1807520.0,0,1807520.0,180752.0,0,0,,,,,,,, +OF,ISI029,17872-73R0#HOSE HTR OUTLET,11543.0,160.0,1846880.0,0,1846880.0,184688.0,0,0,,,,,,,, +OF,ISI,"23881-73R00-000#HOSE, CLUTCH RESERVOIL LH",2602.0,140.0,364280.0,0,364280.0,36428.0,0,0,,,,,,,, +OF,SIM008,35153-65J00#GROMMET REAR COMB LAMP,662.0,720.0,476640.0,0,476640.0,47664.0,0,0,,,,,,,, +OF,ISI,"17873-52S00-000#HOSE, BYPASS",3001.0,34.0,102034.0,0,102034.0,10203.400000000001,0,0,,,,,,,, +OF,ISI014,37275-67L00#CAP CGLTR HOLE,720.0,8.0,5760.0,0,5760.0,576.0,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,13519.0,20.0,270380.0,0,270380.0,27038.0,0,0,,,,,,,, +OF,SIM022,28135-85501A#BOOT GR SHIF CONT LEVER,17000.0,15.0,255000.0,0,255000.0,25500.0,0,0,,,,,,,, +OF,ISI017,SIM.35153-65J00#GROMMET REAR COMB LAMP,1335.0,25.0,33375.0,0,33375.0,3337.5,0,0,,,,,,,, +OF,ISI,09250-30010-000#CAP REAR FLOOR DRAIN,601.0,768.0,461568.0,0,461568.0,46156.8,0,0,,,,,,,, +OF,SIM006,09320-06006#CUSHION SPARE TIRE STOPPER,869.0,960.0,834240.0,0,834240.0,83424.0,0,0,,,,,,,, +OF,ISI006,18571-65H20-00#CAP CANISTER IR,2051.0,684.0,1402884.0,0,1402884.0,140288.4,0,0,,,,,,,, +OF,SIM004,28393-61J00#GROMMET T/M GEAR CONTROL,1518.0,240.0,364320.0,0,364320.0,36432.0,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,6113.0,1440.0,8802720.0,0,8802720.0,880272.0,0,0,,,,,,,, +OF,ISI002,ISI.72831-77500#PAD DECK MOUNTING,1261.0,432.0,544752.0,0,544752.0,54475.200000000004,0,0,,,,,,,, +OF,ISI003,ISI.73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,192.0,102528.0,0,102528.0,10252.800000000001,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,180.0,87120.0,0,87120.0,8712.0,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,180.0,635940.0,0,635940.0,63594.0,0,0,,,,,,,, +OF,SIM032,13881-85R00#BOOT AIR CLEANER,11644.0,48.0,558912.0,0,558912.0,55891.200000000004,0,0,,,,,,,, +OF,SIM025,34955-70K00#BUSH EPI BRKT,484.0,144.0,69696.0,0,69696.0,6969.6,0,0,,,,,,,, +OF,SIM027,75561-67L00#PAD SPARE TIRE,3533.0,144.0,508752.0,0,508752.0,50875.200000000004,0,0,,,,,,,, +OF,ISI007,85299-67L20#CUSHION FR CUSH,1441.0,384.0,553344.0,0,553344.0,55334.4,0,0,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,240.0,197520.0,0,197520.0,19752.0,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,5614.0,12.0,67368.0,0,67368.0,6736.8,0,0,,,,,,,, +OF,SIM016,72831-77500#PAD DECK MOUNTING,1261.0,336.0,423696.0,0,423696.0,42369.600000000006,0,0,,,,,,,, +OF,SIM005,73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,384.0,205056.0,0,205056.0,20505.600000000002,0,0,,,,,,,, +OF,SIM014,09250-30003#PLUG INSPECTION TIMING,1051.0,1688.0,1774088.0,0,1774088.0,177408.80000000002,0,0,,,,,,,, +OF,SIM036,18571-85R00#CAP PURGE UNION,772.0,96.0,74112.0,0,74112.0,7411.200000000001,0,0,,,,,,,, +OF,ISI013,ISI.81892-77700#RUBBER STOPPER,4620.0,3084.0,14248080.0,0,14248080.0,1424808.0,0,0,,,,,,,, +OF,SIM032,13881-85R00#BOOT AIR CLEANER,11644.0,240.0,2794560.0,0,2794560.0,279456.0,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,1068.0,516912.0,0,516912.0,51691.200000000004,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,1176.0,4154808.0,0,4154808.0,415480.80000000005,0,0,,,,,,,, +OF,ISI002,ISI.72831-77500#PAD DECK MOUNTING,1261.0,3600.0,4539600.0,0,4539600.0,453960.0,0,0,,,,,,,, +OF,ISI,09250-30010-000#CAP REAR FLOOR DRAIN,601.0,4320.0,2596320.0,0,2596320.0,259632.0,0,0,,,,,,,, +OF,SIM006,09320-06006#CUSHION SPARE TIRE STOPPER,869.0,5280.0,4588320.0,0,4588320.0,458832.0,0,0,,,,,,,, +OF,ISI006,18571-65H20-00#CAP CANISTER IR,2051.0,3744.0,7678944.0,0,7678944.0,767894.4,0,0,,,,,,,, +OF,SIM004,28393-61J00#GROMMET T/M GEAR CONTROL,1518.0,1440.0,2185920.0,0,2185920.0,218592.0,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,6113.0,8064.0,49295232.0,0,49295232.0,4929523.2,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,5614.0,96.0,538944.0,0,538944.0,53894.4,0,0,,,,,,,, +OF,ISI003,ISI.73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,2496.0,1332864.0,0,1332864.0,133286.4,0,0,,,,,,,, +OF,SIM036,18571-85R00#CAP PURGE UNION,772.0,264.0,203808.0,0,203808.0,20380.800000000003,0,0,,,,,,,, +OF,SIM014,09250-30003#PLUG INSPECTION TIMING,1051.0,3104.0,3262304.0,0,3262304.0,326230.4,0,0,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,2664.0,2192472.0,0,2192472.0,219247.2,0,0,,,,,,,, +OF,ISI,"17852-73R00#HOSE, RDTR INLET",10597.0,160.0,1695520.0,0,1695520.0,169552.0,0,0,,,,,,,, +OF,ISI,"17854-73R00#HOSE, RDTR OUTLET",12009.0,150.0,1801350.0,0,1801350.0,180135.0,0,0,,,,,,,, +OF,ISI,"17871-73R00#HOSE, HTR INLET",11297.0,160.0,1807520.0,0,1807520.0,180752.0,0,0,,,,,,,, +OF,ISI,"17872-73R00#HOSE, HTR OUTLET",11543.0,160.0,1846880.0,0,1846880.0,184688.0,0,0,,,,,,,, +OF,ISI,"23881-73R00-000#HOSE, CLUTCH RESERVOIL LH",2602.0,280.0,728560.0,0,728560.0,72856.0,0,0,,,,,,,, +OF,ISI017,SIM.35153-65J00#GROMMET REAR COMB LAMP,662.0,2928.0,1938336.0,0,1938336.0,193833.6,0,0,,,,,,,, +OF,ISI014,37275-67L00#CAP CGLTR HOLE,700.0,492.0,344400.0,0,344400.0,34440.0,0,0,,,,,,,, +OF,ISI025,SIM.89445-60G10#PROTECTOR TANK FLANGE,1402.0,840.0,1177680.0,0,1177680.0,117768.0,0,0,,,,,,,, +OF,ISI,11191-73R00-000#HOSE BREATHER,2928.0,156.0,456768.0,0,456768.0,45676.8,0,0,,,,,,,, +OF,ISI,11193-73R00-000#HOSE PCV,5054.0,156.0,788424.0,0,788424.0,78842.40000000001,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,10597.0,452.0,4789844.0,0,4789844.0,478984.4,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,12009.0,462.0,5548158.0,0,5548158.0,554815.8,0,0,,,,,,,, +OF,ISI028,17871-73R00#HOSE HTR INLET,11297.0,452.0,5106244.0,0,5106244.0,510624.4,0,0,,,,,,,, +OF,ISI029,17872-73R0#HOSE HTR OUTLET,11543.0,452.0,5217436.0,0,5217436.0,521743.60000000003,0,0,,,,,,,, +OF,SIM020,89445-60G10-00#PROTECTOR TANK FLANGE,1402.0,336.0,471072.0,0,471072.0,47107.200000000004,0,0,,,,,,,, +OF,ISI030,09321-07003#CUSHION FRONT HOOD,2928.0,312.0,913536.0,0,913536.0,91353.6,0,0,,,,,,,, +OF,ISI031,09321-07003#CUSHION FRONT HOOD (copy),5054.0,364.0,1839656.0,0,1839656.0,183965.6,0,0,,,,,,,, +OF,SIM025,34955-70K00#BUSH EPI BRKT,484.0,468.0,226512.0,0,226512.0,22651.2,0,0,,,,,,,, +OF,SIM027,75561-67L00#PAD SPARE TIRE,3533.0,360.0,1271880.0,0,1271880.0,127188.0,0,0,,,,,,,, +OF,SIM005,73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,384.0,205056.0,0,205056.0,20505.600000000002,0,0,,,,,,,, +OF,SIM015,77192-50E00#CUSHION TRUNK LID FRONT,344.0,96.0,33024.0,0,33024.0,3302.4,0,0,,,,,,,, +OF,SIM016,72831-77500#PAD DECK MOUNTING,1261.0,720.0,907920.0,0,907920.0,90792.0,0,0,,,,,,,, +OF,ISI007,85299-67L20#CUSHION FR CUSH,1441.0,1212.0,1746492.0,0,1746492.0,174649.2,0,0,,,,,,,, +OF,ISI004,ISI.77192-50E00#CUSHION TRUNK LID FRONT,344.0,288.0,99072.0,0,99072.0,9907.2,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,48.0,23232.0,0,23232.0,2323.2000000000003,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,48.0,169584.0,0,169584.0,16958.4,0,0,,,,,,,, +OF,ISI007,85299-67L20#CUSHION FR CUSH,1441.0,384.0,553344.0,0,553344.0,55334.4,0,0,,,,,,,, +OF,ISI,09250-30010-000#CAP REAR FLOOR DRAIN,601.0,288.0,173088.0,0,173088.0,17308.8,0,0,,,,,,,, +OF,SIM006,09320-06006#CUSHION SPARE TIRE STOPPER,869.0,384.0,333696.0,0,333696.0,33369.6,0,0,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,240.0,197520.0,0,197520.0,19752.0,0,0,,,,,,,, +OF,ISI006,18571-65H20-00#CAP CANISTER IR,2051.0,288.0,590688.0,0,590688.0,59068.8,0,0,,,,,,,, +OF,SIM004,28393-61J00#GROMMET T/M GEAR CONTROL,1518.0,96.0,145728.0,0,145728.0,14572.800000000001,0,0,,,,,,,, +OF,ISI026,72231-77501#FLAP FRONT MUD,6113.0,576.0,3521088.0,0,3521088.0,352108.80000000005,0,0,,,,,,,, +OF,ISI027,72232-77572#FLAP REAR MUD,5614.0,12.0,67368.0,0,67368.0,6736.8,0,0,,,,,,,, +OF,ISI002,ISI.72831-77500#PAD DECK MOUNTING,1261.0,336.0,423696.0,0,423696.0,42369.600000000006,0,0,,,,,,,, +OF,ISI003,ISI.73461-54G00#CUSHION GLOVE BOX LD SIDE,534.0,192.0,102528.0,0,102528.0,10252.800000000001,0,0,,,,,,,, +OF,ISI016,SIM.34955-70K00-000#BUSH EPI BRKT,484.0,180.0,87120.0,0,87120.0,8712.0,0,0,,,,,,,, +OF,ISI020,SIM.75561-67L00-000#PAD SPARE TIRE,3533.0,180.0,635940.0,0,635940.0,63594.0,0,0,,,,,,,, +OF,SIM015,77192-50E00#CUSHION TRUNK LID FRONT,344.0,96.0,33024.0,0,33024.0,3302.4,0,0,,,,,,,, +OF,SIM032,13881-85R00#BOOT AIR CLEANER,11644.0,24.0,279456.0,0,279456.0,27945.600000000002,0,0,,,,,,,, +OF,SIM036,18571-85R00#CAP PURGE UNION,772.0,98.0,75656.0,0,75656.0,7565.6,0,0,,,,,,,, +OF,SIM014,09250-30003#PLUG INSPECTION TIMING,1051.0,1356.0,1425156.0,0,1425156.0,142515.6,0,0,,,,,,,, +OF,ISI,"17873-52S00-000#HOSE, BYPASS",3001.0,8.0,24008.0,0,24008.0,2400.8,0,0,,,,,,,, +OF,SIM012,09321-10023#CUSHION FRONT HOOD LOCK,823.0,240.0,197520.0,0,197520.0,19752.0,0,0,,,,,,,, +OF,ISI,"17087-73R00-000#HOSE SET,HEATER CIRCULATION",9999.0,20.0,199980.0,0,199980.0,19998.0,0,0,,,,,,,, +OF,ISI,"17852-73R00#HOSE, RDTR INLET",10597.0,160.0,1695520.0,0,1695520.0,169552.0,0,0,,,,,,,, +OF,ISI,"17854-73R00#HOSE, RDTR OUTLET",12009.0,150.0,1801350.0,0,1801350.0,180135.0,0,0,,,,,,,, +OF,ISI,"17871-73R00#HOSE, HTR INLET",11297.0,140.0,1581580.0,0,1581580.0,158158.0,0,0,,,,,,,, +OF,ISI,"17872-73R00#HOSE, HTR OUTLET",11543.0,140.0,1616020.0,0,1616020.0,161602.0,0,0,,,,,,,, +OF,ISI017,SIM.35153-65J00#GROMMET REAR COMB LAMP,662.0,720.0,476640.0,0,476640.0,47664.0,0,0,,,,,,,, +OF,ISI014,37275-67L00#CAP CGLTR HOLE,700.0,192.0,134400.0,0,134400.0,13440.0,0,0,,,,,,,, +OF,ISI025,SIM.89445-60G10#PROTECTOR TANK FLANGE,1402.0,336.0,471072.0,0,471072.0,47107.200000000004,0,0,,,,,,,, +OF,ISI,11191-73R00-000#HOSE BREATHER,2928.0,312.0,913536.0,0,913536.0,91353.6,0,0,,,,,,,, +OF,ISI,11193-73R00-000#HOSE PCV,5054.0,312.0,1576848.0,0,1576848.0,157684.80000000002,0,0,,,,,,,, diff --git a/vit_efaktur/static/fpm.csv b/vit_efaktur/static/fpm.csv new file mode 100644 index 0000000..24b5d84 --- /dev/null +++ b/vit_efaktur/static/fpm.csv @@ -0,0 +1,2 @@ +FM,KD_JENIS_TRANSAKSI,FG_PENGGANTI,NOMOR_FAKTUR,MASA_PAJAK,TAHUN_PAJAK,TANGGAL_FAKTUR,NPWP,NAMA,ALAMAT_LENGKAP,JUMLAH_DPP,JUMLAH_PPN,JUMLAH_PPNBM,IS_CREDITABLE +FM,01,0,0011400000032,08,2017,10/08/2017,030531305064000,FAUZIAH,JUANDA ,75000000,7500000,0,1 diff --git a/vit_efaktur/static/partner.csv b/vit_efaktur/static/partner.csv new file mode 100644 index 0000000..e69de29 diff --git a/vit_efaktur/static/pk.csv b/vit_efaktur/static/pk.csv new file mode 100644 index 0000000..d4b564f --- /dev/null +++ b/vit_efaktur/static/pk.csv @@ -0,0 +1,6 @@ +FK,KD_JENIS_TRANSAKSI,FG_PENGGANTI,NOMOR_FAKTUR,MASA_PAJAK,TAHUN_PAJAK,TANGGAL_FAKTUR,NPWP,NAMA,ALAMAT_LENGKAP,JUMLAH_DPP,JUMLAH_PPN,JUMLAH_PPNBM,ID_KETERANGAN_TAMBAHAN,FG_UANG_MUKA,UANG_MUKA_DPP,UANG_MUKA_PPN,UANG_MUKA_PPNBM,REFERENSI +LT,NPWP,NAMA,JALAN,BLOK,NOMOR,RT,RW,KECAMATAN,KELURAHAN,KABUPATEN,PROPINSI,KODE_POS,NOMOR_TELEPON,,,,, +OF,KODE_OBJEK,NAMA,HARGA_SATUAN,JUMLAH_BARANG,HARGA_TOTAL,DISKON,DPP,PPN,TARIF_PPNBM,PPNBM,,,,,,,, +FK,01,0,0171734018730,07,2017,25/07/2017,803610096011000,BERDIKARI. UD,Sudirman Blok: 2 Nomor: 2 RT: 22 RW: 22 Kel: CIGONDEWAH KALER Kec: BANDUNG KULON Kota/Kab: KOTA BANDUNG Bandung JAWA BARAT,120000000,12000000,0,,0,0,0,0,INV/2017/0026 +FAPR,My Company, Blok: Nomor: RT: RW: Kel: Kec: Kota/Kab: ,,,,,,,,,,,,,,,, +OF,,Jasa,120000000.0,1.0,120000000.0,0,120000000.0,12000000.0,0,0,,,,,,,, diff --git a/vit_efaktur/static/product.csv b/vit_efaktur/static/product.csv new file mode 100644 index 0000000..e69de29 diff --git a/vit_efaktur/static/src/img/export.png b/vit_efaktur/static/src/img/export.png new file mode 100644 index 0000000..e2f87a9 Binary files /dev/null and b/vit_efaktur/static/src/img/export.png differ diff --git a/vit_efaktur/static/src/img/icontax.png b/vit_efaktur/static/src/img/icontax.png new file mode 100644 index 0000000..626cdab Binary files /dev/null and b/vit_efaktur/static/src/img/icontax.png differ diff --git a/vit_efaktur/static/src/img/newtaxicon.jpg b/vit_efaktur/static/src/img/newtaxicon.jpg new file mode 100644 index 0000000..d920ba4 Binary files /dev/null and b/vit_efaktur/static/src/img/newtaxicon.jpg differ diff --git a/vit_efaktur/view/efaktur.xml b/vit_efaktur/view/efaktur.xml new file mode 100644 index 0000000..e09fafc --- /dev/null +++ b/vit_efaktur/view/efaktur.xml @@ -0,0 +1,160 @@ + + + + + + vit.efaktur.tree + vit.efaktur + tree + + + + + + + + + + + + vit.efaktur.form + vit.efaktur + form + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + vit.efaktur.search + vit.efaktur + search + + + + + + + + + + + + + + + + Nomor E-Faktur + ir.actions.act_window + vit.efaktur + tree,form + + + + + + form + + + + + + + tree + + + + + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/vit_efaktur/view/invoice.xml b/vit_efaktur/view/invoice.xml new file mode 100644 index 0000000..9dabd9b --- /dev/null +++ b/vit_efaktur/view/invoice.xml @@ -0,0 +1,45 @@ + + + + + + account_invoice_efaktur + account.move + + + + + + + + + + + + + + + + + + + + + + + + + + tree_invoice_efaktur + account.move + + + + + + + + + + + diff --git a/vit_efaktur/view/invoice_supplier.xml b/vit_efaktur/view/invoice_supplier.xml new file mode 100644 index 0000000..6dda173 --- /dev/null +++ b/vit_efaktur/view/invoice_supplier.xml @@ -0,0 +1,45 @@ + + + + + + + + tree_invoice_supplier_efaktur + account.move + + + + + + + + + + + diff --git a/vit_efaktur/view/partner.xml b/vit_efaktur/view/partner.xml new file mode 100644 index 0000000..bef1384 --- /dev/null +++ b/vit_efaktur/view/partner.xml @@ -0,0 +1,42 @@ + + + + + + res.partner_efaktur + res.partner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vit_efaktur/view/product.xml b/vit_efaktur/view/product.xml new file mode 100644 index 0000000..e7435a1 --- /dev/null +++ b/vit_efaktur/view/product.xml @@ -0,0 +1,29 @@ + + + + + + product.template_efaktur + product.template + + + + + + + + + + + + + + + + + + + + + + diff --git a/vit_efaktur/wizard/__init__.py b/vit_efaktur/wizard/__init__.py new file mode 100644 index 0000000..a3bac3c --- /dev/null +++ b/vit_efaktur/wizard/__init__.py @@ -0,0 +1,7 @@ +from . import generate +from . import product +from . import partner +from . import pk +from . import auto +from . import pm +from . import assign \ No newline at end of file diff --git a/vit_efaktur/wizard/assign.py b/vit_efaktur/wizard/assign.py new file mode 100644 index 0000000..1fbd802 --- /dev/null +++ b/vit_efaktur/wizard/assign.py @@ -0,0 +1,35 @@ +from odoo import api, fields, models, _ +import time +from odoo.exceptions import UserError +import logging +_logger = logging.getLogger(__name__) + +class AssignConfirm(models.TransientModel): + _name = 'vit.assign_wizard' + _description = 'Assign Confirmation' + + + def _get_active_invoices(self): + if self._context.get('active_model') == 'account.invoice': + return self._context.get('active_ids', False) + return False + + invoice_ids = fields.Many2many(comodel_name="account.invoice", string="Invoices", required=True, + default=_get_active_invoices) + + efaktur_id = fields.Many2one(comodel_name="vit.efaktur", string="Nomor E-Faktur", required=False, ) + + """ + logika: + update invoice_ids.efaktur_id dengan yang dipilih + :return: + """ + + # @api.multi + def confirm_button(self): + self.ensure_one() + + for inv in self.invoice_ids: + inv.efaktur_id = self.efaktur_id + + return {'type': 'ir.actions.act_window_close'} diff --git a/vit_efaktur/wizard/assign.xml b/vit_efaktur/wizard/assign.xml new file mode 100644 index 0000000..06ec473 --- /dev/null +++ b/vit_efaktur/wizard/assign.xml @@ -0,0 +1,31 @@ + + + + + + assign + vit.assign_wizard + +
+ + + + +
+
+
+
+
+ + + +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/auto.py b/vit_efaktur/wizard/auto.py new file mode 100644 index 0000000..7c7720b --- /dev/null +++ b/vit_efaktur/wizard/auto.py @@ -0,0 +1,52 @@ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + +class efaktur_wizard(models.TransientModel): + _name = 'vit.efaktur_auto' + + start = fields.Date("Invoice Date Start",required=True) + end = fields.Date("Invoice Date End",required=True) + invoice_ids = fields.Many2many(comodel_name="account.move", string="Invoices", ) + + # @api.multi + def confirm_button(self): + + invoice_ids = self.invoice_ids + + efaktur_ids = self.env['vit.efaktur'].search([('is_used','=',False)], + order="name asc") + efaktur_len = len(efaktur_ids) + + i = 0 + for inv in invoice_ids: + if i < efaktur_len: + inv.efaktur_id = efaktur_ids[i] + else: + break + i+=1 + + self.env.cr.commit() + raise UserError("Selesai penomoran E-Faktur %s invoices(s)!" % i) + + # @api.multi + def find_invoices(self): + start = self.start + end = self.end + + inv_obj = self.env['account.move'] + invoices = inv_obj.search([('invoice_date','>=', start), + ('invoice_date','<=', end), + ('state','=','open'), + ('efaktur_id','=',False), + ('type','=','out_invoice') + ]) + i = 0 + invoice_ids = [] + for inv in invoices: + invoice_ids.append((4,inv.id)) + i+=1 + + self.invoice_ids=invoice_ids + self.env.cr.commit() + raise UserError("Found %s invoices(s)!" % i) + diff --git a/vit_efaktur/wizard/auto.xml b/vit_efaktur/wizard/auto.xml new file mode 100644 index 0000000..6457326 --- /dev/null +++ b/vit_efaktur/wizard/auto.xml @@ -0,0 +1,42 @@ + + + + + + Auto Number eFaktur + ir.actions.act_window + vit.efaktur_auto + form + new + + + + vit.efaktur_auto.form + vit.efaktur_auto + form + + +
+ + + + + + + + + + + +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/generate.py b/vit_efaktur/wizard/generate.py new file mode 100644 index 0000000..e152899 --- /dev/null +++ b/vit_efaktur/wizard/generate.py @@ -0,0 +1,28 @@ +from odoo import api, fields, models, _ + +class efaktur_wizard(models.TransientModel): + _name = 'vit.generate_efaktur' + + start = fields.Char("Start") + end = fields.Char("End") + year = fields.Integer("Year") + + # @api.multi + def confirm_button(self): + start = self.start + end = self.end + + #017-17-34018714 + a = start.split("-") + b = end.split("-") + + for i in range(int(a[2]), int(b[2])+1): + nomor = "%s-%s-%08d" % (a[0],a[1],i) + data = { + 'year': self.year, + 'name': nomor, + } + self.env['vit.efaktur'].create(data) + + return + diff --git a/vit_efaktur/wizard/generate.xml b/vit_efaktur/wizard/generate.xml new file mode 100644 index 0000000..f904208 --- /dev/null +++ b/vit_efaktur/wizard/generate.xml @@ -0,0 +1,36 @@ + + + + + + Generate eFaktur + ir.actions.act_window + vit.generate_efaktur + form + new + + + + vit.generate_efaktur.form + vit.generate_efaktur + form + + +
+ + + + + + +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/partner.py b/vit_efaktur/wizard/partner.py new file mode 100644 index 0000000..fe87361 --- /dev/null +++ b/vit_efaktur/wizard/partner.py @@ -0,0 +1,96 @@ +from odoo import api, fields, models, _ +import time +import csv +from odoo.modules import get_modules, get_module_path +from odoo.exceptions import UserError +import copy +import logging +from io import StringIO +import base64 + +_logger = logging.getLogger(__name__) + + +class efaktur_partner_wizard(models.TransientModel): + _name = 'vit.efaktur_partner' + + export_file = fields.Binary(string="Export File", ) + export_filename = fields.Char(string="Export File", ) + + # @api.multi + def confirm_button(self): + """ + export partner yang is_efaktur_exported = False + update setelah export + :return: + """ + cr = self.env.cr + + headers = [ + 'LT', + 'NPWP', + 'NAMA', + 'JALAN', + 'BLOK', + 'NOMOR', + 'RT', + 'RW', + 'KECAMATAN', + 'KELURAHAN', + 'KABUPATEN', + 'PROPINSI', + 'KODE_POS', + 'NOMOR_TELEPON' + ] + + mpath = get_module_path('vit_efaktur') + # csvfile = open(mpath + '/static/partner.csv', 'wb') + + csvfile = StringIO() + csvwriter = csv.writer(csvfile, delimiter=',') + csvwriter.writerow([h.upper() for h in headers]) + + partner = self.env['res.partner'] + partners = partner.search([('is_efaktur_exported','=',False), + ('npwp','!=',False)]) + i=0 + for part in partners: + npwp = part.npwp.replace(".","").replace("-","") + data = { + 'LT' : 'LT', + 'NPWP' : npwp, + 'NAMA' : part.name, + 'JALAN' : part.street or '', + 'BLOK' : part.blok or '', + 'NOMOR' : part.nomor or '', + 'RT' : part.rt or '', + 'RW' : part.rw or '', + 'KECAMATAN' : part.kecamatan_id.name or '', + 'KELURAHAN' : part.kelurahan_id.name or '', + 'KABUPATEN' : part.kecamatan_id.kota_id.name or '', + 'PROPINSI' : part.state_id.name or '', + 'KODE_POS' : part.zip or '', + 'NOMOR_TELEPON': part.phone or '' + } + csvwriter.writerow([data[v] for v in headers]) + + part.is_efaktur_exported=True + part.date_efaktur_exported=time.strftime("%Y-%m-%d %H:%M:%S") + i+=1 + + cr.commit() + # csvfile.close() + + # raise UserError("Export %s record(s) Done!" % i) + + self.export_file = base64.b64encode(csvfile.getvalue().encode()) + self.export_filename = 'Export-%s.csv' % time.strftime("%Y%m%d_%H%M%S") + return { + 'name': "Export E-Faktur Complete, total %s records" % i, + 'type': 'ir.actions.act_window', + 'res_model': 'vit.efaktur_partner', + 'view_mode': 'form', + 'res_id': self.id, + 'views': [(False, 'form')], + 'target': 'new', + } diff --git a/vit_efaktur/wizard/partner.xml b/vit_efaktur/wizard/partner.xml new file mode 100644 index 0000000..a39f926 --- /dev/null +++ b/vit_efaktur/wizard/partner.xml @@ -0,0 +1,54 @@ + + + + + + Export Lawan Transaksi + ir.actions.act_window + vit.efaktur_partner + form + new + + + + view_vit_efaktur_partner_form + vit.efaktur_partner + form + + +
+

+ Klik tombol Export di bawah untuk mulai export data Lawan Transaksi. + Data yang diexport adalah Customer yang memiliki NPWP dan belum diexport ke E-Faktur. +

+ +

+ Setelah proses export Lawan Transaksi selesai dilakukan, + download file: +

+

+ + + + + + +

+

+ Lalu import ke program E-Faktur DJP melalui menu Referensi - Lawan Transaksi - Import +

+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/pk.py b/vit_efaktur/wizard/pk.py new file mode 100644 index 0000000..3c94622 --- /dev/null +++ b/vit_efaktur/wizard/pk.py @@ -0,0 +1,340 @@ +from odoo import api, fields, models, _ +import time +import csv +from odoo.modules import get_modules, get_module_path +from odoo.exceptions import UserError +import copy +import logging +from io import StringIO +import base64 + +_logger = logging.getLogger(__name__) + +class efaktur_pk_wizard(models.TransientModel): + _name = 'vit.efaktur_pk' + + export_file = fields.Binary(string="Export File", ) + export_filename = fields.Char(string="Export File", ) + + # @api.multi + def confirm_button(self): + """ + export pk yang is_efaktur_exported = False + update setelah export + :return: + """ + cr = self.env.cr + + headers = [ + 'FK', + 'KD_JENIS_TRANSAKSI', + 'FG_PENGGANTI', + 'NOMOR_FAKTUR', + 'MASA_PAJAK', + 'TAHUN_PAJAK', + 'TANGGAL_FAKTUR', + 'NPWP', + 'NAMA', + 'ALAMAT_LENGKAP', + 'JUMLAH_DPP', + 'JUMLAH_PPN', + 'JUMLAH_PPNBM', + 'ID_KETERANGAN_TAMBAHAN', + 'FG_UANG_MUKA', + 'UANG_MUKA_DPP', + 'UANG_MUKA_PPN', + 'UANG_MUKA_PPNBM', + 'REFERENSI' + ] + + + mpath = get_module_path('vit_efaktur') + + # csvfile = open(mpath + '/static/fpk.csv', 'wb') + csvfile = StringIO() + csvwriter = csv.writer(csvfile, delimiter=',') + csvwriter.writerow([h.upper() for h in headers]) + + inv_obj = self.env['account.move'] + invoices = inv_obj.search([('is_efaktur_exported','=',False), + ('state','=','open'), + ('efaktur_id','!=', False), + ('move_type','=','out_invoice')]) + + company = self.env.user.company_id.partner_id + + i=0 + self.baris2(headers, csvwriter) + self.baris3(headers, csvwriter) + + combined_invoices = self.gabung_by_efaktur(invoices) + + for invoice in combined_invoices: + self.baris4(headers, csvwriter, invoice) + self.baris5(headers, csvwriter, company ) + + for line in invoice['invoice_line_ids']: + self.baris6(headers, csvwriter, line) + + i+=1 + + for id in invoices.mapped('id'): + invoice = inv_obj.browse(id) + invoice.is_efaktur_exported=True + invoice.date_efaktur_exported=time.strftime("%Y-%m-%d %H:%M:%S") + + cr.commit() + # csvfile.close() + # _logger.info(csvfile.getvalue().encode() ) + self.export_file = base64.b64encode(csvfile.getvalue().encode()) + self.export_filename = 'Export-%s.csv' % time.strftime("%Y%m%d_%H%M%S") + return { + 'name': "Export E-Faktur Complete, total %s records" % i, + 'type': 'ir.actions.act_window', + 'res_model': 'vit.efaktur_pk', + 'view_mode': 'form', + 'res_id': self.id, + 'views': [(False, 'form')], + 'target': 'new', + } + # raise UserError("Export %s record(s) Done!" % i) + + def gabung_by_efaktur(self, invoices): + old_efaktur = None + inv_obj = self.env['account.move'] + i=0 + combines=[] + # list of tuples of invoices to be combined by efaktur + # [(inv1,inv2,inv5),(inv3,inv4)] + + + final_invoices = [] + # list of final combined invoices, totallized + # [inv125, inv34] + + for inv in sorted(invoices, key=lambda inv: inv.efaktur_id): + if old_efaktur == inv.efaktur_id: + combines[i-1].append(inv_obj.search_read([('id','=',inv.id)])[0]) + else: + combines.append([inv_obj.search_read([('id','=',inv.id)])[0]]) + i += 1 + old_efaktur = inv.efaktur_id + + # comb = invoices per efaktur yg sama + for comb in combines: + i=0 + for inv in comb: + if i == 0: + i+=1 + continue + + line_ids = inv['invoice_line_ids'] + for id in line_ids: + comb[0]['invoice_line_ids'].append(id) + + comb[0]['amount_untaxed'] += inv['amount_untaxed'] + comb[0]['amount_tax'] += inv['amount_tax'] + comb[0]['amount_total'] += inv['amount_total'] + comb[0]['number'] += "," + inv['number'] + i+=1 + + comb[0]['invoice_line_ids'] = self.merge_lines(comb[0]['invoice_line_ids']) + + final_invoices.append(comb[0]) + + return final_invoices + + def merge_lines(self, lines): + old_line = None + final_lines = [] + + i=0 + for line in self.env['account.move.line'].search_read([('id','in',lines)]): + if old_line and (old_line['product_id'] == line['product_id'] and old_line['price_unit'] == line['price_unit']): + old_line['price_unit'] += line['price_unit'] + old_line['quantity'] += line['quantity'] + final_lines.append(old_line) + else: + final_lines.append(line) + + old_line = line + i+=1 + + + return final_lines + + + + def baris2(self, headers, csvwriter): + data = { + 'FK': 'LT', + 'KD_JENIS_TRANSAKSI': 'NPWP', + 'FG_PENGGANTI': 'NAMA', + 'NOMOR_FAKTUR': 'JALAN', + 'MASA_PAJAK': 'BLOK', + 'TAHUN_PAJAK': 'NOMOR', + 'TANGGAL_FAKTUR': 'RT', + 'NPWP': 'RW', + 'NAMA': 'KECAMATAN', + 'ALAMAT_LENGKAP': 'KELURAHAN', + 'JUMLAH_DPP': 'KABUPATEN', + 'JUMLAH_PPN': 'PROPINSI', + 'JUMLAH_PPNBM': 'KODE_POS', + 'ID_KETERANGAN_TAMBAHAN': 'NOMOR_TELEPON', + 'FG_UANG_MUKA': '', + 'UANG_MUKA_DPP': '', + 'UANG_MUKA_PPN': '', + 'UANG_MUKA_PPNBM': '', + 'REFERENSI': '' + } + csvwriter.writerow([data[v] for v in headers]) + + def baris3(self, headers, csvwriter): + data = { + 'FK': 'OF', + 'KD_JENIS_TRANSAKSI': 'KODE_OBJEK', + 'FG_PENGGANTI': 'NAMA', + 'NOMOR_FAKTUR': 'HARGA_SATUAN', + 'MASA_PAJAK': 'JUMLAH_BARANG', + 'TAHUN_PAJAK': 'HARGA_TOTAL', + 'TANGGAL_FAKTUR': 'DISKON', + 'NPWP': 'DPP', + 'NAMA': 'PPN', + 'ALAMAT_LENGKAP': 'TARIF_PPNBM', + 'JUMLAH_DPP': 'PPNBM', + 'JUMLAH_PPN': '', + 'JUMLAH_PPNBM': '', + 'ID_KETERANGAN_TAMBAHAN': '', + 'FG_UANG_MUKA': '', + 'UANG_MUKA_DPP': '', + 'UANG_MUKA_PPN': '', + 'UANG_MUKA_PPNBM': '', + 'REFERENSI': '' + } + csvwriter.writerow([data[v] for v in headers]) + + + def baris4(self, headers, csvwriter, inv): + partner_id = self.env['res.partner'].browse(inv['partner_id'][0]) + if not partner_id.npwp: + raise UserError("Harap masukkan NPWP Customer %s" % inv['partner_id'][1]) + + if not inv['efaktur_id'][0]: + raise UserError("Harap masukkan Nomor Seri Faktur Pajak Keluaran Invoice Nomor %s" % inv['number']) + + # yyyy-mm-dd to dd/mm/yyyy + + # d = inv['invoice_date'].split("-") + # invoice_date = "%s/%s/%s" %(d[2],d[1],d[0]) + invoice_date = inv['invoice_date'].strftime("%d/%m/%Y") + npwp = partner_id.npwp.replace(".","").replace("-","") + faktur = inv['efaktur_id'][1].replace(".","").replace("-","") + + print ("Tax ", inv['amount_tax']) + print ("DPP ", inv['amount_untaxed']) + print ("Tax Round ", round(inv['amount_tax'])) + print ("DPP Round ", round(inv['amount_untaxed'])) + + if inv['is_cancel']: + data = { + 'FK': 'FK', + 'KD_JENIS_TRANSAKSI': '01', + 'FG_PENGGANTI': '1', + 'NOMOR_FAKTUR': faktur, + 'MASA_PAJAK': inv['masa_pajak'] or '', + 'TAHUN_PAJAK': inv['tahun_pajak'] or '', + 'TANGGAL_FAKTUR': invoice_date, + 'NPWP': npwp, + 'NAMA': partner_id.name.encode('utf8') or '', + 'ALAMAT_LENGKAP': partner_id.alamat_lengkap.encode('utf8') or '', + 'JUMLAH_DPP': round(inv['amount_untaxed']) or 0, + 'JUMLAH_PPN': round(inv['amount_tax']) or 0, + 'JUMLAH_PPNBM': 0, + 'ID_KETERANGAN_TAMBAHAN': '', + 'FG_UANG_MUKA': 0, + 'UANG_MUKA_DPP': 0, + 'UANG_MUKA_PPN': 0, + 'UANG_MUKA_PPNBM': 0, + 'REFERENSI': inv['number'] or '' + } + + elif not inv['is_cancel']: + data = { + 'FK': 'FK', + 'KD_JENIS_TRANSAKSI': '01', + 'FG_PENGGANTI': '0', + 'NOMOR_FAKTUR': faktur, + 'MASA_PAJAK': inv['masa_pajak'] or '', + 'TAHUN_PAJAK': inv['tahun_pajak'] or '', + 'TANGGAL_FAKTUR': invoice_date, + 'NPWP': npwp, + 'NAMA': partner_id.name.encode('utf8') or '', + 'ALAMAT_LENGKAP': partner_id.alamat_lengkap.encode('utf8') or '', + 'JUMLAH_DPP': round(inv['amount_untaxed']) or 0, + 'JUMLAH_PPN': round(inv['amount_tax']) or 0, + 'JUMLAH_PPNBM': 0, + 'ID_KETERANGAN_TAMBAHAN': '', + 'FG_UANG_MUKA': 0, + 'UANG_MUKA_DPP': 0, + 'UANG_MUKA_PPN': 0, + 'UANG_MUKA_PPNBM': 0, + 'REFERENSI': inv['number'] or '' + } + + _logger.info(data) + csvwriter.writerow([data[v] for v in headers]) + + def baris5(self, headers, csvwriter, company): + data = { + 'FK': 'FAPR', + 'KD_JENIS_TRANSAKSI': company.name, + 'FG_PENGGANTI': company.alamat_lengkap, + 'NOMOR_FAKTUR': '', + 'MASA_PAJAK': '', + 'TAHUN_PAJAK': '', + 'TANGGAL_FAKTUR': '', + 'NPWP': '', + 'NAMA': '', + 'ALAMAT_LENGKAP': '', + 'JUMLAH_DPP': '', + 'JUMLAH_PPN': '', + 'JUMLAH_PPNBM': '', + 'ID_KETERANGAN_TAMBAHAN': '', + 'FG_UANG_MUKA': '', + 'UANG_MUKA_DPP': '', + 'UANG_MUKA_PPN': '', + 'UANG_MUKA_PPNBM': '', + 'REFERENSI': '' + } + csvwriter.writerow([data[v] for v in headers]) + + def baris6(self, headers, csvwriter, line): + # harga_total = line['price_unit'] * line['quantity'] + harga_total = round(line['price_subtotal']) + dpp = harga_total + ppn = round(dpp * 0.1) #TODO ambil dari Tax many2many + product_id = self.env['product.product'].browse(line['product_id'][0]) + + data = { + 'FK': 'OF', + 'KD_JENIS_TRANSAKSI': product_id.default_code or '', + 'FG_PENGGANTI': product_id.name or '', + 'NOMOR_FAKTUR': line['price_unit'], + 'MASA_PAJAK': line['quantity'] , + 'TAHUN_PAJAK': harga_total, + 'TANGGAL_FAKTUR': line['discount'] or 0, + 'NPWP': dpp, + 'NAMA': ppn, + 'ALAMAT_LENGKAP': '0', + 'JUMLAH_DPP': '0', + 'JUMLAH_PPN': '', + 'JUMLAH_PPNBM': '', + 'ID_KETERANGAN_TAMBAHAN': '', + 'FG_UANG_MUKA': '', + 'UANG_MUKA_DPP': '', + 'UANG_MUKA_PPN': '', + 'UANG_MUKA_PPNBM': '', + 'REFERENSI': '' + } + csvwriter.writerow([data[v] for v in headers]) + diff --git a/vit_efaktur/wizard/pk.xml b/vit_efaktur/wizard/pk.xml new file mode 100644 index 0000000..8e8e002 --- /dev/null +++ b/vit_efaktur/wizard/pk.xml @@ -0,0 +1,58 @@ + + + + + + Export Faktur Pajak Keluaran + ir.actions.act_window + vit.efaktur_pk + form + new + + + + view_vit_efaktur_pk_form + vit.efaktur_pk + form + + +
+ +

+ Klik tombol Export di bawah untuk mulai export Faktur Pajak Keluaran. + Data yang diexport adalah Customer Invoice yang berstatus Open dan belum diexport ke E-Faktur. +

+ + +

+ Setelah proses export Faktur Pajak Keluaran selesai dilakukan, + download file ini: +

+

+ + + + + + + + + +

+ + +

+ Lalu import ke program E-Faktur DJP melalui menu Referensi - Pajak Keluaran - Import +

+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/pm.py b/vit_efaktur/wizard/pm.py new file mode 100644 index 0000000..608069e --- /dev/null +++ b/vit_efaktur/wizard/pm.py @@ -0,0 +1,115 @@ +from odoo import api, fields, models, _ +import time +import csv +from odoo.modules import get_modules, get_module_path +from odoo.exceptions import UserError +import copy +import logging +from io import StringIO +import base64 + +_logger = logging.getLogger(__name__) + +class efaktur_pm_wizard(models.TransientModel): + _name = 'vit.efaktur_pm' + + export_file = fields.Binary(string="Export File", ) + export_filename = fields.Char(string="Export File", ) + + # @api.multi + def confirm_button(self): + """ + export pm yang is_efaktur_exported = False + update setelah export + :return: + """ + cr = self.env.cr + + headers = [ + 'FM', + 'KD_JENIS_TRANSAKSI', + 'FG_PENGGANTI', + 'NOMOR_FAKTUR', + 'MASA_PAJAK', + 'TAHUN_PAJAK', + 'TANGGAL_FAKTUR', + 'NPWP', + 'NAMA', + 'ALAMAT_LENGKAP', + 'JUMLAH_DPP', + 'JUMLAH_PPN', + 'JUMLAH_PPNBM', + 'IS_CREDITABLE' + ] + + + mpath = get_module_path('vit_efaktur') + + # csvfile = open(mpath + '/static/fpm.csv', 'wb') + csvfile = StringIO() + csvwriter = csv.writer(csvfile, delimiter=',') + csvwriter.writerow([h.upper() for h in headers]) + + onv_obj = self.env['account.move'] + invoices = onv_obj.search([('is_efaktur_exported','=',False), + ('state','=','open'), + ('efaktur_masukan','!=', ''), + ('move_type','=','in_invoice')]) + + + i=0 + for invoice in invoices: + self.baris2(headers, csvwriter, invoice) + invoice.is_efaktur_exported=True + invoice.date_efaktur_exported=time.strftime("%Y-%m-%d %H:%M:%S") + i+=1 + + cr.commit() + # csvfile.close() + + # raise UserError("Export %s record(s) Done!" % i) + + self.export_file = base64.b64encode(csvfile.getvalue().encode()) + self.export_filename = 'Export-%s.csv' % time.strftime("%Y%m%d_%H%M%S") + return { + 'name': "Export E-Faktur Complete, total %s records" % i, + 'type': 'ir.actions.act_window', + 'res_model': 'vit.efaktur_pm', + 'view_mode': 'form', + 'res_id': self.id, + 'views': [(False, 'form')], + 'target': 'new', + } + + def baris2(self, headers, csvwriter, inv): + if not inv.partner_id.npwp: + raise UserError("Harap masukkan NPWP Supplier %s" % inv.partner_id.name) + + if not inv.efaktur_masukan: + raise UserError("Harap masukkan Nomor Seri Faktur Pajak Masukan Invoice Nomor %s" % inv.number) + + # yyyy-mm-dd to dd/mm/yyyy + # d = inv.invoice_date.split("-") + # invoice_date = "%s/%s/%s" %(d[2],d[1],d[0]) + invoice_date = inv['invoice_date'].strftime("%d/%m/%Y") + npwp = inv.partner_id.npwp.replace(".","").replace("-","") + faktur = inv.efaktur_masukan.replace(".","").replace("-","") + + data = { + 'FM':'FM', + 'KD_JENIS_TRANSAKSI':'01', + 'FG_PENGGANTI':'0', + 'NOMOR_FAKTUR':faktur, + 'MASA_PAJAK': inv.masa_pajak or '', + 'TAHUN_PAJAK': inv.tahun_pajak or '', + 'TANGGAL_FAKTUR': invoice_date, + 'NPWP': npwp, + 'NAMA': inv.partner_id.name or '', + 'ALAMAT_LENGKAP': inv.partner_id.alamat_lengkap or '', + 'JUMLAH_DPP': int(inv.amount_untaxed) or 0, + 'JUMLAH_PPN': int(inv.amount_tax) or 0, + 'JUMLAH_PPNBM': 0, + 'IS_CREDITABLE':1 + } + csvwriter.writerow([data[v] for v in headers]) + diff --git a/vit_efaktur/wizard/pm.xml b/vit_efaktur/wizard/pm.xml new file mode 100644 index 0000000..d4fafec --- /dev/null +++ b/vit_efaktur/wizard/pm.xml @@ -0,0 +1,51 @@ + + + + + + Export Faktur Pajak Masukan + ir.actions.act_window + vit.efaktur_pm + form + new + + + + view_vit_efaktur_pm_form + vit.efaktur_pm + form + + +
+

+ Klik tombol Export di bawah untuk mulai export Faktur Pajak Masukan. + Data yang diexport adalah Invoice Supplier yang berstatus Open dan belum diexport ke E-Faktur. +

+

+ Setelah proses export Faktur Pajak Masukan selesai dilakukan, + download file: +

+

+ + + + + +

+

+ Lalu import ke program E-Faktur DJP melalui menu Referensi - Pajak Masukan - Import +

+
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/vit_efaktur/wizard/product.py b/vit_efaktur/wizard/product.py new file mode 100644 index 0000000..5f5b897 --- /dev/null +++ b/vit_efaktur/wizard/product.py @@ -0,0 +1,72 @@ +from odoo import api, fields, models, _ +import time +import csv +from odoo.modules import get_module_path +from odoo.exceptions import UserError +import copy +import logging +from io import StringIO +import base64 + +class efaktur_product_wizard(models.TransientModel): + _name = 'vit.efaktur_product' + + export_file = fields.Binary(string="Export File", ) + export_filename = fields.Char(string="Export File", ) + + # @api.multi + def confirm_button(self): + """ + export product yang is_efaktur_exported = False + update setelah export + :return: + """ + cr = self.env.cr + + headers = [ + 'OB', + 'KODE_OBJEK', + 'NAMA', + 'HARGA_SATUAN' + ] + + mpath = get_module_path('vit_efaktur') + + # csvfile = open(mpath + '/static/product.csv', 'wb') + csvfile = StringIO() + csvwriter = csv.writer(csvfile, delimiter=',') + csvwriter.writerow([h.upper() for h in headers]) + + product = self.env['product.template'] + products = product.search([('is_efaktur_exported','=',False)]) + i=0 + + for prod in products: + data = { + 'OB' : 'OB', + 'KODE_OBJEK': prod.default_code or '', + 'NAMA' : prod.name, + 'HARGA_SATUAN':prod.list_price + } + csvwriter.writerow([data[v] for v in headers]) + + prod.is_efaktur_exported=True + prod.date_efaktur_exported=time.strftime("%Y-%m-%d %H:%M:%S") + i+=1 + + cr.commit() + # csvfile.close() + + # raise UserError("Export %s record(s) Done!" % i) + + self.export_file = base64.b64encode(csvfile.getvalue().encode()) + self.export_filename = 'Export-%s.csv' % time.strftime("%Y%m%d_%H%M%S") + return { + 'name': "Export E-Faktur Complete, total %s records" % i, + 'type': 'ir.actions.act_window', + 'res_model': 'vit.efaktur_product', + 'view_mode': 'form', + 'res_id': self.id, + 'views': [(False, 'form')], + 'target': 'new', + } \ No newline at end of file diff --git a/vit_efaktur/wizard/product.xml b/vit_efaktur/wizard/product.xml new file mode 100644 index 0000000..79f2751 --- /dev/null +++ b/vit_efaktur/wizard/product.xml @@ -0,0 +1,56 @@ + + + + + + Export Product + ir.actions.act_window + vit.efaktur_product + form + new + + + + view_vit_efaktur_product_form + vit.efaktur_product + form + + +
+

+ Klik tombol Export di bawah untuk mulai export data Barang/Jasa. + Data yang diexport adalah Product yang belum diexport ke E-Faktur. +

+ +

+ Setelah proses export Barang/Jasa selesai dilakukan, + download file: +

+

+ + + + + + +

+ + +

+ Lalu import ke program E-Faktur DJP melalui menu Referensi - Barang/Jasa - Import +

+ + + +
+
+
+ +
+
\ No newline at end of file -- cgit v1.2.3