| @ -0,0 +1,23 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################# | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| # | |||
| #    Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | |||
| #    Author: Cybrosys Techno Solutions(odoo@cybrosys.com) | |||
| # | |||
| #    You can modify it under the terms of the GNU AFFERO | |||
| #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | |||
| # | |||
| #    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 | |||
| #    (AGPL v3) along with this program. | |||
| #    If not, see <http://www.gnu.org/licenses/>. | |||
| # | |||
| ############################################################################# | |||
| 
 | |||
| from . import models | |||
| @ -0,0 +1,43 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################# | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| # | |||
| #    Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | |||
| #    Author: Cybrosys Techno Solutions(odoo@cybrosys.com) | |||
| # | |||
| #    You can modify it under the terms of the GNU AFFERO | |||
| #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | |||
| # | |||
| #    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 | |||
| #    (AGPL v3) along with this program. | |||
| #    If not, see <http://www.gnu.org/licenses/>. | |||
| # | |||
| ############################################################################# | |||
| { | |||
|     'name': "POS Discount Manager Approval", | |||
|     'version': '14.0.1.0.0', | |||
|     'summary': """Discount limit for each employee in every  point of sale""", | |||
|     'description': """"This module helps you to set a discount limit for each employee in every  point of sale.  | |||
|     It facilitate the manager approval when discount over the limit of employee""", | |||
|     'category': 'Point Of Sale', | |||
|     'author': 'Cybrosys Techno Solutions', | |||
|     'company': 'Cybrosys Techno Solutions', | |||
|     'maintainer': "Cybrosys Techno Solutions", | |||
|     'website': "http://www.cybrosys.com", | |||
|     'version': '14.0.1.0.0', | |||
|     'depends': ['point_of_sale', 'hr'], | |||
|     'data': [ | |||
|         'views/hr_employee_inherit_view.xml', | |||
|         'views/templates.xml', | |||
|     ], | |||
|     'images': ['static/description/banner.jpg'], | |||
|     'license': 'AGPL-3', | |||
|     'installable': True, | |||
|     'application': True, | |||
| } | |||
| @ -0,0 +1,8 @@ | |||
| ## Module <pos_discount_manager> | |||
| 
 | |||
| #### 15.05.2021 | |||
| #### Version 14.0.1.0.0 | |||
| ##### ADD | |||
| - Initial commit | |||
| 
 | |||
| 
 | |||
| @ -0,0 +1,23 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################# | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| # | |||
| #    Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | |||
| #    Author: Cybrosys Techno Solutions(odoo@cybrosys.com) | |||
| # | |||
| #    You can modify it under the terms of the GNU AFFERO | |||
| #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | |||
| # | |||
| #    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 | |||
| #    (AGPL v3) along with this program. | |||
| #    If not, see <http://www.gnu.org/licenses/>. | |||
| # | |||
| ############################################################################# | |||
| 
 | |||
| from . import hr_employee_inherit | |||
| @ -0,0 +1,31 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################# | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| # | |||
| #    Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | |||
| #    Author: Cybrosys Techno Solutions(odoo@cybrosys.com) | |||
| # | |||
| #    You can modify it under the terms of the GNU AFFERO | |||
| #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | |||
| # | |||
| #    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 | |||
| #    (AGPL v3) along with this program. | |||
| #    If not, see <http://www.gnu.org/licenses/>. | |||
| # | |||
| ############################################################################# | |||
| 
 | |||
| from odoo import models, fields, api | |||
| 
 | |||
| 
 | |||
| class DiscountRestrictCat(models.Model): | |||
|     _inherit = 'hr.employee' | |||
| 
 | |||
|     limited_discount = fields.Integer(string="Discount Limit") | |||
| 
 | |||
| 
 | |||
| 
 | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 16 KiB | 
| After Width: | Height: | Size: 302 KiB | 
| After Width: | Height: | Size: 1.1 KiB | 
| After Width: | Height: | Size: 1.0 KiB | 
| After Width: | Height: | Size: 752 B | 
| After Width: | Height: | Size: 1.7 KiB | 
| After Width: | Height: | Size: 132 KiB | 
| After Width: | Height: | Size: 133 KiB | 
| After Width: | Height: | Size: 92 KiB | 
| After Width: | Height: | Size: 76 KiB | 
| After Width: | Height: | Size: 130 KiB | 
| After Width: | Height: | Size: 860 B | 
| After Width: | Height: | Size: 1.0 KiB | 
| After Width: | Height: | Size: 53 KiB | 
| After Width: | Height: | Size: 11 KiB | 
| @ -0,0 +1,613 @@ | |||
| <div class="oe_styling_v8"> | |||
|     <!-- HERO --> | |||
|     <section class="oe_container" style="font-family: Montserrat, 'sans-serif'; padding:2rem 3rem 1rem"> | |||
|         <div class="row deep-4" style="max-width:1540px; margin:0 auto; border-radius: 10px;"> | |||
|             <!-- LEFT HERO --> | |||
|             <div class="col-lg-6" style="margin-top: 0rem; padding: 3rem"> | |||
|                 <h1 class="font-weight-bold text-dark">Point of Sale Discount Manager Approval</h1> | |||
|                 <p class="lead text-dark">Discount limit for each employee in every  point of sale</p> | |||
|                 <!-- KEY FEATURES --> | |||
|                 <h5 class="font-weight-bold text-dark mt-4">Key Features</h5> | |||
|                 <hr class="mb-4" style="border: 2px solid #377DFF; max-width: 50px; margin-left: 0;"> | |||
| 
 | |||
| 
 | |||
|                 <div class="d-flex justify-content-start align-items-center"> | |||
|                     <div class="p-3 d-flex justify-content-center align-items-center" | |||
|                         style="background-color: #FFBA08; height: 35px; width: 35px; border-radius: 50%;"><img | |||
|                             src="https://i.ibb.co/P1sH08G/shop-icon.png" height="20px" width="20px"></div> | |||
|                     <p class="font-weight-bold ml-2 tex-dark" style="margin-top: 20px;">Discount limits for employee.</p> | |||
|                 </div> | |||
| 
 | |||
|                 <div class="d-flex justify-content-start align-items-center"> | |||
|                     <div class="p-3 d-flex justify-content-center align-items-center" | |||
|                         style="background-color: #F23970; height: 35px; width: 35px; border-radius: 50%;"><img | |||
|                             src="https://i.ibb.co/qNTqSKW/money-icon.png" height="20px" width="20px"></div> | |||
|                     <p class="font-weight-bold ml-2 tex-dark" style="margin-top: 20px;">Manager approval over the discount limit.</p> | |||
|                 </div> | |||
| 
 | |||
|                 <!-- END OF KEY FEATURES --> | |||
|             </div> | |||
|             <!-- END OF LEFT HERO --> | |||
|             <!-- RIGHT HERO --> | |||
|             <div class="col-lg-6 bg-white" | |||
|                 style="background-image: url('/pos_discount_manager/static/description/assets/hero.png'); background-size: cover; background-repeat: no-repeat; margin-top: 0rem; padding: 3rem; border-radius: 0px 10px 10px 0px;"> | |||
|             </div> | |||
|             <!-- END OF RIGHT HERO --> | |||
|         </div> | |||
|     </section> | |||
|     <!-- END OF HERO --> | |||
| 
 | |||
|     <!-- TAB LIST --> | |||
|     <section class="oe_container d-flex" style="margin: -1rem 0 3rem; padding:4rem 3rem 1rem"> | |||
|         <div class="row bg-white deep-4" | |||
|             style="max-width:1540px; margin:0 auto; padding: 3rem 2.5rem; border-radius: 10px;"> | |||
|             <div class="col-lg-12"> | |||
|                 <h5 class="font-weight-bold text-dark mt-4">App Details</h5> | |||
|                 <hr class="mb-4" style="border: 2px solid #377DFF; max-width: 50px; margin-left: 0;"> | |||
|                 <!-- TAB LIST --> | |||
|                 <div class="row pt-3"> | |||
|                     <div class="col-md-4"> | |||
|                         <!-- PILLS --> | |||
|                         <div class="nav flex-column nav-pills" id="pills" role="tablist"> | |||
| 
 | |||
|                             <a class="nav-link mb-2" | |||
|                                 style="padding:2px; border-radius: 0px; background-color: none !important" id="pill1" | |||
|                                 data-toggle="pill" href="#tab1" role="tab" aria-controls="tab1" aria-selected="true"> | |||
|                                 <div class="bg-white p-2 d-flex justify-content-between align-items-center" | |||
|                                     style="border: none;"> | |||
|                                     <div class="d-flex"> | |||
|                                         <div class="d-flex justify-content-center align-content-center" | |||
|                                             style="width:30px; height:30px; background-color:#377DFF; border-radius:50%; padding:5px"> | |||
|                                             <img class="img-fluid align-top" | |||
|                                                 src="https://i.ibb.co/ZVvdXQ6/doughnut-icon.png" width="40px" | |||
|                                                 height="40px"> | |||
|                                         </div> | |||
|                                         <div class="pl-2 mt-1"> | |||
|                                             <h4 class="h6 mb-1 d-flex align-items-center text-dark font-weight-bold"> | |||
|                                                 Overview</h4> | |||
|                                         </div> | |||
|                                     </div> | |||
|                                     <div style="font-size: 0.9rem;"> | |||
|                                         <i class="fa fa-chevron-right" style="color: #dfe6e9;"></i> | |||
|                                     </div> | |||
|                                 </div> | |||
|                             </a> | |||
| 
 | |||
|                             <a class="nav-link mb-2" | |||
|                                 style="padding:2px; border-radius: 0px; background-color: none !important" id="pill2" | |||
|                                 data-toggle="pill" href="#tab2" role="tab" aria-controls="tab2" aria-selected="true"> | |||
|                                 <div class="bg-white p-2 d-flex justify-content-between align-items-center" | |||
|                                     style="border: none;"> | |||
|                                     <div class="d-flex"> | |||
|                                         <div class="d-flex justify-content-center align-content-center" | |||
|                                             style="width:30px; height:30px; background-color:#377DFF; border-radius:50%; padding:5px"> | |||
|                                             <img class="img-fluid align-top" | |||
|                                                 src="https://i.ibb.co/4d08Ryj/wrench-icon.png" width="40px" | |||
|                                                 height="40px"> | |||
|                                         </div> | |||
|                                         <div class="pl-2 mt-1"> | |||
|                                             <h4 class="h6 mb-1 d-flex align-items-center text-dark font-weight-bold"> | |||
|                                                 Configuration</h4> | |||
|                                         </div> | |||
|                                     </div> | |||
|                                     <div style="font-size: 0.9rem;"> | |||
|                                         <i class="fa fa-chevron-right" style="color: #dfe6e9;"></i> | |||
|                                     </div> | |||
|                                 </div> | |||
|                             </a> | |||
| 
 | |||
|                             <a class="nav-link mb-2" | |||
|                                 style="padding:2px; border-radius: 0px; background-color: none !important" id="pill3" | |||
|                                 data-toggle="pill" href="#tab3" role="tab" aria-controls="tab3" aria-selected="true"> | |||
|                                 <div class="bg-white p-2 d-flex justify-content-between align-items-center" | |||
|                                     style="border: none;"> | |||
|                                     <div class="d-flex"> | |||
|                                         <div class="d-flex justify-content-center align-content-center" | |||
|                                             style="width:30px; height:30px; background-color:#377DFF; border-radius:50%; padding:5px"> | |||
|                                             <img class="img-fluid align-top" | |||
|                                                 src="https://i.ibb.co/4YYd6XQ/star-icon.png" width="40px" height="40px"> | |||
|                                         </div> | |||
|                                         <div class="pl-2 mt-1"> | |||
|                                             <h4 class="h6 mb-1 d-flex align-items-center text-dark font-weight-bold"> | |||
|                                                 Features</h4> | |||
|                                         </div> | |||
|                                     </div> | |||
|                                     <div style="font-size: 0.9rem;"> | |||
|                                         <i class="fa fa-chevron-right" style="color: #dfe6e9;"></i> | |||
|                                     </div> | |||
|                                 </div> | |||
|                             </a> | |||
| 
 | |||
|                             <a class="nav-link mb-2" | |||
|                                 style="padding:2px; border-radius: 0px; background-color: none !important" id="pill4" | |||
|                                 data-toggle="pill" href="#tab4" role="tab" aria-controls="tab4" aria-selected="true"> | |||
|                                 <div class="bg-white   p-2 d-flex justify-content-between align-items-center" | |||
|                                     style="border: none;"> | |||
|                                     <div class="d-flex"> | |||
|                                         <div class="d-flex justify-content-center align-content-center" | |||
|                                             style="width:30px; height:30px; background-color:#377DFF; border-radius:50%; padding:5px"> | |||
|                                             <img class="img-fluid align-top" | |||
|                                                 src="https://i.ibb.co/41xqSk5/picture-icon.png" width="30px" | |||
|                                                 height="30px"> | |||
|                                         </div> | |||
|                                         <div class="pl-2 mt-1"> | |||
|                                             <h4 class="h6 mb-1 d-flex align-items-center text-dark font-weight-bold"> | |||
|                                                 Screenshots</h4> | |||
|                                         </div> | |||
|                                     </div> | |||
|                                     <div style="font-size: 0.9rem;"> | |||
|                                         <i class="fa fa-chevron-right" style="color: #dfe6e9;"></i> | |||
|                                     </div> | |||
|                                 </div> | |||
|                             </a> | |||
| 
 | |||
|                         </div> | |||
|                         <!-- END OF PILLS --> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="col-md-8 pl-lg-4"> | |||
|                         <!-- PILL 1 --> | |||
|                         <div class="tab-content bg-white p-3" id="tab-content"> | |||
|                             <div class="tab-pane fade show active" id="tab1" role="tabpanel" aria-labelledby="pill1"> | |||
|                                 <h5 class="mb-2">Point of Sale Discount Manager Approval</h5> | |||
|                                 <p class="text-dark" style="font-size: 0.9rem"> | |||
|                                     This module sets discount limit for each employee by manager. And manager approval over the discount limit by employee. | |||
|                                 </p> | |||
|                             </div> | |||
| 
 | |||
|                             <!-- END OF PILL 1 --> | |||
| 
 | |||
|                             <!-- CONFIGURATION --> | |||
|                             <div class="tab-pane fade" id="tab2" role="tabpanel" aria-labelledby="pill2"> | |||
|                                 <h5 class="mb-2">Configuration</h5> | |||
|                                 | |||
|                                 <ul> | |||
|                                     <li>Sets discount limit for each employee.</li> | |||
|                                     <li>Manager Can Set the PIN</li> | |||
|                                     <li>Manager pin needed for approving the discount given by the employee.</li> | |||
|                                     | |||
|                                 </ul> | |||
| 
 | |||
|                             </div> | |||
|                             <!-- END OF CONFIGURATION --> | |||
| 
 | |||
|                             <!-- FEATURES --> | |||
|                             <div class="tab-pane fade" id="tab3" role="tabpanel" aria-labelledby="pill3"> | |||
|                                 <h5 class="mb-2">Features</h5> | |||
|                                 | |||
|                                 <div class="row"> | |||
|                                     <div class="col-lg-5 card p-3 m-3 bg-light d-flex flex-row justify-content-start align-items-center" | |||
|                                         style="border-radius: 5px;"> | |||
|                                         <div class="p-3 d-flex justify-content-center align-items-center" | |||
|                                             style="background-color: #20bf6b; height: 55px; width: 55px; border-radius: 50%;"> | |||
|                                             <img src="https://i.ibb.co/yXbGjgv/sync-icon.png" height="30px" | |||
|                                                 width="30px"> | |||
|                                         </div> | |||
| 
 | |||
|                                         <h6 class="mt-2 ml-3">Sets discount limit for each employee</h6> | |||
|                                     </div> | |||
| 
 | |||
|                                     <div class="col-lg-5 card p-3 m-3 bg-light d-flex flex-row justify-content-start align-items-center" | |||
|                                         style="border-radius: 5px;"> | |||
|                                         <div class="p-3 d-flex justify-content-center align-items-center" | |||
|                                             style="background-color: #F23970; height: 55px; width: 55px; border-radius: 50%;"> | |||
|                                             <img src="https://i.ibb.co/P1sH08G/shop-icon.png" height="30px" | |||
|                                                 width="30px"> | |||
|                                         </div> | |||
| 
 | |||
|                                         <h6 class="mt-2 ml-3">Manager pin needed for approving the discount given by the employee.</h6> | |||
|                                     </div> | |||
| 
 | |||
| 
 | |||
|                                 </div> | |||
|                             </div> | |||
|                             <!-- END OF FEATURES --> | |||
| 
 | |||
|                             <!-- SCREENSHOTS --> | |||
|                             <div class="tab-pane fade" id="tab4" role="tabpanel" aria-labelledby="pill4"> | |||
|                                 <h5 class="mb-3">Screenshots</h5> | |||
|                                 <img src="./assets/screenshots/1.png" | |||
|                                     class="img-fluid img-thumbnail rounded mt-4"> | |||
|                                 <h6 class="text-dark mt-3"> | |||
|                                     Caption | |||
|                                 </h6> | |||
|                                 <p class="text-dark mb-3" style="font-size: 0.9rem"> | |||
|                                     setting the discount to employee. | |||
|                                 </p> | |||
| 
 | |||
|                                 <img src="./assets/screenshots/2.png" | |||
|                                     class="img-fluid img-thumbnail rounded mt-4"> | |||
|                                 <h6 class="text-dark mt-3"> | |||
|                                     Caption | |||
|                                 </h6> | |||
|                                 <p class="text-dark mb-3" style="font-size: 0.9rem"> | |||
|                                     set the pin to manager. | |||
|                                 </p> | |||
| 
 | |||
|                                 <img src="./assets/screenshots/5.png" | |||
|                                     class="img-fluid img-thumbnail rounded mt-4"> | |||
|                                 <h6 class="text-dark mt-3"> | |||
|                                     Caption | |||
|                                 </h6> | |||
|                                 <p class="text-dark mb-3" style="font-size: 0.9rem"> | |||
|                                     set employee for sale. | |||
|                                 </p> | |||
| 
 | |||
|                                 <img src="./assets/screenshots/3.png" | |||
|                                     class="img-fluid img-thumbnail rounded mt-4"> | |||
|                                 <h6 class="text-dark mt-3"> | |||
|                                     Caption | |||
|                                 </h6> | |||
|                                 <p class="text-dark mb-3" style="font-size: 0.9rem"> | |||
|                                    shop the product. | |||
|                                 </p> | |||
| 
 | |||
|                                 <img src="./assets/screenshots/4.png" | |||
|                                     class="img-fluid img-thumbnail rounded mt-4"> | |||
|                                 <h6 class="text-dark mt-3"> | |||
|                                     Caption | |||
|                                 </h6> | |||
|                                 <p class="text-dark mb-3" style="font-size: 0.9rem"> | |||
|                                    manager approval for unlimited discount. | |||
|                                 </p> | |||
| 
 | |||
|                                  | |||
| 
 | |||
| 
 | |||
| 
 | |||
|                             </div> | |||
|                             <!-- END OF SCREENSHOTS --> | |||
| 
 | |||
|                         </div> | |||
|                     </div> | |||
|                 </div> | |||
|             </div> | |||
|         </div> | |||
|     </section> | |||
|     <!-- END OF TAB LIST --> | |||
|     <!-- Suggested Products --> | |||
|     <section class="oe_container" style="padding:2rem 3rem 1rem; max-width:1540px; margin: 0 auto; "> | |||
|         <h2 style="font-weight:600; text-align:center; margin-bottom:1rem; width:100%">Suggested Products</h2> | |||
|         <hr | |||
|             style="background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> | |||
|         <div id="suggestedSlider" class="row carousel slide mt-4" data-ride="carousel"> | |||
|             <!-- The slideshow --> | |||
|             <div class="carousel-inner"> | |||
|                 <div class="carousel-item" style="min-height: 191px;"> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/13.0/project_task_timer/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/project_task_timer.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/13.0/project_report_pdf/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/project_repo.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/13.0/project_custom_gantt/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/project_gantt.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                 </div> | |||
|                 <div class="carousel-item active" style="min-height: 191px;"> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/12.0/project_task_timer/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/task_image.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/13.0/task_deadline_reminder/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/reminder.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                     <div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> | |||
|                         <a href="https://apps.odoo.com/apps/modules/12.0/project_report_pdf/" target="_blank"> | |||
|                             <div style="border-radius:10px"> | |||
|                                 <img class="img img-responsive center-block" | |||
|                                     style="border-top-left-radius:10px; border-top-right-radius:10px" | |||
|                                     src="//apps.odoocdn.com/apps/assets/14.0/custom_gantt_view/images/project_report.png?ae168aa"> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                 </div> | |||
|             </div> | |||
|             <!-- Left and right controls --> | |||
|             <a class="carousel-control-prev" href="#suggestedSlider" data-slide="prev" style="width:35px; color:#000"> | |||
|                 <span class="carousel-control-prev-icon"><i class="fa fa-chevron-left" | |||
|                         style="font-size:24px"></i></span> </a> <a class="carousel-control-next" href="#suggestedSlider" | |||
|                 data-slide="next" style="width:35px; color:#000"> | |||
|                 <span class="carousel-control-next-icon"><i class="fa fa-chevron-right" | |||
|                         style="font-size:24px"></i></span> | |||
|             </a> | |||
|         </div> | |||
|     </section> | |||
|     <!-- End of Suggested Products --> | |||
|     <!-- Our Services --> | |||
|     <section class="oe_container" style="padding:2rem 3rem 1rem"> | |||
|         <!-- <h2 style="font-weight:600; text-align:center; margin-bottom:1rem; width:100%">Our Services</h2> | |||
|         <hr | |||
|         style="background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> --> | |||
|         <div class="row mt-4 position-relative" style="max-width:1540px; margin: 0 auto;"> | |||
|             <div class="col-lg-12 jumbotron text-white position-relative shadow-lg" | |||
|                 style="background: #E0EAFC;  background: -webkit-linear-gradient(to right, #f1f5fb, #E0EAFC);  background: linear-gradient(to right, #f1f5fb, #E0EAFC);  background-size: cover; background-position: bottom; border-radius: 10px;"> | |||
|                 <span class="badge badge-pill px-3 py-2 text-white shadow-sm  font-weight-bold" | |||
|                     style="background-color: #377DFF;"><i class="fa fa-trophy mr-2"></i>Odoo Gold Partner</span> | |||
|                 <div class="row"> | |||
|                     <div class="col-lg-6 mt-4"> | |||
|                         <h1 class="text-dark">Our Services</h1> | |||
|                         <p class="lead text-dark">We provide following services</p> | |||
|                         <ul class="mt-4" style="list-style: none; padding: 0; line-height: 2.8; font-weight: 500;"> | |||
|                             <li><a class="text-dark" | |||
|                                     href="https://www.cybrosys.com/odoo-customization-and-installation/" | |||
|                                     style="color: white; text-decoration: none;" target="_blank"><i | |||
|                                         class="fa fa-cogs mr-2" style="color: #377DFF; font-size: 1.5rem"></i>Odoo | |||
|                                     Customization</a></li> | |||
|                             <li><a class="text-dark" href="https://www.cybrosys.com/odoo-erp-implementation/" | |||
|                                     style="color: white; text-decoration: none;" target="_blank"><i | |||
|                                         class="fa fa-wrench mr-2" style="color: #377DFF; font-size: 1.5rem"></i>Odoo | |||
|                                     Implementation</a></li> | |||
|                             <li><a class="text-dark" href="https://www.cybrosys.com/odoo-erp-support/" | |||
|                                     style="color: white; text-decoration: none;" target="_blank"><i | |||
|                                         class="fa fa-life-ring mr-2" style="color: #377DFF; font-size: 1.5rem"></i>Odoo | |||
|                                     Support</a></li> | |||
|                             <li><a class="text-dark" href="https://www.cybrosys.com/hire-odoo-developer/" | |||
|                                     style=text-decoration: none;" target="_blank"><i class="fa fa-user mr-2" | |||
|                                         style="color: #377DFF; font-size: 1.5rem"></i> | |||
|                                     Hire | |||
|                                     Odoo Developers</a></li> | |||
|                         </ul> | |||
|                     </div> | |||
|                 </div> | |||
|             </div> | |||
|             <img src="https://i.ibb.co/YLRGpvL/trophy.png" width="45%" height="auto" alt="Odoo Gold Partner" | |||
|                 class="position-absolute" style="right: 0; bottom: 0;"> | |||
|         </div> | |||
|     </section> | |||
|     <!-- End of Our Services --> | |||
|     <!-- Our Industries --> | |||
|     <section class="oe_container mt-4" style="padding:2rem 3rem 1rem"> | |||
|         <div class="row" style="max-width:1540px; margin: 0 auto; "> | |||
|             <div class="col-lg-12"> | |||
|                 <h2 style="font-weight:600; text-align:center; margin-bottom:1rem; width:100%">Our | |||
|                     Industries</h2> | |||
|                 <hr | |||
|                     style="background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> | |||
|             </div> | |||
|             <div class="row mt-4 position-relative" style="max-width:1540px; margin: 0 auto;"> | |||
|                 <!-- Left Column --> | |||
|                 <div class="col-lg-6"> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 mb-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/best-trading-erp/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/J3HsKWB/trading.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Trading</h4> | |||
|                                     <p style="font-weight: 300;">Easily procure and sell your products</p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/education-erp-software/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/ssmySQK/education.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Education</h4> | |||
|                                     <p style="font-weight: 300;">A Collaborative platform for educational | |||
|                                         management</p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/manufacturing-erp-software/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/fx6j6zY/manufacturing.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Manufacturing</h4> | |||
|                                     <p style="font-weight: 300;">Plan, track and schedule your operations</p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/ecommerce-website/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/z6TK3yK/ecom.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">E-commerce & Website</h4> | |||
|                                     <p style="font-weight: 300;">Mobile friendly, awe-inspiring product pages | |||
|                                     </p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                 </div> | |||
|                 <!-- End of Left Column --> | |||
|                 <!-- Right Column --> | |||
|                 <div class="col-lg-6"> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 mb-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/pos/" target="_blank" class="text-dark" | |||
|                             style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/Hh9pqjY/pos.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">POS</h4> | |||
|                                     <p style="font-weight: 300;">Easy configuring and convivial selling</p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/service-management/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/541x9sq/service.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Service Management</h4> | |||
|                                     <p style="font-weight: 300;">Keep track of services and invoice accordingly | |||
|                                     </p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/restaurant-management/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/wYjn3HB/restaurant.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Restaurant</h4> | |||
|                                     <p style="font-weight: 300;">Run your bar or restaurant methodica</p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
| 
 | |||
|                     <div class="bg-white shadow px-4 py-3 my-3" style="border-radius: 10px;"> | |||
|                         <a href="https://www.cybrosys.com/odoo/industries/hotel-management-erp/" target="_blank" | |||
|                             class="text-dark" style="text-decoration: none;"> | |||
|                             <div class="row"> | |||
|                                 <div class="col-lg-3 no-gutters"> | |||
|                                     <img src="https://i.ibb.co/XbkbpwV/hotel.png"> | |||
|                                 </div> | |||
|                                 <div class="col-lg-9 no-gutters pt-3"> | |||
|                                     <h4 style="font-family: Roboto, 'sans-serif">Hotel Management</h4> | |||
|                                     <p style="font-weight: 300;">An all-inclusive hotel management application | |||
|                                     </p> | |||
|                                 </div> | |||
|                             </div> | |||
|                         </a> | |||
|                     </div> | |||
|                 </div> | |||
|                 <!-- End of Right Column --> | |||
|             </div> | |||
|         </div> | |||
|     </section> | |||
|     <!-- End of Our Industries--> | |||
|     <!-- Footer Section --> | |||
|     <section class="oe_container" style="padding:2rem 3rem 1rem"> | |||
|         <div class="row" style="max-width:1540px; margin: 0 auto; "> | |||
|             <div class="col-lg-12 mb-4"> | |||
|                 <h2 style="font-weight:600; text-align:center; margin-bottom:1rem; width:100%">Need Help?</h2> | |||
|                 <hr | |||
|                     style="background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> | |||
|             </div> | |||
|         </div> | |||
| 
 | |||
|         <!-- Contact Cards --> | |||
|         <div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin: 0 auto;"> | |||
|             <div class="col-lg-3  shadow mt-2" | |||
|                 style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem;  border-top: 7px solid #546E7A; height: 300px;"> | |||
|                 <h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';">Visit us</h5> | |||
|                 <p class="mb-4" style="color: #808e9b; font-size: 0.9rem;">Visit our website for more | |||
|                     information.</p> | |||
|                 <a href="https://cybrosys.com" target="_blank" class="btn btn-block mb-2 deep_hover" | |||
|                     style="text-decoration: none; background-color: #546E7A; color: #FFF;  border-radius: 4px;">www.cybrosys.com</a> | |||
|             </div> | |||
| 
 | |||
|             <div class="col-lg-3  shadow mt-2" | |||
|                 style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem;  border-top: 7px solid #b22126; height: 330px;"> | |||
|                 <h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';">Write to us</h5> | |||
|                 <p class="mb-4" style="color: #808e9b; font-size: 0.9rem;">Do you have any queries regarding our | |||
|                     products & services? Let us know.</p> | |||
|                 <a href="mailto:odoo@cybrosys.com" target="_blank" class="btn btn-block mb-2 deep_hover" | |||
|                     style="text-decoration: none;  background-color: #b22126; color: #FFF;  border-radius: 4px;">odoo@cybrosys.com</a> | |||
|                 <a href="mailto:info@cybrosys.com" target="_blank" class="btn btn-block deep_hover" | |||
|                     style="text-decoration: none; background-color: #b22126; color: #FFF;  border-radius: 4px;">info@cybrosys.com</a> | |||
|             </div>b | |||
| 
 | |||
|             <div class="col-lg-3  shadow mt-2" | |||
|                 style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem;  border-top: 7px solid #546E7A; height: 300px;"> | |||
|                 <h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';">Follow Us</h5> | |||
|                 <p class="mb-4" style="color: #808e9b; font-size: 0.9rem;">Follow us on social media for latest | |||
|                     updates.</p> | |||
|                 <div class="d-flex justify-content-begin align-items-center"> | |||
|                     <a href="https://www.facebook.com/cybrosystechnologies" target="_blank" | |||
|                         class="btn mb-2 mr-2 deep_hover d-flex justify-content-center align-items-center" | |||
|                         style="text-decoration: none; background-color:#3b5998; color: #fff; height: 35px; width: 35px;  border-radius: 4px;"><i | |||
|                             class="fa fa-facebook"></i></a> | |||
| 
 | |||
|                     <a href="https://twitter.com/cybrosys" target="_blank" | |||
|                         class="btn mb-2 mr-2 deep_hover d-flex justify-content-center align-items-center" | |||
|                         style="text-decoration: none; background-color:#00acee ; color: #fff ; height: 35px; width: 35px;  border-radius: 4px;"><i | |||
|                             class="fa fa-twitter"></i></a> | |||
| 
 | |||
|                     <a href="https://www.youtube.com/channel/UCKjWLm7iCyOYINVspCSanjg" target="_blank" | |||
|                         class="btn mb-2 mr-2 deep_hover d-flex justify-content-center align-items-center" | |||
|                         style="text-decoration: none; background-color:#FF0000 ; color: #fff ; height: 35px; width: 35px;  border-radius: 4px;"><i | |||
|                             class="fa fa-play"></i></a> | |||
|                     <a href="https://medium.com/cybrosys" target="_blank" | |||
|                         class="btn mb-2 deep_hover d-flex justify-content-center align-items-center" | |||
|                         style="text-decoration: none; background-color:#000  ; color: #fff  ; height: 35px; width: 35px;  border-radius: 4px;"><i | |||
|                             class="fa fa-medium"></i></a> | |||
|                 </div> | |||
| 
 | |||
|             </div> | |||
|             <!-- End of Contact Cards --> | |||
|         </div> | |||
|     </section> | |||
| </div> | |||
| <!-- Footer --> | |||
| <section class="oe_container" style="padding:2rem 3rem 1rem;"> | |||
|     <div class="row" style="max-width:1540px; margin: 0 auto; margin-right: 3rem; "> | |||
|         <!-- Logo --> | |||
|         <div class="col-lg-12 d-flex justify-content-center align-items-center" style="margin-top: 4rem;"> | |||
|             <img src="https://www.cybrosys.com/images/logo.png" width="200px" height="auto" /> | |||
|         </div> | |||
|         <!-- End of Logo --> | |||
|         <div class="col-lg-12" style="margin-top: 2rem;"> | |||
|             <hr | |||
|                 style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> | |||
|             <!-- End of Footer Section --> | |||
|         </div> | |||
|     </div> | |||
| </section> | |||
| </div> | |||
| @ -0,0 +1,6 @@ | |||
| .pos .popup.popup-number | |||
| { | |||
| height:500px; | |||
| width:500px | |||
| 
 | |||
| } | |||
| @ -0,0 +1,84 @@ | |||
| odoo.define('pos_discount_manager.DiscountButton', function(require) { | |||
|     'use strict'; | |||
| 
 | |||
|     const PosComponent = require('point_of_sale.PosComponent'); | |||
|     const ProductScreen = require('point_of_sale.ProductScreen'); | |||
|     const { | |||
|         useListener | |||
|     } = require('web.custom_hooks'); | |||
|     const Registries = require('point_of_sale.Registries'); | |||
|     var models = require('point_of_sale.models'); | |||
|     var DiscountButton = require('pos_discount.DiscountButton') | |||
|     models.load_fields('hr.employee', ['limited_discount']); | |||
| 
 | |||
|     const DiscountButtonManger = (DiscountButton) => | |||
|         class extends DiscountButton { | |||
|         constructor() { | |||
|             super(...arguments); | |||
|             useListener('click', this.onClick); | |||
|         } | |||
|         async onClick() { | |||
|             var self = this; | |||
|             const { confirmed, payload } = await this.showPopup('NumberPopup',{ | |||
|                 title: this.env._t('Discount Percentage'), | |||
|                 startingValue: this.env.pos.config.discount_pc, | |||
|             }); | |||
|             if (confirmed) { | |||
|                 const val = Math.round(Math.max(0,Math.min(100,parseFloat(payload)))); | |||
|                 await self.apply_discount(val); | |||
|             } | |||
|         } | |||
| 
 | |||
|         async apply_discount(pc) { | |||
|             var order    = this.env.pos.get_order(); | |||
|             var lines    = order.get_orderlines(); | |||
|             var product  = this.env.pos.db.get_product_by_id(this.env.pos.config.discount_product_id[0]); | |||
|             if (product === undefined) { | |||
|                 await this.showPopup('ErrorPopup', { | |||
|                     title : this.env._t("No discount product found"), | |||
|                     body  : this.env._t("The discount product seems misconfigured. Make sure it is flagged as 'Can be Sold' and 'Available in Point of Sale'."), | |||
|                 }); | |||
|                 return; | |||
|             } | |||
| 
 | |||
|             // Remove existing discounts
 | |||
|             var i = 0; | |||
|             while ( i < lines.length ) { | |||
|                 if (lines[i].get_product() === product) { | |||
|                     order.remove_orderline(lines[i]); | |||
|                 } else { | |||
|                     i++; | |||
|                 } | |||
|             } | |||
| 
 | |||
|             // Add discount
 | |||
|             // We add the price as manually set to avoid recomputation when changing customer.
 | |||
|             var base_to_discount = order.get_total_without_tax(); | |||
|             if (product.taxes_id.length){ | |||
|                 var first_tax = this.env.pos.taxes_by_id[product.taxes_id[0]]; | |||
|                 if (first_tax.price_include) { | |||
|                     base_to_discount = order.get_total_with_tax(); | |||
|                 } | |||
|             } | |||
|             var discount = - pc / 100.0 * base_to_discount; | |||
| 
 | |||
|             if( discount < 0 ){ | |||
|                 order.add_product(product, { | |||
|                     price: discount, | |||
|                     lst_price: discount, | |||
|                     extras: { | |||
|                         price_manually_set: true, | |||
|                         disc_percentage: pc, | |||
|                     }, | |||
|                 }); | |||
|             } | |||
|         } | |||
|     }; | |||
| 
 | |||
| 
 | |||
|     Registries.Component.extend(DiscountButton, DiscountButtonManger); | |||
| 
 | |||
|     return DiscountButtonManger; | |||
| 
 | |||
| 
 | |||
| }); | |||
| @ -0,0 +1,147 @@ | |||
| odoo.define('pos_discount_manager.ValidateManager', function(require) { | |||
|     'use strict'; | |||
| 
 | |||
|     const { | |||
|         parse | |||
|     } = require('web.field_utils'); | |||
|     const PosComponent = require('point_of_sale.PosComponent'); | |||
|     const { | |||
|         useErrorHandlers | |||
|     } = require('point_of_sale.custom_hooks'); | |||
|     const NumberBuffer = require('point_of_sale.NumberBuffer'); | |||
|     const { | |||
|         useListener | |||
|     } = require('web.custom_hooks'); | |||
|     const Registries = require('point_of_sale.Registries'); | |||
|     const { | |||
|         onChangeOrder | |||
|     } = require('point_of_sale.custom_hooks'); | |||
|     var PaymentScreen = require('point_of_sale.PaymentScreen') | |||
| 
 | |||
|     const ValidateManagers = (PaymentScreen) => | |||
|         class extends PaymentScreen { | |||
| 
 | |||
|             constructor() { | |||
| 
 | |||
|                 super(...arguments); | |||
| 
 | |||
|             } | |||
| 
 | |||
|             async _finalizeValidation() { | |||
|                 if ((this.currentOrder.is_paid_with_cash() || this.currentOrder.get_change()) && this.env.pos.config.iface_cashdrawer) { | |||
|                     this.env.pos.proxy.printer.open_cashbox(); | |||
|                 } | |||
| 
 | |||
|                 this.currentOrder.initialize_validation_date(); | |||
|                 this.currentOrder.finalized = true; | |||
| 
 | |||
|                 let syncedOrderBackendIds = []; | |||
| 
 | |||
|                 try { | |||
|                     if (this.currentOrder.is_to_invoice()) { | |||
|                         syncedOrderBackendIds = await this.env.pos.push_and_invoice_order( | |||
|                             this.currentOrder | |||
|                         ); | |||
|                     } else { | |||
|                         syncedOrderBackendIds = await this.env.pos.push_single_order(this.currentOrder); | |||
|                     } | |||
|                 } catch (error) { | |||
|                     if (error instanceof Error) { | |||
|                         throw error; | |||
|                     } else { | |||
|                         await this._handlePushOrderError(error); | |||
|                     } | |||
|                 } | |||
|                 if (syncedOrderBackendIds.length && this.currentOrder.wait_for_push_order()) { | |||
|                     const result = await this._postPushOrderResolve( | |||
|                         this.currentOrder, | |||
|                         syncedOrderBackendIds | |||
|                     ); | |||
|                     if (!result) { | |||
|                         await this.showPopup('ErrorPopup', { | |||
|                             title: 'Error: no internet connection.', | |||
|                             body: error, | |||
|                         }); | |||
|                     } | |||
|                 } | |||
| 
 | |||
| 
 | |||
| 
 | |||
|                 var order = this.env.pos.get_order(); | |||
| 
 | |||
|                 var employee_dis = this.env.pos.get_cashier()['limited_discount']; | |||
|                 var employee_name = this.env.pos.get_cashier()['name'] | |||
| 
 | |||
|                 var flag = 1; | |||
|                 var global; | |||
| 
 | |||
|                 var dis = 0; | |||
|                 for (var i = 0; i < order.orderlines.length; i++) { | |||
|                     dis = dis + order.orderlines.models[i].discount; | |||
| 
 | |||
| 
 | |||
|                     if (order.orderlines.models[i].discount > employee_dis || order.orderlines.models[i].disc_percentage > employee_dis || dis > employee_dis) { | |||
|                         flag = 0; | |||
| 
 | |||
| 
 | |||
|                     } | |||
|                 } | |||
|                 if (flag != 1) { | |||
| 
 | |||
|                     const { | |||
|                         confirmed, | |||
|                         payload | |||
|                     } = await this.showPopup('NumberPopup', { | |||
|                         title: this.env._t(employee_name + ', your discount is over the limit. \n MANAGER pin for Approval'), | |||
|                     }); | |||
| 
 | |||
|                     if (confirmed) { | |||
|                         var output = this.env.pos.employees.filter((obj) => obj.role == 'manager'); | |||
|                         var pin = output[0].pin | |||
| 
 | |||
|                         if (Sha1.hash(payload) == pin) { | |||
| 
 | |||
|                         } else { | |||
|                             this.showPopup('ErrorPopup', { | |||
|                                 title: this.env._t(" MANAGER RESTRICTED YOUR DISCOUNT"), | |||
|                                 body: this.env._t(employee_name + ", Your Manager pin is INCORRECT."), | |||
| 
 | |||
|                             }); | |||
|                             return false; | |||
| 
 | |||
|                         } | |||
|                     } | |||
| 
 | |||
|                 } | |||
| 
 | |||
|                 this.showScreen(this.nextScreen); | |||
| 
 | |||
|                 // If we succeeded in syncing the current order, and
 | |||
|                 // there are still other orders that are left unsynced,
 | |||
|                 // we ask the user if he is willing to wait and sync them.
 | |||
|                 if (syncedOrderBackendIds.length && this.env.pos.db.get_orders().length) { | |||
|                     const { | |||
|                         confirmed | |||
|                     } = await this.showPopup('ConfirmPopup', { | |||
|                         title: this.env._t('Remaining unsynced orders'), | |||
|                         body: this.env._t( | |||
|                             'There are unsynced orders. Do you want to sync these orders?' | |||
|                         ), | |||
|                     }); | |||
|                     if (confirmed) { | |||
|                         // NOTE: Not yet sure if this should be awaited or not.
 | |||
|                         // If awaited, some operations like changing screen
 | |||
|                         // might not work.
 | |||
|                         this.env.pos.push_orders(); | |||
| 
 | |||
|                     } | |||
|                 } | |||
|             } | |||
|         }; | |||
| 
 | |||
| 
 | |||
|     Registries.Component.extend(PaymentScreen, ValidateManagers); | |||
| 
 | |||
|     return ValidateManagers; | |||
| 
 | |||
| }); | |||
| @ -0,0 +1,14 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <odoo> | |||
|     <record model="ir.ui.view" id="discount_limit_category"> | |||
|       <field name="name">DiscountLimit list</field> | |||
|       <field name="model">hr.employee</field> | |||
|       <field name="inherit_id" ref="hr.view_employee_form"/> | |||
|       <field name="arch" type="xml"> | |||
|         <xpath expr="//field[@name='job_id']" position="after"> | |||
|                 <field name="limited_discount" /> | |||
| 
 | |||
|         </xpath> | |||
|       </field> | |||
|     </record> | |||
| </odoo> | |||
| @ -0,0 +1,12 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <odoo> | |||
|     <template id="assets" inherit_id="point_of_sale.assets"> | |||
|           <xpath expr="." position="inside"> | |||
|               <script type="text/javascript" src="/pos_discount_manager/static/src/js/DiscountButton.js"></script> | |||
|               <script type="text/javascript" src="/pos_discount_manager/static/src/js/ValidateManager.js"></script> | |||
|           </xpath> | |||
|         <xpath expr="//link[@id='pos-stylesheet']" position="after"> | |||
|               <link rel="stylesheet" href="/pos_discount_manager/static/src/css/popup_size.css"/> | |||
|           </xpath> | |||
|         </template> | |||
| </odoo> | |||