|
@@ -90,7 +90,8 @@ 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.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'PNG',10,10,20,15);
|
|
|
+ pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'png', 10, 10, 50, 30);
|
|
|
|
|
|
_.each(self.AccountInvoiceLine, function(item){
|
|
|
docItem.push({
|
|
@@ -102,18 +103,22 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
});
|
|
|
getColumns.push({
|
|
|
title : 'Descripción',
|
|
|
+ halign: 'center',
|
|
|
dataKey: 'name'
|
|
|
});
|
|
|
getColumns.push({
|
|
|
title : 'Cantidad',
|
|
|
+ halign: 'center',
|
|
|
dataKey: 'quantity'
|
|
|
});
|
|
|
getColumns.push({
|
|
|
title : 'Precio Unitario',
|
|
|
+ halign: 'center',
|
|
|
dataKey: 'price_unit'
|
|
|
});
|
|
|
getColumns.push({
|
|
|
title : 'subtotal',
|
|
|
+ halign: 'center',
|
|
|
dataKey: 'price_subtotal'
|
|
|
});
|
|
|
|
|
@@ -132,22 +137,22 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
},
|
|
|
columnStyles: {
|
|
|
name : {columnWidth: 'auto'},
|
|
|
- quantity : {columnWidth: 30, halign:'right'},
|
|
|
- price_unit : {columnWidth: 30, halign:'right'},
|
|
|
- price_subtotal : {columnWidth: 30, halign:'right'},
|
|
|
+ quantity : {columnWidth: 25, halign:'right'},
|
|
|
+ price_unit : {columnWidth: 25, halign:'right'},
|
|
|
+ price_subtotal : {columnWidth: 25, halign:'right'},
|
|
|
},
|
|
|
|
|
|
margin: { top: 80, horizontal: 10},
|
|
|
|
|
|
addPageContent: function (data) {
|
|
|
|
|
|
- pdfDoc.setFontSize(11);
|
|
|
- pdfDoc.setFontStyle('bold');
|
|
|
- pdfDoc.setTextColor(20);
|
|
|
- pdfDoc.text(40, 13,'Empresa: ');
|
|
|
- pdfDoc.setFontSize(11);
|
|
|
- pdfDoc.setFontStyle('normal');
|
|
|
- pdfDoc.text(60, 13, 'M&S DECORART');
|
|
|
+ // pdfDoc.setFontSize(11);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(20);
|
|
|
+ // pdfDoc.text(40, 13,'Empresa: ');
|
|
|
+ // pdfDoc.setFontSize(11);
|
|
|
+ // pdfDoc.setFontStyle('normal');
|
|
|
+ // pdfDoc.text(60, 13, 'M&S DECORART');
|
|
|
|
|
|
pdfDoc.setFontSize(11);
|
|
|
pdfDoc.setFontStyle('bold');
|
|
@@ -174,27 +179,28 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
pdfDoc.text(147, 23, AccountInvoice[0].user_name);
|
|
|
|
|
|
// Cuadro principal
|
|
|
- pdfDoc.rect(10, 30, pdfDoc.internal.pageSize.getWidth() - 20 , 40, 'S');
|
|
|
+ //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, 30, 80, 10, 'S');
|
|
|
+ pdfDoc.rect(10, 40, 80, 7, 'S');
|
|
|
pdfDoc.setFontSize(8);
|
|
|
pdfDoc.setFontStyle('normal');
|
|
|
pdfDoc.setTextColor(20);
|
|
|
- pdfDoc.text(12, 36,'Fecha de emisión: ');
|
|
|
- pdfDoc.text(45, 36, moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
|
|
|
+ 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, 40, pdfDoc.internal.pageSize.getWidth() - 20, 10, 'S');
|
|
|
- pdfDoc.text(12, 46,'RUC / Documento de Identidad No.: ' + AccountInvoice[0].partner_id[0].ruc);
|
|
|
+ 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, 50, pdfDoc.internal.pageSize.getWidth() - 20, 10, 'S');
|
|
|
- pdfDoc.text(12, 56,'Nombre o Razón Social: ' + AccountInvoice[0].partner_id[0].name);
|
|
|
+ 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, 60, 95, 10, 'S');
|
|
|
- pdfDoc.text(12, 66,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].phone));
|
|
|
-
|
|
|
- // Dirreccion
|
|
|
- pdfDoc.rect(105, 60, 95, 10, 'S');
|
|
|
- pdfDoc.text(107, 66,'Direccion: ' + self.valorNull(AccountInvoice[0].partner_id[0].address));
|
|
|
+ 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));
|
|
|
|
|
|
}
|
|
|
});
|
|
@@ -308,7 +314,7 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
|
|
|
pdfDoc.addPage();
|
|
|
|
|
|
- pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'PNG',10,10,20,15);
|
|
|
+ pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'png', 10, 10, 50, 30);
|
|
|
pdfDoc.setFontSize(16);
|
|
|
pdfDoc.setFontStyle('bold');
|
|
|
pdfDoc.setTextColor(40);
|
|
@@ -370,72 +376,72 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
|
|
|
pdfDoc.addPage();
|
|
|
|
|
|
- pdfDoc.addImage("data:image/png;base64," + AccountInvoice[0].company_id[0].logo, 'PNG',10,10,20,15);
|
|
|
+ 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(10, 30,'Empresa: MyS Decorart');
|
|
|
+ pdfDoc.text(91, 30,'Empresa: MyS Decorart');
|
|
|
pdfDoc.setFontSize(10);
|
|
|
pdfDoc.setFontStyle('normal');
|
|
|
pdfDoc.setTextColor(40);
|
|
|
- pdfDoc.rect(10, 35, 95, 7, 'S');
|
|
|
- pdfDoc.text(12,40,'SUCURSAL: ' );
|
|
|
- pdfDoc.rect(105, 35, 95, 7, 'S');
|
|
|
- pdfDoc.text(110,40,'Fecha de Operación: ' + moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
|
|
|
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,50,'Vendedor: ' + AccountInvoice[0].user_name);
|
|
|
+ pdfDoc.text(12,60,'Vendedor: ' + AccountInvoice[0].user_name);
|
|
|
pdfDoc.setFontSize(10);
|
|
|
pdfDoc.setFontStyle('bold');
|
|
|
pdfDoc.setTextColor(40);
|
|
|
- pdfDoc.text(10, 58,'Datos del Cliente o Empresa');
|
|
|
+ pdfDoc.text(10, 72,'Datos del Cliente o Empresa');
|
|
|
|
|
|
// Cuadro principal
|
|
|
- pdfDoc.rect(10, 60, pdfDoc.internal.pageSize.getWidth() - 20 , 35, 'S');
|
|
|
+ pdfDoc.rect(10, 80, pdfDoc.internal.pageSize.getWidth() - 20 , 35, 'S');
|
|
|
// Cuadro fecha de emision
|
|
|
- pdfDoc.rect(10, 60, 95, 7, 'S');
|
|
|
+ pdfDoc.rect(10, 80, 95, 7, 'S');
|
|
|
pdfDoc.setFontSize(8);
|
|
|
pdfDoc.setFontStyle('normal');
|
|
|
pdfDoc.setTextColor(20);
|
|
|
- pdfDoc.text(12, 64,'Fecha de emisión: ');
|
|
|
- pdfDoc.text(45, 64, moment(AccountInvoice[0].date_invoice).format('DD/MM/YYYY'));
|
|
|
+ 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, 60, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 64,'RUC / Doc. de Identidad No.: ' + AccountInvoice[0].partner_id[0].ruc);
|
|
|
+ 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, 67, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 72,'Nombre o Razón Social: ' + AccountInvoice[0].partner_id[0].name);
|
|
|
+ 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, 67, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 72,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].phone));
|
|
|
+ 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, 74, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 78,'Direccion: ' + self.valorNull(AccountInvoice[0].partner_id[0].address));
|
|
|
+ pdfDoc.rect(10, 94, 95, 7, 'S');
|
|
|
+ pdfDoc.text(12, 98,'Direccion: ' + self.valorNull(AccountInvoice[0].partner_id[0].address));
|
|
|
|
|
|
// celular
|
|
|
- pdfDoc.rect(105, 74, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 78,'Celular: ' + self.valorNull(AccountInvoice[0].partner_id[0].mobile));
|
|
|
+ pdfDoc.rect(105, 94, 95, 7, 'S');
|
|
|
+ pdfDoc.text(125, 98,'Celular: ' + self.valorNull(AccountInvoice[0].partner_id[0].mobile));
|
|
|
|
|
|
// Direccion
|
|
|
- pdfDoc.rect(10, 81, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 85,'Barrio: ' + self.valorNull(AccountInvoice[0].partner_id[0].barrio));
|
|
|
+ pdfDoc.rect(10, 101, 95, 7, 'S');
|
|
|
+ pdfDoc.text(12, 105,'Barrio: ' + self.valorNull(AccountInvoice[0].partner_id[0].barrio));
|
|
|
|
|
|
// celular
|
|
|
- pdfDoc.rect(105, 81, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 85,'Ciudad: ' + self.valorNull(AccountInvoice[0].partner_id[0].city));
|
|
|
+ pdfDoc.rect(105, 101, 95, 7, 'S');
|
|
|
+ pdfDoc.text(125, 105,'Ciudad: ' + self.valorNull(AccountInvoice[0].partner_id[0].city));
|
|
|
|
|
|
// Direccion
|
|
|
- pdfDoc.rect(10, 88, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 92,'Estado Civil: ' + self.valorNull(AccountInvoice[0].partner_id[0].estado_civil));
|
|
|
+ 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, 88, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 92,'Email: ' + self.valorNull(AccountInvoice[0].partner_id[0].email));
|
|
|
+ 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){
|
|
@@ -444,40 +450,40 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
tipo = "Vivienda Alquilada";
|
|
|
}
|
|
|
// TIPO DE VIVIENDA
|
|
|
- pdfDoc.rect(10, 95, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 100,'Tipo de Vivienda: ' + self.valorNull(tipo));
|
|
|
+ pdfDoc.rect(10, 115, 95, 7, 'S');
|
|
|
+ pdfDoc.text(12, 119,'Tipo de Vivienda: ' + self.valorNull(tipo));
|
|
|
|
|
|
// celular
|
|
|
- pdfDoc.rect(105, 95, 95, 7, 'S');
|
|
|
+ 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, 112, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 116,'Empresa o Lugar de Trabajo: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_empresa));
|
|
|
+ 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, 112, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 116,'Teléfono: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_telefono));
|
|
|
+ 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, 119, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 123,'Dirección: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_street));
|
|
|
+ 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, 119, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 123,'Ciudad: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_city));
|
|
|
+ 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, 126, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 130,'Cargo: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_cargo));
|
|
|
+ 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, 126, 95, 7, 'S');
|
|
|
- pdfDoc.text(125, 130,'Antiguedad: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_antiguedad_a) + ',' + self.valorNull(AccountInvoice[0].partner_id[0].trab_antiguedad_m));
|
|
|
+ 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, 133, 95, 7, 'S');
|
|
|
- pdfDoc.text(12, 137,'Salario: ' + self.valorNull(AccountInvoice[0].partner_id[0].trab_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');
|
|
@@ -485,27 +491,28 @@ openerp.pagare_decorart = function (instance, local) {
|
|
|
|
|
|
pdfDoc.setFontSize(8);
|
|
|
pdfDoc.setFontStyle('normal');
|
|
|
- pdfDoc.text(12,150,'Referencias Comerciales:');
|
|
|
+ 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,155, '' + item.name);
|
|
|
- pdfDoc.text(55+i,155, '' + item.phone);
|
|
|
+ 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,180,'Referencias Personales:');
|
|
|
+ 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,185, '' + item.name);
|
|
|
- pdfDoc.text(55+i,185, '' + item.phone);
|
|
|
+ pdfDoc.text(12+i,195, '- ' + item.email);
|
|
|
+ pdfDoc.text(30+i,195, '' + item.name);
|
|
|
+ pdfDoc.text(65+i,195, '' + item.phone);
|
|
|
i=95;
|
|
|
|
|
|
});
|