deisy 5 년 전
부모
커밋
2b44b12d02
4개의 변경된 파일30개의 추가작업 그리고 69개의 파일을 삭제
  1. BIN
      __init__.pyc
  2. 3 3
      static/src/js/model.js
  3. 0 58
      static/src/js/screen.js
  4. 27 8
      static/src/xml/pos.xml

BIN
__init__.pyc


+ 3 - 3
static/src/js/model.js

@@ -17,13 +17,13 @@ function pos_ticket_model(instance, module){
                     label: _t('Print'),
                     icon: '/point_of_sale/static/src/img/icons/png48/printer.png',
                     click: function(){ self.print(); },
-                });
+            });
 
             var finish_button = this.add_action_button({
                     label: _t('Next Order'),
                     icon: '/point_of_sale/static/src/img/icons/png48/go-next.png',
                     click: function() { self.finishOrder(); },
-                });
+            });
 
             this.refresh();
 
@@ -46,7 +46,7 @@ function pos_ticket_model(instance, module){
         refresh: function() {
             var order = this.pos.get('selectedOrder');
             var orderLines = order.get('orderLines').models;
-            // console.log(orderLines);
+            console.log(order);
             var qty =  _.reduce(_.map(orderLines,function(item){
                 return item.quantity;
             }), function(memo, num){

+ 0 - 58
static/src/js/screen.js

@@ -383,62 +383,4 @@ function pos_screens(instance, module){ //module is instance.point_of_sale
             this._super();
         },
     });
-
-    module.ReceiptScreenWidget = module.ScreenWidget.extend({
-        template: 'ReceiptScreenWidget',
-
-        show_numpad:     false,
-        show_leftpane:   false,
-
-        show: function(){
-            this._super();
-            var self = this;
-
-            var print_button = this.add_action_button({
-                    label: _t('Print'),
-                    icon: '/point_of_sale/static/src/img/icons/png48/printer.png',
-                    click: function(){ self.print(); },
-                });
-
-            var finish_button = this.add_action_button({
-                    label: _t('Next Order'),
-                    icon: '/point_of_sale/static/src/img/icons/png48/go-next.png',
-                    click: function() { self.finishOrder(); },
-                });
-
-            this.refresh();
-
-            finish_button.set_disabled(true);
-            setTimeout(function(){
-                finish_button.set_disabled(false);
-            }, 2000);
-        },
-        print: function() {
-            this.pos.get('selectedOrder')._printed = true;
-            window.print();
-        },
-        finishOrder: function() {
-            this.pos.get('selectedOrder').destroy();
-        },
-        refresh: function() {
-            var order = this.pos.get('selectedOrder');
-
-            var pos_driver = _.find(this.pos.users, function (item) {
-                return item.id === order.attributes.pos_driver
-            });
-
-            $('.pos-receipt-container', this.$el).html(QWeb.render('PosTicket',{
-                widget:this,
-                order: order,
-                pos_driver_name: (pos_driver && pos_driver.name) || '' ,
-                table_name: (order.attributes.table && order.attributes.table.name) || '' ,
-                orderlines: order.get('orderLines').models,
-                paymentlines: order.get('paymentLines').models
-            }));
-        },
-        close: function(){
-            this._super();
-        }
-    });
-
 }

+ 27 - 8
static/src/xml/pos.xml

@@ -20,19 +20,38 @@
                     </div>
                     <br />
                 </t>
-                <t t-esc="widget.pos.company.name || ''"/><br />
-                <t t-esc="widget.pos.company.street || ''"/><br />
-                <t t-esc="widget.pos.company.phone || ''"/><br />
+                <t t-if="widget.pos.company.name">
+                    <t t-esc="widget.pos.company.name"/><br />
+                </t>
+                <t t-if="widget.pos.company.street">
+                    <t t-esc="widget.pos.company.street"/><br />
+                </t>
+                <t t-if="widget.pos.company.phone">
+                  <t t-esc="widget.pos.company.phone"/><br />
+                </t>
+
                 <br/>
                 User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/>
                 <t t-if="order.attributes.client">
                     <p>========================</p>
                     <!-- RUC: <t t-esc="order.attributes.client.ruc ? order.attributes.client.ruc : ''"/><br /> -->
-                    Cliente: <t t-esc="order.attributes.client.name ? order.attributes.client.name : ''"/><br />
-                    Teléfono: <t t-esc="order.attributes.client.phone ? order.attributes.client.phone : ''"/><br />
-                    Dirección: <t t-esc="order.attributes.client.address ? order.attributes.client.address : ''"/><br />
-                    Delivery: <t t-esc="pos_driver_name"/><br />
-                    Mesa N°: <t t-esc="table_name"/>
+                    <t t-if="order.attributes.client.name">
+                      Cliente: <t t-esc="order.attributes.client.name"/><br />
+                    </t>
+                    <t t-if="order.attributes.client.phone">
+                      Teléfono: <t t-esc="order.attributes.client.phone"/><br />
+                    </t>
+                    <t t-if="order.attributes.client.address">
+                      Dirección: <t t-esc="order.attributes.client.address"/><br />
+                    </t>
+                    <t t-if="order.attributes.table">
+                      <t t-if="order.attributes.table.type =='table'">
+                        Mesa: <t t-esc="order.attributes.table.name"/>
+                      </t>
+                      <t t-if="order.attributes.table.type =='delivery'">
+                        Delivery: <t t-esc="order.attributes.table.name"/>
+                      </t>
+                    </t>
                 </t>
                 <p>========================</p>
                 <table class="table table-condensed" style="font-size: 12px;">