|
@@ -0,0 +1,667 @@
|
|
|
+openerp.workorder_printprofesional = function (instance, local) {
|
|
|
+ local.widgetInstance = null;
|
|
|
+ local.parentInstance = null;
|
|
|
+
|
|
|
+ local.WorkOrderprofesionalWidget = instance.Widget.extend({
|
|
|
+ template : "workorder_printprofesional.WorkOrderprofesional",
|
|
|
+ jsonDoc:[],
|
|
|
+
|
|
|
+ init:function(parent){
|
|
|
+ this._super(parent);
|
|
|
+ },
|
|
|
+
|
|
|
+ updateId : function(id){
|
|
|
+ var self = this;
|
|
|
+ self.id=id;
|
|
|
+ },
|
|
|
+
|
|
|
+ start: function () {
|
|
|
+ var self = this;
|
|
|
+ this.$el.click(function (e) {
|
|
|
+ self.fecthInitial();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ valorNull:function(dato){
|
|
|
+ var valor ="";
|
|
|
+ if (dato){
|
|
|
+ if(dato == true && typeof dato == 'boolean'){
|
|
|
+ valor=" ";
|
|
|
+ }else{
|
|
|
+ valor=dato;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return valor;
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthInitial: function(){
|
|
|
+ var id= openerp.webclient._current_state.id;
|
|
|
+ var self = this;
|
|
|
+ self.fecthRepairWorkorder(id).then(function(RepairWorkorder){
|
|
|
+ return RepairWorkorder;
|
|
|
+ }).then(function(RepairWorkorder){
|
|
|
+ self.RepairWorkorder = RepairWorkorder;
|
|
|
+ return self.fecthRepairWorkorderLine();
|
|
|
+ }).then(function(RepairWorkorderLine){
|
|
|
+ self.RepairWorkorderLine = RepairWorkorderLine;
|
|
|
+ return self.fecthRepairPedidosorderLine();
|
|
|
+ }).then(function(RepairPedidosorderLine){
|
|
|
+ self.RepairPedidosorderLine = RepairPedidosorderLine;
|
|
|
+ return self.fecthRepairResumenorderLine();
|
|
|
+ }).then(function(RepairResumenorderLine){
|
|
|
+ self.RepairResumenorderLine = RepairResumenorderLine;
|
|
|
+ return self.fecthRepairCalidadorderLine();
|
|
|
+ }).then(function(RepairCalidadorderLine){
|
|
|
+ self.RepairCalidadorderLine = RepairCalidadorderLine;
|
|
|
+ return self.fecthRepairSugerenciaorderLine();
|
|
|
+ }).then(function(RepairSugerenciaorderLine){
|
|
|
+ self.RepairSugerenciaorderLine = RepairSugerenciaorderLine;
|
|
|
+ return self.fetchRepairWorkorderConsumed();
|
|
|
+ }).then(function(RepairWorkorderConsumed){
|
|
|
+ self.RepairWorkorderConsumed = RepairWorkorderConsumed;
|
|
|
+ return self.drawPDF();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthRepairWorkorder: function(id){
|
|
|
+ var domain=[['id','=', id]];
|
|
|
+ var RepairWorkorder = new instance.web.Model('repair.workorderimproved');
|
|
|
+ return RepairWorkorder.call('getRepairWorkorder',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthRepairWorkorderLine: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairWorkorder,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairWorkorderLine = new instance.web.Model('repair.workorderimproved.line');
|
|
|
+ return RepairWorkorderLine.call('getRepairWorkorderLine',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ fecthRepairPedidosorderLine: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairWorkorder,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairPedidosorderLine = new instance.web.Model('repair.pedidosorderimproved.line');
|
|
|
+ return RepairPedidosorderLine.call('getRepairPedidosorderLine',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthRepairResumenorderLine: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairWorkorder,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairResumenorderLine = new instance.web.Model('repair.resumenorderimproved.line');
|
|
|
+ return RepairResumenorderLine.call('getRepairResumenorderLine',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthRepairCalidadorderLine: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairWorkorder,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairCalidadorderLine = new instance.web.Model('repair.calidadorderimproved.line');
|
|
|
+ return RepairCalidadorderLine.call('getRepairCalidadorderLine',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ fecthRepairSugerenciaorderLine: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairSugerenciaorderLine,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairSugerenciaorderLine = new instance.web.Model('repair.sugerenciaorderimproved.line');
|
|
|
+ return RepairSugerenciaorderLine.call('getRepairSugerenciaorderLine',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ fetchRepairWorkorderConsumed: function () {
|
|
|
+ var self = this;
|
|
|
+ var workorder_ids = _.flatten(_.map(self.RepairWorkorder,function(map){
|
|
|
+ return map.id;
|
|
|
+ }));
|
|
|
+ var domain=[['workorder_id','in',workorder_ids]];
|
|
|
+ var RepairWorkorderConsumed = new instance.web.Model('repair.workorderimproved.consumed');
|
|
|
+ return RepairWorkorderConsumed.call('getRepairWorkorderConsumed',[domain], {
|
|
|
+ context: new instance.web.CompoundContext()
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ drawPDF:function(){
|
|
|
+ var self = this;
|
|
|
+ var doc = self.RepairWorkorder.shift();
|
|
|
+
|
|
|
+ var docItem = [];
|
|
|
+ var docWorkItem = [];
|
|
|
+ var getColumns = [];
|
|
|
+ var getColumns1 = [];
|
|
|
+ var getColumnsMaterial = [];
|
|
|
+ var docWorkItem1 = [];
|
|
|
+ var docWorkItem2 = [];
|
|
|
+ var docWorkItem3 = [];
|
|
|
+ var getColumnsMaterial1 = [];
|
|
|
+ var getColumnsMaterial2 = [];
|
|
|
+ var getColumnsMaterial3 = [];
|
|
|
+
|
|
|
+ var pdfDoc = new jsPDF();
|
|
|
+ pdfDoc.addImage("data:image/png;base64," + doc.company_logo, 'PNG',12,5,45,15);
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ =============================================================
|
|
|
+ OBTENER LINEAS DEL PEDIDO
|
|
|
+ =============================================================
|
|
|
+ */
|
|
|
+ var RepairWorkorderLine = self.RepairWorkorderLine;
|
|
|
+ for (var i = 0; i < RepairWorkorderLine.length; i++) {
|
|
|
+ docItem.push({
|
|
|
+ xnumber : i + 1,
|
|
|
+ product : RepairWorkorderLine[i].description,
|
|
|
+ brand : RepairWorkorderLine[i].brand,
|
|
|
+ number : RepairWorkorderLine[i].number
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ getColumns.push({
|
|
|
+ title : 'N°',
|
|
|
+ dataKey: 'xnumber',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+
|
|
|
+ getColumns.push({
|
|
|
+ title : 'A- DETALLES DE SERVICIOS PEDIDOS POR CLIENTE',
|
|
|
+ dataKey: 'product',
|
|
|
+ align: 'left',
|
|
|
+ });
|
|
|
+ getColumns.push({
|
|
|
+ title : 'Cantidad',
|
|
|
+ dataKey: 'brand',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumns.push({
|
|
|
+ title : 'Estado',
|
|
|
+ dataKey: 'number',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ var RepairPedidosorderLine = self.RepairPedidosorderLine;
|
|
|
+ for (var i = 0; i < RepairPedidosorderLine.length; i++) {
|
|
|
+ docWorkItem.push({
|
|
|
+ xnumber : i + 1,
|
|
|
+ description : RepairPedidosorderLine[i].description,
|
|
|
+ quantity : RepairPedidosorderLine[i].quantity,
|
|
|
+ number : RepairPedidosorderLine[i].number
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ getColumnsMaterial.push({
|
|
|
+ title : 'N°',
|
|
|
+ dataKey: 'xnumber',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial.push({
|
|
|
+ title : 'B- PEDIDOS ADICIONALES Y EMERGENTES',
|
|
|
+ dataKey: 'description',
|
|
|
+ align: 'left',
|
|
|
+ });
|
|
|
+ getColumnsMaterial.push({
|
|
|
+ title : 'Cantidad',
|
|
|
+ dataKey: 'quantity',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial.push({
|
|
|
+ title : 'Estado',
|
|
|
+ dataKey: 'number',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+
|
|
|
+ var x=0
|
|
|
+ _.each(self.RepairResumenorderLine, function(item){
|
|
|
+ docWorkItem1.push({
|
|
|
+ xnumber : x+1,
|
|
|
+ description : item.description
|
|
|
+ });
|
|
|
+ });
|
|
|
+ getColumnsMaterial1.push({
|
|
|
+ title : 'N°',
|
|
|
+ dataKey: 'xnumber',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial1.push({
|
|
|
+ title : 'C- ESTADO Y RESUMEN DE TRABAJOS',
|
|
|
+ dataKey: 'description',
|
|
|
+ align: 'left',
|
|
|
+ });
|
|
|
+
|
|
|
+ var y=0
|
|
|
+ _.each(self.RepairCalidadorderLine, function(item){
|
|
|
+ docWorkItem2.push({
|
|
|
+ xnumber : y+1,
|
|
|
+ description : item.description,
|
|
|
+ quantity : item.quantity,
|
|
|
+ number : item.number
|
|
|
+ });
|
|
|
+ });
|
|
|
+ getColumnsMaterial2.push({
|
|
|
+ title : 'N°',
|
|
|
+ dataKey: 'xnumber',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial2.push({
|
|
|
+ title : 'D- CONTROL DE CALIDAD, FICHAS Y LACRES',
|
|
|
+ dataKey: 'description',
|
|
|
+ align: 'left',
|
|
|
+ });
|
|
|
+ getColumnsMaterial2.push({
|
|
|
+ title : 'Ficha',
|
|
|
+ dataKey: 'quantity',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial2.push({
|
|
|
+ title : 'Lacre',
|
|
|
+ dataKey: 'number',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+
|
|
|
+ var z=0
|
|
|
+ _.each(self.RepairSugerenciaorderLine, function(item){
|
|
|
+ docWorkItem3.push({
|
|
|
+ xnumber : z+1,
|
|
|
+ description : item.description
|
|
|
+ });
|
|
|
+ });
|
|
|
+ getColumnsMaterial3.push({
|
|
|
+ title : 'N°',
|
|
|
+ dataKey: 'xnumber',
|
|
|
+ align: 'center',
|
|
|
+ });
|
|
|
+ getColumnsMaterial3.push({
|
|
|
+ title : 'E- SUGERENCIAS Y PENDIENTES',
|
|
|
+ dataKey: 'description',
|
|
|
+ align: 'left',
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ pdfDoc.autoTable(getColumns, docItem, {
|
|
|
+ theme: 'grid',
|
|
|
+ styles: {
|
|
|
+ overflow: 'linebreak',
|
|
|
+ columnWidth: 'auto',
|
|
|
+ fontSize: 7,
|
|
|
+
|
|
|
+ },
|
|
|
+ headerStyles: {
|
|
|
+ fillColor: [255, 255, 255],
|
|
|
+ borderColor: [150, 152, 154],
|
|
|
+ color: 'black',
|
|
|
+ fontStyle: 'bold',
|
|
|
+ textColor: [0, 0, 0],
|
|
|
+ fontSize: 9
|
|
|
+ },
|
|
|
+ columnStyles: {
|
|
|
+ xnumber : {halign:'center',columnWidth: '4px'},
|
|
|
+ product : {columnWidth: '8px',fontStyle: 'bold'},
|
|
|
+ brand : {halign:'center', columnWidth: '8px'},
|
|
|
+ number : {halign:'center',columnWidth: '8px'},
|
|
|
+ },
|
|
|
+ margin: { top: 60, horizontal: 14},
|
|
|
+
|
|
|
+
|
|
|
+ addPageContent: function (data) {
|
|
|
+
|
|
|
+ /*
|
|
|
+ ====================================================================
|
|
|
+ CABECERA
|
|
|
+ ====================================================================
|
|
|
+ */
|
|
|
+
|
|
|
+ // pdfDoc.setFontSize(8);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(14,26,doc.company_address);
|
|
|
+ //
|
|
|
+ // pdfDoc.setFontSize(8);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(14,30,'Cel.: ' + doc.company_phone);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(14);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(105,10,'INFORME TÉCNICO DE TRABAJO');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(12);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(125,23, doc.vat);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(13);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(130,17,'Nº ' + doc.name);
|
|
|
+
|
|
|
+ pdfDoc.setDrawColor('252', '252', '252');
|
|
|
+ pdfDoc.rect(13, 25, pdfDoc.internal.pageSize.getWidth() - 26 , 26, 'S');
|
|
|
+
|
|
|
+ /*
|
|
|
+ ====================================================================
|
|
|
+ PRIMERA SECCION
|
|
|
+ ====================================================================
|
|
|
+ */
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(14,32,'Fecha: ' + moment(doc.order_date).format('DD/MM/YYYY'));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(47,32,'Cliente: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(61,32, doc.partner_name);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(149,32,'R.U.C. N°: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(168,32, doc.partner_ruc);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(14,37,'Presupuesto: ');
|
|
|
+
|
|
|
+ // pdfDoc.setFontSize(10);
|
|
|
+ // pdfDoc.setFontStyle('normal');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(32,60, );
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(50,37,'Obra: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(70,37,self.valorNull(doc.name_obra));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(149,37,'Inicio: ' );
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(168,37, moment(doc.planned_start_date).format('DD/MM/YYYY'));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(14,42,'Factura N°: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(29,42,self.valorNull(doc.nro_factura));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(75,42,'Pedido por: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(95,42, doc.contacto_obra);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(149,42,'Fin: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(168,42, moment(doc.planned_end_date).format('DD/MM/YYYY'));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(14,47,'Local: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(31,47,self.valorNull(doc.name_local));
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(75,47,'Técnico: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(90,47, doc.responsable);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(149,47,'Móvil: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(10);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(168,47, doc.movil);
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(12);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(40);
|
|
|
+ pdfDoc.text(78,58,'LISTA DE PEDIDOS');
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /*
|
|
|
+ =============================================================
|
|
|
+ PEDIDOS ADICIONALES Y EMERGENTES
|
|
|
+ =============================================================
|
|
|
+ */
|
|
|
+ var finalY = pdfDoc.autoTable.previous.finalY;
|
|
|
+ pdfDoc.autoTable(getColumnsMaterial, docWorkItem, {
|
|
|
+ theme: 'grid',
|
|
|
+ startY: finalY + 4,
|
|
|
+ styles: {
|
|
|
+ overflow: 'linebreak',
|
|
|
+ columnWidth: 'auto',
|
|
|
+ fontSize: 8,
|
|
|
+
|
|
|
+ },
|
|
|
+ headerStyles: {
|
|
|
+ fillColor: [255, 255, 255],
|
|
|
+ borderColor: [150, 152, 154],
|
|
|
+ fontSize: 9,
|
|
|
+ textColor: [0, 0, 0]
|
|
|
+ },
|
|
|
+ columnStyles: {
|
|
|
+ xnmumber : {columnWidth: '4px',halign: 'center'},
|
|
|
+ description: {columnWidth: '8px', halign: 'left'},
|
|
|
+ quantity : {columnWidth: '8px', halign: 'center'},
|
|
|
+ number : {columnWidth: '8px', halign: 'center'},
|
|
|
+ },
|
|
|
+ margin: {horizontal: 14},
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ =============================================================
|
|
|
+ ESTADO Y RESUMEN DE TRABAJOS
|
|
|
+ =============================================================
|
|
|
+ */
|
|
|
+ var finalY = pdfDoc.autoTable.previous.finalY;
|
|
|
+ pdfDoc.autoTable(getColumnsMaterial1, docWorkItem1, {
|
|
|
+ theme: 'grid',
|
|
|
+ startY: finalY + 4,
|
|
|
+ styles: {
|
|
|
+ overflow: 'linebreak',
|
|
|
+ columnWidth: 'auto',
|
|
|
+ fontSize: 8,
|
|
|
+
|
|
|
+ },
|
|
|
+ headerStyles: {
|
|
|
+ fillColor: [255, 255, 255],
|
|
|
+ borderColor: [150, 152, 154],
|
|
|
+ fontSize: 9,
|
|
|
+ textColor: [0, 0, 0]
|
|
|
+ },
|
|
|
+ columnStyles: {
|
|
|
+ xnmumber : {columnWidth: '4px',halign: 'center'},
|
|
|
+ description: {columnWidth: '23px', halign: 'left'},
|
|
|
+ },
|
|
|
+ margin: {horizontal: 14},
|
|
|
+ // addPageContent: function (data) {
|
|
|
+ // pdfDoc.setFontSize(12);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(15,finalY + 7,'ESTADO Y RESUMEN DE TRABAJOS');
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ /*
|
|
|
+ =============================================================
|
|
|
+ CONTROL DE CALIDAD, FICHAS Y LACRES
|
|
|
+ =============================================================
|
|
|
+ */
|
|
|
+ var finalY = pdfDoc.autoTable.previous.finalY;
|
|
|
+ pdfDoc.autoTable(getColumnsMaterial2, docWorkItem2, {
|
|
|
+ theme: 'grid',
|
|
|
+ startY: finalY + 4,
|
|
|
+ styles: {
|
|
|
+ overflow: 'linebreak',
|
|
|
+ columnWidth: 'auto',
|
|
|
+ fontSize: 9,
|
|
|
+
|
|
|
+ },
|
|
|
+ headerStyles: {
|
|
|
+ fillColor: [255, 255, 255],
|
|
|
+ borderColor: [150, 152, 154],
|
|
|
+ fontSize: 9,
|
|
|
+ textColor: [0, 0, 0]
|
|
|
+ },
|
|
|
+ columnStyles: {
|
|
|
+ xnmumber : {columnWidth: '4px', halign: 'center'},
|
|
|
+ description: {columnWidth: '8px', halign: 'left'},
|
|
|
+ quantity : {columnWidth: '8px', halign: 'center'},
|
|
|
+ number : {columnWidth: '8px', halign: 'center'},
|
|
|
+ },
|
|
|
+ margin: {horizontal: 14},
|
|
|
+ // addPageContent: function (data) {
|
|
|
+ // pdfDoc.setFontSize(12);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(15,finalY + 7,'CONTROL DE CALIDAD, FICHAS Y LACRES');
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ =============================================================
|
|
|
+ CONTROL DE CALIDAD, FICHAS Y LACRES
|
|
|
+ =============================================================
|
|
|
+ */
|
|
|
+ var finalY = pdfDoc.autoTable.previous.finalY;
|
|
|
+ pdfDoc.autoTable(getColumnsMaterial3, docWorkItem3, {
|
|
|
+ theme: 'grid',
|
|
|
+ startY: finalY + 4,
|
|
|
+ styles: {
|
|
|
+ overflow: 'linebreak',
|
|
|
+ columnWidth: 'auto',
|
|
|
+ fontSize: 8,
|
|
|
+
|
|
|
+ },
|
|
|
+ headerStyles: {
|
|
|
+ fillColor: [255, 255, 255],
|
|
|
+ borderColor: [150, 152, 154],
|
|
|
+ fontSize: 9,
|
|
|
+ textColor: [0, 0, 0]
|
|
|
+ },
|
|
|
+ columnStyles: {
|
|
|
+ xnmumber : {columnWidth: '4px',halign: 'center'},
|
|
|
+ description: {columnWidth: '23px', halign: 'left'},
|
|
|
+ },
|
|
|
+ margin: {horizontal: 14},
|
|
|
+ // addPageContent: function (data) {
|
|
|
+ // pdfDoc.setFontSize(12);
|
|
|
+ // pdfDoc.setFontStyle('bold');
|
|
|
+ // pdfDoc.setTextColor(40);
|
|
|
+ // pdfDoc.text(15,finalY + 7,'SUGERENCIAS Y PENDIENTES');
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(9);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(14,pdfDoc.autoTable.previous.finalY + 14,'Firma de conformidad de cliente o encargado: ............................................. Sello: ');
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(9);
|
|
|
+ pdfDoc.setFontStyle('normal');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(14,pdfDoc.autoTable.previous.finalY + 24,'Aclaración: ................................. C.I.N°: ....................');
|
|
|
+
|
|
|
+
|
|
|
+ pdfDoc.setFontSize(9);
|
|
|
+ pdfDoc.setFontStyle('bold');
|
|
|
+ pdfDoc.setTextColor(10);
|
|
|
+ pdfDoc.text(14,pdfDoc.autoTable.previous.finalY + 34,'Firma de técnico responsable: ..................................................................... Sello: ');
|
|
|
+
|
|
|
+
|
|
|
+ pdfDoc.save('Informe técnico de trabajo.pdf');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if (instance.web && instance.web.FormView) {
|
|
|
+ instance.web.FormView.include({
|
|
|
+ load_form: function (record) {
|
|
|
+ this._super.apply(this, arguments);
|
|
|
+ if (this.model !== 'repair.workorderimproved') return;
|
|
|
+ local.parentInstance = this;
|
|
|
+ if (local.widgetInstance) {
|
|
|
+ local.widgetInstance.updateId(record.id);
|
|
|
+ }
|
|
|
+ local.widgetInstance = new local.WorkOrderprofesionalWidget(this);
|
|
|
+ var elemento = this.$el.find('.oe_form_sheet.oe_form_sheet_width');
|
|
|
+ elemento = elemento.find('.oe_right.oe_button_box.workorderprofesional_button_box');
|
|
|
+ local.widgetInstance.appendTo(elemento);
|
|
|
+ local.widgetInstance.updateId(record.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|