diff --git a/account_pdc/__init__.py b/account_pdc/__init__.py new file mode 100644 index 000000000..aa4ed3a7f --- /dev/null +++ b/account_pdc/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/account_pdc/__manifest__.py b/account_pdc/__manifest__.py new file mode 100644 index 000000000..fdb023811 --- /dev/null +++ b/account_pdc/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'PDC Management', + 'version': '12.0.1.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Accounting', + 'summary': 'Extension on Cheques to handle Post Dated Cheques', + 'description': """ Extension on Cheques to handle Post Dated Cheques """, + 'depends': ['account_check_printing'], + 'data': [ + 'data/account_pdc_data.xml', + 'views/account_payment_view.xml', + ], + 'images': ['static/description/pdc_banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/account_pdc/data/account_pdc_data.xml b/account_pdc/data/account_pdc_data.xml new file mode 100644 index 000000000..54ec4ca7f --- /dev/null +++ b/account_pdc/data/account_pdc_data.xml @@ -0,0 +1,19 @@ + + + + + + PDC + pdc + inbound + + + PDC + pdc + outbound + + + + + + \ No newline at end of file diff --git a/account_pdc/models/__init__.py b/account_pdc/models/__init__.py new file mode 100644 index 000000000..50bcf54d5 --- /dev/null +++ b/account_pdc/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from . import account_journal +from . import account_payment diff --git a/account_pdc/models/account_journal.py b/account_pdc/models/account_journal.py new file mode 100644 index 000000000..451782691 --- /dev/null +++ b/account_pdc/models/account_journal.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from odoo import models, api, _ + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + @api.one + @api.depends('outbound_payment_method_ids') + def _compute_check_printing_payment_method_selected(self): + self.check_printing_payment_method_selected = any( + pm.code in ['check_printing', 'pdc'] for pm in self.outbound_payment_method_ids) + + @api.model + def _enable_pdc_on_bank_journals(self): + """ Enables check printing payment method and add a check sequence on bank journals. + Called upon module installation via data file. + """ + pdcin = self.env.ref('account_pdc.account_payment_method_pdc_in') + pdcout = self.env.ref('account_pdc.account_payment_method_pdc_out') + bank_journals = self.search([('type', '=', 'bank')]) + for bank_journal in bank_journals: + # bank_journal._create_check_sequence() + bank_journal.write({ + 'inbound_payment_method_ids': [(4, pdcin.id, None)], + 'outbound_payment_method_ids': [(4, pdcout.id, None)], + }) diff --git a/account_pdc/models/account_payment.py b/account_pdc/models/account_payment.py new file mode 100644 index 000000000..b4ff88123 --- /dev/null +++ b/account_pdc/models/account_payment.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class AccountRegisterPayments(models.TransientModel): + _inherit = "account.register.payments" + + bank_reference = fields.Char(copy=False) + cheque_reference = fields.Char(copy=False) + effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False) + + def get_payment_vals(self): + res = super(AccountRegisterPayments, self).get_payment_vals() + if self.payment_method_id == self.env.ref('account_check_printing.account_payment_method_check'): + res.update({ + 'check_amount_in_words': self.check_amount_in_words, + 'check_manual_sequencing': self.check_manual_sequencing, + 'effective_date': self.effective_date, + }) + return res + + +class AccountPayment(models.Model): + _inherit = "account.payment" + + bank_reference = fields.Char(copy=False) + cheque_reference = fields.Char(copy=False) + effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False) + + @api.multi + def print_checks(self): + """ Check that the recordset is valid, set the payments state to sent and call print_checks() """ + # Since this method can be called via a client_action_multi, we need to make sure the received records are what we expect + self = self.filtered(lambda r: r.payment_method_id.code in ['check_printing', 'pdc'] and r.state != 'reconciled') + + if len(self) == 0: + raise UserError(_("Payments to print as a checks must have 'Check' or 'PDC' selected as payment method and " + "not have already been reconciled")) + if any(payment.journal_id != self[0].journal_id for payment in self): + raise UserError(_("In order to print multiple checks at once, they must belong to the same bank journal.")) + + if not self[0].journal_id.check_manual_sequencing: + # The wizard asks for the number printed on the first pre-printed check + # so payments are attributed the number of the check the'll be printed on. + last_printed_check = self.search([ + ('journal_id', '=', self[0].journal_id.id), + ('check_number', '!=', 0)], order="check_number desc", limit=1) + next_check_number = last_printed_check and last_printed_check.check_number + 1 or 1 + return { + 'name': _('Print Pre-numbered Checks'), + 'type': 'ir.actions.act_window', + 'res_model': 'print.prenumbered.checks', + 'view_type': 'form', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'payment_ids': self.ids, + 'default_next_check_number': next_check_number, + } + } + else: + self.filtered(lambda r: r.state == 'draft').post() + self.write({'state': 'sent'}) + return self.do_print_checks() + + + def _get_move_vals(self, journal=None): + """ Return dict to create the payment move + """ + journal = journal or self.journal_id + if not journal.sequence_id: + raise UserError(_('Configuration Error !'), + _('The journal %s does not have a sequence, please specify one.') % journal.name) + if not journal.sequence_id.active: + raise UserError(_('Configuration Error !'), _('The sequence of journal %s is deactivated.') % journal.name) + name = self.move_name or journal.with_context(ir_sequence_date=self.payment_date).sequence_id.next_by_id() + if self.payment_method_code =='pdc': + date = self.effective_date + else: + date = self.payment_date + return { + 'name': name, + 'date': date, + 'ref': self.communication or '', + 'company_id': self.company_id.id, + 'journal_id': journal.id, + } diff --git a/account_pdc/static/description/account-cheque-cybrosys-1.png b/account_pdc/static/description/account-cheque-cybrosys-1.png new file mode 100644 index 000000000..469e0458c Binary files /dev/null and b/account_pdc/static/description/account-cheque-cybrosys-1.png differ diff --git a/account_pdc/static/description/account-cheque-cybrosys-2.png b/account_pdc/static/description/account-cheque-cybrosys-2.png new file mode 100644 index 000000000..94b6bdd89 Binary files /dev/null and b/account_pdc/static/description/account-cheque-cybrosys-2.png differ diff --git a/account_pdc/static/description/account-cheque-cybrosys-3.png b/account_pdc/static/description/account-cheque-cybrosys-3.png new file mode 100644 index 000000000..174817063 Binary files /dev/null and b/account_pdc/static/description/account-cheque-cybrosys-3.png differ diff --git a/account_pdc/static/description/cybro_logo.png b/account_pdc/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/account_pdc/static/description/cybro_logo.png differ diff --git a/account_pdc/static/description/icon.png b/account_pdc/static/description/icon.png new file mode 100644 index 000000000..f47728351 Binary files /dev/null and b/account_pdc/static/description/icon.png differ diff --git a/account_pdc/static/description/index.html b/account_pdc/static/description/index.html new file mode 100644 index 000000000..91d1b8f38 --- /dev/null +++ b/account_pdc/static/description/index.html @@ -0,0 +1,341 @@ +
+
+

+ PDC Management +

+

+ Manage Post Dated Cheques +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ The module allows the user to handle Post Dated Cheques easly +

+
+
+
+
+

+ Features +

+

+ + handle Post Dated Cheques +

+
+
+
+
+

+ Screenshots +

+

+ + As shown here, You have to select PDC to enable the PDC payment.This is only available with Journal of type 'Bank' +

+
+ +
+

+
+ Payment form have two extra fields to put Bank and Cheque Detail. +
+

+
+ +
+

+
+ When you select PDC, You have to put 'effective date' of PDC. +
+

+
+ +
+
+
+
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + + + + + + diff --git a/account_pdc/static/description/pdc_banner.jpg b/account_pdc/static/description/pdc_banner.jpg new file mode 100644 index 000000000..4725892dd Binary files /dev/null and b/account_pdc/static/description/pdc_banner.jpg differ diff --git a/account_pdc/static/description/pdc_journal.png b/account_pdc/static/description/pdc_journal.png new file mode 100644 index 000000000..de3a74d44 Binary files /dev/null and b/account_pdc/static/description/pdc_journal.png differ diff --git a/account_pdc/static/description/pdc_payment.png b/account_pdc/static/description/pdc_payment.png new file mode 100644 index 000000000..6a0a8ae77 Binary files /dev/null and b/account_pdc/static/description/pdc_payment.png differ diff --git a/account_pdc/static/description/pdc_selected_payment.png b/account_pdc/static/description/pdc_selected_payment.png new file mode 100644 index 000000000..8425bf5b5 Binary files /dev/null and b/account_pdc/static/description/pdc_selected_payment.png differ diff --git a/account_pdc/views/account_payment_view.xml b/account_pdc/views/account_payment_view.xml new file mode 100644 index 000000000..aaa88c39f --- /dev/null +++ b/account_pdc/views/account_payment_view.xml @@ -0,0 +1,77 @@ + + + + account.payment.form.inherited + account.payment + + + +