diff --git a/pos_restaurant_floor_facility/README.rst b/pos_restaurant_floor_facility/README.rst new file mode 100644 index 000000000..23261186a --- /dev/null +++ b/pos_restaurant_floor_facility/README.rst @@ -0,0 +1,28 @@ +==================================== +Floor Wise Charges in Restaurant v10 +==================================== +This module adds floor wise charging facility in POS Restaurant. + +Installation +============ +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= +Nothing to configure. + +Usage +===== +* Create some Facility and its charging percentage. +* POS-> Configuration-> Floor Facility. + +* Add created facility to floors. +* POS-> Configuration-> Floor Plans-> Add Facility Lines + +* On clicking a product in pos screen, Amount will add automatically. + +Credits +======= +Developer: Nilmar Shereef @ cybrosys, shereef@cybrosys.in + + diff --git a/pos_restaurant_floor_facility/__init__.py b/pos_restaurant_floor_facility/__init__.py new file mode 100644 index 000000000..edb32423b --- /dev/null +++ b/pos_restaurant_floor_facility/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 models diff --git a/pos_restaurant_floor_facility/__manifest__.py b/pos_restaurant_floor_facility/__manifest__.py new file mode 100644 index 000000000..d087d3d69 --- /dev/null +++ b/pos_restaurant_floor_facility/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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': 'Floor Wise Charge in Restaurant', + 'version': '10.0.1.0.0', + 'summary': """Product Price Change Based on Floor of POS Restaurant.""", + 'description': """Module adds the facility charge of floor with each products in POS restaurant""", + 'author': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + 'category': 'Point Of Sale', + 'depends': ['point_of_sale', + 'pos_restaurant'], + 'data': [ + 'views/pos_restaurant_extra_facility.xml', + 'views/templates.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/pos_restaurant_floor_facility/models/__init__.py b/pos_restaurant_floor_facility/models/__init__.py new file mode 100644 index 000000000..cbbc6fa88 --- /dev/null +++ b/pos_restaurant_floor_facility/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 pos_restaurant_extra_facility diff --git a/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py b/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py new file mode 100644 index 000000000..eca871610 --- /dev/null +++ b/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 odoo import models, fields, api + + +class FacilityRestaurant(models.Model): + + _inherit = "restaurant.floor" + + rest_floor_facility = fields.One2many('restaurant.floor.line', 'ref_field', string='Floor Facility') + facility_service_percentage = fields.Float(string="Active Facility Charge %", readonly=True) + + @api.onchange('rest_floor_facility') + def onchange_facility(self): + sum_of_percentage = 0.0 + for records in self.rest_floor_facility: + sum_of_percentage += records.line_percentage + self.facility_service_percentage = sum_of_percentage + + +class FacilityRestaurantLines(models.Model): + _name = "restaurant.floor.line" + + name = fields.Many2one('restaurant.floor.facility') + line_percentage = fields.Float(string="Extra Charging Percentage") + ref_field = fields.Many2one('restaurant.floor', invisible=True, ondelete='cascade') + + @api.onchange('name') + def onchange_facility(self): + if self.name: + self.line_percentage = self.name.percentage + + +class FloorFacility(models.Model): + + _name = "restaurant.floor.facility" + + name = fields.Char(string="Name", required=True,) + percentage = fields.Float(string="Extra Charging Percentage(%)", required=True, + help="Increment percentage of the each Product Price ") + description = fields.Html(string="Description") diff --git a/pos_restaurant_floor_facility/static/description/1.png b/pos_restaurant_floor_facility/static/description/1.png new file mode 100644 index 000000000..53c275d34 Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/1.png differ diff --git a/pos_restaurant_floor_facility/static/description/2.png b/pos_restaurant_floor_facility/static/description/2.png new file mode 100644 index 000000000..4bcf0c2af Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/2.png differ diff --git a/pos_restaurant_floor_facility/static/description/3.png b/pos_restaurant_floor_facility/static/description/3.png new file mode 100644 index 000000000..cbb656b8f Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/3.png differ diff --git a/pos_restaurant_floor_facility/static/description/4.png b/pos_restaurant_floor_facility/static/description/4.png new file mode 100644 index 000000000..6eb12cd48 Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/4.png differ diff --git a/pos_restaurant_floor_facility/static/description/5.png b/pos_restaurant_floor_facility/static/description/5.png new file mode 100644 index 000000000..1afe94e1b Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/5.png differ diff --git a/pos_restaurant_floor_facility/static/description/cybro_logo.png b/pos_restaurant_floor_facility/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_restaurant_floor_facility/static/description/cybro_logo.png differ diff --git a/pos_restaurant_floor_facility/static/description/index.html b/pos_restaurant_floor_facility/static/description/index.html new file mode 100644 index 000000000..b8bc86d18 --- /dev/null +++ b/pos_restaurant_floor_facility/static/description/index.html @@ -0,0 +1,100 @@ +
+
+

Floor Wise Charges in Restaurant

+

User can set floor facility charges on Products

+

Cybrosys Technologies , www.cybrosys.com

+
+

Features:

+
    +
  •    Facilities With Charging Percentage.
  • +
  •    Facility Lines in Floor Master.
  • +
  •    Enables Separate Price in Floors Wise.
  • +
  •    Simple Configuration.
  • +
+
+
+
+ +
+

Facility Master - Tree View

+
+
+
+ +
+
+
+
+ +
+

Facility Master - Form View

+
+

+

    +
  • Facilities with its charging percentage.
  • +
  • Images and bullet points of facility.
  • +
+

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

Floor Master With Facility Lines - Form View

+
+

+

    +
  • Facility lines with its charging percentage.
  • +
  • User can alter its charges from this lines.
  • +
  • Automated total affecting facility percentage of floor.
  • +
+

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

Floor Wise Price Change - POS Screen

+
+

+

    +
  • Floor facility charge will added with actual price of product.
  • +
+

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

Need Any Help?

+ + +
\ No newline at end of file diff --git a/pos_restaurant_floor_facility/static/src/js/facility_floor.js b/pos_restaurant_floor_facility/static/src/js/facility_floor.js new file mode 100644 index 000000000..a8d75d907 --- /dev/null +++ b/pos_restaurant_floor_facility/static/src/js/facility_floor.js @@ -0,0 +1,20 @@ +odoo.define('pos_restaurant_floor_facility.floor_facility_rate_addition', function (require) { +'use strict'; +alert("aaaaaaaa"); +var models = require('point_of_sale.models'); +var screens = require('point_of_sale.screens'); +var restaurant = require('pos_restaurant.floors'); + +models.load_fields("restaurant.floor",['facility_service_percentage']); + +screens.ProductScreenWidget.include({ + click_product: function(product) { + if(product.to_weight && this.pos.config.iface_electronic_scale){ + this.gui.show_screen('scale',{product: product}); + }else{ + this.pos.get_order().add_product(product,{ price: product.price + + (product.price * this.pos.table.floor.facility_service_percentage)/100}); + } + } +}); +}); \ No newline at end of file diff --git a/pos_restaurant_floor_facility/views/pos_restaurant_extra_facility.xml b/pos_restaurant_floor_facility/views/pos_restaurant_extra_facility.xml new file mode 100644 index 000000000..78f6b46ad --- /dev/null +++ b/pos_restaurant_floor_facility/views/pos_restaurant_extra_facility.xml @@ -0,0 +1,69 @@ + + + + + Floor View Extra + restaurant.floor + + + + + + + + + + + + + + + + + + + + Floor Facility Form + restaurant.floor.facility + +
+ + + + + + + + + + + +
+
+
+ + + Floor Facility Tree + restaurant.floor.facility + + + + + + + + + + Floor Facility + restaurant.floor.facility + form + tree,form + +

+ Click to add a new facility. +

+
+
+ +
+
\ No newline at end of file diff --git a/pos_restaurant_floor_facility/views/templates.xml b/pos_restaurant_floor_facility/views/templates.xml new file mode 100644 index 000000000..be7cdeb99 --- /dev/null +++ b/pos_restaurant_floor_facility/views/templates.xml @@ -0,0 +1,10 @@ + + + + + +