PageSourceSearch

https://demo.medimate247.com/uae/quotation.module-5UYVPQUQ.js

js medimate247.com collected 2026-10-05 18:34:37 UTC 32,364 bytes, 1 lines download raw bytes

1import{a as qt}from"./chunk-JK3RLO54.js";import{b as St}from"./chunk-7QTCPIAI.js";import{a as Dt}from"./chunk-TOUUJD4J.js";import{a as B}from"./chunk-ZVIT4ODB.js";import{$ as Ct,A as xt,Bb as wt,Ga as yt,Ka as A,La as Ot,N as G,O as bt,Ta as W,_ as ht,da as Mt,e as V,i as st,k as pt,l as mt,m as gt,n as ut,o as _t,wb as vt,x as ft,xa as Pt,z,za as R}from"./chunk-LOLNAVA7.js";import{$ as g,$a as s,Aa as x,B as et,Cc as H,Fa as p,Gb as Q,H as nt,Ha as it,Ia as ot,J as D,O as q,Ra as o,S as E,Sa as i,T as k,Ta as u,Ub as F,Vb as T,Xa as M,_ as m,_a as f,db as b,f as X,fc as dt,i as Z,kb as I,lb as r,mb as at,nb as _,qa as c,ra as C,rb as P,sb as y,tb as O,vb as rt,w as $,xb as lt,xc as ct,y as tt,zc as N}from"./chunk-5PS2SECJ.js";import"./chunk-FVZJUPOX.js";import"./chunk-3ENMYILF.js";import{a as h,b as v,h as J}from"./chunk-TWZW5B45.js";var Et=J(Mt());var Vt=()=>({decline:"btn-info",confirm:"btn-success"});function zt(l,n){if(l&1){let t=M();o(0,"tr")(1,"td",13),r(2),i(),o(3,"td",14),u(4,"app-patient-edit",15),r(5),i(),o(6,"td",14),r(7),i(),o(8,"td",16),r(9),i(),o(10,"td")(11,"button",17),f("click",function(){let a=m(t).$implicit,d=s(2);return g(d.view(a==null?null:a.id))}),u(12,"i",18),i(),o(13,"button",19),f("click",function(){let a=m(t).$implicit,d=s(2),w=I(4);return g(d.showDeletePopup(w,a))}),u(14,"i",20),i()()()}if(l&2){let t=n.$implicit,e=s(2);c(2),_(" ",e.Moment(t==null?null:t.date).format("DD/MM/YYYY")," "),c(2),p("patientNo",t==null?null:t.patientNo),c(),_(" ",t==null?null:t.patientName," "),c(2),_(" ",t==null?null:t.notes," "),c(2),_(" ",t==null?null:t.total," ")}}function Rt(l,n){l&1&&(o(0,"tr")(1,"td",21),r(2,"No Quotations added"),i()())}function At(l,n){if(l&1){let t=M();o(0,"div",3)(1,"div",4)(2,"button",5),f("click",function(){m(t);let a=s();return g(a.view())}),u(3,"i",6),r(4," Create "),i()(),o(5,"table",7)(6,"thead")(7,"tr")(8,"th",8),r(9,"Date"),i(),o(10,"th",9),r(11,"Patient"),i(),o(12,"th",10),r(13,"Notes"),i(),o(14,"th",8),r(15,"Total"),i(),o(16,"th",8),r(17,"Action"),i()()(),o(18,"tbody"),x(19,zt,15,5,"tr",11)(20,Rt,3,0,"tr",12),i()()()}if(l&2){let t=s();c(19),p("ngForOf",t.quotations),c(),p("ngIf",t.quotations.length===0)}}function Wt(l,n){if(l&1){let t=M();o(0,"app-confirmation",22),f("Confirm",function(){let a=m(t).$implicit;return s().deleteQuotation(),g(a.dismiss("Cross click"))})("Decline",function(){let a=m(t).$implicit,d=s();return a.dismiss("Cross click"),g(d.scrollTo(0,0))}),i()}l&2&&(ot(lt(5,Vt)),p("confirm","Delete")("decline","Cancel")("msg","Are you sure you want to delete?"))}var L=class l{constructor(n,t,e,a){this.api=n;this.router=e;this.modalService=a;this.quotations=[];this.initialized=!1;this.deletionData=null;this.Moment=Et.default;this.scrollTo=scrollTo;this.notifier=t}ngOnInit(){this.getQuotations()}getQuotations(){this.api.postRequest("Quotation/getQuotationList",{}).subscribe(n=>{n?.status==="Success"?(this.quotations=n.data,this.initialized=!0):this.notifier.notify("error","Failed to fetch data please try again later.")})}showDeletePopup(n,t){this.deletionData=t,this.modalRefs=this.modalService.open(n,{ariaLabelledBy:"modal-basic-title",size:"sm",centered:!0}),this.modalRefs.result.then(e=>{this.deletionData=null,this.closeResult=`Closed with: ${e}`},e=>{this.closeResult=`Dismissed ${this.getDismissReason(e)}`})}getDismissReason(n){return n===G.ESC?"by pressing ESC":n===G.BACKDROP_CLICK?"by clicking on a backdrop":`with: ${n}`}deleteQuotation(){let t={id:this.deletionData.id};this.api.postRequest("Quotation/deleteQuotation",t).subscribe(e=>{e.status==="Success"?(e.response?this.notifier.notify("success",e.response):this.notifier.notify("success","Quotation deleted successfully..."),this.getQuotations()):e.response?this.notifier.notify("error",e.response):this.notifier.notify("error","Failed to delete!"),this.deletionData=null})}view(n=""){this.router.navigate(["/quotation/form",n])}static{this.\u0275fac=function(t){return new(t||l)(C(W),C(R),C(N),C(bt))}}static{this.\u0275cmp=E({type:l,selectors:[["app-quotation"]],decls:5,vars:3,consts:[["confirms",""],[3,"heading","icon"],["class","w-100  ",4,"ngIf"],[1,"w-100"],[1,"justify-content-end","d-flex","p-0"],["type","button",1,"btn","btn-sm","btn-primary","btn-small",3,"click"],[1,"fa","fa-plus","mr-1"],[1,"table-bordered","w-100","mt-2"],[2,"width","10%"],[2,"width","25%"],[2,"width","45%"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"px-2",2,"position","relative"],[1,"text-left","px-2"],[3,"patientNo"],[1,"px-2"],["title","View","type","button",1,"btn","btn-primary","btn-xs",3,"click"],[1,"fa","fa-eye",2,"color","white"],["title","Delete",1,"ml-2","btn","btn-xs","btn-sm","btn-danger",3,"click"],[1,"fa","fa-tras
1h"],["colspan","5",1,"text-center"],[3,"Confirm","Decline","confirm","decline","msg"]],template:function(t,e){t&1&&(o(0,"div"),u(1,"app-page-header",1),x(2,At,21,2,"div",2),i(),x(3,Wt,1,6,"ng-template",null,0,Q)),t&2&&(c(),p("heading","Quotations")("icon","fa fa-file-pdf-o"),c(),p("ngIf",e.initialized))},dependencies:[F,T,B,A,qt],styles:['legend[_ngcontent-%COMP%]{display:block;width:auto;max-width:100%;padding:10px;margin-bottom:.5rem;font-size:17px;line-height:inherit;color:inherit;white-space:normal}fieldset.scheduler-border[_ngcontent-%COMP%]{border:1px groove #ddd!important;padding:0 1.4em 1.4em!important;margin:0 0 1.5em!important;-webkit-box-shadow:0 0 0 0 #000;box-shadow:0 0 #000}legend.scheduler-border[_ngcontent-%COMP%]{width:inherit;padding:0 10px;border-bottom:none}.clearfix[_ngcontent-%COMP%]{width:100%;min-height:10px}input[type=file][_ngcontent-%COMP%]{display:none}.fileLabel[_ngcontent-%COMP%]{padding:6px;background:#247cd4;display:table;color:#fff;width:145px;text-align:center}label[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:13px}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:5px;font-size:12px;line-height:12px;vertical-align:middle}.input-group[_ngcontent-%COMP%]{position:relative;display:flex;flex-wrap:wrap;align-items:self-start;width:100%}.form-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:inline-block;margin-bottom:0!important}.input-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:inline-block;margin-top:0rem;margin-bottom:.5rem!important}.size[_ngcontent-%COMP%]{height:32px;padding-top:0;padding-left:0;padding-right:0;margin-bottom:0;font-size:12px}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:0}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:12px;text-align:left}.table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{vertical-align:middle}.menu[_ngcontent-%COMP%]{position:relative}.main[_ngcontent-%COMP%]{border:1px solid black;border-color:#ccc;padding:5px;line-height:1.5;border-radius:5px}.borderless[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .borderless[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border:none}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:5px 8px}.btn-sm1[_ngcontent-%COMP%]{padding:4px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-sm2[_ngcontent-%COMP%]{padding:4px 10px;font-size:13px;line-height:1.5;border-radius:3px}.size2[_ngcontent-%COMP%]{height:-1px;padding:0;margin:0;font-size:12px}[type=checkbox][_ngcontent-%COMP%]{vertical-align:middle}.first[_ngcontent-%COMP%]{background-color:#162545}label[_ngcontent-%COMP%], input[_ngcontent-%COMP%]{font-size:13px}.input1[_ngcontent-%COMP%]{width:15%}.second[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{text-emphasis-color:#fff;text-decoration-color:#fff;color:#fff!important}.boarder[_ngcontent-%COMP%]{border-left:7px solid lightgrey;background-color:#d3d3d3}.text[_ngcontent-%COMP%]{font-size:14px}.text2[_ngcontent-%COMP%]{font-size:10px}input[_ngcontent-%COMP%]:read-only{background-color:#0e0d0d14}table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:12px;background-color:#162545;color:#fff;text-align:center}.btn-orange[_ngcontent-%COMP%]{background-color:#0e8891}tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{max-width:350px}.main[_ngcontent-%COMP%]{border:2px solid black;border-color:#ccc;padding:10px;line-height:1.5;border-radius:3px;box-shadow:0 4px 8px #cac7c733,0 6px 20px #00000030}.table[_ngcontent-%COMP%]{border-collapse:collapse!important}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#fff!important}.table-bordered[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .table-bordered[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid #ddd!important}.drug[_ngcontent-%COMP%]{color:#17a8eb}.th[_ngcontent-%COMP%]{border:1px solid #fff}legend[_ngcontent-%COMP%]{display:block;width:auto;max-width:100%;padding:10px;margin-bottom:.5rem;font-size:16px;line-height:inherit;color:inherit;white-space:normal}.high-light[_ngcontent-%COMP%]{font-weight:700;font-size:19px;color:#162545}fieldset[_ngcontent-%COMP%]{min-width:0;padding:10px;margin:5px;border:1px solid grey}label[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{font-size:13px;text-align:center}input[_ngcontent-%COMP%], select[_ngcontent-%COMP%], option[_ngcontent-%COMP%]{font-size:13px}.btn-group-xs[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%], .btn-xs[_ngcontent-%COMP%]{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}
1.fa-cog[_ngcontent-%COMP%]{color:red}.faa-cog[_ngcontent-%COMP%]{color:green}.fa-envelope-o[_ngcontent-%COMP%]:before{content:"\\f003";font-size:12px;border-radius:50%;border:1px solid green;padding:2px;background-color:green;color:#fff}.loading-screen-wrapper[_ngcontent-%COMP%]{z-index:100000;position:absolute;background-color:#fff9;width:100%;height:100%;display:block}.loading-screen-icon[_ngcontent-%COMP%]{position:absolute;top:10%;left:50%;transform:translate(-50%,-50%)}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .tbl[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{padding:0}useExistingCsslabel[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{font-size:13px;text-align:center}.heading[_ngcontent-%COMP%]{background-color:#1674b8;margin-bottom:5px;padding:1px 9px;margin-top:15px;color:#fff}.printtable[_ngcontent-%COMP%]{border:1px solid black}.printtable[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .printtable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid black;padding:2px;font-size:16px;color:#000}.printtable2[_ngcontent-%COMP%]{border:1px solid black}.printtable2[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .printtable2[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid black;padding:2px;font-size:16px;color:#000}.ltr-hd[_ngcontent-%COMP%]{margin-top:5cm;margin-bottom:5cm}.remarks_length[_ngcontent-%COMP%]{word-break:break-all}']})}};var j=J(Mt());function Bt(l,n){if(l&1&&u(0,"ngb-highlight",2),l&2){let t=n.result,e=n.term;p("result",t.name)("term",e)}}function Lt(l,n){l&1&&(o(0,"legend"),r(1,"Edit Quotation"),i())}function jt(l,n){l&1&&(o(0,"legend"),r(1,"New Quotation"),i())}function Yt(l,n){l&1&&(o(0,"div",37),r(1,"Sorry, suggestions could not be loaded. "),i())}function Ht(l,n){if(l&1){let t=M();o(0,"tr")(1,"td",27)(2,"input",28),f("selectItem",function(a){let d=m(t).index,w=s(3);return g(w.set_item(a,d))}),i(),x(3,Yt,2,0,"div",29),i(),o(4,"td")(5,"input",30),O("ngModelChange",function(a){let d=m(t).$implicit;return y(d.description,a)||(d.description=a),g(a)}),i()(),o(6,"td")(7,"input",31),O("ngModelChange",function(a){let d=m(t).$implicit;return y(d.quantity,a)||(d.quantity=a),g(a)}
1),f("change",function(){let a=m(t).index,d=s(3);return g(d.getAmount(a))}),i()(),o(8,"td")(9,"input",31),O("ngModelChange",function(a){let d=m(t).$implicit;return y(d.rate,a)||(d.rate=a),g(a)}),f("change",function(){let a=m(t).index,d=s(3);return g(d.getAmount(a))}),i()(),o(10,"td")(11,"input",32),O("ngModelChange",function(a){let d=m(t).$implicit;return y(d.amount,a)||(d.amount=a),g(a)}),i()(),o(12,"td")(13,"button",33),f("click",function(){let a=m(t).index,d=s(3);return g(d.addRow(a))}),u(14,"i",34),i(),o(15,"button",35),f("click",function(){let a=m(t).index,d=s(3);return g(d.removeRow(a))}),u(16,"i",36),i()()()}if(l&2){let t=n.$implicit,e=n.index,a=s(3),d=I(1);c(2),it("is-invalid",a.searchFailed),b("id","cpt",e,""),b("name","cpt",e,""),p("ngModel",t)("inputFormatter",a.formatter)("ngbTypeahead",a.cptSearch)("resultTemplate",d),c(),p("ngIf",a.searchFailed),c(2),b("id","description",e,""),b("name","description",e,""),P("ngModel",t.description),c(2),b("id","quantity",e,""),b("name","quantity",e,""),P("ngModel",t.quantity),c(2),b("id","rate",e,""),b("name","rate",e,""),P("ngModel",t.rate),c(2),b("id","amount",e,""),b("name","amount",e,""),P("ngModel",t.amount)}}function Gt(l,n){if(l&1){let t=M();o(0,"button",38),f("click",function(){m(t);let a=s(3);return g(a.saveQuotation())}),r(1,"Create Quotation "),i()}}function Kt(l,n){if(l&1){let t=M();o(0,"button",38),f("click",function(){m(t);let a=s(3);return g(a.saveQuotation())}),r(1,"Save Quotation "),i()}}function Ut(l,n){if(l&1){let t=M();o(0,"form",5)(1,"fieldset",6),x(2,Lt,2,0,"legend",1)(3,jt,2,0,"legend",1),o(4,"div",7)(5,"div",8)(6,"label"),r(7,"Patient No"),i(),o(8,"span",9),r(9,"\xA0*"),i(),o(10,"app-patient-search",10),f("set_item",function(a){m(t);let d=s(2);return g(d.set_search_item(a))}),i()(),o(11,"div",11)(12,"label"),r(13,"Issue date"),i(),o(14,"span",9),r(15,"\xA0*"),i(),o(16,"div",12)(17,"input",13),O("ngModelChange",function(a){m(t);let d=s(2);return y(d.quotationData.date,a)||(d.quotationData.date=a),g(a)}),i()()()(),o(18,"div",14)(19,"label"),r(20,"Introduction"),i(),o(21,"span",9),r(22,"\xA0*"),i(),o(23,"textarea",15),O("ngModelChange",function(a){m(t);let d=s(2);return y(d.quotationData.intro,a)||(d.quotationData.intro=a),g(a)}),i()(),o(24,"div",14)(25,"table",16)(26,"thead")(27,"tr")(28,"th",17),r(29,"CPT Name"),i(),o(30,"th",17),r(31,"Description"),i(),o(32,"th",18),r(33,"Qty"),i(),o(34,"th",18),r(35,"Rate"),i(),o(36,"th",18),r(37,"Amount"),i(),o(38,"th",18),r(39,"Action"),i()()(),o(40,"tbody"),x(41,Ht,17,31,"tr",19),o(42,"tr")(43,"td",20)(44,"b"),r(45,"Total"),i()(),o(46,"td",21),r(47),i(),u(48,"td"),i()()()(),o(49,"div",14)(50,"label"),r(51,"Notes"),i(),o(52,"textarea",22),O("ngModelChange",function(a){m(t);let d=s(2);return y(d.quotationData.notes,a)||(d.quotationData.notes=a),g(a)}),i()(),o(53,"div",14)(54,"label"),r(55,"Bank Details"),i(),o(56,"span",9),r(57,"\xA0*"),i(),o(58,"textarea",23),O("ngModelChange",function(a){m(t);let d=s(2);return y(d.quotationData.bank,a)||(d.quotationData.bank=a),g(a)}),i()(),o(59,"div",14)(60,"label"),r(61,"Terms & Conditions"),i(),o(62,"span",9),r(63,"\xA0*"),i(),o(64,"textarea",24),O("ngModelChange",function(a){m(t);let d=s(2);return y(d.quotationData.terms,a)||(d.quotationData.terms=a),g(a)}),i()(),o(65,"div",25),x(66,Gt,2,0,"button",26)(67,Kt,2,0,"button",26),i()()()}if(l&2){let t,e=s(2);c(2),p("ngIf",!!e.quotationNo),c(),p("ngIf",!e.quotationNo),c(7),p("show_name",1)("patientId",(t=e.quotationData==null?null:e.quotationData.patientId)!==null&&t!==void 0?t:0),c(7),P("ngModel",e.quotationData.date),p("max",e.maxDate),c(6),P("ngModel",e.quotationData.intro),c(18),p("ngForOf",e.quotationData.procedures)("ngForTrackBy",e.trackByIndex),c(6),_(" ",e.quotationData.total," "),c(5),P("ngModel",e.quotationData.notes),c(6),P("ngModel",e.quotationData.bank),c(6),P("ngModel",e.quotationData.terms),c(2),p("ngIf",e.quotationData.id<=0),c(),p("ngIf",e.quotationData.id>0)}}function Jt(l,n){l&1&&(o(0,"button",56),u(1,"i",57),r(2,"Print "),i()),l&2&&p("useExistingCss",!0)}function Xt(l,n){if(l&1&&(o(0,"tr")(1,"td",58),r(2),i(),o(3,"td",27),r(4),i(),o(5,"td",27),r(6),i(),o(7,"td",58),r(8),i(),o(9,"td",59),r(10),i(),o(11,"td",59),r(12),i()()),l&2){let t=n.$implicit,e=n.index;c(2),_(" ",e+1," "),c(2),_(" ",t.name," "),c(2),_(" ",t.description," "),c(2),_(" ",t.quantity," "),c(2),_(" ",t.rate," "),c(2),_(" ",t.amount," ")}}
1function Zt(l,n){if(l&1&&(o(0,"div",49)(1,"b"),r(2,"Notes"),i(),u(3,"br"),o(4,"div",50),r(5),i()()),l&2){let t=s(3);c(5),_(" ",t.quotationData==null?null:t.quotationData.notes," ")}}function $t(l,n){if(l&1){let t=M();o(0,"div")(1,"div",39)(2,"button",40),f("click",function(){m(t);let a=s(2);return g(a.enableEdit())}),u(3,"i",41),r(4,"Edit "),i(),x(5,Jt,3,1,"button",42),i(),o(6,"div",43)(7,"h3",44),r(8,"Quotation"),i(),u(9,"app-print-header"),o(10,"div",45)(11,"div",46)(12,"b"),r(13),i(),u(14,"br")(15,"app-patient-edit",47),i(),o(16,"div",48)(17,"b"),r(18,"Issue date"),i(),u(19,"br"),r(20),i()(),o(21,"div",49)(22,"div",50),r(23),i()(),o(24,"div",49)(25,"table",51)(26,"thead")(27,"tr")(28,"th",52),r(29,"#"),i(),o(30,"th",17),r(31,"CPT Name"),i(),o(32,"th",53),r(33,"Description"),i(),o(34,"th",18),r(35,"Qty"),i(),o(36,"th",18),r(37,"Rate"),i(),o(38,"th",18),r(39,"Amount"),i()()(),o(40,"tbody"),x(41,Xt,13,6,"tr",19),o(42,"tr")(43,"td",54)(44,"b"),r(45,"Total"),i()(),o(46,"td",54),r(47),i()()()()(),x(48,Zt,6,1,"div",55),o(49,"div",49)(50,"b"),r(51,"Bank Details"),i(),u(52,"br"),o(53,"div",50),r(54),i()(),o(55,"div",49)(56,"b"),r(57,"Terms And Conditions"),i(),u(58,"br"),o(59,"div",50),r(60),i()()()()}if(l&2){let t,e=s(2);c(5),p("ngIf",e.quotationData.id>0),c(8),at(e.patientName),c(2),p("patientNo",e.patientNo),c(5),_(" ",e.Moment(e.quotationData==null?null:e.quotationData.date).format("DD/MM/YYYY")," "),c(3),_(" ",e.quotationData==null?null:e.quotationData.intro," "),c(18),p("ngForOf",e.quotationData.procedures)("ngForTrackBy",e.trackByIndex),c(6),_(" ",e.quotationData.total," "),c(),p("ngIf",((t=e.quotationData==null?null:e.quotationData.notes)!==null&&t!==void 0?t:"").length>0),c(6),_(" ",e.quotationData==null?null:e.quotationData.bank," "),c(6),_(" ",e.quotationData==null?null:e.quotationData.terms," ")}}function te(l,n){if(l&1&&(o(0,"div"),u(1,"app-page-header",3),x(2,Ut,68,15,"form",4)(3,$t,61,11,"div",1),i()),l&2){let t=s();c(),p("heading","Quotation")("icon","fa fa-file-pdf-o"),c(),p("ngIf",!t.printView),c(),p("ngIf",t.printView)}}var S=class l{constructor(n,t,e,a){this.route=n;this.api=t;this.router=a;this.user={};this.initialized=!1;this.printView=!1;this.defaultProcedure={procedureId:0,id:"",name:"",description:"",rate:0,quantity:1,amount:0};this.maxDate=(0,j.default)().format("YYYY-MM-DD");this.quotationNo=null;this.patient_no="";this.quotationData={id:0,patientId:0,date:this.maxDate,intro:"",terms:"",bank:"",notes:"",procedures:[],total:0,userId:0};this.patientNo="";this.patientName="";this.searchFailed=!1;this.searching=!1;this.fields=[{field:"patientId",required:!0,validate:n=>n>0,message:"Please Select a Patient."},{field:"date",required:!0,validate:n=>(0,j.default)(n).isValid(),message:"Please Select A Valid Date."},{field:"intro",required:!0,validate:n=>n?.length>0,message:"Please Enter Introduction."},{field:"bank",required:!0,validate:n=>n?.length>0,message:"Bank details required."},{field:"procedures",required:!0,validate:n=>n?.filter(t=>t?.id>0).length>0,message:"Please Select At Least One CPT."},{field:"terms",required:!0,validate:n=>n?.length>0,message:"Please Enter Terms and Conditions."}];this.cptSearch=n=>n.pipe(tt(500),et(),D(()=>this.searching=!0),nt(t=>this.api.postRequest("Quotation/getCptList",{search_text:t,limit:20,start:0}).pipe(Z(e=>e.data)).pipe(D(()=>this.searchFailed=!1),$(()=>(this.searchFailed=!0,X([""]))))),D(()=>this.searching=!1));this.formatter=n=>n.name;this.Moment=j.default;this.notifier=e}ngOnInit(){this.user=Pt("user"),this.quotationData.userId=this.user.user_id,this.route.params.subscribe(n=>{let t=n.app_id;t==null||t==""?this.getDefaults():(this.quotationData.id=t,this.getQuotation())})}getDefaults(){this.api.getRequest("Quotation/getDefaults").subscribe(n=>{n.status==="Success"&&(this.quotationData.intro=n.data.intro,this.quotationData.terms=n.data.terms,this.quotationData.bank=n.data.bank,this.initialized=!0)}),this.addRow()}getQuotation(){this.api.postRequest("Quotation/getQuotationData",{id:this.quotationData.id}).subscribe(n=>{if(n?.status==="Success"){let t=n.data;this.quotationData=v(h({},this.quotationData),{id:t?.id,patientId:t?.patientId,total:t?.total,date:t?.date,notes:t?.notes,bank:t?.bank,intro:t?.intro,terms:t?.terms,procedures:t?.procedures?.map(e=>v(h({},e),{amount:parseFloat(e.quantity)*parseFloat(e.rate)}))}),this.patientNo=t?.patientNo,this.patientName=t?.patientName,this.initialized=!0,this.printView=!0}else this.notifier.notify("error","Failed to fetch data please try again later.")})}enableEdit(){this.printView=!1}set_item(n,t=0){let e=n.item;
1this.getCpt(e,t)}getCpt(n,t){let e={cpt_id:n?.id};this.api.postRequest("Quotation/getCptData",e).subscribe(a=>{if(a?.status==="Success"){let d=a.data,w=v(h({},this.quotationData.procedures[t]),{id:n?.id}),U=parseFloat(d?.rate);this.quotationData.procedures[t]=v(h({},w),{name:d?.name,rate:isNaN(U)?0:U}),this.getAmount(t),t===this.quotationData?.procedures.length-1&&this.addRow(t)}else this.notifier.notify("error","Failed to fetch data please try again later.")})}addRow(n=-1){let t=this.defaultProcedure;n>=0&&n<this.quotationData.procedures.length-1?this.quotationData.procedures.splice(n+1,0,h({},t)):this.quotationData.procedures.push(h({},t))}removeRow(n){this.quotationData.procedures.length===1?this.quotationData.procedures[0]=h({},this.defaultProcedure):this.quotationData.procedures.splice(n,1),this.calculateTotal()}trackByIndex(n){return n}set_search_item(n){let t=n.item;console.log({data:t}),this.quotationData.patientId=t.OP_REGISTRATION_ID,this.patientNo=t.OP_REGISTRATION_NO,this.patientName=t.NAME}getAmount(n){let t=this.quotationData.procedures[n],e=parseFloat(t.rate)*parseFloat(t.quantity);this.quotationData.procedures[n]=v(h({},t),{amount:e}),this.calculateTotal()}calculateTotal(){this.quotationData.total=this.quotationData.procedures.reduce((n,t)=>{let e=parseFloat(t.amount);return n+(isNaN(e)?0:e)},0)}saveQuotation(){let n=this.fields?.filter(t=>!t.validate(this.quotationData[t.field]));if(n?.length>0)this.notifier.notify("error",n[0]?.message);else{let t=v(h({},this.quotationData),{procedures:this.quotationData.procedures?.filter(e=>e.id>0)});this.api.postRequest("Quotation/saveQuotation",t).subscribe(e=>{if(e.status==="Success"){let a=e?.data?.quotation_id;this.quotationData.id=a,e.msg?this.notifier.notify("success",e.msg):this.notifier.notify("success","Quotation saved successfully..."),this.router.navigate(["/quotation/"])}else e.msg?this.notifier.notify("error",e.msg):this.notifier.notify("error","Failed  to saved the details!")})}}static{this.\u0275fac=function(t){return new(t||l)(C(ct),C(W),C(R),C(N))}}static{this.\u0275cmp=E({type:l,selectors:[["app-quotation-form"]],standalone:!0,features:[rt],decls:3,vars:1,consts:[["rt",""],[4,"ngIf"],[3,"result","term"],[3,"heading","icon"],["role","form",4,"ngIf"],["role","form"],[1,"form-group","row"],[1,"row","col-lg-12"],[1,"form-group","col-lg-3"],[1,"text-danger"],[3,"set_item","show_name","patientId"],[1,"form-group","col-md-3"],[1,"input-group","mb-3"],["name","date","type","date",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","max"],[1,"form-group","col-lg-12","mb-3"],["id","intro","maxlength","1000","name","intro","rows","3",1,"form-control",3,"ngModelChange","ngModel"],[1,"table-bordered","w-100"],[2,"width","30%"],[2,"width","10%"],[4,"ngFor","ngForOf","ngForTrackBy"],["colspan","2",1,"text-end","pr-2"],["colspan","3",1,"text-end","pr-2"],["id","notes","maxlength","500","name","notes","rows","3",1,"form-control",3,"ngModelChange","ngModel"],["disabled","","maxlength","500","id","bank","name","bank","rows","5",1,"form-control",3,"ngModelChange","ngModel"],["maxlength","1000","id","terms","name","terms","rows","5",1,"form-control",3,"ngModelChange","ngModel"],[1,"col-lg-12","mt-4"],["class","pull-right btn btn-sm btn-primary btn-small","type","button",3,"click",4,"ngIf"],[1,"text-left",2,"position","relative"],["placeholder","CPT code / CPT alias name / CPT description...","type","text",1,"form-control",2,"height","29px",3,"selectItem","ngModel","inputFormatter","ngbTypeahead","resultTemplate","id","name"],["class","invalid-feedback","style","height: 29px;",4,"ngIf"],["type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","id","name"],["type","text",1,"form-control","form-control-sm",3,"ngModelChange","change","ngModel","id","name"],["readonly","","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","id","name"],["title","Add New data","type","button",1,"btn","btn-primary","btn-xs","mr-2",3,"click"],[1,"fa","fa-plus",2,"color","white"],["title","Add New data","type","button",1,"btn","btn-danger","btn-xs",3,"click"],[1,"fa","fa-minus",2,"color","white"],[1,"invalid-feedback",2,"height","29px"],["type","button",1,"pull-right","btn","btn-sm","btn-primary","btn-small",3,"click"],[1,"col-md-12","d-flex","justify-content-end"],[1,"btn","btn-outline-primary","btn-xs","mr-2",3,"click"],[1,"fa","fa-pencil","mr-1"],["class","btn btn-outline-info btn-xs mr-2","ngxPrint","","printSectionId","printView","title","Print",3,"useExistingCss",4,"ngIf"],["id","printView",1,"printView","row"],[1,"text-center"],[1,"row","col-lg-12","justify-content-between","mt-3"],[1,"col-lg-3"],[3,"patientNo"],[1,"col-lg-3","text-right"],[1,"col-lg-12","mt-3"],[2,"white-space","pre-line","line-height","1.2em","font-size","15px"],[1,"table-bordered","w-100","mt-3"],[2,"width","5%"],[2,"width","35%"],["colspan","3",1,"text-end","pr-1"],["class","col-lg-12  mt-3",4,"ngIf"],["ngxPrint","","printSectionId","printView","title","Print",1,"btn","btn-outline-info","btn-xs","mr-2",3,"useExistingCss"],[1,"fa","fa-print","mr-1"],[1,"text-center",2,"position","relative"],[1,"text-right","pr-1",2,"position","relative"]],template:function(t,e){t&1&&x(0,Bt,1,2,"ng-template",null,0,Q)(2,te,4,4,"div",1),t&2&&(c(2),p("ngIf",e.initialized))},dependencies:[V,B,Ot,vt,Dt,xt,_t,st,pt,mt,ft,z,ut,gt,F,T,St,Ct,ht,A,yt],styles:['legend[_ngcontent-%COMP%]{display:block;width:auto;max-width:100%;padding:10px;margin-bottom:.5rem;font-size:17px;line-height:inherit;color:inherit;white-space:normal}fieldset.scheduler-border[_ngcontent-%COMP%]{border:1px groove #ddd!important;padding:0 1.4em 1.4em!important;margin:0 0 1.5em!important;-webkit-box-shadow:0 0 0 0 #000;box-shadow:0 0 #000}legend.scheduler-border[_ngcontent-%COMP%]{width:inherit;padding:0 10px;border-bottom:none}.clearfix[_ngcontent-%COMP%]{width:100%;min-height:10px}input[type=file][_ngcontent-%COMP%]{display:none}.fileLabel[_ngcontent-%COMP%]{padding:6px;background:#247cd4;display:table;color:#fff;width:145px;text-align:center}label[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{font-size:13px}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:5px;font-size:12px;line-height:12px;vertical-align:middle}.input-group[_ngcontent-%COMP%]{position:relative;display:flex;flex-wrap:wrap;align-items:self-start;width:100%}.form-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:inline-block;margin-bottom:0!important}.input-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:inline-block;margin-top:0rem;margin-bottom:.5rem!important}.size[_ngcontent-%COMP%]{height:32px;padding-top:0;padding-left:0;padding-right:0;margin-bottom:0;font-size:12px}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:0}.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:12px;text-align:left}.table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{vertical-align:middle}.menu[_ngcontent-%COMP%]{position:relative}.main[_ngcontent-%COMP%]{border:1px solid black;border-color:#ccc;padding:5px;line-height:1.5;border-radius:5px}.borderless[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .borderless[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border:none}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:5px 8px}.btn-sm1[_ngcontent-%COMP%]{padding:4px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-sm2[_ngcontent-%COMP%]{padding:4px 10px;font-size:13px;line-height:1.5;border-radius:3px}.size2[_ngcontent-%COMP%]{height:-1px;padding:0;margin:0;font-size:12px}[type=checkbox][_ngcontent-%COMP%]{vertical-align:middle}.first[_ngcontent-%COMP%]{background-color:#162545}label[_ngcontent-%COMP%], input[_ngcontent-%COMP%]{font-size:13px}.input1[_ngcontent-%COMP%]{width:15%}.second[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{text-emphasis-color:#fff;text-decoration-color:#fff;color:#fff!important}.boarder[_ngcontent-%COMP%]{border-left:7px solid lightgrey;background-color:#d3d3d3}.text[_ngcontent-%COMP%]{font-size:14px}.text2[_ngcontent-%COMP%]{font-size:10px}input[_ngcontent-%COMP%]:read-only{background-color:#0e0d0d14}table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{font-size:12px;background-color:#162545;color:#fff;text-align:center}.btn-orange[_ngcontent-%COMP%]{background-color:#0e8891}tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{max-width:350px}.main[_ngcontent-%COMP%]{border:2px solid black;border-color:#ccc;padding:10px;line-height:1.5;border-radius:3px;box-shadow:0 4px 8px #cac7c733,0 6px 20px #00000030}.table[_ngcontent-%COMP%]{border-collapse:collapse!important}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#fff!important}.table-bordered[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .table-bordered[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid #ddd!important}.drug[_ngcontent-%COMP%]{color:#17a8eb}.th[_ngcontent-%COMP%]{border:1px solid #fff}legend[_ngcontent-%COMP%]{display:block;width:auto;max-width:100%;padding:10px;margin-bottom:.5rem;font-size:16px;line-height:inherit;color:inherit;white-space:normal}.high-light[_ngcontent-%COMP%]{font-weight:700;font-size:19px;color:#162545}fieldset[_ngcontent-%COMP%]{min-width:0;padding:10px;margin:5px;border:1px solid grey}.printView[_ngcontent-%COMP%]{margin:5px;padding:10px;border:1px solid grey}label[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{font-size:13px;text-align:center}input[_ngcontent-%COMP%], select[_ngcontent-%COMP%], option[_ngcontent-%COMP%]{font-size:13px}.btn-group-xs[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%], .btn-xs[_ngcontent-%COMP%]{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}
1.fa-cog[_ngcontent-%COMP%]{color:red}.faa-cog[_ngcontent-%COMP%]{color:green}.fa-envelope-o[_ngcontent-%COMP%]:before{content:"\\f003";font-size:12px;border-radius:50%;border:1px solid green;padding:2px;background-color:green;color:#fff}.loading-screen-wrapper[_ngcontent-%COMP%]{z-index:100000;position:absolute;background-color:#fff9;width:100%;height:100%;display:block}.loading-screen-icon[_ngcontent-%COMP%]{position:absolute;top:10%;left:50%;transform:translate(-50%,-50%)}.tbl[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .tbl[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{padding:0}useExistingCsslabel[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{font-size:13px;text-align:center}.heading[_ngcontent-%COMP%]{background-color:#1674b8;margin-bottom:5px;padding:1px 9px;margin-top:15px;color:#fff}.printtable[_ngcontent-%COMP%]{border:1px solid black}.printtable[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .printtable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid black;padding:2px;font-size:16px;color:#000}.printtable2[_ngcontent-%COMP%]{border:1px solid black}.printtable2[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .printtable2[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:1px solid black;padding:2px;font-size:16px;color:#000}.ltr-hd[_ngcontent-%COMP%]{margin-top:5cm;margin-bottom:5cm}.remarks_length[_ngcontent-%COMP%]{word-break:break-all}@media print{table[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{color:#000!important;border:1.2pt solid #000!important}th[_ngcontent-%COMP%]{background-color:#fff!important;font-weight:700!important}table[_ngcontent-%COMP%]{box-shadow:none!important;border-collapse:collapse!important}tr[_ngcontent-%COMP%], td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}}']})}};var ee=[{path:"",children:[{path:"",component:L},{path:"form",component:S},{path:"form/:app_id",component:S}],runGuardsAndResolvers:"always"}],Y=class l{static{this.\u0275fac=function(t){return new(t||l)}}static{this.\u0275mod=k({type:l})}static{this.\u0275inj=q({imports:[H.forChild(ee),H]})}};var kt=class l{static{this.\u0275fac=function(t){return new(t||l)}}static{this.\u0275mod=k({type:l})}static{this.\u0275inj=q({imports:[dt,Y,V,z,wt]})}};export{kt as QuotationModule};

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.