PageSourceSearch

https://mjs-order.firebaseapp.com/7335-es5.06e62098c2d350523561.js

js mjs-order.firebaseapp.com collected 2026-10-03 14:10:04 UTC 30,474 bytes, 1 lines download raw bytes

1!function(){"use strict";function e(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function o(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}(self.webpackChunkOrder=self.webpackChunkOrder||[]).push([[7335],{44981:function(o,n,i){i.d(n,{h:function(){return d},Z:function(){return c}});var r,a=i(33018),c=((r=function(){function o(){e(this,o)}return t(o,[{key:"transform",value:function(e,t){return t&&e?o.filter(e,t):e}}],[{key:"filter",value:function(e,o){var t=o.toLowerCase();function n(e,o){for(var i in e)if(null!==e[i]&&null!=e[i]&&("object"==typeof e[i]&&n(e[i],o)||e[i].toString().toLowerCase().includes(t)))return!0;return!1}return e.filter(function(e){return n(e,o)})}}]),o}()).\u0275fac=function(e){return new(e||r)},r.\u0275pipe=a.Yjl({name:"filter",type:r,pure:!1}),r.\u0275prov=a.Yz7({token:r,factory:r.\u0275fac}),r),d=function(){var o=t(function o(){e(this,o)});return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=a.oAB({type:o}),o.\u0275inj=a.cJS({}),o}()},57335:function(o,n,i){i.r(n),i.d(n,{ComprasDetPageModule:function(){return S}});var r=i(38583),a=i(90665),c=i(35541),d=i(46476),u=i(64762),s=i(33018),l=i(43241),p=i(2311),g=i(71729),h=i(13408),f=i(63437),m=i(98302),Z=i(44981);function v(e,o){1&e&&(s.TgZ(0,"ion-title"),s._uU(1,"Compra Crear"),s.qZA())}function x(e,o){1&e&&(s.TgZ(0,"ion-title"),s._uU(1,"Compra Editar"),s.qZA())}function b(e,o){1&e&&(s.TgZ(0,"ion-label",29),s._uU(1,"Seleccione proveedor"),s.qZA())}function A(e,o){if(1&e&&(s.TgZ(0,"ion-label"),s._uU(1),s.TgZ(2,"p"),s._uU(3),s.qZA(),s.TgZ(4,"p"),s._uU(5),s.qZA(),s.TgZ(6,"p"),s._uU(7),s.qZA(),s.qZA()),2&e){var t=s.oxw();s.xp6(1),s.hij("",t.proveedor.nombre," "),s.xp6(2),s.Oqu(t.proveedor.direccion),s.xp6(2),s.AsE("",t.proveedor.barrio," | ",t.proveedor.ciudad,""),s.xp6(2),s.AsE("",t.proveedor.movil," - ",t.proveedor.documento,"")}}function T(e,o){1&e&&s._UZ(0,"ion-icon",30)}function q(e,o){1&e&&s._UZ(0,"ion-icon",31)}function C(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-item"),s.TgZ(1,"ion-radio",35),s.NdJ("ngModelChange",function(e){return s.CHM(t).$implicit.id=e})("click",function(){var e=s.CHM(t).$implicit,o=s.oxw(2);return s.MAs(33).dismiss(),o.seleccionaProveedor(e.id)}),s.qZA(),s.TgZ(2,"ion-label"),s.TgZ(3,"b"),s._uU(4),s.qZA(),s.TgZ(5,"p"),s._uU(6),s.qZA(),s.TgZ(7,"p"),s._uU(8),s.qZA(),s.TgZ(9,"p"),s._uU(10),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=o.$implicit;s.xp6(1),s.s9C("value",n.id),s.Q6J("ngModel",n.id),s.xp6(3),s.Oqu(n.nombre),s.xp6(2),s.AsE("",n.movil," - ",n.documento,""),s.xp6(2),s.Oqu(n.direccion),s.xp6(2),s.AsE("",n.barrio," | ",n.ciudad,"")}}function k(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-content"),s.TgZ(1,"ion-searchbar",32),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().buscar=e}),s.qZA(),s.TgZ(2,"ion-list"),s.TgZ(3,"ion-radio-group",33),s.YNc(4,C,11,8,"ion-item",34),s.ALo(5,"filter"),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=s.oxw();s.xp6(1),s.Q6J("ngModel",n.buscar),s.xp6(2),s.Q6J("allowEmptySelection",!0),s.xp6(1),s.Q6J("ngForOf",s.xi3(5,3,n.proveedores,n.buscar))}}function y(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-content",42),s.TgZ(1,"ion-card"),s.TgZ(2,"ion-item",43),s.TgZ(3,"ion-datetime",44),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw(2).compra.fecha=e}),s.qZA(),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=s.oxw(2);s.Q6J("fullscreen",!0),s.xp6(3),s.Q6J("ngModel",n.compra.fecha)("showDefaultButtons",!0)}}function w(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"div"),s.TgZ(1,"ion-item",36),s.TgZ(2,"ion-label",37),s._uU(3,"Fecha"),s.qZA(),s.TgZ(4,"ion-input",38),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().compra.fecha=e}),s.qZA(),s.qZA(),s.TgZ(5,"ion-modal",39,40),s.YNc(7,y,4,3,"ng-template"),s.qZA(),s.TgZ(8,"ion-item",20),s.TgZ(9,"ion-textarea",41),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().compra.observacion=e}),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=s.oxw();s.xp6(4),s.Q6J("ngModel",n.compra.fecha)("readonly",!0),s.xp6(1),s.Q6J("initialBreakp
1oint",.75),s.xp6(4),s.Q6J("ngModel",n.compra.observacion)}}function M(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-item",20),s.TgZ(1,"ion-label",37),s._uU(2,"Abono "),s.TgZ(3,"ion-text",49),s._uU(4,"*"),s.qZA(),s.qZA(),s.TgZ(5,"ion-input",54),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw(2).pago.valor=e})("ionChange",function(){return s.CHM(t),s.oxw(2).getSaldo()}),s.qZA(),s.qZA()}if(2&e){var n=s.oxw(2);s.xp6(5),s.Q6J("ngModel",n.pago.valor)}}function J(e,o){if(1&e&&(s.TgZ(0,"ion-select-option",55),s._uU(1),s.qZA()),2&e){var t=o.$implicit;s.s9C("value",t.id),s.xp6(1),s.hij(" ",t.nombre," ")}}var U=function(e){return[e,"COP","","1.0","es"]};function _(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-content"),s.TgZ(1,"ion-card",3),s.TgZ(2,"ion-card-header"),s.TgZ(3,"ion-row"),s.TgZ(4,"ion-col"),s.TgZ(5,"ion-card-title",4),s._uU(6),s.qZA(),s.qZA(),s.TgZ(7,"ion-col"),s.TgZ(8,"ion-card-title",5),s._uU(9),s.ALo(10,"currency"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(11,"ion-card-content",6),s.TgZ(12,"ion-item",45),s.TgZ(13,"ion-label",46),s._uU(14,"Pago total"),s.qZA(),s.TgZ(15,"ion-toggle",47),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().pagoTotal=e})("ionChange",function(){return s.CHM(t),s.oxw().pagoTotalCompra()}),s.qZA(),s.qZA(),s.YNc(16,M,6,1,"ion-item",48),s.TgZ(17,"ion-item",20),s.TgZ(18,"ion-label",37),s._uU(19,"Medio pago "),s.TgZ(20,"ion-text",49),s._uU(21,"*"),s.qZA(),s.qZA(),s.TgZ(22,"ion-select",50),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().pago.medio.id=e}),s.YNc(23,J,2,2,"ion-select-option",51),s.qZA(),s.qZA(),s.qZA(),s.TgZ(24,"ion-card-header"),s.TgZ(25,"ion-row"),s.TgZ(26,"ion-col"),s.TgZ(27,"ion-card-title",4),s._uU(28,"Saldo"),s.qZA(),s.qZA(),s.TgZ(29,"ion-col"),s.TgZ(30,"ion-card-title",52),s._uU(31),s.ALo(32,"currency"),s.qZA(),s.qZA(),s.qZA(),s.TgZ(33,"ion-grid"),s.TgZ(34,"ion-row"),s.TgZ(35,"i
1on-col"),s.TgZ(36,"ion-button",53),s.NdJ("click",function(){return s.CHM(t),s.oxw().cancel()}),s._uU(37,"Cancelar"),s.qZA(),s.qZA(),s.TgZ(38,"ion-col"),s.TgZ(39,"ion-button",17),s.NdJ("click",function(){return s.CHM(t),s.oxw().guardar()}),s._uU(40," Guardar "),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=s.oxw();s.xp6(6),s.hij("Compra: ",n.compra.documento,""),s.xp6(3),s.hij("$ ",s.G7q(10,7,s.VKq(19,U,n.compra.total))," "),s.xp6(6),s.Q6J("ngModel",n.pagoTotal),s.xp6(1),s.Q6J("ngIf",!n.pagoTotal),s.xp6(6),s.Q6J("ngModel",n.pago.medio.id),s.xp6(1),s.Q6J("ngForOf",n.mediosPago),s.xp6(8),s.hij("$ ",s.G7q(32,13,s.VKq(21,U,n.compra.saldo))," ")}}function N(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-item"),s.TgZ(1,"ion-radio",35),s.NdJ("ngModelChange",function(e){return s.CHM(t).$implicit.id=e})("click",function(){var e=s.CHM(t).$implicit,o=s.oxw(2),n=s.MAs(53);return o.seleccionaProducto(e.id),n.dismiss()}),s.qZA(),s.TgZ(2,"ion-label"),s._uU(3),s.TgZ(4,"p",57),s._uU(5),s.qZA(),s.TgZ(6,"p"),s._uU(7),s.qZA(),s.qZA(),s._uU(8),s.ALo(9,"currency"),s.qZA()}if(2&e){var n=o.$implicit;s.xp6(1),s.s9C("value",n.id),s.Q6J("ngModel",n.id),s.xp6(2),s.hij("",n.nombre," "),s.xp6(2),s.AsE("",n.referencia," - ",n.linea.nombre,""),s.xp6(2),s.hij("Disponible: ",1==n.inventario?n.disponible:"N/A",""),s.xp6(1),s.hij(" $ ",s.G7q(9,7,s.VKq(13,U,n.costo))," ")}}function P(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-content"),s.TgZ(1,"ion-searchbar",56),s.NdJ("ngModelChange",function(e){return s.CHM(t),s.oxw().buscarProducto=e}),s.qZA(),s.TgZ(2,"ion-list"),s.TgZ(3,"ion-radio-group",33),s.YNc(4,N,10,15,"ion-item",34),s.ALo(5,"filter"),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=s.oxw();s.xp6(1),s.Q6J("ngModel",n.buscarProducto),s.xp6(2),s.Q6J("allowEmptySelection",!0),s.xp6(1),s.Q6J("ngForOf",s.xi3(5,3,n.productos,n.buscarProducto))}}function I(e,o){if(1&e){var t=s.EpF();s.TgZ(0,"ion-item",20),s.TgZ(1,"ion-label",3),s.TgZ(2,"ion-row"),s.TgZ(3,"ion-col",58),s.TgZ(4,"ion-text",59),s.TgZ(5,"p",60),s._uU(6),s.qZA(),s.qZA(),s.qZA(),s.TgZ(7,"ion-col",61),s.TgZ(8,"ion-text",62),s.TgZ(9,"p",63),s._uU(10),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(11,"ion-row"),s.TgZ(12,"ion-col",64),s.TgZ(13,"ion-text",59),s.TgZ(14,"p",65),s._uU(15),s.qZA(),s.qZA(),s.qZA(),s.TgZ(16,"ion-col",66),s.TgZ(17,"ion-text",62),s.TgZ(18,"b"),s.TgZ(19,"p",67),s._uU(20),s.ALo(21,"currency"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(22,"ion-row"),s.TgZ(23,"ion-col",6),s.TgZ(24,"ion-button",68),s.NdJ("click",function(){var e=s.CHM(t).$implicit;return s.oxw().menos(e)}),s._UZ(25,"ion-icon",69),s.qZA(),s.TgZ(26,"ion-button",70),s.NdJ("click",function(){var e=s.CHM(t).$implicit;return s.oxw().mas(e)}),s._UZ(27,"ion-icon",71),s.qZA(),s.TgZ(28,"ion-button",72),s.NdJ("click",function(){var e=s.CHM(t).$implicit;return s.oxw().borra(e)}),s._UZ(29,"ion-icon",73),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA()}if(2&e){var n=o.$implicit;s.xp6(6),s.Oqu(n.nombre),s.xp6(4),s.Oqu(n.cantidad),s.xp6(5),s.AsE("",n.referencia," - ",n.linea.nombre," "),s.xp6(5),s.hij("$ ",s.G7q(21,5,s.VKq(11,U,n.total))," ")}}var Y,z=[{path:"",component:(Y=function(){function o(t,n,i,r,a,c,d,u,s,l){e(this,o),this.state=t,this.alertController=n,this.kardexService=i,this.nav=r,this.comprasService=a,this.productoService=c,this.proveedorService=d,this.mediopagoService=u,this.loadingCtrl=s,this.util=l,this.divCabecera=!0,this.pagoTotal=!1,this.mdGuardar=!1,this.mediosPago=[],this.banco={nombre:""},this.medio={nombre:"",cuenta:"",banco:this.banco,estado:!0},this.proveedor={id:"",tipo:"",documento:null,nombre:"",email:"",movil:null,direccion:"",barrio:"",ciudad:""},this.compra={fecha:this.util.fecha(),proveedor:this.proveedor,documento:null,observacion:"",total:0,saldo:0,productos:[],pagos:[]},this.kardex={fecha:this.util.fecha(),tipo:null,entrada:null,documento:null,observacion:"",total:null,fechaCrea:this.util.fecha(),horaCrea:this.util.hora(),periodo:this.util.periodoActual(),productos:[]},this.pago={fecha:"",valor:null,periodo:null,medio:this.medio},this.comprasProductos=[]}return t(o,[{key:"ngOnInit",value:function(){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var o,t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadingCtrl.create({message:"Cargando..."});case 2:return o=e.sent,e.next=5,o.present();case 5:e.prev=5,this.productoService.obtener().subscribe(function(e){t.productos=e}),this.proveedorService.obtener().subscribe(function(e){t.proveedores=e,t.proveedores.forEac
1h(function(e){return e.estado=!1})}),this.mediopagoService.obtener().subscribe(function(e){t.mediosPago=e.filter(function(e){return 1==e.estado})}),this.comprasService.secuencia().subscribe(function(e){t.compra.documento=e.length>0?null==e[0].documento?1:1*e[0].documento+1:1,o.dismiss()}),null==this.state.snapshot.params.id?this.modoEditar=!1:(this.modoEditar=!0,this.comprasService.obtenerId(this.state.snapshot.params.id).subscribe(function(e){t.compra=e,t.id=t.state.snapshot.params.id})),e.next=14;break;case 9:return e.prev=9,e.t0=e.catch(5),this.util.msg(e.t0,"X"),e.next=14,o.dismiss();case 14:case"end":return e.stop()}},e,this,[[5,9]])}))}},{key:"seleccionaProveedor",value:function(e){this.proveedor.id=e;var o=this.proveedores.find(function(o){return o.id==e});this.proveedor.tipo=o.tipo,this.proveedor.nombre=o.nombre,this.proveedor.documento=o.documento,this.proveedor.email=o.email,this.proveedor.movil=o.movil,this.proveedor.direccion=o.direccion,this.proveedor.barrio=o.barrio,this.proveedor.ciudad=o.ciudad}},{key:"seleccionaProducto",value:function(e){this.referencia=this.productos.find(function(o){return o.id==e}).referencia,this.cantidad=1}},{key:"showCabecera",value:function(){this.divCabecera=!this.divCabecera}},{key:"addProducto",value:function(){var e=this;if(this.productos.find(function(o){return o.referencia==e.referencia})){var o=this.productos.find(function(o){return o.referencia==e.referencia});this.comprasProductos.find(function(o){return o.referencia==e.referencia})?this.mas(this.comprasProductos.find(function(o){return o.referencia==e.referencia})):this.comprasProductos.push({id:o.id,referencia:o.referencia,linea:o.linea,cantidad:this.cantidad,nombre:o.nombre,costo:o.costo,total:1*this.cantidad*(1*o.costo),saldo:o.disponible,venta:o.venta}),this.determinaTotal()}else this.util.msg("La referencia ingresada no existe","X");this.referencia="",this.cantidad=null}},{key:"menos",value:function(e){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function o(){var t;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.loadingCtrl.create({message:"Cargando...",mode:"ios"});case 2:return t=o.sent,o.next=5,t.present();case 5:return e.cantidad>0?(e.cantidad=1*e.cantidad-1,e.total=1*e.cantidad*e.costo,0==e.cantidad&&this.borraMenos(e)):this.util.msg("Producto sin cantidad para restar","X"),this.determinaTotal(),o.next=9,t.dismiss();case 9:case"end":return o.stop()}},o,this)}))}},{key:"mas",value:function(e){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function o(){var t;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.loadingCtrl.create({message:"Cargando...",mode:"ios"});case 2:return t=o.sent,o.next=5,t.present();case 5:return e.cantidad=1*e.cantidad+1,e.total=1*e.cantidad*e.costo,this.determinaTotal(),o.next=10,t.dismiss();case 10:case"end":return o.stop()}},o,this)}))}},{key:"borraMenos",value:function(e){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function o(){var t=this;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.alertController.create({header:"Eliminar",message:"\xbfEsta seguro que desea eliminar: <br><b>".concat(e.referencia," - ").concat(e.nombre,"</b>?"),buttons:[{text:"Cancelar",role:"cancel",handler:function(){e.cantidad=1,e.total=1*e.cantidad+1*e.costo,t.determinaTotal()}},{text:"Aceptar",handler:function(){var o=t.comprasProductos.indexOf(e);-1!==o&&t.comprasProductos.splice(o,1),t.determinaTotal()}}]});case 2:o.sent.present();case 3:case"end":return o.stop()}},o,this)}))}},{key:"borra",value:function(e){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function o(){var t=this;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.alertController.create({header:"Eliminar",message:"\xbfEsta seguro que desea eliminar: <br><b>".concat(e.referencia," - ").concat(e.nombre,"</b>?"),buttons:[{text:"Cancelar",role:"cancel"},{text:"Aceptar",handler:function(){var o=t.comprasProductos.indexOf(e);-1!==o&&t.comprasProductos.splice(o,1),t.determinaTotal()}}]});case 2:o.sent.present();case 3:case"end":return o.stop()}},o,this)}))}},{key:"cancel",value:function(){this.mdGuardar=!1}},{key:"guardarModal",value:function(){this.mdGuardar=!1,this.validaCampos()&&(this.comprasProductos.length>0?this.mdGuardar=!0:this.util.msg("Agregue al menos un item","X"))}},{key:"pagoTotalCompra",value:function(){this.pagoTotal?(this.compra.saldo=0,this.pago.valor=this.compra.total):(this.compra.saldo=this.compra.total,this.pago.valor=null)}},{key:"getSaldo",value:function(){this.compra.saldo=1*this.compra.total-1*this.pago.valor}},{key:"guardar",value:function(){return(0,u.mG)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var o,t,n,i,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.mdGuardar=!1,e.next=3,this.loadingCtrl.create({message:"Cargando..."});case 3:return o=e.sent,e.next=6,o.present();case 6:if(e.prev=6,(null==this.pago.medio.id||""==this.pago.medio.id)&&this.pago.valor>0)o.dismiss(),this.pago.valor=null,this.pagoTotal=!1,this.util.msg("Seleccione medio de pago","X");else if(this.pago.valor>this.compra.saldo&&0==this.pagoTotal)o.dismiss(),this.pago.fecha=this.util.fecha(),this.pago.valor=null,this.pago.medio.id="",this.util.msg("El valor del pago supera el saldo actual","X");
1else if(this.id)this.comprasService.editar(this.compra,this.id).then(function(e){return r.util.msg("Compra actualizado correctamente","")}).catch(function(e){return r.util.msg(e,"X")});else{for(this.compra.productos=this.comprasProductos,this.compra.proveedor=this.proveedor,this.compra.periodo=this.util.periodo(this.compra.fecha),this.compra.fechaCrea=this.util.fecha(),this.compra.horaCrea=this.util.hora(),this.kardex.fecha=this.util.fecha(),this.kardex.entrada=!0,this.kardex.tipo=2,this.kardex.documento=this.compra.documento,this.kardex.fechaCrea=this.util.fecha(),this.kardex.horaCrea=this.util.hora(),this.kardex.periodo=this.util.periodoActual(),t=function(e){var o=r.comprasProductos[e];1==r.productos.find(function(e){return e.id==o.id}).inventario&&r.kardex.productos.push({id:o.id,referencia:o.referencia,linea:o.linea,nombre:o.nombre,cantidad:o.cantidad,costo:o.costo,saldo:1*o.saldo+o.cantidad,total:1*o.cantidad*(1*o.costo)})},n=0;n<this.comprasProductos.length;n++)t(n);for(this.kardex.total=0,i=0;i<this.kardex.productos.length;i++)this.kardex.total=1*this.kardex.total+1*this.kardex.productos[i].total;this.pago.valor>0&&(this.pago.fecha=this.util.fecha(),this.pago.periodo=this.util.periodoActual(),this.pago.medio=this.mediosPago.find(function(e){return e.id==r.pago.medio.id}),this.compra.pagos.push(this.pago)),this.comprasService.agregar(this.compra).then(function(e){if(r.kardex.productos.length>0){r.kardexService.agregar(r.kardex).then(function(e){});for(var o=function(e){var o=r.kardex.productos[e].id,t=r.productos.find(function(e){return e.id==o});t.disponible=r.kardex.productos[e].saldo,r.productoService.editar(t,o).then(function(e){r.util.msg("Compra creada correctamente","")}).catch(function(e){r.util.msg(e,"X")})},t=0;t<r.kardex.productos.length;t++)o(t)}else r.util.msg("Compra creada correctamente","");r.compra.fecha=r.util.fecha(),r.compra.documento=null,r.compra.observacion="",r.compra.total=null,r.compra.saldo=null,r.cantidad=null,r.compra.proveedor.tipo="",r.compra.proveedor.documento=null,r.compra.proveedor.nombre="",r.compra.proveedor.email="",r.compra.proveedor.movil=null,r.compra.proveedor.direccion="",r.compra.proveedor.barrio="",r.compra.proveedor.ciudad="",r.compra.productos=[],r.comprasProductos=[],r.compra.pagos=[],r.pago.fecha=r.util.fecha(),r.pago.periodo=r.util.periodoActual(),r.pago.valor=null,r.medio.id="",r.banco.id="",r.banco.nombre="",r.medio.banco=r.banco,r.medio.cuenta="",r.medio.estado=!0,r.medio.nombre="",r.pago.medio=r.medio,r.kardex.fecha=r.util.fecha(),r.kardex.tipo=null,r.kardex.entrada=null,r.kardex.documento=null,r.kardex.observacion="",r.kardex.total=null,r.kardex.productos=[],r.kardex.fechaCrea=r.util.fecha(),r.kardex.horaCrea=r.util.hora(),r.kardex.periodo=r.util.periodoActual(),r.referencia="",r.cantidad=null}).catch(function(e){r.util.msg(e,"X"),o.dismiss()})}e.next=13;break;case 10:e.prev=10,e.t0=e.catch(6),this.util.msg(e.t0,"X");case 13:return e.prev=13,e.next=16,o.dismiss();case 16:return e.finish(13);case 17:case"end":return e.stop()}},e,this,[[6,10,13,17]])}))}},{key:"determinaTotal",value:function(){this.compra.total=0;for(var e=0;e<this.comprasProductos.length;e++)this.compra.total=1*this.compra.total+1*this.comprasProductos[e].total;this.compra.saldo=this.compra.total}},{key:"validaCampos",value:function(){return null!=this.compra.proveedor&&""!=this.compra.proveedor.id||(this.util.msg("Proveedor es requerido","X"),!1)}}]),o}(),Y.\u0275fac=function(e){return new(e||Y)(s.Y36(d.gz),s.Y36(c.Br),s.Y36(l.O),s.Y36(c.SH),s.Y36(p.K),s.Y36(g.U),s.Y36(h.z),s.Y36(f.C),s.Y36(c.HT),s.Y36(m.I))},Y.\u0275cmp=s.Xpm({type:Y,selectors:[["app-compras-det"]],decls:57,vars:23,consts:[["slot","start"],[4,"ngIf"],["offsetXl","2","sizeXl","8"],[2,"margin","0px"],[1,"card-title"],["color","success",2,"float","right"],[2,"padding","0px"],["sizeXs","12","sizeXl","6"],["sizeXs","10","sizeLg","11",2,"padding","0px"],["detail","false","id","open-modal-proveedor",1,"item-custom"],["color","medium",4,"ngIf"],["sizeXs","2","sizeLg","1",2,"padding","0px"],["size","default","fill","clear",3,"click"],["name","caret-down-outline",4,"ngIf"],["name","caret-up-outline",4,"ngIf"],["trigger","open-modal-proveedor",3,"initialBreakp
1oint"],["modalproveedor",""],["fill","outline","shape","round","color","primary","expand","block",3,"click"],[3,"isOpen"],["size","5",2,"padding","0px"],[1,"item-custom"],["placeholder","Ref.",3,"ngModel","ngModelChange"],["size","7",2,"padding","0px"],["type","number","placeholder","Cant.",3,"ngModel","ngModelChange"],["fill","outline","shape","round","color","tertiary",3,"click"],["size","small","fill","outline","shape","round","color","dark","expand","block","id","open-modal-producto"],["trigger","open-modal-producto",3,"initialBreakpoint"],["modalProducto",""],["class","item-custom",4,"ngFor","ngForOf"],["color","medium"],["name","caret-down-outline"],["name","caret-up-outline"],["placeholder","Ingrese texto a buscar",1,"custom",3,"ngModel","ngModelChange"],[3,"allowEmptySelection"],[4,"ngFor","ngForOf"],["slot","start",3,"value","ngModel","ngModelChange","click"],["detail","false","id","open-modal",1,"item-custom"],["position","fixed","color","medium"],["type","date",3,"ngModel","readonly","ngModelChange"],["trigger","open-modal",3,"initialBreakpoint"],["mdFecha",""],["placeholder","Observacion","type","text","rows","2",3,"ngModel","ngModelChange"],[3,"fullscreen"],[2,"align-items","center"],["id","datetime","presentation","date","displayFormat","DD/MM/YYYY","doneText","Ok","cancelText","Cancelar",3,"ngModel","showDefaultButtons","ngModelChange"],["lines","none"],[1,"label-custom"],["slot","end",3,"ngModel","ngModelChange","ionChange"],["class","item-custom",4,"ngIf"],["color","danger"],["interface","alert",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["color","danger",2,"float","right"],["fill","outline","shape","round","color","medium","expand","block",3,"click"],["type","number",3,"ngModel","ngModelChange","ionChange"],[3,"value"],["placeholder","Ingrese teto a buscar",1,"custom",3,"ngModel","ngModelChange"],[2,"color","gray"],["size-xs","11","size-xl","9",2,"padding","0px"],["color","dark",1,"ion-text-wrap"],[2,"color","black","font-size","medium"],["size-xs","1","size-xl","3",2,"padding","0px"],["color","dark"],[2,"float","right","color","gray","font-size","medium"],["size-xs","8","size-xl","9",2,"padding","0px"],[2,"color","gray","font-size","small"],["size-xs","4","size-xl","3",2,"padding","0px"],[2,"float","right","color","black","font-size","medium"],["shape","round","size","small",1,"btncolor-warning",3,"click"],["name","remove-outline"],["shape","round","size","small",1,"btncolor-success",3,"click"],["name","add-outline"],["shape","round","size","small",1,"btncolor-danger",3,"click"],["name","trash-outline"]],template:function(e,o){1&e&&(s.TgZ(0,"ion-header"),s.TgZ(1,"ion-toolbar"),s.TgZ(2,"ion-buttons",0),s._UZ(3,"ion-back-button"),s.qZA(),s.YNc(4,v,2,0,"ion-title",1),s.YNc(5,x,2,0,"ion-title",1),s.qZA(),s.qZA(),s.TgZ(6,"ion-content"),s.TgZ(7,"ion-grid"),s.TgZ(8,"ion-row"),s.TgZ(9,"ion-col",2),s.TgZ(10,"ion-card",3),s.TgZ(11,"ion-card-header"),s.TgZ(12,"ion-row"),s.TgZ(13,"ion-col"),s.TgZ(14,"ion-card-title",4),s._uU(15),s.qZA(),s.qZA(),s.TgZ(16,"ion-col"),s.TgZ(17,"ion-card-title",5),s._uU(18),s.ALo(19,"currency"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(20,"ion-card-content",6),s.TgZ(21,"ion-row"),s.TgZ(22,"ion-col",7),s.TgZ(23,"ion-row",6),s.TgZ(24,"ion-col",8),s.TgZ(25,"ion-item",9),s.YNc(26,b,2,0,"ion-label",10),s.YNc(27,A,8,6,"ion-label",1),s.qZA(),s.qZA(),s.TgZ(28,"ion-col",11),s.TgZ(29,"ion-button",12),s.NdJ("click",function(){return o.showCabecera()}),s.YNc(30,T,1,0,"ion-icon",13),s.YNc(31,q,1,0,"ion-icon",14),s.qZA(),s.qZA(),s.qZA(),s.TgZ(32,"ion-modal",15,16),s.YNc(34,k,6,6,"ng-template"),s.qZA(),s.YNc(35,w,10,4,"div",1),s.TgZ(36,"ion-card-header"),s.TgZ(37,"ion-button",17),s.NdJ("click",function(){return o.guardarModal()}),s._uU(38," Guardar "),s.qZA(),s.qZA(),s.TgZ(39,"ion-modal",18),s.YNc(40,_,41,23,"ng-template"),s.qZA(),s.TgZ(41,"ion-row"),s.TgZ(42,"ion-col",19),s.TgZ(43,"ion-item",20),s.TgZ(44,"ion-input",21),s.NdJ("ngModelChange",function(e){return o.referencia=e})("ngModelChange",function(e){return o.referencia=e.toLocaleUpperCase()}),s.qZA(),s.qZA(),s.qZA(),s.TgZ(45,"ion-col",22),s.TgZ(46,"ion-item",20),s.TgZ(47,"ion-input",23),s.NdJ("ngModelChange",function(e){return o.cantidad=e}
1),s.qZA(),s.TgZ(48,"ion-button",24),s.NdJ("click",function(){return o.addProducto()}),s._uU(49," Agregar "),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(50,"ion-button",25),s._uU(51," Buscar producto "),s.qZA(),s.TgZ(52,"ion-modal",26,27),s.YNc(54,P,6,6,"ng-template"),s.qZA(),s.qZA(),s.TgZ(55,"ion-col",7),s.YNc(56,I,30,13,"ion-item",28),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA()),2&e&&(s.xp6(4),s.Q6J("ngIf",!o.modoEditar),s.xp6(1),s.Q6J("ngIf",o.modoEditar),s.xp6(10),s.hij("Compra: ",o.compra.documento,""),s.xp6(3),s.hij("$ ",s.G7q(19,15,s.VKq(21,U,o.compra.total))," "),s.xp6(8),s.Q6J("ngIf",!o.proveedor.id),s.xp6(1),s.Q6J("ngIf",o.proveedor.id),s.xp6(3),s.Q6J("ngIf",!o.divCabecera),s.xp6(1),s.Q6J("ngIf",o.divCabecera),s.xp6(1),s.Q6J("initialBreakpoint",.75),s.xp6(3),s.Q6J("ngIf",o.divCabecera),s.xp6(4),s.Q6J("isOpen",o.mdGuardar),s.xp6(5),s.Q6J("ngModel",o.referencia),s.xp6(3),s.Q6J("ngModel",o.cantidad),s.xp6(5),s.Q6J("initialBreakpoint",.75),s.xp6(4),s.Q6J("ngForOf",o.comprasProductos))},directives:[c.Gu,c.sr,c.Sm,c.oU,c.cs,r.O5,c.W2,c.jY,c.Nd,c.wI,c.PM,c.Zi,c.Dq,c.FN,c.Ie,c.YG,c.ki,c.j9,c.pK,a.JJ,a.On,c.as,r.sg,c.wd,c.Q$,c.gu,c.VI,c.q_,c.se,c.QI,c.B7,c.U5,c.g2,c.x4,c.ho,c.w,c.yW,c.t9,c.n0],pipes:[r.H9,Z.Z],styles:[""]}),Y)}],Q=function(){var o=t(function o(){e(this,o)});return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=s.oAB({type:o}),o.\u0275inj=s.cJS({imports:[[d.Bz.forChild(z)],d.Bz]}),o}(),S=function(){var o=t(function o(){e(this,o)});return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=s.oAB({type:o}),o.\u0275inj=s.cJS({imports:[[r.ez,a.u5,c.Pc,Z.h,Q]]}),o}()},43241:function(o,n,i){i.d(n,{O:function(){return s}});var r,a=i(88002),c=i(33018),d=i(76178),u=i(98302),s=((r=function(){function o(t,n){e(this,o),this.db=t,this.util=n,this.empresaIds=["001","002","009","010","011","999"]}return t(o,[{key:"obtener",value:function(){return this.db.collection(this.defineRuta(),function(e){return e.orderBy("fechaCrea","desc").orderBy("horaCrea","desc")}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}))}},{key:"obtenerId",value:function(e){return this.getCollection().doc(e).valueChanges()}},{key:"agregar",value:function(e){return this.getCollection().add(e)}},{key:"editar",value:function(e,o){return this.getCollection().doc(o).update(e)}},{key:"eliminar",value:function(e){return this.getCollection().doc(e).delete()}},{key:"getCollection",value:function(){return this.db.collection(this.defineRuta())}},{key:"defineRuta",value:function(){var e=this.util.rol.cliente;return this.empresaIds.includes(e)?"kardex/empresa/".concat(e):"kardex".concat(e)}}]),o}()).\u0275fac=function(e){return new(e||r)(c.LFG(d.ST),c.LFG(u.I))},r.\u0275prov=c.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r)},63437:function(o,n,i){i.d(n,{C:function(){return s}});var r,a=i(88002),c=i(33018),d=i(76178),u=i(98302),s=((r=function(){function o(t,n){e(this,o),this.db=t,this.util=n,this.empresaIds=["001","002","009","010","011","999"]}return t(o,[{key:"obtener",value:function(){return this.db.collection(this.defineRuta(),function(e){return e.orderBy("nombre","asc")}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}))}},{key:"obtenerId",value:function(e){return this.getCollection().doc(e).valueChanges()}},{key:"agregar",value:function(e){return this.getCollection().add(e)}},{key:"editar",value:function(e,o){return this.getCollection().doc(o).update(e)}},{key:"eliminar",value:function(e){return this.getCollection().doc(e).delete()}},{key:"getCollection",value:function(){return this.db.collection(this.defineRuta())}},{key:"defineRuta",value:function(){var e=this.util.rol.cliente;return this.empresaIds.includes(e)?"mediopago/empresa/".concat(e):"mediopago".concat(e)}}]),o}()).\u0275fac=function(e){return new(e||r)(c.LFG(d.ST),c.LFG(u.I))},r.\u0275prov=c.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r)},71729:function(o,n,i){i.d(n,{U:function(){return s}});var r,a=i(88002),c=i(33018),d=i(76178),u=i(98302),s=((r=function(){function o(t,n){e(this,o),this.db=t,this.util=n,this.empresaIds=["001","002","009","010","011","999"]}return t(o,[{key:"obtener",value:function(){return this.db.collection(this.defineRuta(),function(e){return e.orderBy("nombre","asc")}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}
1))}},{key:"obtenerVenta",value:function(){return this.db.collection(this.defineRuta(),function(e){return e.where("venta","==",!0)}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}))}},{key:"obtenerRef",value:function(e){return this.db.collection(this.defineRuta(),function(o){return o.where("referencia","==",e)}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}))}},{key:"obtenerPorCodigoBarras",value:function(e){return this.db.collection(this.defineRuta(),function(o){return o.where("codigoBarras","==",e)}).snapshotChanges().pipe((0,a.U)(function(e){return e.map(function(e){var o=e.payload.doc.data();return o.id=e.payload.doc.id,o})}))}},{key:"obtenerId",value:function(e){return this.getCollection().doc(e).valueChanges()}},{key:"agregar",value:function(e){return this.getCollection().add(e)}},{key:"editar",value:function(e,o){return this.getCollection().doc(o).update(e)}},{key:"eliminar",value:function(e){return this.getCollection().doc(e).delete()}},{key:"getCollection",value:function(){return this.db.collection(this.defineRuta())}},{key:"defineRuta",value:function(){var e=this.util.rol.cliente;return this.empresaIds.includes(e)?"producto/empresa/".concat(e):"producto".concat(e)}}]),o}()).\u0275fac=function(e){return new(e||r)(c.LFG(d.ST),c.LFG(u.I))},r.\u0275prov=c.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r)}}])}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.