13 changed files with 337 additions and 0 deletions
			
			
		| @ -0,0 +1,22 @@ | |||
| ============================ | |||
| POS Category wise receipt v8 | |||
| ============================ | |||
| This module aims to print category wise receipt for point of sale. | |||
| 
 | |||
| Features | |||
| ======== | |||
| * The receipt shows category wise product and Subtotal of each category. | |||
| 
 | |||
| Installation | |||
| ============ | |||
| Just select it from available modules to install it, there is no need to extra installations. | |||
| 
 | |||
| Configuration | |||
| ============= | |||
| Nothing to configure. | |||
| 
 | |||
| 
 | |||
| Credits | |||
| ======= | |||
| Developer: Anusha @ cybrosys | |||
| Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in | |||
| @ -0,0 +1,22 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################## | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | |||
| #    Author: Nilmar Shereef(<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/>. | |||
| # | |||
| ############################################################################## | |||
| @ -0,0 +1,44 @@ | |||
| # -*- coding: utf-8 -*- | |||
| ############################################################################## | |||
| # | |||
| #    Cybrosys Technologies Pvt. Ltd. | |||
| #    Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | |||
| #    Author: Nilmar Shereef(<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': "POS Category Wise Receipt", | |||
|     'summary': """This module print category wise POS receipt.""", | |||
|     'author': "Cybrosys Techno Solutions", | |||
|     'website': "http://www.cybrosys.com", | |||
|     'category': 'Point of Sale', | |||
|     'version': '0.2', | |||
|     'depends': [ | |||
|                 'base', | |||
|                 'point_of_sale', | |||
|                 ], | |||
|     'data': [ | |||
|             'views/pos_category_wise_receipt_view.xml', | |||
|             ], | |||
|     'qweb': [ | |||
|         'static/src/xml/pos_category_wise_receipt.xml', | |||
|     ], | |||
|     'images': ['static/description/banner.jpg'], | |||
|     'license': 'AGPL-3', | |||
|     'installable': True, | |||
|     'auto_install': False, | |||
| } | |||
| After Width: | Height: | Size: 134 KiB | 
| After Width: | Height: | Size: 50 KiB | 
| After Width: | Height: | Size: 22 KiB | 
| @ -0,0 +1,48 @@ | |||
| <section class="oe_container"> | |||
|     <div class="oe_row oe_spaced"> | |||
|         <h2 class="oe_slogan">POS Category wise receipt</h2> | |||
|         <h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4> | |||
|     </div> | |||
| </section> | |||
| 
 | |||
| <section class="oe_container"> | |||
|     <div class="oe_row oe_spaced"> | |||
|         <p class='oe_mt32'> | |||
|             ☛ Choose your product randomly | |||
|         </p> | |||
|         <div class="oe_span12"> | |||
|             <div class="oe_row_img oe_centered"> | |||
|                 <img class="oe_picture oe_screenshot" src="pic1.png"> | |||
|             </div> | |||
|         </div> | |||
|     </div> | |||
| </section> | |||
| 
 | |||
| <section class="oe_container oe_dark"> | |||
|     <div class="oe_row oe_padded"> | |||
|         <p class='oe_mt32'> | |||
|             ☛Product category wise receipt | |||
|         </p> | |||
|         <div class="oe_span12"> | |||
|             <div class="oe_row_img oe_centered"> | |||
|                 <img class="oe_picture oe_screenshot" src="pic2.png"> | |||
|             </div> | |||
|         </div> | |||
|     </div> | |||
| </section> | |||
| <section class="oe_container oe_dark"> | |||
|     <h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> | |||
|     <div class="oe_slogan" style="margin-top:10px !important;"> | |||
|         <a  class="btn btn-primary btn-lg mt8" | |||
|             style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i | |||
|             class="fa fa-envelope"></i> Email </a> <a | |||
|             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | |||
|             href="http://www.cybrosys.com/contact/"><i | |||
|             class="fa fa-phone"></i> Contact Us </a> <a | |||
|             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | |||
|             href="http://www.cybrosys.com/odoo-customization-and-installation/"><i | |||
|             class="fa fa-check-square"></i> Request Customization </a> | |||
|     </div> | |||
|             <img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> | |||
| </section> | |||
| 
 | |||
| After Width: | Height: | Size: 138 KiB | 
| After Width: | Height: | Size: 73 KiB | 
| @ -0,0 +1,5 @@ | |||
| 
 | |||
| 
 | |||
| .pos_underline { | |||
|     text-decoration: underline; | |||
| } | |||
| @ -0,0 +1,58 @@ | |||
| openerp.pos_category_wise_receipt = function(instance){ | |||
| 
 | |||
|     var module = instance.point_of_sale; | |||
|     var OrderlineParent = module.Orderline; | |||
|     var orderline_id = 1; | |||
|     console.log("12"); | |||
| 
 | |||
|     module.Orderline = module.Orderline.extend({ | |||
|         initialize: function(attr,options){ | |||
|             this.pos = options.pos; | |||
| 
 | |||
|             this.order = options.order; | |||
| 
 | |||
|             this.product = options.product; | |||
| 
 | |||
|             this.price   = options.product.price; | |||
|             this.set_quantity(1); | |||
|             this.discount = 0; | |||
|             this.discountStr = '0'; | |||
|             this.type = 'unit'; | |||
|             this.selected = false; | |||
|             this.count = true; | |||
|             this.category_selected=true; | |||
|             this.id       = orderline_id++; | |||
| 
 | |||
|         }, | |||
|         get_category: function(){ | |||
| 
 | |||
|             var product = this.product.pos_categ_id[1]; | |||
|             return (product ? this.product.pos_categ_id[1] : undefined) || 'UnCategorised Product'; | |||
|         }, | |||
|         get_category_id: function(){ | |||
|             return this.product.pos_categ_id[0]; | |||
|         }, | |||
|         // selects or deselects this orderline
 | |||
|         set_selected: function(selected){ | |||
| 
 | |||
|             this.selected = selected; | |||
|         }, | |||
|         set_selected_product: function(selected){ | |||
|             this.count = selected; | |||
|             this.trigger('change',this); | |||
|         }, | |||
|         set_selected_category: function(selected){ | |||
|             this.category_selected = selected; | |||
|             this.trigger('change',this); | |||
|         }, | |||
|         is_selected_product: function(){ | |||
|             return this.count; | |||
|         }, | |||
|         is_selected_category: function(){ | |||
|             return this.category_selected; | |||
|         }, | |||
| 
 | |||
|     }); | |||
| 
 | |||
| } | |||
| 
 | |||
| @ -0,0 +1,123 @@ | |||
| <templates> | |||
|     <t t-extend="PosTicket"> | |||
|          <t t-jquery="div.pos-sale-ticket" t-operation="replace"> | |||
|              <div class="pos-sale-ticket"> | |||
|                 <div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' + | |||
|                     Date.CultureInfo.formatPatterns.longTime)"/> <t t-esc="order.get('name')"/></div> | |||
|                 <br /> | |||
|                 <t t-esc="widget.pos.company.name"/><br /> | |||
|                 Phone: <t t-esc="widget.pos.company.phone || ''"/><br /> | |||
|                 User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br /> | |||
|                 Shop: <t t-esc="widget.pos.shop.name"/><br /> | |||
|                 <br /> | |||
|                 <t t-if="widget.pos.config.receipt_header"> | |||
|                     <div style='text-align:center'> | |||
|                         <t t-esc="widget.pos.config.receipt_header" /> | |||
|                     </div> | |||
|                     <br /> | |||
|                 </t> | |||
|                 <t t-foreach="orderlines" t-as="l"> | |||
|                     <t t-if="l.is_selected_product"> | |||
|                         <t t-set="sum" t-value="0"></t> | |||
|                         <t t-foreach="orderlines" t-as="orderline"> | |||
|                             <t t-if="orderline.is_selected_product()"> | |||
|                                 <table> | |||
|                                     <tr> | |||
|                                         <t t-if="l.get_category_id()==orderline.get_category_id()"> | |||
|                                             <t t-set="sum" t-value="sum + orderline.get_display_price()"/> | |||
|                                             <p> | |||
|                                                 <t t-if="l.is_selected_category()"> | |||
|                                                     <h3 class="pos_underline"><t t-esc="l.get_category()"/></h3> | |||
|                                                     <t t-esc="l.set_selected_category(false)"></t> | |||
|                                                 </t> | |||
|                                             </p> | |||
|                                             <tr> | |||
|                                                 <td> | |||
|                                                     <t t-esc="orderline.get_product().display_name"/> | |||
|                                                     <t t-if="orderline.get_discount() > 0"> | |||
|                                                         <div class="pos-disc-font"> | |||
|                                                             With a <t t-esc="orderline.get_discount()"/>% discount | |||
|                                                         </div> | |||
|                                                     </t> | |||
|                                                 </td> | |||
|                                                 <td class="pos-right-align"> | |||
|                                                     <t t-esc="orderline.get_quantity_str_with_unit()"/> | |||
|                                                 </td> | |||
|                                                 <td class="pos-right-align"> | |||
|                                                     <t t-esc="widget.format_currency(orderline.get_display_price())"/> | |||
|                                                 </td> | |||
|                                             </tr> | |||
|                                             <t t-esc="orderline.set_selected_product(false)"/> | |||
|                                             <t t-esc="l.set_selected(true)"/> | |||
|                                         </t> | |||
|                                     </tr> | |||
|                                 </table> | |||
|                             </t> | |||
|                         </t> | |||
|                         <t t-if="l.is_selected()"> | |||
|                             <table> | |||
|                                 <tr> | |||
|                                     <td class="pos-right-align pos_underline"> | |||
|                                         <t t-esc="widget.format_currency(sum)"/> | |||
|                                     </td> | |||
|                                 </tr> | |||
|                             </table> | |||
|                         </t> | |||
|                     </t> | |||
|                 </t> | |||
|                 <br /> | |||
|                 <table> | |||
|                 <tr> | |||
|                     <td>Subtotal:</td> | |||
|                     <td class="pos-right-align"> | |||
|                         <t t-esc="widget.format_currency(order.getTotalTaxExcluded())"/> | |||
|                     </td> | |||
|                 </tr> | |||
|                 <t t-foreach="order.getTaxDetails()" t-as="taxdetail"> | |||
|                     <tr> | |||
|                         <td><t t-esc="taxdetail.name" /></td> | |||
|                         <td class="pos-right-align"> | |||
|                             <t t-esc="widget.format_currency(taxdetail.amount)" /> | |||
|                         </td> | |||
|                     </tr> | |||
|                 </t> | |||
|                 <tr> | |||
|                     <td>Discount:</td> | |||
|                     <td class="pos-right-align"> | |||
|                         <t t-esc="widget.format_currency(order.getDiscountTotal())"/> | |||
|                     </td> | |||
|                 </tr> | |||
|                 <tr class="emph"> | |||
|                     <td>Total:</td> | |||
|                     <td class="pos-right-align pos_underline"> | |||
|                         <t t-esc="widget.format_currency(order.getTotalTaxIncluded())"/> | |||
|                     </td> | |||
|                 </tr> | |||
|                 </table> | |||
|                 <br /> | |||
|                 <table> | |||
|                     <tr t-foreach="paymentlines" t-as="line"> | |||
|                         <td> | |||
|                             <t t-esc="line.name"/> | |||
|                         </td> | |||
|                         <td class="pos-right-align"> | |||
|                             <t t-esc="widget.format_currency(line.get_amount())"/> | |||
|                         </td> | |||
|                     </tr> | |||
|                 </table> | |||
|                 <br /> | |||
|                 <table> | |||
|                     <tr><td>Change:</td><td class="pos-right-align"> | |||
|                         <t t-esc="widget.format_currency(order.getChange())"/> | |||
|                         </td></tr> | |||
|                 </table> | |||
|                 <t t-if="widget.pos.config.receipt_footer"> | |||
|                     <br /> | |||
|                     <div style='text-align:center'> | |||
|                         <t t-esc="widget.pos.config.receipt_footer" /> | |||
|                     </div> | |||
|                 </t> | |||
|              </div> | |||
|          </t> | |||
|     </t> | |||
| </templates> | |||
| @ -0,0 +1,15 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <openerp> | |||
|     <data> | |||
|         <template id="assets_backend" name="point_of_sale assets" inherit_id="point_of_sale.assets_backend"> | |||
|             <xpath expr="." position="inside"> | |||
|                 <script type="text/javascript" src="/pos_category_wise_receipt/static/src/js/pos_category_wise_receipt.js"/> | |||
|             </xpath> | |||
|         </template> | |||
|         <template id="index" inherit_id='point_of_sale.index' name="Restaurant Index"><!DOCTYPE html> | |||
|             <xpath expr="//link[@id='pos-stylesheet']" position="after"> | |||
|                 <link rel="stylesheet" href="/pos_category_wise_receipt/static/src/css/pos_category.css" /> | |||
|             </xpath> | |||
|         </template> | |||
|     </data> | |||
| </openerp> | |||
					Loading…
					
					
				
		Reference in new issue