Browse Source

Agregar en la fidelización ciudad en el reporte.

sebas 3 years ago
parent
commit
9f1277b14c

+ 5 - 2
controller/helpers/pos_order.py

@@ -29,7 +29,8 @@ def get_pos_order_baco():
             partner.ruc,
             partner.phone,
             partner.mobile,
-            partner.email
+            partner.email,
+            partner.city
         FROM pos_order as pos
         LEFT JOIN res_store_journal_rel as journal
         ON journal.journal_id = pos.sale_journal
@@ -55,7 +56,8 @@ def get_pos_order_baco():
             partner.ruc,
             partner.phone,
             partner.mobile,
-            partner.email
+            partner.email,
+            partner.city
     '''
 
     r.cr.execute(validate)
@@ -82,6 +84,7 @@ def get_pos_order_baco():
                 'phone':j[13],
                 'mobile':j[14],
                 'email':j[15],
+                'city':j[16],
             } for j in r.cr.fetchall()
         ]
     else:

+ 3 - 1
controller/helpers/res_partner.py

@@ -6,7 +6,8 @@ def get_res_partner_baco():
         SELECT
             partner.id,
             partner.name,
-            partner.ruc
+            partner.ruc,
+            partner.city
         FROM res_partner AS partner
         WHERE partner.customer = True AND partner.active = True
     '''
@@ -18,5 +19,6 @@ def get_res_partner_baco():
             'id': j[0],
             'name': j[1],
             'ruc': j[2],
+            'city': j[3],
         } for j in r.cr.fetchall()
     ]

+ 6 - 3
static/src/js/reports/report_ventas_fidelizacion.js

@@ -80,7 +80,7 @@ function report_ventas_fidelizacion(reporting){
                 =================================
                 */
                 self.ResStore = IntialSQL.stores;
-                console.log(self.ResStore);
+                // console.log(self.ResStore);
                 if(self.ResStore.length > 1){
                     self.$el.find('#current-store').append('<option value="9999999">Todas las sucursales</option>');
                     _.each(self.ResStore,function(item){
@@ -480,11 +480,11 @@ function report_ventas_fidelizacion(reporting){
         getStoreName:function(store_id){
           var self = this;
 
-          console.log(store_id);
+          // console.log(store_id);
           var ResStore =  _.filter(self.ResStore,function (item) {
                   return item.id == store_id;
           });
-          console.log(ResStore);
+          // console.log(ResStore);
           //return ResStore[0].name;
           return ResStore.name;
         },
@@ -520,6 +520,7 @@ function report_ventas_fidelizacion(reporting){
                     customer_name:self.valorNull(item.customer_name),
                     phone:self.valorNull(item.phone),
                     mobile:self.valorNull(item.mobile),
+                    city:self.valorNull(item.city),
                     email:self.valorNull(item.email),
                     pos:PosOrder[0].length,
                     sale: AccountInvoice[0].length,
@@ -573,6 +574,7 @@ function report_ventas_fidelizacion(reporting){
                     customer_name:self.valorNull(item.customer_name),
                     phone:self.valorNull(item.phone),
                     mobile:self.valorNull(item.mobile),
+                    city:self.valorNull(item.city),
                     email:self.valorNull(item.email),
                     pos: PosOrder[0].length,
                     sale: AccountInvoice[0].length,
@@ -684,6 +686,7 @@ function report_ventas_fidelizacion(reporting){
                     customer_ruc:{columnWidth: 15, halign:'left'},
                     phone:{columnWidth: 19, halign:'right'},
                     mobile:{columnWidth: 20, halign:'right'},
+                    city:{columnWidth: 20, halign:'left'},
                     email:{ halign:'right'},
                     total:{columnWidth: 22, halign:'right'},
                     sale_type:{columnWidth: 15, halign:'center'},

+ 1 - 0
static/src/reports/report_ventas_fidelizacion.xml

@@ -129,6 +129,7 @@
                               <th data-field="customer_ruc" data-align="left">RUC</th>
                               <th data-field="phone" data-align="left">Teléfono</th>
                               <th data-field="mobile" data-align="left">Celular</th>
+                              <th data-field="city" data-align="left">Ciudad</th>
                               <th data-field="email" data-align="left">Email</th>
                               <th data-field="total" data-align="right" data-footer-formatter="TotalFooter">Total</th>
                               <th data-field="sale_type" data-align="center">Tipo de venta</th>