diff --git a/l10n_id_djbc_plb_lap_pemasukan/README.rst b/l10n_id_djbc_plb_lap_pemasukan/README.rst new file mode 100644 index 0000000..6327289 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================================================ +Indonesia - Lap. Pemasukan for DJBC's Pusat Logistik Berikat +============================================================ + + + +Installation +============ + +To install this module, you need to: + +1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-l10n-indonesia +2. Add the path to this repository in your configuration (addons-path) +3. Update the module list +4. Go to menu *Setting -> Modules -> Local Modules* +5. Search For *Indonesia - Lap. Pemasukan for DJBC's Pusat Logistik Berikat* +6. Install the module + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed +and welcomed feedback. + + +Credits +======= + +Contributors +------------ + +* Michael Viriyananda +* Andhitia Rama + +Maintainer +---------- + +.. image:: https://opensynergy-indonesia.com/logo.png + :alt: OpenSynergy Indonesia + :target: https://opensynergy-indonesia.com + +This module is maintained by the OpenSynergy Indonesia. diff --git a/l10n_id_djbc_plb_lap_pemasukan/__init__.py b/l10n_id_djbc_plb_lap_pemasukan/__init__.py new file mode 100644 index 0000000..b2067ab --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import wizards +from . import reports diff --git a/l10n_id_djbc_plb_lap_pemasukan/__openerp__.py b/l10n_id_djbc_plb_lap_pemasukan/__openerp__.py new file mode 100644 index 0000000..f341462 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# pylint: disable=locally-disabled, manifest-required-author +{ + "name": "Indonesia - Lap. Pemasukan for DJBC's " + "Pusat Logistik Berikat", + "version": "8.0.1.2.1", + "category": "localization", + "website": "https://opensynergy-indonesia.com", + "author": "OpenSynergy Indonesia", + "license": "AGPL-3", + "installable": True, + "depends": [ + "l10n_id_djbc_plb_common" + ], + "data": [ + "security/ir.model.access.csv", + "wizards/date_range_selector_views.xml", + "reports/lap_plb_lap_pemasukan.xml" + ], +} diff --git a/l10n_id_djbc_plb_lap_pemasukan/reports/__init__.py b/l10n_id_djbc_plb_lap_pemasukan/reports/__init__.py new file mode 100644 index 0000000..4890784 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/reports/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import lap_plb_lap_pemasukan diff --git a/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.py b/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.py new file mode 100644 index 0000000..91387f7 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.py @@ -0,0 +1,131 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields +from openerp import tools + + +class LapPlbLapPemasukan(models.Model): + _name = "l10n_id.djbc_plb_lap_pemasukan" + _description = "Laporan Pemasukan Barang Untuk Pusat Logistik Berikat" + _auto = False + + jenis_dokumen = fields.Many2one( + string="Jenis Dokumen", + comodel_name="l10n_id.djbc_document_type" + ) + + no_dokumen = fields.Char( + string="No. Dokumen" + ) + + tgl_dokumen = fields.Date( + string="Tanggal Dokumen" + ) + + no_penerimaan = fields.Char( + string="Nomor Penerimaan" + ) + + tgl_penerimaan = fields.Char( + string="Tanggal Penerimaan" + ) + + pengirim = fields.Many2one( + string="Pengirim Barang", + comodel_name="res.partner" + ) + + kode_barang = fields.Char( + string="Kode Barang" + ) + + nama_barang = fields.Many2one( + string="Nama Barang", + comodel_name="product.product" + ) + + jumlah = fields.Float( + string="Jumlah" + ) + + satuan = fields.Many2one( + string="Satuan", + comodel_name="product.uom" + ) + + nilai = fields.Float( + string="Nilai" + ) + + warehouse_id = fields.Many2one( + string="Warehouse", + comodel_name="stock.warehouse" + ) + + def _select(self): + select_str = """ + SELECT a.id as id, + C.type_id as jenis_dokumen, + C.name as no_dokumen, + C.date as tgl_dokumen, + B.name as no_penerimaan, + A.date as tgl_penerimaan, + B.partner_id as pengirim, + D.default_code as kode_barang, + A.product_id as nama_barang, + A.product_qty as jumlah, + A.product_uom as satuan, + F.nilai as nilai, + E.warehouse_id AS warehouse_id + """ + return select_str + + def _from(self): + from_str = """ + FROM stock_move AS A + """ + return from_str + + def _where(self): + where_str = """ + WHERE E.djbc_plb_movement_type='in' AND + E.djbc_plb_scrap IS FALSE AND + E.djbc_plb_adjustment IS FALSE + """ + return where_str + + def _join(self): + join_str = """ + LEFT JOIN stock_picking AS B ON A.picking_id=B.id + JOIN l10n_id_djbc_custom_document AS C + ON A.djbc_custom_document_id=C.id + JOIN product_product AS D ON A.product_id=D.id + JOIN stock_picking_type AS E ON A.picking_type_id=E.id + JOIN + ( + SELECT F1.move_id, + SUM(G1.qty*G1.cost) AS nilai + FROM stock_quant_move_rel AS F1 + JOIN stock_quant AS G1 ON F1.quant_id=G1.id + GROUP BY F1.move_id + ) AS F ON F.move_id=A.id + """ + return join_str + + def init(self, cr): + tools.drop_view_if_exists(cr, self._table) + # pylint: disable=locally-disabled, sql-injection + cr.execute("""CREATE or REPLACE VIEW %s as ( + %s + %s + %s + %s + )""" % ( + self._table, + self._select(), + self._from(), + self._join(), + self._where() + )) diff --git a/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.xml b/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.xml new file mode 100644 index 0000000..e0f638d --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/reports/lap_plb_lap_pemasukan.xml @@ -0,0 +1,63 @@ + + + + + + + l10n_id.djbc_plb_lap_mutasi_common Tree + l10n_id.djbc_plb_lap_pemasukan + + + + + + + + + + + + + + + + + + + + l10n_id.djbc_plb_lap_pemasukan Tree + l10n_id.djbc_plb_lap_pemasukan + + + + + + + + + + + + + + + + + + + + + + Lap. Pemasukan Barang + ir.actions.act_window + l10n_id.djbc_plb_lap_pemasukan + form + tree + + + current + + + + diff --git a/l10n_id_djbc_plb_lap_pemasukan/security/ir.model.access.csv b/l10n_id_djbc_plb_lap_pemasukan/security/ir.model.access.csv new file mode 100644 index 0000000..a571943 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_all_djbc_plb_lap_pemasukan,all user l10n_id.djbc_plb_lap_pemasukan,model_l10n_id_djbc_plb_lap_pemasukan,,1,0,0,0 diff --git a/l10n_id_djbc_plb_lap_pemasukan/static/description/icon.png b/l10n_id_djbc_plb_lap_pemasukan/static/description/icon.png new file mode 100644 index 0000000..0f884a8 Binary files /dev/null and b/l10n_id_djbc_plb_lap_pemasukan/static/description/icon.png differ diff --git a/l10n_id_djbc_plb_lap_pemasukan/wizards/__init__.py b/l10n_id_djbc_plb_lap_pemasukan/wizards/__init__.py new file mode 100644 index 0000000..c21edb6 --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/wizards/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import date_range_selector diff --git a/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector.py b/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector.py new file mode 100644 index 0000000..dbf929e --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, models, fields + + +class PLBLapPemasukanWizard(models.TransientModel): + _name = "l10n_id.plb_lap_pemasukan_wizard" + _inherit = ["l10n_id.date_range_selector"] + + warehouse_ids = fields.Many2many( + string="Warehouse", + comodel_name="stock.warehouse", + relation="rel_plb_lap_pemasukan_2_warehouse", + column1="wizard_id", + column2="warehouse_id" + ) + + @api.multi + def action_print_sreen(self): + waction = self.env.ref( + "l10n_id_djbc_plb_lap_pemasukan.djbc_plb_lap_pemasukan_action") + criteria = [ + ("tgl_penerimaan", ">=", self.date_start), + ("tgl_penerimaan", "<=", self.date_end), + ("warehouse_id", "in", self.warehouse_ids.ids) + ] + waction.domain = criteria + return waction.read()[0] diff --git a/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector_views.xml b/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector_views.xml new file mode 100644 index 0000000..264b57c --- /dev/null +++ b/l10n_id_djbc_plb_lap_pemasukan/wizards/date_range_selector_views.xml @@ -0,0 +1,35 @@ + + + + + + + l10n_id.plb_lap_pemasukan_wizard form + l10n_id.plb_lap_pemasukan_wizard + + primary + + + + + + + + Pemasukan Barang + l10n_id.plb_lap_pemasukan_wizard + form + form + + new + + + + +