Browse Source

[FIX] correccion en la vista del ticket

Rodney Elpidio Enciso Arias 7 years ago
parent
commit
d3d11450f2
3 changed files with 12 additions and 13 deletions
  1. 1 2
      models/account_journal.py
  2. 8 8
      static/src/js/models.js
  3. 3 3
      static/src/xml/pos_receipt.xml

+ 1 - 2
models/account_journal.py

@@ -1,5 +1,4 @@
-	
-# -*- coding: utf-8 -*-
+	# -*- coding: utf-8 -*-
 from openerp import models, fields, api
 from openerp.exceptions import except_orm, Warning, RedirectWarning
 

+ 8 - 8
static/src/js/models.js

@@ -11,13 +11,13 @@ function pos_company_models(instance, module){
         },
     });
 
-    // module.PosModel.prototype.models.push({
-    //     model: "account.journal",
-    //     fields: ['currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'tax_calculation_rounding_method','street', 'city'],
-    //     ids:    function(self){ return [self.user.company_id[0]] },
-    //     loaded: function(self, companies){
-    //         self.companies = companies[0];
-    //     },
-    // });
+    module.PosModel.prototype.models.push({
+        model: "account.journal",
+        fields: ['number', 'start_of_validity', 'end_of_validity'],
+        domain: function(self){ return [["id", "=", self.config.journal_id[0]]]},
+        loaded: function(self, legal_journal){
+            self.legal_journal = legal_journal;
+        },
+    });
 };
 

+ 3 - 3
static/src/xml/pos_receipt.xml

@@ -23,11 +23,11 @@
             <br/>
             RUC-DNI: <t t-esc="widget.pos.company.company_registry || ''"/>
             <br/>
-            Timbrado: <t t-esc="widget.pos.company.city || ''"/>
+            Timbrado: <t t-esc="widget.pos.legal_journal[0].number || ''"/>
             <br/>
-            Fecha: Inicio de vigencia <t t-esc="widget.pos.company.city || ''"/>
+            Fecha: Inicio de vigencia <t t-esc="new Date(widget.pos.legal_journal[0].start_of_validity).toString(Date.CultureInfo.formatPatterns.shortDate)"/>
             <br/>
-            Fecha: Fin de vigencia <t t-esc="widget.pos.company.city || ''"/>
+            Fecha: Fin de vigencia <t t-esc="new Date(widget.pos.legal_journal[0].end_of_validity).toString(Date.CultureInfo.formatPatterns.shortDate)"/>
             <br/>
             <br/>
             <div class="pos-center-align">