1import{a as re}from"./chunk-WVBX2HI2.js";import"./chunk-PDM4MBNM.js";import{E as Ze,Vb as Ye,rb as Je}from"./chunk-D2DXWN37.js";import"./chunk-WS225X7H.js";import"./chunk-P4AWLXSQ.js";import"./chunk-FLWLAOWP.js";import"./chunk-QLBE3UGC.js";import"./chunk-3B4MX5E2.js";import"./chunk-ZTSILIWW.js";import"./chunk-E4RNTLEE.js";import{b as I}from"./chunk-UTIROFZB.js";import{V as Y,g as Q,ga as We}from"./chunk-STQRMAKW.js";import{$ as De,B as be,Ba as Re,C as Te,D as j,E as $,Ha as Ie,Oa as Ve,Ua as Be,W as G,Ya as X,Z as Ee,Za as W,_ as Ne,_a as Z,aa as Oe,ab as Ue,cb as J,g as he,ga as K,h as ye,ha as Pe,jb as He,ka as Ae,lb as qe,m as ve,ma as Me,mb as je,ob as $e,p as Ce,pa as Le,qa as we,ra as Fe,s as _e,sa as ke,sb as Ge,tb as Ke,v as xe,vb as Qe,wb as Xe,z as Se}from"./chunk-E6SPOSAE.js";import{$a as E,Ab as o,Ba as f,Bb as T,Cb as d,Cc as k,Ga as M,Ha as L,Hc as R,J as v,Jc as fe,Jf as B,Kb as le,Kf as U,Lb as ce,Ma as h,Mb as me,Mf as H,Pa as c,Pb as O,Vb as g,X as A,Xb as de,Ya as y,Yb as C,Zb as F,_a as w,ab as N,ba as S,bb as a,ca as b,cb as r,cg as q,db as u,hb as D,he as ze,kb as z,ke as ge,mb as p,ne,rc as pe,sc as ue,xa as l,xf as V,zb as se}from"./chunk-CECBUGKR.js";import{a as ae}from"./chunk-O7S4L63H.js";function ee(i){let e=i.solicitacao_financeira;if(e==null)return null;if(Array.isArray(e)){if(e.length===0)return null;let t=e[0];return!t||typeof t!="object"?null:t}return typeof e=="object"?e:null}function _(i){if(!i||typeof i!="object")return"";let s=i.nome;return s!=null&&String(s).trim()?String(s).trim():""}function et(i){if(!i||typeof i!="object")return"";let s=i.codigo;return s!=null&&String(s).trim()?String(s).trim():""}function tt(i,s){return i&&s?`${i} - ${s}`:s||i||""}function ct(i){if(!i||typeof i!="object")return"";let e=i.codigo;return e!=null&&String(e).trim()?String(e).trim():_(i)}function mt(i){let s=i.recibo?.competencia;return s!=null&&String(s).trim()!==""}function te(i){return!i.recibo||typeof i.recibo!="object"?!1:!!(P(i)||_(i.recibo.condominio)||mt(i))}function ie(i){if(te(i)){let t=i.recibo?.condominio,n=tt(et(t),_(t));if(n)return n}let e=ee(i)?.condominio;return tt(et(e),_(e))}function it(i){return ee(i)!=null&&!te(i)}function P(i){if(i.recibo?.uuid)return String(i.recibo.uuid);if(i.recibo_uuid)return String(i.recibo_uuid)}function nt(i){let s=ee(i);if(!s)return;let e=s.uuid;return e!=null&&String(e).trim()?String(e).trim():void 0}function rt(i){let s=ee(i);if(!s)return null;let e=s.solicitacao_tipo;return{condominioNome:_(s.condominio),unidadeLabel:ct(s.unidade),fornecedorNome:_(s.fornecedor),solicitanteNome:_(s.solicitante),tipoNome:_(e),observacoes:s.observacoes!=null&&String(s.observacoes).trim()?String(s.observacoes).trim():"",dataVencimento:s.data_vencimento!=null&&String(s.data_vencimento).trim()?String(s.data_vencimento).trim():""}}var Tt=()=>[16,0],Et=()=>["fornecedor","condominio"],Nt=(i,s)=>s.value;function Dt(i,s){if(i&1&&u(0,"nz-option",9),i&2){let e=s.$implicit;c("nzLabel",e.label)("nzValue",e.value)}}function Ot(i,s){if(i&1&&u(0,"nz-alert",14),i&2){let e=s.$implicit;c("nzMessage",e)}}function Pt(i,s){if(i&1&&(a(0,"nz-tag",23),o(1," Sem conta repasse "),r()),i&2){let e=p().$implicit,t=p();c("nzTooltipTitle",t.missingRepasseAccountTooltip(e))}}function At(i,s){if(i&1&&(o(0),g(1,"date")),i&2){let e=p().$implicit;d(" ",C(1,1,e.data_vencimento,"dd/MM/yyyy","UTC")," ")}}function Mt(i,s){i&1&&o(0," \u2014 ")}function Lt(i,s){if(i&1){let e=D();a(0,"a",26),u(1,"span",27),r(),a(2,"nz-dropdown-menu",null,0)(4,"ul",28)(5,"li",29),z("click",function(){S(e);let n=p().$implicit,m=p();return b(m.quickApprove(n))}),u(6,"span",30),o(7," Aprovar "),r(),a(8,"li",31)(9,"a",32),z("click",function(){S(e);let n=p().$implicit,m=p();return b(m.quickCancel(n))}),u(10,"span",33),o(11," Cancelar "),r()()()()}if(i&2){let e=se(3),t=p().$implicit,n=p();c("nzDropdownMenu",e),l(5),c("nzDisabled",!t.possui_conta_repasse)("nzTooltipTitle",n.missingRepasseAccountTooltip(t))}}function wt(i,s){if(i&1){let e=D();a(0,"tr")(1,"td"),o(2),r(),a(3,"td"),o(4),g(5,"date"),r(),a(6,"td"),o(7),g(8,"currency"),r(),a(9,"td")(10,"nz-tag",22),o(11),r(),h(12,Pt,2,1,"nz-tag",23),r(),a(13,"td"),h(14,At,2,5)(15,Mt,1,0),r(),a(16,"td",20)(17,"button",24),z("click",function(){let n=S(e).$implicit,m=p();return b(m.openDetails(n))}),u(18,"span",25),r(),h(19,Lt,12,3),r()()}if(i&2){let e=s.$implicit,t=p();l(2),T(t.condominioDisplayNome(e)),l(2),T(C(5,9,e.competencia,"MM/yyyy","UTC")),l(3),T(F(8,13,e.valor,"BRL","symbol","1.2-2")),l(3),c("nzColor",t.getStatusTagColor(e.status)),l(),d(" ",e.status," "),l(),y(e.status==="PENDENTE"&&!e.possui_conta_repasse?12:-1),l(2),y(e.data_vencimento?14:15),l(3),c("nzTooltipTitle",t.detailScreenTooltip(e)),l(2),y(e.status==="PENDENTE"?19:-1)}}var ot=(()=>{class i{constructor(e,t,n,m,x){this.fb=e,this.api=t,this.router=n,this.message=m,this.modalService=x,this.isLoadingList=!1,this.errorList=[],this.orders=[],this.displayedOrders=[],this.batchSize=20,this.scrollThreshold=120,this.sortKey="vencimento",this.sortDirection="descend",this.statusOptions=[{label:"Pendente",value:"PENDENTE"},{label:"Aprovada",value:"APROVADA"},{label:"Cancelada",value:"CANCELADA"}],this.filterForm=this.fb.group({status:[[]],vencimento_inicio:[null],vencimento_fim:[null],competencia:[null],credor_uuid:[null]})}hasAtLeastOneFilter(){let e=this.filterForm.value;return Object.keys(e).some(t=>{let n=e[t];return n==null?!1:Array.isArray(n)?n.length>0:n instanceof Date&&!isNaN(n.getTime())||typeof n=="string"&&n.trim()!==""?!0:!!n})}get sortedOrders(){return[...this.orders].sort((t,n)=>{let m=0;return this.sortKey==="condominio"?m=this.compareString(ie(t),ie(n)):this.sortKey==="competencia"?m=this.compareDate(t.competencia,n.competencia):this.sortKey==="valor"?m=this.compareNumber(Number(t.valor),Number(n.valor)):m=this.compareDate(t.data_vencimento,n.data_vencimento,t,n),this.sortDirection==="ascend"?m:-m})}compareString(e,t){return(e??"").localeCompare(t??"","pt-BR",{sensitivity:"base"})}compareNumber(e,t){return(Number(e)||0)-(Number(t)||0)}compareDate(e,t,n,m){let x=e?new Date(e).getTime():n?.created_at?new Date(n.created_at).getTime():0,lt=t?new Date(t).getTime():m?.created_at?new Date(m.created_at).getTime():0;return x-lt}resetDisplayedOrders(){this.displayedOrders=[],this.appendNextBatch()}appendNextBatch(){let e=this.sortedOrders;if(this.displayedOrders.length>=e.length)return;let t=e.slice(this.displayedOrders.length,this.displayedOrders.length+this.batchSize);this.displayedOrders=[...this.displayedOrders,...t]}onTableScroll(e){let t=e.target;if(!t)return;t.scrollTop+t.clientHeight>=t.scrollHeight-this.scrollThreshold&&this.appendNextBatch()}onQueryParamsChange(e){let t=e.sort.find(n=>n.value);if(!t?.key||!t.value){this.sortKey="vencimento",this.sortDirection="descend",this.resetDisplayedOrders();return}t.key!=="condominio"&&t.key!=="competencia"&&t.key!=="valor"||(this.sortKey=t.key,this.sortDirection=t.value==="ascend"?"ascend":"descend",this.resetDisplayedOrders())}loadOrders(){if(!this.hasAtLeastOneFilter()){this.errorList=["Por favor, preencha pelo menos um filtro para realizar a busca."],this.orders=[],this.displayedOrders=[];return}this.errorList=[],this.isLoadingList=!0;let e=this.filterForm.value,t={status:e.status&&e.status.length?e.status:void 0,competencia:e.competencia,vencimento_inicio:e.vencimento_inicio,vencimento_fim:e.vencimento_fim,condominio_uuid:e.credor_uuid};this.api.post("/payment-orders/list",ae({},t)).pipe(v(()=>{this.isLoadingList=!1})).subscribe({next:n=>{this.orders=n||[],this.resetDisplayedOrders()},error:n=>{let m=Array.isArray(n?.error?.message)?n.error.message:[n?.error?.message||"Erro ao carregar ordens de pagamento."];this.errorList=m,this.orders=[],this.displayedOrders=[]}})}resetFilters(){this.filterForm.reset({status:[],vencimento_inicio:null,vencimento_fim:null,competencia:null,credor_uuid:null}),this.errorList=[],this.orders=[],this.displayedOrders=[]}openDetails(e){e.uuid&&this.router.navigate(["/app/ordens-de-pagamento/detalhar",e.uuid])}detailScreenTooltip(e){return P(e)?"Abrir detalhe da ordem (recibo de repasse)":nt(e)?"Abrir detalhe da ordem (solicita\xE7\xE3o financeira)":"Abrir detalhe da ordem"}quickApprove(e){!e.uuid||e.status!=="PENDENTE"||!e.possui_conta_repasse||this.modalService.confirm({nzTitle:"Aprovar ordem de pagamento",nzContent:"Deseja realmente aprovar esta ordem de pagamento?",nzOkText:"Sim",nzCancelText:"N\xE3o",nzOnOk:()=>{this.isLoadingList=!0,this.api.patch(`/payment-orders/${e.uuid}/approve`,{}).pipe(v(()=>{this.isLoadingList=!1})).subscribe({next:()=>{this.message.success("Ordem de pagamento aprovada com sucesso."),this.loadOrders()},error:t=>{let n=Array.isArray(t?.error?.message)?t.error.message:[t?.error?.message||"Erro ao aprovar ordem de pagamento."];this.errorList=n}})}})}missingRepasseAccountTooltip(e){return e.status!=="PENDENTE"||e.possui_conta_repasse?"":"Sem c
1onta de repasse no contrato vigente. Vincule a conta antes de aprovar."}quickCancel(e){!e.uuid||e.status!=="PENDENTE"||this.modalService.confirm({nzTitle:"Cancelar ordem de pagamento",nzContent:"Deseja realmente cancelar esta ordem de pagamento?",nzOkText:"Sim",nzCancelText:"N\xE3o",nzOnOk:()=>{this.isLoadingList=!0,this.api.patch(`/payment-orders/${e.uuid}/cancel`,{motivo:"Cancelada pela listagem de ordens de pagamento."}).pipe(v(()=>{this.isLoadingList=!1})).subscribe({next:()=>{this.message.success("Ordem de pagamento cancelada com sucesso."),this.loadOrders()},error:t=>{let n=Array.isArray(t?.error?.message)?t.error.message:[t?.error?.message||"Erro ao cancelar ordem de pagamento."];this.errorList=n}})}})}condominioDisplayNome(e){return ie(e)||"\u2014"}getStatusTagColor(e){switch(e){case"PENDENTE":return"warning";case"APROVADA":return"success";case"CANCELADA":return"error";default:return"default"}}static{this.\u0275fac=function(t){return new(t||i)(f(Se),f(I),f(ge),f(K),f(q))}}static{this.\u0275cmp=M({type:i,selectors:[["app-payment-orders-list"]],standalone:!1,decls:56,vars:17,consts:[["moreMenu","nzDropdownMenu"],[1,"site-page-header-ghost-wrapper"],[3,"nzGhost"],["nz-form","","nzLayout","vertical",3,"formGroup"],[3,"nzGutter"],["nzXs","24","nzSm","24","nzMd","8"],["label","Credor","formControlName","credor_uuid",3,"required","selectMode","tiposPessoas","allowClear"],["nzXs","24","nzSm","12","nzMd","4"],["formControlName","status","nzMode","multiple","nzAllowClear","","nzPlaceHolder","Selecione o status"],[3,"nzLabel","nzValue"],["formControlName","vencimento_inicio","nzFormat","dd/MM/yyyy","nzPlaceHolder","Selecione a data"],["formControlName","vencimento_fim","nzFormat","dd/MM/yyyy","nzPlaceHolder","Selecione a data"],["nzXs","24","nzSm","24","nzMd","24",1,"filters-actions"],["nz-button","","nzType","primary","type","button",3,"click"],["nzType","error","nzShowIcon","","nzCloseable","",2,"margin-top","8px",3,"nzMessage"],[2,"max-height","65vh","overflow-y","auto","margin-top","16px",3,"scroll"],["nzSize","middle",3,"nzQueryParams","nzData","nzLoading","nzFrontPagination","nzShowPagination"],["nzColumnKey","condominio","nzShowSort","",3,"nzSortFn"],["nzColumnKey","competencia","nzShowSort","",3,"nzSortFn"],["nzColumnKey","valor","nzShowSort","",3,"nzSortFn"],["nzAlign","center"],[4,"ngFor","ngForOf"],[3,"nzColor"],["nzColor","warning","nz-tooltip","",3,"nzTooltipTitle"],["type","button","nz-button","","nzType","link","nz-tooltip","",3,"click","nzTooltipTitle"],["nz-icon","","nzType","eye","nzTheme","outline"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","Mais op\xE7\xF5es","nz-dropdown","","nzTrigger","click",3,"nzDropdownMenu"],["nz-icon","","nzType","more","nzTheme","outline"],["nz-menu",""],["nz-menu-item","","nz-tooltip","",3,"click","nzDisabled","nzTooltipTitle"],["nz-icon","","nzType","check","nzTheme","outline"],["nz-menu-item",""],["nz-button","","nzType","link","nzDanger","",3,"click"],["nz-icon","","nzType","close","nzTheme","outline"]],template:function(t,n){t&1&&(a(0,"div",1)(1,"nz-page-header",2)(2,"nz-page-header-title"),o(3,"Ordens de Pagamento"),r(),a(4,"nz-page-header-subtitle"),o(5,"Gest\xE3o das ordens de repasse para condom\xEDnios"),r(),a(6,"nz-page-header-content")(7,"form",3)(8,"nz-row",4)(9,"nz-col",5)(10,"nz-form-item")(11,"nz-form-control"),u(12,"app-filtro-pessoas",6),r()()(),a(13,"nz-col",7)(14,"nz-form-item")(15,"nz-form-label"),o(16,"Status"),r(),a(17,"nz-form-control")(18,"nz-select",8),E(19,Dt,1,2,"nz-option",9,Nt),r()()()(),a(21,"nz-col",7)(22,"nz-form-item")(23,"nz-form-label"),o(24,"Vencimento a partir de"),r(),a(25,"nz-form-control"),u(26,"nz-date-picker",10),r()()(),a(27,"nz-col",7)(28,"nz-form-item")(29,"nz-form-label"),o(30,"Vencimento at\xE9"),r(),a(31,"nz-form-control"),u(32,"nz-date-picker",11),r()()(),a(33,"nz-col",12)(34,"button",13),z("click",function(){return n.loadOrders()}),o(35,"Buscar"),r()()()(),E(36,Ot,1,1,"nz-alert",14,w),a(38,"div",15),z("scroll",function(x){return n.onTableScroll(x)}),a(39,"nz-table",16),z("nzQueryParams",function(x){return n.onQueryParamsChange(x)}),a(40,"thead")(41,"tr")(42,"th",17),o(43,"Condom\xEDnio"),r(),a(44,"th",18),o(45,"Compet\xEAncia"),r(),a(46,"th",19),o(47,"Valor"),r(),a(48,"th"),o(49,"Status"),r(),a(50,"th"),o(51,"Vencimento"),r(),a(52,"th",20),o(53,"A\xE7\xF5es"),r()()(),a(54,"tbody"),h(55,wt,20,18,"tr",21),r()()()()()()),t&2&&(l(),c("nzGhost",!1),l(6),c("formGroup",n.filterForm),l(),c("nzGutter",O(15,Tt)),l(4),c("required",!1)("selectMode","default")("tiposPessoas",O(16,Et))("allowClear",!0),l(7),N(n.statusOptions),l(17),N(n.errorList),l(3),c("nzData",n.displayedOrders
1)("nzLoading",n.isLoadingList)("nzFrontPagination",!1)("nzShowPagination",!1),l(3),c("nzSortFn",!0),l(2),c("nzSortFn",!0),l(2),c("nzSortFn",!0),l(9),c("ngForOf",n.displayedOrders))},dependencies:[pe,Ze,ve,he,ye,xe,Ce,_e,Q,H,B,U,Ve,$,j,Ne,Ee,Oe,De,V,Me,Ae,J,X,W,Z,Re,Ie,Ke,qe,He,je,Xe,Ge,Qe,$e,Y,G,Le,we,ke,Fe,R,k],styles:[".filters-actions[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:flex-end;justify-content:flex-end}"]})}}return i})();var Ft=()=>[16,16];function kt(i,s){if(i&1&&u(0,"nz-alert",6),i&2){let e=s.$implicit;c("nzMessage",e)}}function Rt(i,s){i&1&&u(0,"nz-alert",7)}function It(i,s){if(i&1){let e=D();a(0,"button",14),z("click",function(){S(e);let n=p(3);return b(n.openReceiptDetailsModal(n.receiptModalUuid()))}),u(1,"span",15),o(2," Ver recibo "),r()}}function Vt(i,s){if(i&1&&(a(0,"p")(1,"strong"),o(2,"Condom\xEDnio:"),r(),o(3),r(),a(4,"p")(5,"strong"),o(6,"Compet\xEAncia do recibo:"),r(),o(7),g(8,"date"),r(),h(9,It,3,0,"button",13)),i&2){let e=p(2);l(3),d(" ",(e.order.recibo==null||e.order.recibo.condominio==null?null:e.order.recibo.condominio.nome)||"\u2014",""),l(4),d(" ",C(8,3,e.order.recibo==null?null:e.order.recibo.competencia,"MM/yyyy","UTC"),""),l(2),c("ngIf",e.receiptModalUuid())}}function Bt(i,s){if(i&1&&(a(0,"p")(1,"strong"),o(2,"Vencimento:"),r(),o(3),g(4,"date"),r()),i&2){p();let e=me(0);l(3),d(" ",C(4,1,e==null?null:e.dataVencimento,"dd/MM/yyyy","UTC"),"")}}function Ut(i,s){if(i&1&&(le(0),a(1,"p")(2,"strong"),o(3,"Condom\xEDnio:"),r(),o(4),r(),a(5,"p")(6,"strong"),o(7,"Unidade:"),r(),o(8),r(),a(9,"p")(10,"strong"),o(11,"Fornecedor:"),r(),o(12),r(),a(13,"p")(14,"strong"),o(15,"Solicitante:"),r(),o(16),r(),a(17,"p")(18,"strong"),o(19,"Tipo:"),r(),o(20),r(),a(21,"p")(22,"strong"),o(23,"Observa\xE7\xF5es:"),r(),o(24),r(),a(25,"p")(26,"strong"),o(27,"Compet\xEAncia (ordem):"),r(),o(28),g(29,"date"),r(),h(30,Bt,5,5,"p"),a(31,"p",16),o(32,"Sem recibo de repasse vinculado; dados exibidos a partir da solicita\xE7\xE3o financeira."),r()),i&2){let e=p(2),t=ce(e.financialRequestContext());l(4),d(" ",(t==null?null:t.condominioNome)||"\u2014",""),l(4),d(" ",(t==null?null:t.unidadeLabel)||"\u2014",""),l(4),d(" ",(t==null?null:t.fornecedorNome)||"\u2014",""),l(4),d(" ",(t==null?null:t.solicitanteNome)||"\u2014",""),l(4),d(" ",(t==null?null:t.tipoNome)||"\u2014",""),l(4),d(" ",(t==null?null:t.observacoes)||e.order.observacao||"\u2014",""),l(4),d(" ",C(29,9,e.order.competencia,"MM/yyyy","UTC"),""),l(2),y(t!=null&&t.dataVencimento?30:-1)}}function Ht(i,s){i&1&&(a(0,"p"),o(1,"Nenhum recibo vinculado."),r())}function qt(i,s){if(i&1&&(a(0,"nz-row",8)(1,"nz-col",9)(2,"nz-card",10)(3,"p")(4,"strong"),o(5,"Status: "),r(),a(6,"nz-tag",11),o(7),r()(),a(8,"p")(9,"strong"),o(10,"Valor:"),r(),o(11),g(12,"currency"),r(),a(13,"p")(14,"strong"),o(15,"Compet\xEAncia:"),r(),o(16),g(17,"date"),r(),a(18,"p")(19,"strong"),o(20,"Observa\xE7\xE3o:"),r(),o(21),r(),a(22,"p")(23,"strong"),o(24,"Criada em:"),r(),o(25),g(26,"date"),r()()(),a(27,"nz-col",9)(28,"nz-card",12),h(29,Vt,10,7)(30,Ut,33,13)(31,Ht,2,0,"p"),r()()()),i&2){let e=p();c("nzGutter",O(21,Ft)),l(6),c("nzColor",e.getStatusTagColor(e.order.status)),l(),d(" ",e.order.status," "),l(4),d(" ",F(12,9,e.order.valor,"BRL","symbol","1.2-2"),""),l(5),d(" ",C(17,14,e.order.competencia,"MM/yyyy","UTC"),""),l(5),d(" ",e.order.observacao||"-",""),l(4),d(" ",de(26,18,e.order.created_at,"dd/MM/yyyy HH:mm"),""),l(3),c("nzTitle",e.showMeaningfulRecibo?"Recibo associado":e.showFinancialRequestContext?"Solicita\xE7\xE3o financeira":"Recibo associado"),l(),y(e.showMeaningfulRecibo?29:e.showFinancialRequestContext?30:31)}}var at=(()=>{class i{constructor(e,t,n,m){this.route=e,this.api=t,this.message=n,this.modalService=m,this.isLoading=!1,this.errorList=[]}ngOnInit(){this.route.params.subscribe(e=>{let t=e.uuid;t&&(this.orderUuid=t,this.loadOrder(t))})}get canApprove(){return this.order?.status==="PENDENTE"&&!!this.order?.possui_conta_repasse}get missingRepasseAccount(){return this.order?.status==="PENDENTE"&&!this.order?.possui_conta_repasse}get canCancel(){return this.order?.status==="PENDENTE"}get isApproved(){return this.order?.status==="APROVADA"}get showMeaningfulRecibo(){return!!(this.order&&te(this.order))}get showFinancialRequestContext(){return!!(this.order&&it(this.order))}get detailSecondarySubtitle(){return this.showMeaningfulRecibo?"Ordem vinculada a re
1cibo de repasse":this.showFinancialRequestContext?"Ordem vinculada a solicita\xE7\xE3o financeira":"Visualize e gerencie a obriga\xE7\xE3o provis\xF3ria"}financialRequestContext(){return this.order?rt(this.order):null}receiptModalUuid(){return this.order?P(this.order):void 0}getStatusTagColor(e){switch(e){case"PENDENTE":return"warning";case"APROVADA":return"success";case"CANCELADA":return"error";default:return"default"}}loadOrder(e){this.errorList=[],this.isLoading=!0,this.api.get(`/payment-orders/${e}`).pipe(v(()=>{this.isLoading=!1})).subscribe({next:t=>{this.order=t},error:t=>{let n=Array.isArray(t?.error?.message)?t.error.message:[t?.error?.message||"Erro ao carregar ordem de pagamento."];this.errorList=n}})}openApproveModal(){this.canApprove&&this.modalService.confirm({nzTitle:"Aprovar ordem de pagamento",nzContent:"Deseja realmente aprovar esta ordem de pagamento?",nzOkText:"Sim",nzCancelText:"N\xE3o",nzOnOk:()=>this.submitApprove()})}openCancelModal(){this.canCancel&&this.modalService.confirm({nzTitle:"Cancelar ordem de pagamento",nzContent:"Deseja realmente cancelar esta ordem de pagamento?",nzOkText:"Sim",nzCancelText:"N\xE3o",nzOnOk:()=>this.submitCancel()})}submitApprove(){this.order?.uuid&&(this.isLoading=!0,this.api.patch(`/payment-orders/${this.order.uuid}/approve`,{}).pipe(v(()=>{this.isLoading=!1})).subscribe({next:()=>{this.message.success("Ordem de pagamento aprovada com sucesso."),this.orderUuid&&this.loadOrder(this.orderUuid)},error:e=>{let t=Array.isArray(e?.error?.message)?e.error.message:[e?.error?.message||"Erro ao aprovar ordem de pagamento."];this.errorList=t}}))}submitCancel(){this.order?.uuid&&(this.isLoading=!0,this.api.patch(`/payment-orders/${this.order.uuid}/cancel`,{motivo:"Cancelada na tela de detalhe da ordem de pagamento."}).pipe(v(()=>{this.isLoading=!1})).subscribe({next:()=>{this.message.success("Ordem de pagamento cancelada com sucesso."),this.orderUuid&&this.loadOrder(this.orderUuid)},error:e=>{let t=Array.isArray(e?.error?.message)?e.error.message:[e?.error?.message||"Erro ao cancelar ordem de pagamento."];this.errorList=t}}))}openReceiptDetailsModal(e){e&&this.modalService.create({nzTitle:"Detalhes do recibo",nzContent:Je,nzData:{receiptUuid:e},nzWidth:"70%"})}static{this.\u0275fac=function(t){return new(t||i)(f(ze),f(I),f(K),f(q))}}static{this.\u0275cmp=M({type:i,selectors:[["app-payment-order-detail"]],standalone:!1,decls:18,vars:8,consts:[[1,"site-page-header-ghost-wrapper"],[3,"nzGhost"],["nz-tooltip","",3,"nzTooltipTitle"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],["nz-button","","nzType","default","type","button","nzDanger","",3,"click","disabled"],[3,"nzSpinning"],["nzType","error","nzShowIcon","","nzCloseable","",2,"margin-bottom","8px",3,"nzMessage"],["nzType","warning","nzShowIcon","","nzMessage","Conta de repasse obrigat\xF3ria","nzDescription","Este condom\xEDnio n\xE3o possui conta de repasse vinculada ao contrato vigente. Cadastre a conta em Condom\xEDnios > Conta banc\xE1ria e vincule no contrato antes de aprovar.",2,"margin-bottom","12px"],[3,"nzGutter"],["nzXs","24","nzMd","12"],["nzTitle","Dados da Ordem"],[3,"nzColor"],[3,"nzTitle"],["nz-button","","nzType","link",3,"click",4,"ngIf"],["nz-button","","nzType","link",3,"click"],["nz-icon","","nzType","file-text","nzTheme","outline"],[1,"muted-hint"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"nz-page-header",1)(2,"nz-page-header-title"),o(3,"Detalhes da Ordem de Pagamento"),r(),a(4,"nz-page-header-subtitle"),o(5),r(),a(6,"nz-page-header-extra")(7,"span",2)(8,"button",3),z("click",function(){return n.openApproveModal()}),o(9," Aprovar "),r()(),a(10,"button",4),z("click",function(){return n.openCancelModal()}),o(11," Cancelar "),r()(),a(12,"nz-page-header-content")(13,"nz-spin",5),E(14,kt,1,1,"nz-alert",6,w),h(16,Rt,1,0,"nz-alert",7)(17,qt,32,22,"nz-row",8),r()()()()),t&2&&(l(),c("nzGhost",!1),l(4),T(n.detailSecondarySubtitle),l(2),c("nzTooltipTitle",n.missingRepasseAccount?"Vincule a conta de repasse no contrato vigente antes de aprovar":null),l(),c("disabled",!n.canApprove),l(2),c("disabled",!n.canCancel),l(3),c("nzSpinning",n.isLoading),l(
1),N(n.errorList),l(2),y(n.missingRepasseAccount?16:-1),l(),y(n.order?17:-1))},dependencies:[ue,Q,H,B,U,Be,$,j,V,J,X,W,Z,Ue,Pe,Y,G,R,k],styles:[".site-page-header-ghost-wrapper[_ngcontent-%COMP%]{background-color:#f5f5f5}.muted-hint[_ngcontent-%COMP%]{margin-top:12px;font-size:13px;color:#00000073}"]})}}return i})();var jt=[{path:"",pathMatch:"full",redirectTo:"buscar"},{path:"buscar",component:ot,canActivate:[re]},{path:"detalhar/:uuid",component:at,canActivate:[re]}],st=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=L({type:i})}static{this.\u0275inj=A({imports:[ne.forChild(jt),ne]})}}return i})();var bi=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=L({type:i})}static{this.\u0275inj=A({imports:[fe,st,Ye,be,Te,We]})}}return i})();export{bi as PaymentOrdersModule};
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.