Przeglądaj źródła

Firma final de cada hoja

sebastian 5 lat temu
rodzic
commit
0393120093
1 zmienionych plików z 21 dodań i 283 usunięć
  1. 21 283
      static/src/js/main.js

+ 21 - 283
static/src/js/main.js

@@ -90,7 +90,9 @@ openerp.pagare_decorart = function (instance, local) {
             var getColumnsQuota = [];
 
             var pdfDoc = new jsPDF("p","mm","a4");
-            // pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'PNG',10,10,20,15);
+
+            // pdfDoc.page=1;
+
             pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'png', 10, 10, 50, 30);
 
             _.each(self.AccountInvoiceLine, function(item){
@@ -146,53 +148,6 @@ openerp.pagare_decorart = function (instance, local) {
 
                 addPageContent: function (data) {
 
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('bold');
-                    // pdfDoc.setTextColor(20);
-                    // pdfDoc.text(120, 13,'Número de Operación: ');
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('normal');
-                    // pdfDoc.text(165, 13, AccountInvoice[0].origin);
-                    //
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('bold');
-                    // pdfDoc.setTextColor(20);
-                    // pdfDoc.text(120, 18,'Número de Documento: ');
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('normal');
-                    // pdfDoc.text(165, 18, AccountInvoice[0].number);
-                    //
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('bold');
-                    // pdfDoc.setTextColor(20);
-                    // pdfDoc.text(120, 23,'Responsable: ');
-                    // pdfDoc.setFontSize(11);
-                    // pdfDoc.setFontStyle('normal');
-                    // pdfDoc.text(147, 23, AccountInvoice[0].user_name);
-                    //
-                    // // Cuadro principal
-                    // //pdfDoc.rect(10, 30, pdfDoc.internal.pageSize.getWidth() - 20 , 40, 'S');
-                    // pdfDoc.rect(10, 40, pdfDoc.internal.pageSize.getWidth() - 20 , 40, 'S');
-                    // // Cuadro fecha de emision
-                    // pdfDoc.rect(10, 40, 80, 7, 'S');
-                    // pdfDoc.setFontSize(8);
-                    // pdfDoc.setFontStyle('normal');
-                    // pdfDoc.setTextColor(20);
-                    // pdfDoc.text(12, 44,'Fecha de emisión: ');
-                    // pdfDoc.text(45, 44,  moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
-                    // // RUC / Documento de identidad No.
-                    // pdfDoc.rect(10, 47, pdfDoc.internal.pageSize.getWidth() - 20, 7, 'S');
-                    // pdfDoc.text(12, 52,'RUC / Documento de Identidad No.: ' + AccountInvoice[0].partner_id[0].ruc);
-                    // // Nombre o Razon Social
-                    // pdfDoc.rect(10, 54, pdfDoc.internal.pageSize.getWidth() - 20, 7, 'S');
-                    // pdfDoc.text(12, 59,'Nombre o Razón Social: ' + AccountInvoice[0].partner_id[0].name);
-                    // // Telefono
-                    // pdfDoc.rect(10, 61, 95, 7, 'S');
-                    // pdfDoc.text(12, 65,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].phone));
-                    // //
-                    // // Direccion
-                    // pdfDoc.rect(105, 61, 95, 7, 'S');
-                    // pdfDoc.text(107, 65,'Direccion: ' + self.valorNull(AccountInvoice[0].partner_id[0].address));
 
                     pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'png', 10, 10, 50, 30);
 
@@ -347,6 +302,12 @@ openerp.pagare_decorart = function (instance, local) {
                 pdfDoc.setTextColor(40);
                 pdfDoc.text(85,195,'ESPECIFICACIÓN DE VENTAS ');
 
+
+                // function footer(){
+                //     pdfDoc.text(150,285, 'page ' + doc.page);
+                //     pdfDoc.page ++;
+                // };
+
                 }
             });
 
@@ -382,6 +343,12 @@ openerp.pagare_decorart = function (instance, local) {
             pdfDoc.setTextColor(40);
             pdfDoc.text(10,finalY + 5,'Total: ' + accounting.formatMoney(AccountInvoice[0].amount_total,CurrencyBase.symbol,CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator));
 
+            pdfDoc.setFontSize(10);
+            pdfDoc.setFontStyle('bold');
+            pdfDoc.text(10,finalY + 10,'Firma del cliente: _ _ _ _ _ _ _ _ _ _       Aclaración: _ _ _ _ _ _ _ _ _ _               C.I.N°: _ _ _ _ _ _ _');
+
+
+
             pdfDoc.addPage();
             var finalY2 = 20
             pdfDoc.setFontSize(10);
@@ -436,6 +403,12 @@ openerp.pagare_decorart = function (instance, local) {
             pdfDoc.setTextColor(40);
             pdfDoc.text(10,finalY2,'Total: ' + accounting.formatMoney(AccountInvoice[0].amount_total,CurrencyBase.symbol,CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator));
 
+            finalY2 +=5
+            pdfDoc.setFontSize(10);
+            pdfDoc.setFontStyle('bold');
+            pdfDoc.text(10,finalY2,'Firma del cliente: _ _ _ _ _ _ _ _ _ _       Aclaración: _ _ _ _ _ _ _ _ _ _               C.I.N°: _ _ _ _ _ _ _');
+            
+
             pdfDoc.addPage();
 
             var finalY2 = 20
@@ -679,241 +652,6 @@ openerp.pagare_decorart = function (instance, local) {
             pdfDoc.text(10,210,'Firma: ');
             pdfDoc.text(120,210,'Firma:');
 
-            pdfDoc.addPage();
-
-            // pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'png', 10, 10, 50, 30);
-            //
-            // pdfDoc.setFontSize(11);
-            // pdfDoc.setFontStyle('bold');
-            // pdfDoc.setTextColor(20);
-            // pdfDoc.text(80, 25,'SOLICITUD DE LINEA DE CREDITO');
-            //
-            // pdfDoc.text(91, 30,'Empresa: MyS Decorart');
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('normal');
-            // pdfDoc.setTextColor(40);
-            // pdfDoc.rect(10, 45, 95, 7, 'S');
-            // pdfDoc.text(12,50,'SUCURSAL: ' );
-            // pdfDoc.rect(105, 45, 95, 7, 'S');
-            // pdfDoc.text(110,50,'Fecha de Operación: ' + moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
-            // pdfDoc.rect(10, 55, 95, 7, 'S');
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('normal');
-            // pdfDoc.text(12,60,'Vendedor: ' + AccountInvoice[0].user_name);
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('bold');
-            // pdfDoc.setTextColor(40);
-            // pdfDoc.text(10, 72,'Datos del Cliente o Empresa');
-            //
-            // // Cuadro principal
-            // pdfDoc.rect(10, 80, pdfDoc.internal.pageSize.getWidth() - 20 , 35, 'S');
-            // // Cuadro fecha de emision
-            // pdfDoc.rect(10, 80, 95, 7, 'S');
-            // pdfDoc.setFontSize(8);
-            // pdfDoc.setFontStyle('normal');
-            // pdfDoc.setTextColor(20);
-            // pdfDoc.text(12, 84,'Fecha de emisión: ');
-            // pdfDoc.text(45, 84,  moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
-            // // RUC / Documento de identidad No.
-            // pdfDoc.rect(105, 80, 95, 7, 'S');
-            // pdfDoc.text(125, 84,'RUC / Doc. de Identidad No.: ' + AccountInvoice[0].partner_id[0].ruc);
-            // // Nombre o Razon Social
-            // pdfDoc.rect(10, 87, 95, 7, 'S');
-            // pdfDoc.text(12, 92,'Nombre o Razón Social: ' + AccountInvoice[0].partner_id[0].name);
-            // // Telefono
-            // pdfDoc.rect(105, 87, 95, 7, 'S');
-            // pdfDoc.text(125, 92,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].phone));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 94, 95, 7, 'S');
-            // pdfDoc.text(12, 98,'Direccion: ' + self.valorNull(AccountInvoice[0].partner_id[0].address));
-            //
-            // // celular
-            // pdfDoc.rect(105, 94, 95, 7, 'S');
-            // pdfDoc.text(125, 98,'Celular: ' + self.valorNull(AccountInvoice[0].partner_id[0].mobile));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 101, 95, 7, 'S');
-            // pdfDoc.text(12, 105,'Barrio: ' + self.valorNull(AccountInvoice[0].partner_id[0].barrio));
-            //
-            // // celular
-            // pdfDoc.rect(105, 101, 95, 7, 'S');
-            // pdfDoc.text(125, 105,'Ciudad: ' + self.valorNull(AccountInvoice[0].partner_id[0].city));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 108, 95, 7, 'S');
-            // pdfDoc.text(12, 112,'Estado Civil: ' + self.valorNull(AccountInvoice[0].partner_id[0].estado_civil));
-            //
-            // // celular
-            // pdfDoc.rect(105, 108, 95, 7, 'S');
-            // pdfDoc.text(125, 112,'Email: ' + self.valorNull(AccountInvoice[0].partner_id[0].email));
-            //
-            // var tipo;
-            // if(AccountInvoice[0].partner_id[0].casa_propia == true){
-            //        tipo = "Vivienda Propia";
-            //    }else{
-            //        tipo = "Vivienda Alquilada";
-            // }
-            // // TIPO DE VIVIENDA
-            // pdfDoc.rect(10, 115, 95, 7, 'S');
-            // pdfDoc.text(12, 119,'Tipo de Vivienda: ' + self.valorNull(tipo));
-            //
-            // // celular
-            // pdfDoc.rect(105, 115, 95, 7, 'S');
-            // // pdfDoc.text(125, 100,'Vivienda Alquilada: ' + self.valorNull(AccountInvoice[0].partner_id[0].casa_alquiler));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 122, 95, 7, 'S');
-            // pdfDoc.text(12, 126,'Empresa o Lugar de Trabajo: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_empresa));
-            //
-            // // celular
-            // pdfDoc.rect(105, 122, 95, 7, 'S');
-            // pdfDoc.text(125, 126,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_telefono));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 129, 95, 7, 'S');
-            // pdfDoc.text(12, 133,'Dirección: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_street));
-            //
-            // // celular
-            // pdfDoc.rect(105, 129, 95, 7, 'S');
-            // pdfDoc.text(125, 133,'Ciudad: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_city));
-            //
-            // // Direccion
-            // pdfDoc.rect(10, 136, 95, 7, 'S');
-            // pdfDoc.text(12, 140,'Cargo: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_cargo));
-            //
-            // // celular
-            // pdfDoc.rect(105, 136, 95, 7, 'S');
-            // pdfDoc.text(125, 140,'Antiguedad: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_antiguedad_a) + ',' + self.valorNull(AccountInvoice[0].partner_id[0].trab_antiguedad_m));
-            //
-            // // salario
-            // pdfDoc.rect(10, 143, 95, 7, 'S');
-            // pdfDoc.text(12, 147,'Salario: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_salario));
-            //
-            // // ref
-            // // pdfDoc.rect(105, 133, 95, 7, 'S');
-            // // pdfDoc.text(125, 137,'Vivienda Alquilada: ' + self.valorNull(AccountInvoice[0].partner_id[0].casa_alquiler));
-            //
-            // pdfDoc.setFontSize(8);
-            // pdfDoc.setFontStyle('normal');
-            // pdfDoc.text(12,160,'Referencias Comerciales:');
-            //
-            // i=0;
-            // _.each(AccountInvoice[0].partner_id[0].ref_comercial_ids,function(item){
-            //     pdfDoc.setFontSize(8);
-            //     pdfDoc.setFontStyle('normal');
-            //     pdfDoc.text(12+i,165, '' + item.name);
-            //     pdfDoc.text(55+i,165, '' + item.phone);
-            //     i=95;
-            // });
-            //
-            // pdfDoc.setFontSize(8);
-            // pdfDoc.setFontStyle('normal');
-            // pdfDoc.text(12,190,'Referencias Personales:');
-            //
-            // i=0;
-            // _.each(AccountInvoice[0].partner_id[0].ref_personal_ids,function(item){
-            //     pdfDoc.setFontSize(8);
-            //     pdfDoc.setFontStyle('normal');
-            //     pdfDoc.text(12+i,195, '- ' + item.email);
-            //     pdfDoc.text(30+i,195, '' + item.name);
-            //     pdfDoc.text(65+i,195, '' + item.phone);
-            //     i=95;
-            //
-            // });
-
-
-            // pdfDoc.addPage();
-            // var monto_cuota;
-            // var AccountInvoiceQuota;
-            // var tot_cuota;
-            // for (var i = 0; i < self.AccountInvoiceQuota.length; i++) {
-            // // _.each(self.AccountInvoiceQuota, function(item){
-            //     // AccountInvoiceQuota = self.productProduct[i];
-            //     if (i==1) {
-            //         AccountInvoiceQuota = self.AccountInvoiceQuota[i];
-            //         monto_cuota=AccountInvoiceQuota.amount;
-            //         tot_cuota=AccountInvoiceQuota.tot_cuota;
-            //     }
-            //     // x=x+1
-            // }
-            //
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('bold');
-            // pdfDoc.text(12,20,'Línea de crédito solicitado: '  + accounting.formatMoney(AccountInvoice[0].amount_total,CurrencyBase.symbol,CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator));
-            //
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('bold');
-            // pdfDoc.text(115,20,'Condición de venta: ' + accounting.formatMoney(monto_cuota,CurrencyBase.symbol,CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator) + 'x' + tot_cuota);
-            //
-            // pdfDoc.setFontSize(10);
-            // pdfDoc.setFontStyle('bold');
-            // pdfDoc.text(12,25,'Tipos de garantías: ' + self.valorNull(AccountInvoice[0].comment));
-
-
-            // var self = this;
-            // var AccountInvoice = self.AccountInvoice;
-            // var CurrencyBase = self.AccountInvoice[0].currency_id[0];
-            // var docItem = [];
-            // var docQuotaItem = [];
-            // var getColumns = [];
-            // var getColumnsQuota = [];
-            //
-            // var finalY = pdfDoc.autoTable.previous.finalY;
-            // _.each(self.AccountInvoiceLine, function(item){
-            //     startY: finalY + 2,
-            //     docItem.push({
-            //         name : item.name,
-            //         quantity : item.quantity,
-            //         price_unit : accounting.formatMoney(item.price_unit,'',CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
-            //         price_subtotal : accounting.formatMoney(item.price_subtotal,'',CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
-            //     });
-            // });
-            //
-            // getColumns.push({
-            //      title : 'Descripción',
-            //      dataKey: 'name'
-            // });
-            //
-            // getColumns.push({
-            //     title : 'Cantidad',
-            //     dataKey: 'quantity'
-            // });
-            // getColumns.push({
-            //     title : 'Precio Unitario',
-            //     dataKey: 'price_unit'
-            // });
-            // getColumns.push({
-            //     title : 'Subtotal',
-            //     dataKey: 'price_subtotal'
-            // });
-            //
-            //
-            // pdfDoc.autoTable(getColumns, docItem, {
-            //      theme: 'grid',
-            //      styles: {
-            //         overflow: 'linebreak',
-            //         columnWidth: 'auto',
-            //         fontSize: 7
-            //     },
-            //     headerStyles: {
-            //         textColor: 20,
-            //         fillColor: null,
-            //         lineWidth: 0.1,
-            //         fontSize: 9
-            //     },
-            //     columnStyles: {
-            //          name : {columnWidth: 'auto'},
-            //          quantity : {columnWidth: 30, halign:'right'},
-            //          price_unit : {columnWidth: 30, halign:'right'},
-            //          price_subtotal : {columnWidth: 30, halign:'right'},
-            //      },
-            //
-            //     margin: { top: 28, horizontal: 10},
-            // });
-
-
-
 
             pdfDoc.save('pagare.pdf');
         },