[IMP] hw_escpos / point_of_sale: print receipt with an xml template
[odoo/odoo.git] / addons / point_of_sale / static / src / js / devices.js
index 5db9192..f46b156 100644 (file)
@@ -511,43 +511,8 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
             return this.message('open_cashbox');
         },
 
-        /* ask the printer to print a receipt
-         * receipt is a JSON object with the following specs:
-         * receipt{
-         *  - orderlines : list of orderlines :
-         *     {
-         *          quantity:           (number) the number of items, or the weight, 
-         *          unit_name:          (string) the name of the item's unit (kg, dozen, ...)
-         *          price:              (number) the price of one unit of the item before discount
-         *          discount:           (number) the discount on the product in % [0,100] 
-         *          product_name:       (string) the name of the product
-         *          price_with_tax:     (number) the price paid for this orderline, tax included
-         *          price_without_tax:  (number) the price paid for this orderline, without taxes
-         *          tax:                (number) the price paid in taxes on this orderline
-         *          product_description:         (string) generic description of the product
-         *          product_description_sale:    (string) sales related information of the product
-         *     }
-         *  - paymentlines : list of paymentlines :
-         *     {
-         *          amount:             (number) the amount paid
-         *          journal:            (string) the name of the journal on wich the payment has been made  
-         *     }
-         *  - total_with_tax:     (number) the total of the receipt tax included
-         *  - total_without_tax:  (number) the total of the receipt without taxes
-         *  - total_tax:          (number) the total amount of taxes paid
-         *  - total_paid:         (number) the total sum paid by the client
-         *  - change:             (number) the amount of change given back to the client
-         *  - name:               (string) a unique name for this order
-         *  - client:             (string) name of the client. or null if no client is logged
-         *  - cashier:            (string) the name of the cashier
-         *  - date: {             the date at wich the payment has been done
-         *      year:             (number) the year  [2012, ...]
-         *      month:            (number) the month [0,11]
-         *      date:             (number) the day of the month [1,31]
-         *      day:              (number) the day of the week  [0,6] 
-         *      hour:             (number) the hour [0,23]
-         *      minute:           (number) the minute [0,59]
-         *    }
+        /* 
+         * ask the printer to print a receipt
          */
         print_receipt: function(receipt){
             var self = this;
@@ -558,7 +523,7 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
             function send_printing_job(){
                 if (self.receipt_queue.length > 0){
                     var r = self.receipt_queue.shift();
-                    self.message('print_receipt',{ receipt: r },{ timeout: 5000 })
+                    self.message('print_xml_receipt',{ receipt: r },{ timeout: 5000 })
                         .then(function(){
                             send_printing_job();
                         },function(){