diff --git a/fleet_report/__init__.py b/fleet_report/__init__.py new file mode 100644 index 000000000..8e126bc5f --- /dev/null +++ b/fleet_report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# 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 . +# +############################################################################## + +import report diff --git a/fleet_report/__openerp__.py b/fleet_report/__openerp__.py new file mode 100644 index 000000000..f6a588941 --- /dev/null +++ b/fleet_report/__openerp__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# 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 . +# +############################################################################## + +{ + 'name': "Fleet Reports", + 'version': '9.0.1.0.0', + 'summary': """Provide PDF report of fleet and Contracts """, + 'author': "Cybrosys Techno Solutions", + 'company': "https://www.cybrosys.com", + 'website': "https://www.cybrosys.com", + 'category': 'Human Resources', + 'depends': ['base', 'fleet'], + 'data': [ + 'report/report.xml', + 'report/fleet_contract_report.xml', + 'report/fleet_report.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, + +} diff --git a/fleet_report/report/__init__.py b/fleet_report/report/__init__.py new file mode 100644 index 000000000..53dfe7092 --- /dev/null +++ b/fleet_report/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# 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 . +# +############################################################################## + +from . import fleet_report_parser diff --git a/fleet_report/report/fleet_contract_report.xml b/fleet_report/report/fleet_contract_report.xml new file mode 100644 index 000000000..4dae2b1e9 --- /dev/null +++ b/fleet_report/report/fleet_contract_report.xml @@ -0,0 +1,89 @@ + + + + + + \ No newline at end of file diff --git a/fleet_report/report/fleet_report.xml b/fleet_report/report/fleet_report.xml new file mode 100644 index 000000000..8f0870712 --- /dev/null +++ b/fleet_report/report/fleet_report.xml @@ -0,0 +1,128 @@ + + + + + + \ No newline at end of file diff --git a/fleet_report/report/fleet_report_parser.py b/fleet_report/report/fleet_report_parser.py new file mode 100644 index 000000000..a3bcf2df4 --- /dev/null +++ b/fleet_report/report/fleet_report_parser.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# 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 . +# +############################################################################## + +from openerp.report import report_sxw +from openerp.osv import osv + + +class FleetParser(report_sxw.rml_parse): + + def __init__(self, cr, uid, name, context=None): + super(FleetParser, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'contract_details': self.contract_details, + 'cost_details': self.cost_details, + 'odoometer_details': self.odoometer_details, + # 'service_details': self.service_details, + + }) + self.context = context + + def contract_details(self, d): + contract = [] + + obj_contract = self.pool.get('fleet.vehicle.log.contract').search(self.cr, self.uid, [('vehicle_id', '=', d)]) + if obj_contract: + for obj in obj_contract: + obj_cont = self.pool.get('fleet.vehicle.log.contract').browse(self.cr, self.uid, obj, context=None) + vals = { + 'vendor': obj_cont.insurer_id.name, + 'date': obj_cont.start_date, + 'date_closed': obj_cont.expiration_date, + 'state': obj_cont.state, + 'type':obj_cont.cost_subtype_id.name, + + } + contract.append(vals) + return contract + + def cost_details(self, d): + contract = [] + + obj_contract = self.pool.get('fleet.vehicle.cost').search(self.cr, self.uid, + [('vehicle_id', '=', d)]) + if obj_contract: + for obj in obj_contract: + obj_cont = self.pool.get('fleet.vehicle.cost').browse(self.cr, self.uid, obj, context=None) + vals = { + 'price': obj_cont.amount, + 'type': obj_cont.cost_subtype_id.name, + 'date': obj_cont.date, + + + } + contract.append(vals) + return contract + + def odoometer_details(self, d): + contract = [] + + obj_contract = self.pool.get('fleet.vehicle.odometer').search(self.cr, self.uid, + [('vehicle_id', '=', d)]) + if obj_contract: + for obj in obj_contract: + obj_cont = self.pool.get('fleet.vehicle.odometer').browse(self.cr, self.uid, obj, context=None) + vals = { + 'date': obj_cont.date, + 'value': obj_cont.value, + 'unit': obj_cont.unit, + + } + contract.append(vals) + return contract + # + # def service_details(self, d): + # contract = [] + # + # obj_contract = self.pool.get('fleet.vehicle.log.services').search(self.cr, self.uid, + # [('vehicle_id', '=', d)]) + # if obj_contract: + # for obj in obj_contract: + # obj_cont = self.pool.get('fleet.vehicle.log.services').browse(self.cr, self.uid, obj, context=None) + # vals = { + # 'type': obj_cont.cost_subtype_id.name, + # 'value': obj_cont.value, + # 'unit': obj_cont.unit, + # + # } + # contract.append(vals) + # + # return contract + + +class PrintReport(osv.AbstractModel): + _name = 'report.fleet_report.report_fleet' + _inherit = 'report.abstract_report' + _template = 'fleet_report.report_fleet' + _wrapped_report_class = FleetParser diff --git a/fleet_report/report/report.xml b/fleet_report/report/report.xml new file mode 100644 index 000000000..0193d8087 --- /dev/null +++ b/fleet_report/report/report.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/fleet_report/static/description/banner .jpg b/fleet_report/static/description/banner .jpg new file mode 100644 index 000000000..92d2225bb Binary files /dev/null and b/fleet_report/static/description/banner .jpg differ diff --git a/fleet_report/static/description/cybro_logo.png b/fleet_report/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/fleet_report/static/description/cybro_logo.png differ diff --git a/fleet_report/static/description/icon .png b/fleet_report/static/description/icon .png new file mode 100644 index 000000000..a7cdd176a Binary files /dev/null and b/fleet_report/static/description/icon .png differ diff --git a/fleet_report/static/description/index.html b/fleet_report/static/description/index.html new file mode 100644 index 000000000..e51c56d02 --- /dev/null +++ b/fleet_report/static/description/index.html @@ -0,0 +1,86 @@ +
+
+

Fleet Reports

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

Fleet Report

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

+ The Above Pdf gives the details Of Each vehicles Odometer reading,Costs and also Service details. +

+
+
+ +
+
+
+ +
+
+

Fleet Contract Report

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

Need Any Help?

+ +
diff --git a/fleet_report/static/description/pic1.png b/fleet_report/static/description/pic1.png new file mode 100644 index 000000000..a8f58c9e1 Binary files /dev/null and b/fleet_report/static/description/pic1.png differ diff --git a/fleet_report/static/description/pic_2.png b/fleet_report/static/description/pic_2.png new file mode 100644 index 000000000..5522ecaae Binary files /dev/null and b/fleet_report/static/description/pic_2.png differ diff --git a/fleet_report/static/description/pic_3.png b/fleet_report/static/description/pic_3.png new file mode 100644 index 000000000..6d3d72591 Binary files /dev/null and b/fleet_report/static/description/pic_3.png differ diff --git a/fleet_report/static/description/pic_5.png b/fleet_report/static/description/pic_5.png new file mode 100644 index 000000000..9dc4ba410 Binary files /dev/null and b/fleet_report/static/description/pic_5.png differ diff --git a/fleet_report/static/description/pic_6.png b/fleet_report/static/description/pic_6.png new file mode 100644 index 000000000..b19e9df4f Binary files /dev/null and b/fleet_report/static/description/pic_6.png differ