Browse Source

[FIX]effective date

pull/29/head
cybroodoo 8 years ago
parent
commit
1d783e5bca
  1. 23
      account_pdc_payment_report/README.rst
  2. 2
      account_pdc_payment_report/__manifest__.py
  3. 43
      account_pdc_payment_report/__manifest__.py~
  4. 13
      account_pdc_payment_report/report/report_payment.py
  5. BIN
      account_pdc_payment_report/static/description/banner.jpg
  6. BIN
      account_pdc_payment_report/static/description/icon.png
  7. 15
      account_pdc_payment_report/static/description/index.html
  8. 9
      account_pdc_payment_report/views/report_payment.xml
  9. 2
      account_pdc_payment_report/wizard/account_report_payment.py

23
account_pdc_payment_report/README.rst

@ -1,23 +0,0 @@
PDC Payment Report v10
======================
This module developed to take PDF report of PDC Payments. It is a supporting module of PDC Payment.
Installation
============
Just select it from available modules to install it, there is no need to extra installations.
Configuration
=============
Nothing to configure.
Known Issues
============
*It will note work with Enterprise Edition
Credits
=======
Cybrosys Techno Solutions

2
account_pdc_payment_report/__manifest__.py

@ -27,7 +27,7 @@
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com', 'website': 'http://www.cybrosys.com',
'category': 'Accounting', 'category': 'Accounting',
'summary': 'Report of Payments with Filter for PDC Type', 'summary': 'Report of Payments with filter for PDC type',
'description': """ Report of Payments with filter for PDC type """, 'description': """ Report of Payments with filter for PDC type """,
'depends': ['account_check_printing', 'account_pdc'], 'depends': ['account_check_printing', 'account_pdc'],
'data': [ 'data': [

43
account_pdc_payment_report/__manifest__.py~

@ -1,43 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'PDC Payments Report',
'version': '10.0.1.0',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'category': 'Accounting',
'summary': 'Report of Payments with Filter for PDC Type',
'description': """ Report of Payments with filter for PDC type """,
'depends': ['account_check_printing', 'account_pdc'],
'data': [
'views/account_payment_view.xml',
'views/report_payment.xml',
'wizard/account_report_payment_view.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
}

13
account_pdc_payment_report/report/report_payment.py

@ -8,7 +8,7 @@ _logger = logging.getLogger(__name__)
class ReportPayment(models.AbstractModel): class ReportPayment(models.AbstractModel):
_name = 'report.account_pdc.report_payment_template' _name = 'report.account_pdc_payment_report.report_payment_template'
def lines(self, payment_type, journal_ids, pdc_only, data): def lines(self, payment_type, journal_ids, pdc_only, data):
domain = [] domain = []
@ -28,9 +28,9 @@ class ReportPayment(models.AbstractModel):
if pdc_only: if pdc_only:
domain.append(('payment_method_id.code', '=', 'pdc')) domain.append(('payment_method_id.code', '=', 'pdc'))
if data['form']['effective_date_from']: if data['form']['effective_date_from']:
domain.append(('effective_date_from', '>=', data['form']['effective_date_from'])) domain.append(('effective_date', '>=', data['form']['effective_date_from']))
if data['form']['effective_date_to']: if data['form']['effective_date_to']:
domain.append(('effective_date_to', '<=', data['form']['effective_date_to'])) domain.append(('effective_date', '<=', data['form']['effective_date_to']))
return self.env['account.payment'].search(domain) return self.env['account.payment'].search(domain)
@ -38,13 +38,8 @@ class ReportPayment(models.AbstractModel):
@api.model @api.model
def render_html(self, docids, data=None): def render_html(self, docids, data=None):
# target_move = data['form'].get('target_move', 'all')
# sort_selection = data['form'].get('sort_selection', 'date')
payment_type = data['form']['payment_type'] payment_type = data['form']['payment_type']
pdc_only = data['form']['pdc_only'] pdc_only = data['form']['pdc_only']
# effective_date_from = data['form']['effective_date_from']
# effective_date_to = data['form']['effective_date_to']
res = {} res = {}
for journal in data['form']['journal_ids']: for journal in data['form']['journal_ids']:
res[journal] = self.with_context(data['form'].get('used_context', {})).lines(payment_type, journal, pdc_only, data) res[journal] = self.with_context(data['form'].get('used_context', {})).lines(payment_type, journal, pdc_only, data)
@ -56,4 +51,4 @@ class ReportPayment(models.AbstractModel):
'time': time, 'time': time,
'lines': res, 'lines': res,
} }
return self.env['report'].render('account_pdc.report_payment_template', docargs) return self.env['report'].render('account_pdc_payment_report.report_payment_template', docargs)

BIN
account_pdc_payment_report/static/description/banner.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 75 KiB

BIN
account_pdc_payment_report/static/description/icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

15
account_pdc_payment_report/static/description/index.html

@ -18,22 +18,7 @@
</div> </div>
</section> </section>
<section class="oe_container"> <section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="col-md-12"> <p class='oe_mt32' style="text-align:center;">
If you want to analyze the working of PDC Management Module, Click Here:</p>
</div>
<div class="col-md-12"> <a class="btn btn-info btn-lg mt8 center-block"
style="color: #FFFFFF !important; width: 55%;" href="https://apps.odoo.com/apps/modules/10.0/account_pdc/"><i
class="fa fa-money "></i> PDC Management </a>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> <h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;"> <div class="oe_slogan" style="margin-top:10px !important;">
<div> <div>

9
account_pdc_payment_report/views/report_payment.xml

@ -26,7 +26,6 @@
</div> </div>
</div> </div>
<t t-foreach="docs" t-as="o"> <t t-foreach="docs" t-as="o">
<t t-if="lines[o.id]">
<h4><t t-esc="o.name"/> Journal</h4> <h4><t t-esc="o.name"/> Journal</h4>
<table class="table table-condensed"> <table class="table table-condensed">
<thead> <thead>
@ -41,6 +40,7 @@
<th>State</th> <th>State</th>
</tr> </tr>
</thead> </thead>
<t t-if="lines[o.id]">
<tbody> <tbody>
<tr t-foreach="lines[o.id]" t-as="ap"> <tr t-foreach="lines[o.id]" t-as="ap">
<td><span t-esc="ap.name"/></td> <td><span t-esc="ap.name"/></td>
@ -53,9 +53,8 @@
<td><span t-field="ap.state"/></td> <td><span t-field="ap.state"/></td>
</tr> </tr>
</tbody> </tbody>
</table>
</t> </t>
</table>
</t> </t>
</div> </div>
</t> </t>
@ -68,8 +67,8 @@
model="account.payment" model="account.payment"
string="Payments Report" string="Payments Report"
report_type="qweb-pdf" report_type="qweb-pdf"
name="account_pdc.report_payment_template" name="account_pdc_payment_report.report_payment_template"
file="account_pdc.report_payment_template" file="account_pdc_payment_report.report_payment_template"
/> />
</data> </data>

2
account_pdc_payment_report/wizard/account_report_payment.py

@ -65,7 +65,7 @@ class AccountReportPayment(models.TransientModel):
return self._print_report(data) return self._print_report(data)
def _print_report(self, data): def _print_report(self, data):
return self.env['report'].with_context(landscape=True).get_action(self, 'account_pdc.report_payment_template', data=data) return self.env['report'].with_context(landscape=True).get_action(self, 'account_pdc_payment_report.report_payment_template', data=data)

Loading…
Cancel
Save