1import{a as vi,b as or}from"./chunk-OPLHEWR3.js";import{a as hi,b as gi,c as z,d as xi,e as bi,f as Si}from"./chunk-4WJJRKSD.js";import{a as Be,b as _i}from"./chunk-HOI6OZQG.js";import{a as di,b as tr,e as li,f as ir,m as ci,n as rr,q as mi,r as nr}from"./chunk-NWMZBKB5.js";import"./chunk-OGAXEEPD.js";import{a as Te,b as De}from"./chunk-EWXFQG6A.js";import{a as fi,b as ui}from"./chunk-5MUHHPUS.js";import{a as ri,b as Zi,c as ni,d as oi,e as ai,f as si,k as pi,l as er}from"./chunk-VHQYHYF4.js";import{g as Yt,h as Xt,k as Zt,l as Ki,m as ei,n as Qi,o as ti,p as Yi,q as ii,r as Xi}from"./chunk-DTNHFVPG.js";import"./chunk-QZV2ROSX.js";import"./chunk-FFT6MDJW.js";import"./chunk-RFAE3XBD.js";import"./chunk-22YWVOPL.js";import"./chunk-TX3FMS22.js";import{a as Qt,b as Ji}from"./chunk-U5A7TN5M.js";import{a as ae,b as Ge}from"./chunk-BMO4A3MY.js";import{a as Kt}from"./chunk-5YNCPQUX.js";import{$k as St,$l as Bt,$m as ji,Aa as ct,Ao as qi,Av as Ut,Bf as je,Bi as be,Bv as $i,Er as Ee,Ff as Pi,Fr as Wt,Fw as Jt,Gw as zi,Ha as Z,Ia as mt,Il as It,Ir as Fe,Ja as ft,Jl as Ot,Jr as $t,Ml as wt,Mn as oe,Nn as we,Oa as ut,Ol as Et,Qa as _t,Ql as Ft,Ra as vt,Rv as Ht,Sa as ht,Sv as Ui,Ul as Tt,Vl as Dt,Ym as Ie,Zm as Oe,_l as ee,_m as At,al as yt,am as Le,bb as gt,db as ne,fa as X,go as Gt,ha as ve,hb as xe,hn as jt,ho as Ni,ia as dt,in as Li,ja as Ae,jb as xt,jm as Vt,jw as zt,ka as he,km as Mt,kw as Hi,lm as ye,mm as kt,nl as Se,nm as Ce,ol as Ct,om as Pt,or as qt,pr as Wi,qj as Ri,ra as $,rn as Lt,sn as Gi,ta as ge,vm as Rt,wb as bt,wm as Ai,xb as ki,za as lt,zi as S,zo as Nt}from"./chunk-YGEYZW7N.js";import{$b as Pe,$c as at,A as Xe,Ad as _e,Cd as st,D as pe,Da as x,Dc as fe,F as Ze,Gc as R,Hc as Q,Ja as G,Ka as ce,Kb as v,M as ke,Mb as l,Md as pt,Nc as s,O as et,Oc as d,Pc as ue,Qd as re,Ra as ot,Rc as Y,Sa as y,T as ie,Ta as C,U as tt,Yb as c,Zb as m,_b as h,ac as Re,cc as N,fc as w,hc as u,id as q,l as Ye,ma as P,pb as p,qa as L,qb as I,s as j,ta as it,tc as me,ua as rt,uc as t,ud as W,va as nt,vc as F,wc as E,ya as de,z as te,za as le}from"./chunk-SKBIXBKI.js";import"./chunk-BLAF2TTW.js";import{a as D,b as H,d as Qe,e as k}from"./chunk-ZOSK7UEV.js";function sr(r,n){if(r&1&&h(0,"app-pdf-email-form",6),r&2){let o=u();l("form",o.sendByEmailForm)}}var Ii,We=k(()=>{ne();Ft();oi();Oe();q();Ft();Oe();oi();re();ne();qi();Le();Zi();ge();Ii=(()=>{let n=class n{constructor(e,i,a,f){this.dialogData=e,this.dialogRef=i,this.notificationService=a,this.mappers=f,this.sendByEmailForm=this.mappers.toForm(this.dialogData.resourceField,this.dialogData.resourceId,this.dialogData.email),this.sendByEmailToggleControl=new ut(!1)}save(){if(this.sendByEmailToggleControl.value){if(this.sendByEmailForm.invali
1d){this.sendByEmailForm.markAllAsTouched(),this.notificationService.invalidFormError();return}let e=this.mappers.toPdfEmail(this.sendByEmailForm.value);this.dialogRef.close({success:!0,pdfEmail:e})}else this.dialogRef.close({success:!0})}close(){this.dialogRef.close()}};n.\u0275fac=function(i){return new(i||n)(I(Ot),I(It),I(Ie),I(ni))},n.\u0275cmp=G({type:n,selectors:[["app-create-order"]],decls:25,vars:17,consts:[["mat-dialog-title",""],[1,"mb-3",3,"formControl"],[3,"form",4,"ngIf"],["mat-dialog-actions","",1,"d-flex","justify-content-between"],[1,"btn","btn-sm","btn-outline-secondary","mt-3","mb-3",3,"click"],[1,"btn","btn-sm","btn-primary","mt-3","mb-3",3,"click"],[3,"form"]],template:function(i,a){i&1&&(c(0,"h1",0),t(1),s(2,"translate"),m(),t(3,` 2`),c(4,"p"),t(5),s(6,"translate"),m(),t(7,` 3`),c(8,"mat-slide-toggle",1),t(9),s(10,"translate"),m(),t(11,` 4`),v(12,sr,1,1,"app-pdf-email-form",2),t(13,` 5`),c(14,"div",3),t(15,` 6 `),c(16,"button",4),w("click",function(){return a.close()}),t(17),s(18,"translate"),m(),t(19,` 7 `),c(20,"button",5),w("click",function(){return a.save()}),t(21),s(22,"translate"),m(),t(23,` 8`),m(),t(24,` 9`)),i&2&&(p(),F(d(2,7,"orders.draft_to_pending.title")),p(4),F(d(6,9,"orders.draft_to_pending.question")),p(3),l("formControl",a.sendByEmailToggleControl),p(),F(d(10,11,"pdf_emails.send_by_email")),p(3),l("ngIf",a.sendByEmailToggleControl.value),p(5),E(` 10 `,d(18,13,"common.close"),` 11 `),p(4),E(` 12 `,d(22,15,"common.create"),` 13 `))},dependencies:[W,mt,vt,wt,Et,Nt,ee,ri,$],encapsulation:2});let r=n;return r})()});function lr(r,n){if(r&1&&(c(0,"div",0),t(1,` 14 `),c(2,"label"),t(3),s(4,"translate"),m(),t(5,` 15 `),c(6,"div"),t(7,` 16 `),h(8,"app-datepicker",3),s(9,"asControl"),s(10,"dateOptions"),t(11,` 17 `),m(),t(12,` 18`),m()),r&2){let o=u();p(3),F(d(4,3,"common.delivery_date")),p(5),l("control",d(9,5,o.formGroup.get("delivery_date")))("calendarOptions",ue(10,7,o.billingSettings.deliveryDateList,Q(10,dr,o.formGroup.get("order_date").value)))}}function cr(r,n){if(r&1&&(c(0,"div",0),t(1,` 19 `),c(2,"label"),t(3),s(4,"translate"),m(),t(5,` 20 `),h(6,"app-mat-input",4),s(7,"asControl"),t(8,` 21`),m()),r&2){let o=u();p(3),F(d(4,2,"orders.fields.reference")),p(3),l("control",d(7,4,o.formGroup.get("reference")))}}var dr,Oi,$e=k(()=>{Ri();q();re();ji();Li();Gi();ge();Pt();Yi();dr=r=>({baseDate:r});Oi=(()=>{let n=class n{constructor(e){this.chRef=e}ngOnChanges(e){e.formGroup&&e.formGroup.currentValue.valueChanges.subscribe(()=>this.chRef.detectChanges())}};n.\u0275fac=function(i){return new(i||n)(I(at))},n.\u0275cmp=G({type:n,selectors:[["app-order-header"]],inputs:{formGroup:"formGroup",billingSettings:"billingSettings"},features:[ot],decls:15,vars:11,consts:[[1,"order-header-field"],["labelPosition","hidden",3,"label","control"],["class","order-header-field",4,"ngIf"],[3,"control","calendarOptions"],[3,"control"]],template:function(i,a){i&1&&(c(0,"div",0),t(1,` 22 `),c(2,"label"),t(3),s(4,"translate"),m(),t(5,` 23 `),h(6,"app-datepicker",1),s(7,"translate"),s(8,"asControl"),t(9,` 24`),m(),t(10,` 25 26`),v(11,lr,13,12,"div",2),t(12,` 27 28`),v(13,cr,9,6,"div",2),t(14,` 29`)),i&2&&(p(3),F(d(4,5,"orders.fields.order_date")),p(3),l("label",d(7,7,"orders.fields.order_date"))("control",d(8,9,a.formGroup.get("order_date"))),p(5),l("ngIf",a.formGroup.get("delivery_date").enabled),p(2),l("ngIf",a.formGroup.get("reference").enabled))},dependencies:[W,At,jt,Lt,$,Ce,ti],styles:["[_nghost-%COMP%]{display:block;width:320px}.order-header-field[_ngcontent-%COMP%]{display:flex}.order-header-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:120px;display:block;margin-top:.5rem;font-weight:700}.order-header-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%] ~ *[_ngcontent-%COMP%]{flex:1}"]});let r=n;return r})()});var se,wi=k(()=>{rt();xi();se=class{static observeDeliveryDateEnabled(n){let o=n.get("settings.delivery_date_enabled"),e=n.get("header.delivery_date");pe(j(o.value),o.valueChanges).subscribe(i=>i?e.enable():e.disable())}static observeOrderDate(n){let o=n.get("header.order_date"),e=n.get("header.delivery_date");z.observeDates(o,[e])}}});var Ei,Ue=k(()=>{ne();gi();xi();Xt();Si();nt();De();ki();be();Pi();wi();q();ne();De();Xt();gi();Si();Ei=(()=>{let n=class n{constructor(e,i,a,f,g){this.fb=e,this.orderService=i,this.invoiceableMappers=a,this.invoiceableAddressSettings=f,this.invoiceableTranslationsService=g}formToOrder(e){let{id:i,tenant_id:a,offer_id:f,intro:g,closure:O,issuer_address_id:B,customer:V,header:T,settings:M}=e,b=this.orderService.buildOrder({}),K=e.items.map(Me=>this.invoiceableMappers.buildInvoiceItem(Me));return Object.assign(b,D(D(D({id:i,tenant_id:a,offer_id:f,intro:g,closure:O,issuer_address_id:B,items:K},V),T),M)),b}orderToForm(e,i){let{id:a,tenant_id:f,issuer_address_id:g,offer_id:O,is_duplicate:B,is_duplicate_from_other_model:V}=e,{intro:T,closure:M}=e;a||(B&&V?(T=i.orderIntroDefault??T,M=i.orderClosureDefault??M):(T??=i.orderIntroDefault??"",M??=i.orderClosureDefault??""));let b=this.fb.group({id:this.fb.control(a),is_duplicate:this.fb.control(B),is_duplicate_from_other_model:this.fb.control(V),tenant_id:this.fb.control(f,{validators:[Z.required]}),offer_id:this.fb.control(O),intro:this.fb.control(T),closure:this.fb.control(M),issuer_address_id:this.fb.control(g),items:this.invoiceableMappers.buildItemForms(e,i),customer:this.invoiceableMappers.buildCustomerForm(e,i),header:this.buildHeaderForm(e,i),settings:this.buildSettingsForm(e,i)});return this.invoiceableAddressSettings.observe(b,"order",i),this.invoiceableTranslationsService.observe(b),z.observeAddress(b),z.observeVatIncluded(b,"order_date"),z.observeReferenceEnabled(b),z.observeDiscountEnabled(b),se.observeOrderDate(b),se.observeDeliveryDateEnabled(b),b}duplicateOrder(e){return this.orderService.getOrder(e).pipe(te(i=>{let g=i.plainModel,{items:a}=g,f=Qe(g,["items"]);return this.orderService.buildOrder(H(D({},f),{items:a.map(O=>this.invoiceableMappers.buildInvoiceItem(H(D({},O),{id:null,is_duplicate:!0}))),id:null,is_duplicate:!0,order_number_text:null,status:S.DRAFT,order_date:null,delivery_date:null}))}))}offerToOrder(e){let i=this.invoiceableTranslationsService.getTranslatedText("offer",e.language,e.offer_number_text),a=e.items.map(f=>this.invoiceableMappers.buildInvoiceItem(H(D({},f),{id:null,is_duplicate:!0,discount:f.discount||0})));return this.orderService.buildOrder(H(D({},e.plainModel),{items:a,offer_id:e.id,id:null,is_duplicate:!0,is_duplicate_from_other_model:!0,order_number_text:null,status:S.DRAFT,order_date:null,reference_enabled:!0,reference:`${i} ${e.reference??""}`.trim()}))}buildSettingsForm(e,i){let{id:a,currency_id:f,bank_account_id:g,vat_included:O,address_position:B,language:V,reference_enabled:T,is_duplicate:M}=e,{discount_enabled:b,delivery_date_enabled:K}=e;return a||(V??=i.languageDefault??"de",f??=i.currencyDefaultId??null,g??=i.bankAccountDefaultId??null,O??=i.vatIncluded??!1,b??=i.discountEnabled??!1,T??=i.referenceEnabled??!1,K??=i.deliveryDateEnabled??!1,B??=i.addressPosition??bt.LEFT),this.fb.group({language:this.fb.control(V,{validators:Z.required}),currency_id:this.fb.control(f,{validators:Z.required}),bank_account_id:this.fb.control(g,{validators:Z.required}),vat_included:this.fb.control(O),discount_enabled:this.fb.control(b),address_position:this.fb.control(B),reference_enabled:this.fb.control(T),delivery_date_enabled:this.fb.control(K)})}buildHeaderForm(e,i){let{id:a,order_date:f,delivery_date:g,reference:O}=e;return a||(f??=je(new Date),g??=je(new Date,{moveByDays:i.deliveryDateDefault})),this.fb.group({order_date:this.fb.control(f,{validators:[Z.required],updateOn:"blur"}),reference:this.fb.control(O),delivery_date:this.fb.control(g,{updateOn:"blur"})})}};n.\u0275fac=function(i){return new(i||n)(x(gt),x(Te),x(Yt),x(hi),x(bi)
29)},n.\u0275prov=de({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})()});var vr,Ve,He=k(()=>{rt();nt();Dt();Oe();ui();De();si();ct();we();Ge();Mt();be();yt();or();We();Ue();q();Ue();ui();De();si();Dt();yt();Oe();Mt();ct();we();he();vr="new",Ve=(()=>{let n=class n extends Kt{constructor(e,i,a,f,g,O,B,V,T,M,b,K,Me){super(),this.mappers=e,this.offerService=i,this.orderService=a,this.pdfEmailService=f,this.billingSettingsService=g,this.currentTenantRegister=O,this.notificationService=B,this.floatViewService=V,this.sessionService=T,this.modalService=M,this.router=b,this.route=K,this.dialog=Me,this.tenantId=this.sessionService.tenantId$,this.settings=this.select(_=>_.settings),this.form=this.select(Xe([this.data,this.settings]).pipe(ke(([_,A])=>!!_&&!!A)),([_,A])=>this.mappers.orderToForm(_,A)),this.alreadySaved=this.select(this.form.pipe(P(_=>pe(j(_.getRawValue()),_.valueChanges).pipe(tt(_)))),_=>_.get("id").value&&_.pristine),this.load=this.loadEffect(_=>this.tenantId.pipe(ie(1),P(A=>Ze([this.getOrder(_.id?.toString(),A),this.fetchBillingSettings(A)]).pipe(L(([U,Vi])=>this.setState(Mi=>H(D({},Mi),{settings:Vi}))),te(([U])=>U))))),this.save=this.processEffect(()=>this.performSave()),this.create=this.processEffect(()=>this.performSave().pipe(P(_=>{let A={resourceField:"order_id",resourceId:_.id,email:vi(_)};return this.dialog.open(Ii,{width:"400px",data:A}).afterClosed().pipe(ke(U=>!!U),P(({pdfEmail:U})=>this.changeStatus(S.PENDING).pipe(P(()=>U?this.sendEmailPdf(U):j(null)),L(()=>{this.router.navigate([".."],{relativeTo:this.route,queryParams:{status:S.PENDING,page:0},replaceUrl:!0}).then(()=>this.floatViewService.navigate(["order",_.id]))}))))}))),this.cancel=this.processEffect(()=>this.modalService.confirmation({initialState:{description:"orders.confirm_dialog.cancel.description",title:"orders.confirm_dialog.cancel.title"}}).pipe(P(()=>this.changeStatus(S.CANCELED)))),this.openPdf=this.processEffect(()=>this.performSave().pipe(L(_=>this.floatViewService.navigate(["order",_.id])))),this.openSettings=this.processEffect(()=>this.form.pipe(ie(1),L(_=>this.floatViewService.navigate(["order-settings"],{state:{form:_}}))))}changeStatus(e){return this.data.pipe(ie(1),P(({id:i})=>this.orderService.changeStatus(i,e).pipe(L(()=>{this.notificationService.success("orders.status_changed")}))))}performSave(){return this.form.pipe(it(this.data),ie(1),P(([e,i])=>{if(e.invalid)return e.markAllAsTouched(),this.notificationService.invalidFormError(),e.get("settings").invalid&&this.openSettings(),Ye;if(i.id&&e.pristine)return j(i);let a=this.mappers.formToOrder(e.getRawValue());return this.orderService.saveOrder(a,i).pipe(L(f=>{this.setData(f),this.router.navigate(["..",f.id],{relativeTo:this.route,replaceUrl:!0}),this.notificationService.success("common.save_success")}))}))}getOrder(e,i){let a=this.route.snapshot.queryParamMap.get("addressId"),f=this.route.snapshot.queryParamMap.get("duplicateId"),g=this.route.snapshot.queryParamMap.get("offerId");return e!==vr?this.fetchOrder(e):f?this.duplicateOrder(f):g?this.offerToOrder(g):this.buildOrder(i,a)}fetchOrder(e){return this.orderService.getOrder(e)}buildOrder(e,i){let a=this.currentTenantRegister.tenant.addressId,f=S.DRAFT;return j(this.orderService.buildOrder({items:[],tenant_id:e,issuer_address_id:a,status:f,address_id:i}))}duplicateOrder(e){return this.mappers.duplicateOrder(e)}offerToOrder(e){return this.offerService.getOffer(e).pipe(te(i=>this.mappers.offerToOrder(i)))}fetchBillingSettings(e){return this.billingSettingsService.getBillingSettings(e)}sendEmailPdf(e){return this.pdfEmailService.savePdfEmail(e).pipe(L(()=>this.notificationService.success("pdf_emails.send_by_email.success")),et(()=>(this.notificationService.error("pdf_emails.send_by_email.failure"),j(null))))}};n.\u0275fac=function(i){return new(i||n)(x(Ei),x(fi),x(Te),x(ai),x(Tt),x(St),x(Ie),x(Vt),x(lt),x(oe),x(ve),x(X),x(oe))},n.\u0275prov=de({token:n,factory:n.\u0275fac});let r=n;return r})()});function Fr(r,n){if(r&1&&(Pe(0),t(1),Re()),r&2){let o=u().ngIf;p(),F(o.order_number_text)}}function Tr(r,n){r&1&&(t(0),s(1,"translate"),s(2,"titlecase")),r&2&&F(d(2,3,d(1,1,"common.new")))}
29function Dr(r,n){if(r&1&&(Pe(0),t(1,` 30 / 31 `),v(2,Fr,2,1,"ng-container",9),t(3,` 32 `),v(4,Tr,3,5,"ng-template",null,0,Y),t(6,` 33 `),Re()),r&2){let o=n.ngIf,e=me(5);p(2),l("ngIf",o.order_number_text)("ngIfElse",e)}}function Br(r,n){if(r&1&&h(0,"app-order-status",10),r&2){let o=n.ngIf;l("status",o)}}function Vr(r,n){if(r&1&&(c(0,"button",18),t(1,` 34 `),h(2,"fa-icon",14),t(3,` 35 `),c(4,"small"),t(5),s(6,"translate"),m(),t(7,` 36 `),m()),r&2){let o=u().ngIf;l("appFloatLink",Q(6,Or,o.offer_id)),p(2),l("icon",R(8,wr))("fixedWidth",!0),p(3),F(d(6,4,"common.offer"))}}function Mr(r,n){if(r&1){let o=N();c(0,"button",19),s(1,"async"),w("click",function(){y(o);let i=u(2);return C(i.cancel())}),t(2),s(3,"translate"),m()}if(r&2){let o=u(2);l("disabled",d(1,2,o.loading)),p(2),E(` 37 `,d(3,4,"common.cancel"),` 38 `)}}function kr(r,n){if(r&1){let o=N();c(0,"button",20),s(1,"async"),w("click",function(){y(o);let i=u(2);return C(i.create())}),t(2),s(3,"translate"),m()}if(r&2){let o=u(2);l("disabled",d(1,2,o.loading)),p(2),E(` 39 `,d(3,4,"orders.create_order"),` 40 `)}}function Pr(r,n){if(r&1){let o=N();c(0,"div",11),t(1,` 41 `),v(2,Vr,8,9,"button",12),t(3,` 42 `),c(4,"button",13),s(5,"translate"),w("click",function(){y(o);let i=u();return C(i.openSettings())}),t(6,` 43 `),h(7,"fa-icon",14),t(8,` 44 `),m(),t(9,` 45 `),c(10,"button",13),s(11,"translate"),w("click",function(){y(o);let i=u();return C(i.openPdf())}),t(12,` 46 `),h(13,"fa-icon",14),t(14,` 47 `),m(),t(15,` 48 `),v(16,Mr,4,6,"button",15),t(17,` 49 `),c(18,"button",16),s(19,"async"),s(20,"async"),w("click",function(){y(o);let i=u();return C(i.save())}),t(21),s(22,"async"),s(23,"translate"),s(24,"translate"),m(),t(25,` 50 `),v(26,kr,4,6,"button",17),t(27,` 51 `),m()}if(r&2){let o=n.ngIf,e=u();p(2),l("ngIf",o.offer_id),p(2),l("tooltip",d(5,11,"orders.settings_title")),p(3),l("icon",R(25,Cr))("fixedWidth",!0),p(3),l("tooltip",d(11,13,"orders.open_pdf")),p(3),l("icon",R(26,Ir))("fixedWidth",!0),p(3),l("ngIf",o.status!==e.OrderStatus.DRAFT),p(2),l("disabled",d(19,15,e.alreadySaved)||d(20,17,e.loading)),p(3),E(` 52 `,d(22,19,e.alreadySaved)?d(23,21,"common.saved"):d(24,23,"common.save"),` 53 `),p(5),l("ngIf",o.status===e.OrderStatus.DRAFT)}}function Rr(r,n){r&1&&(c(0,"div",21),t(1),s(2,"translate"),m()),r&2&&(p(),E(` 54 `,d(2,1,"orders.not_found"),` 55`))}function Ar(r,n){if(r&1&&(c(0,"form",22),t(1,` 56 `),c(2,"div",23),t(3,` 57 `),c(4,"div",24),t(5,` 58 `),c(6,"div",25),t(7,`
59 `),h(8,"app-invoiceable-customer",26),s(9,"asFormGroup"),t(10,` 60 `),h(11,"app-order-header",27),s(12,"asFormGroup"),s(13,"async"),t(14,` 61 `),m(),t(15,` 62 `),c(16,"div",28),t(17,` 63 `),h(18,"app-quill-input",29),s(19,"translate"),t(20,` 64 `),m(),t(21,` 65 `),h(22,"hr"),t(23,` 66 `),h(24,"app-invoiceable-items",30),s(25,"asFormArray"),s(26,"async"),t(27,` 67 `),c(28,"div",31),t(29,` 68 `),h(30,"app-quill-input",29),s(31,"asControl"),s(32,"translate"),t(33,` 69 `),m(),t(34,` 70 `),m(),t(35,` 71 `),m(),t(36,` 72`),m()),r&2){let o=n.ngIf,e=u();l("formGroup",o),p(8),l("formGroup",d(9,15,o.get("customer")))("addressType","debtor"),p(3),l("formGroup",d(12,17,o.get("header")))("billingSettings",d(13,19,e.settings)),p(7),l("control",o.get("intro"))("label",d(19,21,"orders.fields.intro")),p(6),l("itemForms",d(25,23,o.get("items")))("settings",d(26,25,e.settings))("vatIncluded",o.get("settings.vat_included").value)("discountEnabled",o.get("settings.discount_enabled").value)("currencyId",o.get("settings.currency_id").value)("documentDate",o.get("header.order_date").value),p(6),l("control",d(31,27,o.get("closure")))("label",d(32,29,"orders.fields.closure"))}}function jr(r,n){r&1&&(c(0,"div",32),t(1,` 73 `),c(2,"button",33),t(3,` 74 `),h(4,"fa-icon",34),t(5),s(6,"translate"),m(),t(7,` 75`),m()),r&2&&(p(4),l("icon",R(5,Er))("fixedWidth",!0),p(),E(` 76 `,d(6,3,"common.back_to_list"),` 77 `))}var Cr,Ir,Or,wr,Er,ze,Je=k(()=>{Ge();be();He();q();He();he();re();tr();ne();xt();Wi();Ct();kt();Le();Wt();Ai();$i();$t();Ki();$e();ge();Pt();Hi();Ni();Cr=()=>["fas","cog"],Ir=()=>["fas","file-pdf"],Or=r=>["offer",r],wr=()=>["fas","link"],Er=()=>["fas","arrow-alt-circle-left"];ze=(()=>{let n=class n{constructor(e,i){this.store=e,this.route=i,this.OrderStatus=S,this.form=this.store.form,this.settings=this.store.settings,this.loading=this.store.loading,this.noData=this.store.noData,this.data=this.store.data,this.alreadySaved=this.store.alreadySaved,this.status=this.store.getData("status")}ngOnInit(){ae.routeParams(this.route,{skip:"queryParams"}).subscribe(e=>this.store.load(e))}save(){this.store.save()}create(){this.store.create()}openPdf(){this.store.openPdf()}openSettings(){this.store.openSettings()}cancel(){this.store.cancel()}};n.\u0275fac=function(i){return new(i||n)(I(Ve),I(X))},n.\u0275cmp=G({type:n,selectors:[["app-order-form-view"]],features:[fe([Ve])],decls:29,vars:25,consts:[["newOrder",""],[3,"loading"],[1,"app-page-title","align-items-center"],[4,"ngIf"],[3,"status",4,"ngIf"],["class","app-page-title-content",4,"ngIf"],["class","alert alert-warning",4,"ngIf"],[3,"formGroup",4,"ngIf"],["class","mb-3",4,"ngIf"],[4,"ngIf","ngIfElse"],[3,"status"],[1,"app-page-title-content"],["class","btn btn-icon",3,"appFloatLink",4,"ngIf"],["position","above",1,"btn","btn-icon",3,"click","tooltip"],["size","lg",3,"icon","fixedWidth"],["class","btn btn-outline-danger",3,"disabled","click",4,"ngIf"],[1,"btn","btn-primary",3,"click","disabled"],["class","btn btn-dark",3,"disabled","click",4,"ngIf"],[1,"btn","btn-icon",3,"appFloatLink"],[1,"btn","btn-outline-danger",3,"click","disabled"],[1,"btn","btn-dark",3,"click","disabled"],[1,"alert","alert-warning"],[3,"formGroup"],[1,"card"],[1,"card-body"],[1,"d-flex","justify-content-between"],[3,"formGroup","addressType"],[3,"formGroup","billingSettings"],[1,"mb-4"],[3,"control","label"],[3,"itemForms","settings","vatIncluded","discountEnabled","currencyId","documentDate"],[1,"mt-4"],[1,"mb-3"],["appGoBack","..",1,"btn","btn-sm","btn-outline-primary"],[3,"icon","fixedWidth"]],template:function(i,a){i&1&&(c(0,"app-page-title",1),s(1,"async"),t(2,` 78 `),c(3,"div",2),t(4,` 79 `),c(5,"h3"),t(6),s(7,"translate"),v(8,Dr,7,2,"ng-container",3),s(9,"async"),t(10,` 80 `),m(),t(11,` 81 `),v(12,Br,1,1,"app-order-status",4),s(13,"async"),t(14,` 82 `),m(),t(15,` 83 `),v(16,Pr,28,27,"div",5),s(17,"async"),t(18,` 84`),m(),t(19,` 85 86`),v(20,Rr,3,3,"div",6),s(21,"async"),t(22,` 87 88`),v(23,Ar,37,31,"form",7),s(24,"async"),t(25,` 89 90`),v(26,jr,8,6,"div",8),s(27,"async"),t(28,` 91`)),i&2&&(l("loading",d(1,8,a.loading)),p(6),E(` 92 `,ue(7,10,"model_title.order","{count: 1}"),` 93 `),p(2),l("ngIf",d(9,13,a.data)),p(4),l("ngIf",d(13,15,a.status)),p(4),l("ngIf",d(17,17,a.data)),p(4),l("ngIf",d(21,19,a.noData)),p(3),l("ngIf",d(24,21,a.form)),p(3),l("ngIf",d(27,23,a.data)))},dependencies:[W,di,_t,ft,ht,xe,qt,Se,ye,ee,Ee,Rt,Ut,Fe,Zt,Oi,_e,st,$,Ce,zt,Gt],styles:["[_nghost-%COMP%]{display:block;max-width:1200px}hr[_ngcontent-%COMP%]{border:1px solid #191C1F;margin:0}.app-page-title[_ngcontent-%COMP%]{display:flex;align-items:flex-end;
93gap:1rem}.app-page-title-content[_ngcontent-%COMP%]{display:flex;justify-content:right;align-items:baseline;gap:1rem}button[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:inherit}"]});let r=n;return r})()});function Wr(r,n){if(r&1){let o=N();c(0,"app-orders-list-actions",9),w("edit",function(){y(o);let i=u().$implicit,a=u();return C(a.editOrder(i))})("begin",function(){y(o);let i=u().$implicit,a=u();return C(a.startOrder(i.id))})("finish",function(){y(o);let i=u().$implicit,a=u();return C(a.finishOrder(i.id))})("duplicate",function(){y(o);let i=u().$implicit,a=u();return C(a.duplicateOrder(i.id))})("remove",function(){y(o);let i=u().$implicit,a=u();return C(a.removeOrder(i))})("createInvoice",function(){y(o);let i=u().$implicit,a=u();return C(a.createInvoice(i.id))}),m()}if(r&2){let o=u().$implicit;l("order",o)}}function $r(r,n){if(r&1&&(t(0,` 94 `),c(1,"button",10),s(2,"translate"),t(3,` 95 `),h(4,"fa-icon",6),t(5,` 96 `),m(),t(6,` 97 `)),r&2){let o=u().$implicit;p(),l("appFloatLink",Q(6,Gr,o.id))("tooltip",d(2,4,"common.open")),p(3),l("icon",R(8,Nr))("fixedWidth",!0)}}function Ur(r,n){if(r&1&&(t(0,` 98 `),v(1,Wr,1,1,"app-orders-list-actions",8),s(2,"async"),t(3,` 99 `),v(4,$r,7,9,"ng-template",null,2,Y),t(6,` 100 `)),r&2){let o=me(5),e=u();p(),l("ngIf",d(2,2,e.canManage))("ngIfElse",o)}}function Hr(r,n){if(r&1){let o=N();t(0,` 101 `),c(1,"button",11),w("click",function(){y(o);let i=u();return C(i.export())}),t(2,` 102 `),h(3,"fa-icon",6),t(4),s(5,"translate"),m(),t(6,` 103 `)}r&2&&(p(3),l("icon",R(5,qr))("fixedWidth",!0),p(),E(` 104 `,d(5,3,"common.download_as_csv"),` 105 `))}var Lr,Gr,Nr,qr,Ti,Ke=k(()=>{we();Ge();be();_i();q();_i();he();we();re();rr();ir();xt();Ct();kt();Le();Wt();$t();ge();Lr=()=>["fas","plus"],Gr=r=>["order",r],Nr=()=>["fas","eye"],qr=()=>["fas","download"];Ti=(()=>{let n=class n{constructor(e,i,a,f){this.store=e,this.route=i,this.router=a,this.modalService=f,this.OrderStatus=S,this.data=this.store.data,this.total=this.store.total,this.params=this.store.params,this.loading=this.store.loading,this.canManage=this.store.canManage}ngOnInit(){this.store.load(ae.parseParams(this.route.snapshot.queryParams,{disabledGuessing:!0}))}loadOrders(e){let i=ae.encodeParams(e);this.router.navigate([],{queryParams:i,relativeTo:this.route,queryParamsHandling:"merge",replaceUrl:!0}),this.store.load(e)}editOrder(e){e.status===S.DRAFT?this.store.editOrder(e.id):this.modalService.confirmation({initialState:{title:"orders.confirm_dialog.edit_title",description:"orders.confirm_dialog.edit_description",button_confirm:"orders.confirm_dialog.btn_confirm",hasDuplicateBtn:!0}}).subscribe(i=>{i==="duplicated"?this.store.duplicateOrder(e.id):this.store.editOrder(e.id)})}duplicateOrder(e){this.store.duplicateOrder(e)}startOrder(e){this.store.changeStatus({id:e,status:S.IN_PROGRESS})}finishOrder(e){this.store.changeStatus({id:e,status:S.DONE})}export(){this.store.export()}removeOrder(e){e.status===S.DRAFT?this.store.removeOrder(e.id):this.store.cancelOrder(e.id)}createInvoice(e){this.store.createInvoice(e)}};n.\u0275fac=function(i){return new(i||n)(I(Be),I(X),I(ve),I(oe))},n.\u0275cmp=G({type:n,selectors:[["app-orders-list-view"]],features:[fe([Be])],decls:26,vars:21,consts:[["rowActions",""],["footerActions",""],["openButtonTmpl",""],[3,"loading"],[1,"app-page-title-content"],["routerLink","new",1,"btn","btn-primary","float-right"],[3,"icon","fixedWidth"],["viewSettingsKey","orders-list",3,"paramsChange","orders","params","total","loading"],[3,"order","edit","begin","finish","duplicate","remove","createInvoice",4,"ngIf","ngIfElse"],[3,"edit","begin","finish","duplicate","remove","createInvoice","order"],["type","button","appRowAction","","position","above",1,"btn","btn-icon",3,"appFloatLink","tooltip"],[1,"btn","btn-sm","btn-outline-secondary",3,"click"]],template:function(i,a){if(i&1){let f=N();c(0,"app-page-title",3),s(1,"async"),t(2,` 106 `),c(3,"div",4),t(4,` 107 `),c(5,"a",5),t(6,` 108 `),h(7,"fa-icon",6),t(8),s(9,"translate"),m(),t(10,` 109 `),m(),t(11,` 110`),m(),t(12,` 111 112`),c(13,"app-orders-list",7),s(14,"async"),s(15,"async"),s(16,"async"),s(17,"async"),w("paramsChange",function(O){return y(f),C(a.loadOrders(O))}),t(18,` 113 `),v(19,Ur,7,4,"ng-template",null,0,Y),t(21,` 114 `),v(22,Hr,7,6,"ng-template",null,1,Y),t(24,` 115`),m(),t(25,` 116`)}i&2&&(l("loading",d(1,8,a.loading)),p(7),l("icon",R(20,Lr))("fixedWidth",!0),p(),E(` 117 `,d(9,10,"orders.new_order"),` 118 `),p(5),l("orders",d(14,12,a.data))("params",d(15,14,a.params))("total",d(16,16,a.total))("loading",d(17,18,a.loading)))}
118,dependencies:[W,ci,li,dt,xe,Se,ye,ee,Bt,Ee,Fe,_e,$]});let r=n;return r})()});var zr,Jr,Di,Bi=k(()=>{he();Ji();Ui();Qi();Je();Ke();q();zr=[{path:"",component:Ti,pathMatch:"full",data:{title:"orders.list_title"}},{path:":id",component:ze,canDeactivate:[Qt.forComponent(ze)]}],Jr=[{component:ei,path:"order-settings",data:{title:"orders.settings_title",floatMaxWidth:"500px"}}],Di=(()=>{let n=class n{};n.\u0275fac=function(i){return new(i||n)},n.\u0275mod=ce({type:n}),n.\u0275inj=le({imports:[Ae.forChild(zr),Ht.forChild(Jr),Ae]});let r=n;return r})()});var oa,Kr=k(()=>{re();zi();Xi();er();We();$e();Bi();nr();Je();Ke();q();oa=(()=>{let n=class n{};n.\u0275fac=function(i){return new(i||n)},n.\u0275mod=ce({type:n}),n.\u0275inj=le({imports:[pt,mi,Jt,Di,ii,pi]});let r=n;return r})()});Kr();export{oa as OrdersModule};
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.