dealposbooks 5.33.0 → 5.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-MPFBVM6S.js → chunk-2PDTOOPI.js} +1 -1
- package/{chunk-V3F7SFWL.js → chunk-2WBUZJAU.js} +1 -1
- package/{chunk-TBT7EWUJ.js → chunk-452RR3Q5.js} +1 -1
- package/{chunk-H4PZGISP.js → chunk-4BWEZFB4.js} +1 -1
- package/{chunk-KBT2GX7L.js → chunk-5R5OXGVI.js} +1 -1
- package/{chunk-FFGCE3TK.js → chunk-62S343UQ.js} +1 -1
- package/{chunk-CM2QLSCG.js → chunk-7MHKOL2S.js} +1 -1
- package/{chunk-BU5IXVPY.js → chunk-GY4LV6HX.js} +1 -1
- package/{chunk-OFLZMVEN.js → chunk-GYKMLBSE.js} +1 -1
- package/{chunk-JB4UBWDT.js → chunk-HD2SASNC.js} +1 -1
- package/{chunk-KINBDQRV.js → chunk-HNPBGZU4.js} +1 -1
- package/{chunk-UPYOERLM.js → chunk-JMFWGTOZ.js} +1 -1
- package/{chunk-MZGANYF3.js → chunk-JT7FHN7T.js} +1 -1
- package/{chunk-SMXZZ5T3.js → chunk-LRQ6Z4ZX.js} +1 -1
- package/{chunk-WBPKGJTU.js → chunk-N7OV4C3V.js} +1 -1
- package/chunk-NI56PZU2.js +1 -0
- package/{chunk-VLC4IRPH.js → chunk-OLUQUWUK.js} +1 -1
- package/{chunk-TB3PSBKG.js → chunk-Q25US4N2.js} +1 -1
- package/{chunk-7Q7GUZQB.js → chunk-RPZIOMLU.js} +1 -1
- package/{chunk-W5IDHDT2.js → chunk-RVEUNKOZ.js} +1 -1
- package/{chunk-UP43K7DD.js → chunk-SHEVSJ34.js} +1 -1
- package/{chunk-WJNROQNY.js → chunk-U2WKXQQF.js} +1 -1
- package/chunk-VXM4FDHN.js +7 -0
- package/{chunk-76K2CYGK.js → chunk-WTBARN66.js} +1 -1
- package/{chunk-6ATDYFCA.js → chunk-Y6H6VNCN.js} +1 -1
- package/index.html +2 -2
- package/{main-RFYAOUOX.js → main-GHHA6Y2C.js} +1 -1
- package/package.json +1 -1
- package/chunk-6VZGWVBI.js +0 -1
- package/chunk-QVKOUG4C.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as rt}from"./chunk-6ATDYFCA.js";import{ba as it}from"./chunk-JP6RBSB3.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
1
|
+
import{a as rt}from"./chunk-Y6H6VNCN.js";import{ba as it}from"./chunk-JP6RBSB3.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-EXGI2AG7.js";import{a as rt}from"./chunk-G4XX7EU2.js";import{a as Le,b as We}from"./chunk-HHJMN4BS.js";import{a as ze}from"./chunk-P7Z64VPC.js";import{b as N}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as ne}from"./chunk-AGLKA7OG.js";import{a as Ae,b as Pe}from"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as z,b as O}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Je,k as Be}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Me}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import{a as De,b as Re}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ee,h as Te}from"./chunk-AWXT2WGR.js";import{b as we,c as Ie}from"./chunk-C7LM5UCK.js";import{a as he,b as Se}from"./chunk-J4XRJAME.js";import{a as y,b as Ce,c as xe,d as be,e as ve,f as ye,g as ot}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as de,o as fe,w as _e,x as ge}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as oe,c as re,e as le,f as ae,k as pe,l as me,o as se,v as ce,y as ue}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as X,e as Y,f as Z,i as nt,k as ee,l as te,m as ie}from"./chunk-B63BKC6F.js";import{Ab as L,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as j,Lc as V,Mc as b,Nb as W,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as H,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as G,sc as k,ta as it,uc as K,vc as q,wb as A,wc as M,xc as $,yc as Q,zc as P}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var Ct={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Qe=Ce(ye(Ct),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:z(J(G(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(G(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Me("getCustomerInvoice"),O({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(J(B(()=>p.getJournalInvoiceLoader().pipe(O({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),be(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var vt=()=>({height:"calc(100vh - 70px)"}),Xe=t=>({"ng-invalid ng-dirty":t}),yt=()=>({});function wt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function It(t,p){if(t&1&&g(0,wt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Et(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Tt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ft(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Dt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Et,20,0,"ng-template",null,3,b)(4,Tt,26,22,"ng-template",null,4,b)(6,Ft,1,3,"ng-template",null,5,b)(8,Vt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,vt)),a(),s("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Rt(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Mt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Pt(t,p){if(t&1&&(l(0,"div"),g(1,Mt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function jt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Rt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Nt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Bt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Customer"),o(),l(28,"p-autocomplete",33),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(29,"div",25)(30,"label",26),m(31,"Page Size"),o(),C(32,"input",34),g(33,Pt,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Xe,e.isInvalid("pageSize")))("autoNumeric",P(23,yt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends je{constructor(){super(...arguments),this.store=v(Qe),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(ce)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Me("Customer Suggestions"),H(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(H(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=rt);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=it(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[Q([Qe]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollable","scrollHeight","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,It,1,1,"ng-template",null,0,b)(3,Dt,10,10,"ng-template",null,1,b)(5,jt,34,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,fe,de,We,Le,ue,pe,oe,le,ae,me,se,Ie,we,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Ye=Ce(ot("JournalSupplierBillStore"),ye(zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(J(B(()=>p.getGJSupplierBillLoader().pipe(O({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(J(G(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(G(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),O({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),be(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ot=()=>({height:"calc(100vh - 70px)"}),Ze=t=>({"ng-invalid ng-dirty":t}),Gt=()=>({});function Ht(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ut(t,p){if(t&1&&g(0,Ht,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function At(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Lt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Wt(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Kt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function qt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,At,20,0,"ng-template",null,3,b)(4,Lt,25,21,"ng-template",null,4,b)(6,Wt,1,3,"ng-template",null,5,b)(8,Kt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,Ot)),a(),s("scrollHeight","calc(100vh - 142px)")("value",e.store.data().data)("scrollable",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function $t(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Qt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Yt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Zt(t,p){if(t&1&&(l(0,"div"),g(1,Yt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ei(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ti(t,p){if(t&1&&(l(0,"div"),g(1,ei,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ii(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,$t,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Xt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Zt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Supplier"),o(),l(28,"p-autocomplete",33),w(29,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(30,"div",25)(31,"label",26),m(32,"Page Size"),o(),C(33,"input",34),g(34,ti,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",j(29,17,e.supplierSuggestions$)),a(5),s("autoNumeric",P(23,Gt))("ngClass",F(24,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Me("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(H(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[Q([Ye]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","value","scrollable","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ut,1,1,"ng-template",null,0,b)(3,qt,10,10,"ng-template",null,1,b)(5,ii,35,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,nt,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,We,Le,ue,pe,oe,le,ae,me,se,fe,de,Ee,Ie,we,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},et=Ce(ye(ni),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:z(J(B(()=>p.getGJShiftLoader().pipe(O(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(J(G(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(O(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),be(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var oi=()=>({height:"calc(100vh - 70px)"}),tt=t=>({"ng-invalid ng-dirty":t}),ri=()=>({});function li(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ai(t,p){if(t&1&&g(0,li,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function pi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function mi(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(j(16,20,e.salesNTax)),a(3),x(j(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(j(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function si(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ci(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ui(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,pi,22,0,"ng-template",null,3,b)(4,mi,29,26,"ng-template",null,4,b)(6,si,1,3,"ng-template",null,5,b)(8,ci,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,oi)),a(),s("scrollHeight","calc(100vh - 142px)")("scrollable",!0)("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function di(t,p){if(t&1&&(l(0,"span",31),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function gi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function hi(t,p){if(t&1&&(l(0,"div"),g(1,gi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Si(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Ci(t,p){if(t&1&&(l(0,"div"),g(1,Si,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function xi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,di,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From"),o(),C(10,"p-datepicker",27),g(11,_i,2,1,"div",28),o(),l(12,"div",24)(13,"label",25),m(14,"To"),o(),C(15,"p-datepicker",29),g(16,hi,2,1,"div",28),o(),l(17,"div",24)(18,"label",25),m(19,"Page Size"),o(),C(20,"input",30),g(21,Ci,2,1,"div",28),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,tt,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,tt,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",P(18,ri))("ngClass",F(19,tt,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var St=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(et),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:Oe,export:Ge,exportPageNumber:He,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(Oe,[re.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(H(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[Q([et]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","scrollable","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ai,1,1,"ng-template",null,0,b)(3,ui,10,10,"ng-template",null,1,b)(5,xi,22,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Se,he,ge,_e,ue,pe,oe,le,ae,me,se,Re,De,Ve,Fe,Ee,Ie,we,fe,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yo=[{path:"invoice",component:gt},{path:"supplier-bill",component:ht},{path:"shift",component:St},{path:"join-invoice",loadComponent:()=>import("./chunk-JB4UBWDT.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-TBT7EWUJ.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-FFGCE3TK.js").then(t=>t.AdjustmentJournalComponent)}];export{yo as generateJournalRoutes};
|
|
1
|
+
import{a as D}from"./chunk-EXGI2AG7.js";import{a as rt}from"./chunk-G4XX7EU2.js";import{a as Le,b as We}from"./chunk-HHJMN4BS.js";import{a as ze}from"./chunk-P7Z64VPC.js";import{b as N}from"./chunk-2PDTOOPI.js";import"./chunk-Y6H6VNCN.js";import{a as ne}from"./chunk-AGLKA7OG.js";import{a as Ae,b as Pe}from"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as z,b as O}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Je,k as Be}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Me}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import{a as De,b as Re}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ee,h as Te}from"./chunk-AWXT2WGR.js";import{b as we,c as Ie}from"./chunk-C7LM5UCK.js";import{a as he,b as Se}from"./chunk-J4XRJAME.js";import{a as y,b as Ce,c as xe,d as be,e as ve,f as ye,g as ot}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as de,o as fe,w as _e,x as ge}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as oe,c as re,e as le,f as ae,k as pe,l as me,o as se,v as ce,y as ue}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as X,e as Y,f as Z,i as nt,k as ee,l as te,m as ie}from"./chunk-B63BKC6F.js";import{Ab as L,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as j,Lc as V,Mc as b,Nb as W,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as H,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as G,sc as k,ta as it,uc as K,vc as q,wb as A,wc as M,xc as $,yc as Q,zc as P}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var Ct={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Qe=Ce(ye(Ct),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:z(J(G(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(G(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Me("getCustomerInvoice"),O({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(J(B(()=>p.getJournalInvoiceLoader().pipe(O({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),be(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var vt=()=>({height:"calc(100vh - 70px)"}),Xe=t=>({"ng-invalid ng-dirty":t}),yt=()=>({});function wt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function It(t,p){if(t&1&&g(0,wt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Et(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Tt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ft(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Dt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Et,20,0,"ng-template",null,3,b)(4,Tt,26,22,"ng-template",null,4,b)(6,Ft,1,3,"ng-template",null,5,b)(8,Vt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,vt)),a(),s("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Rt(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Mt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Pt(t,p){if(t&1&&(l(0,"div"),g(1,Mt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function jt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Rt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Nt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Bt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Customer"),o(),l(28,"p-autocomplete",33),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(29,"div",25)(30,"label",26),m(31,"Page Size"),o(),C(32,"input",34),g(33,Pt,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Xe,e.isInvalid("pageSize")))("autoNumeric",P(23,yt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends je{constructor(){super(...arguments),this.store=v(Qe),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(ce)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Me("Customer Suggestions"),H(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(H(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=rt);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=it(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[Q([Qe]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollable","scrollHeight","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,It,1,1,"ng-template",null,0,b)(3,Dt,10,10,"ng-template",null,1,b)(5,jt,34,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,fe,de,We,Le,ue,pe,oe,le,ae,me,se,Ie,we,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Ye=Ce(ot("JournalSupplierBillStore"),ye(zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(J(B(()=>p.getGJSupplierBillLoader().pipe(O({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(J(G(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(G(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),O({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),be(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ot=()=>({height:"calc(100vh - 70px)"}),Ze=t=>({"ng-invalid ng-dirty":t}),Gt=()=>({});function Ht(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ut(t,p){if(t&1&&g(0,Ht,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function At(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Lt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Wt(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Kt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function qt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,At,20,0,"ng-template",null,3,b)(4,Lt,25,21,"ng-template",null,4,b)(6,Wt,1,3,"ng-template",null,5,b)(8,Kt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,Ot)),a(),s("scrollHeight","calc(100vh - 142px)")("value",e.store.data().data)("scrollable",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function $t(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Qt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Yt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Zt(t,p){if(t&1&&(l(0,"div"),g(1,Yt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ei(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ti(t,p){if(t&1&&(l(0,"div"),g(1,ei,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ii(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,$t,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Xt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Zt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Supplier"),o(),l(28,"p-autocomplete",33),w(29,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(30,"div",25)(31,"label",26),m(32,"Page Size"),o(),C(33,"input",34),g(34,ti,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",j(29,17,e.supplierSuggestions$)),a(5),s("autoNumeric",P(23,Gt))("ngClass",F(24,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Me("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(H(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[Q([Ye]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","value","scrollable","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ut,1,1,"ng-template",null,0,b)(3,qt,10,10,"ng-template",null,1,b)(5,ii,35,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,nt,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,We,Le,ue,pe,oe,le,ae,me,se,fe,de,Ee,Ie,we,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},et=Ce(ye(ni),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:z(J(B(()=>p.getGJShiftLoader().pipe(O(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(J(G(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(O(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),be(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var oi=()=>({height:"calc(100vh - 70px)"}),tt=t=>({"ng-invalid ng-dirty":t}),ri=()=>({});function li(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ai(t,p){if(t&1&&g(0,li,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function pi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function mi(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(j(16,20,e.salesNTax)),a(3),x(j(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(j(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function si(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ci(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ui(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,pi,22,0,"ng-template",null,3,b)(4,mi,29,26,"ng-template",null,4,b)(6,si,1,3,"ng-template",null,5,b)(8,ci,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,oi)),a(),s("scrollHeight","calc(100vh - 142px)")("scrollable",!0)("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function di(t,p){if(t&1&&(l(0,"span",31),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function gi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function hi(t,p){if(t&1&&(l(0,"div"),g(1,gi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Si(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Ci(t,p){if(t&1&&(l(0,"div"),g(1,Si,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function xi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,di,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From"),o(),C(10,"p-datepicker",27),g(11,_i,2,1,"div",28),o(),l(12,"div",24)(13,"label",25),m(14,"To"),o(),C(15,"p-datepicker",29),g(16,hi,2,1,"div",28),o(),l(17,"div",24)(18,"label",25),m(19,"Page Size"),o(),C(20,"input",30),g(21,Ci,2,1,"div",28),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,tt,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,tt,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",P(18,ri))("ngClass",F(19,tt,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var St=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(et),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:Oe,export:Ge,exportPageNumber:He,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(Oe,[re.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(H(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[Q([et]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","scrollable","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ai,1,1,"ng-template",null,0,b)(3,ui,10,10,"ng-template",null,1,b)(5,xi,22,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Se,he,ge,_e,ue,pe,oe,le,ae,me,se,Re,De,Ve,Fe,Ee,Ie,we,fe,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yo=[{path:"invoice",component:gt},{path:"supplier-bill",component:ht},{path:"shift",component:St},{path:"join-invoice",loadComponent:()=>import("./chunk-HD2SASNC.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-452RR3Q5.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-62S343UQ.js").then(t=>t.AdjustmentJournalComponent)}];export{yo as generateJournalRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-EXGI2AG7.js";import{a as Be,b as Oe}from"./chunk-HHJMN4BS.js";import{a as He}from"./chunk-P7Z64VPC.js";import{b as D}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as ae}from"./chunk-AGLKA7OG.js";import"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as j,b as H}from"./chunk-O4QM64EH.js";import{d as ke,i as Pe,j as Me,k as ze}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Je}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import{a as Re,b as Ne}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ae,h as De}from"./chunk-AWXT2WGR.js";import{b as Te,c as Ve}from"./chunk-C7LM5UCK.js";import{a as Se,b as be}from"./chunk-J4XRJAME.js";import{a as w,b as ve,c as we,d as ye,e as Ee,f as Ie}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as ge,o as he,w as xe,x as Ce}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as le,c as pe,e as me,f as se,k as ce,l as ue,o as de,v as fe,y as _e}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as ee,e as te,f as ie,i as ne,k as oe,m as re}from"./chunk-B63BKC6F.js";import{Ab as W,Ac as V,Cb as x,Ga as k,Jc as I,Kb as c,Kc as Z,Lc as A,Mc as v,Nb as $,Ub as r,Vb as o,Wb as S,X as N,Yc as T,Z as U,_b as y,bb as L,c as J,cb as G,dc as E,ec as _,gb as l,ha as C,pa as g,qa as h,qc as s,rc as b,s as R,sc as P,uc as q,vc as Q,wb as K,wc as M,xc as X,yc as Y,zc as z}from"./chunk-JP6RBSB3.js";import{a as u,b as f}from"./chunk-YQFG5XE2.js";var qe={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}}},B=ve(Ie(qe),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedAPCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ee(t=>{let a=C(F),e=C(D);return{updateFilter(n){w(t,i=>f(u({},i),{filter:u(u({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!0}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onRowUnselect(n){w(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!1}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onHeaderCheckboxToggle(n){w(t,i=>{let d=i.data.data.map(m=>f(u({},m),{checked:n}));return f(u({},i),{data:f(u({},i.data),{data:d})})})},getAPLoader:j(J(N(()=>a.getAPJournalLoader().pipe(H({next:n=>{w(t,i=>f(u({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:j(J(R(n=>Object.entries(n).reduce((i,[d,m])=>(m!=null&&(i[d]=m),i),{})),N(n=>a.getAPJournal(n).pipe(R(i=>f(u({},i),{data:i.data.map(d=>f(u({},d),{due:e.from(d.due)?e.from(d.due).format():null,checked:!1}))})),H({next:i=>{w(t,d=>f(u({},d),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ye(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var Qe=()=>({height:"calc(100vh - 70px)"}),O=t=>({"ng-invalid ng-dirty":t}),Xe=()=>({});function Ye(t,a){if(t&1){let e=y();r(0,"p-button",10),E("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function Ze(t,a){if(t&1&&x(0,Ye,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function et(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function tt(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,G),l(),P(" ",e.number," "),l(2),b(e.customer),l(2),b(A(12,12,e.date,"d MMM y")),l(3),b(e.due?A(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,L),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function it(t,a){if(t&1&&s(0),t&2){let e=_(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function nt(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function ot(t,a){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",11),E("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,et,18,0,"ng-template",null,3,v)(4,tt,22,18,"ng-template",null,4,v)(6,it,1,3,"ng-template",null,5,v)(8,nt,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();$(z(9,Qe)),l(),c("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function rt(t,a){if(t&1&&(r(0,"span",33),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),P(" ",A(2,2,e.name,30)," ")}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function lt(t,a){if(t&1&&(r(0,"div"),x(1,at,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function pt(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function mt(t,a){if(t&1&&(r(0,"div"),x(1,pt,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function st(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function ct(t,a){if(t&1&&(r(0,"div"),x(1,st,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function ut(t,a){if(t&1){let e=y();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),x(5,rt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From"),o(),S(10,"p-datepicker",28),x(11,lt,2,1,"div",29),o(),r(12,"div",25)(13,"label",26),s(14,"To"),o(),S(15,"p-datepicker",30),x(16,mt,2,1,"div",29),o(),r(17,"div",25)(18,"label",26),s(19,"Supplier"),o(),r(20,"p-autocomplete",31),I(21,"async"),E("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(22,"div",25)(23,"label",26),s(24,"Page Size"),o(),S(25,"input",32),x(26,ct,2,1,"div",29),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(6),c("iconDisplay","input")("showIcon",!0)("ngClass",V(17,O,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(4),c("iconDisplay","input")("showIcon",!0)("ngClass",V(19,O,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",Z(21,15,e.supplierSuggestions$)),l(5),c("autoNumeric",z(21,Xe))("ngClass",V(22,O,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var ti=(()=>{class t extends je{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(ae),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(fe),this.dayjsService=C(D)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:d,supplierID:m,pageNumber:Ue,rowCount:Le,pageSize:Ge,export:Ke,exportPageNumber:We,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(d),supplierID:this.fb.control(m),pageNumber:this.fb.control(Ue),rowCount:this.fb.control(Le),pageSize:this.fb.control(Ge,[pe.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(We),exportRowCount:this.fb.control($e)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(u({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(u({},this.store.filter()),{pageNumber:p+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(U(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-ap-journal"]],features:[Y([B]),W],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AP Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=y();r(0,"app-main-panel",8),X("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),E("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,Ze,1,1,"ng-template",null,0,v)(3,ot,10,10,"ng-template",null,1,v)(5,ut,27,24,"ng-template",null,2,v),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[De,ze,ke,Pe,Me,re,ee,te,ie,ne,oe,Ce,xe,be,Se,_e,ce,le,me,se,ue,de,Ne,Re,Je,Fe,he,ge,Oe,Be,Ve,Te,Ae,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ti as ApJournalComponent};
|
|
1
|
+
import{a as F}from"./chunk-EXGI2AG7.js";import{a as Be,b as Oe}from"./chunk-HHJMN4BS.js";import{a as He}from"./chunk-P7Z64VPC.js";import{b as D}from"./chunk-2PDTOOPI.js";import"./chunk-Y6H6VNCN.js";import{a as ae}from"./chunk-AGLKA7OG.js";import"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as j,b as H}from"./chunk-O4QM64EH.js";import{d as ke,i as Pe,j as Me,k as ze}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Je}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import{a as Re,b as Ne}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ae,h as De}from"./chunk-AWXT2WGR.js";import{b as Te,c as Ve}from"./chunk-C7LM5UCK.js";import{a as Se,b as be}from"./chunk-J4XRJAME.js";import{a as w,b as ve,c as we,d as ye,e as Ee,f as Ie}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as ge,o as he,w as xe,x as Ce}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as le,c as pe,e as me,f as se,k as ce,l as ue,o as de,v as fe,y as _e}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as ee,e as te,f as ie,i as ne,k as oe,m as re}from"./chunk-B63BKC6F.js";import{Ab as W,Ac as V,Cb as x,Ga as k,Jc as I,Kb as c,Kc as Z,Lc as A,Mc as v,Nb as $,Ub as r,Vb as o,Wb as S,X as N,Yc as T,Z as U,_b as y,bb as L,c as J,cb as G,dc as E,ec as _,gb as l,ha as C,pa as g,qa as h,qc as s,rc as b,s as R,sc as P,uc as q,vc as Q,wb as K,wc as M,xc as X,yc as Y,zc as z}from"./chunk-JP6RBSB3.js";import{a as u,b as f}from"./chunk-YQFG5XE2.js";var qe={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}}},B=ve(Ie(qe),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedAPCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ee(t=>{let a=C(F),e=C(D);return{updateFilter(n){w(t,i=>f(u({},i),{filter:u(u({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!0}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onRowUnselect(n){w(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!1}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onHeaderCheckboxToggle(n){w(t,i=>{let d=i.data.data.map(m=>f(u({},m),{checked:n}));return f(u({},i),{data:f(u({},i.data),{data:d})})})},getAPLoader:j(J(N(()=>a.getAPJournalLoader().pipe(H({next:n=>{w(t,i=>f(u({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:j(J(R(n=>Object.entries(n).reduce((i,[d,m])=>(m!=null&&(i[d]=m),i),{})),N(n=>a.getAPJournal(n).pipe(R(i=>f(u({},i),{data:i.data.map(d=>f(u({},d),{due:e.from(d.due)?e.from(d.due).format():null,checked:!1}))})),H({next:i=>{w(t,d=>f(u({},d),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ye(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var Qe=()=>({height:"calc(100vh - 70px)"}),O=t=>({"ng-invalid ng-dirty":t}),Xe=()=>({});function Ye(t,a){if(t&1){let e=y();r(0,"p-button",10),E("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function Ze(t,a){if(t&1&&x(0,Ye,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function et(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function tt(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,G),l(),P(" ",e.number," "),l(2),b(e.customer),l(2),b(A(12,12,e.date,"d MMM y")),l(3),b(e.due?A(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,L),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function it(t,a){if(t&1&&s(0),t&2){let e=_(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function nt(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function ot(t,a){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",11),E("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,et,18,0,"ng-template",null,3,v)(4,tt,22,18,"ng-template",null,4,v)(6,it,1,3,"ng-template",null,5,v)(8,nt,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();$(z(9,Qe)),l(),c("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function rt(t,a){if(t&1&&(r(0,"span",33),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),P(" ",A(2,2,e.name,30)," ")}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function lt(t,a){if(t&1&&(r(0,"div"),x(1,at,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function pt(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function mt(t,a){if(t&1&&(r(0,"div"),x(1,pt,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function st(t,a){if(t&1&&(r(0,"div")(1,"span",35),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function ct(t,a){if(t&1&&(r(0,"div"),x(1,st,3,1,"div",34),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function ut(t,a){if(t&1){let e=y();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),x(5,rt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From"),o(),S(10,"p-datepicker",28),x(11,lt,2,1,"div",29),o(),r(12,"div",25)(13,"label",26),s(14,"To"),o(),S(15,"p-datepicker",30),x(16,mt,2,1,"div",29),o(),r(17,"div",25)(18,"label",26),s(19,"Supplier"),o(),r(20,"p-autocomplete",31),I(21,"async"),E("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(22,"div",25)(23,"label",26),s(24,"Page Size"),o(),S(25,"input",32),x(26,ct,2,1,"div",29),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(6),c("iconDisplay","input")("showIcon",!0)("ngClass",V(17,O,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(4),c("iconDisplay","input")("showIcon",!0)("ngClass",V(19,O,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",Z(21,15,e.supplierSuggestions$)),l(5),c("autoNumeric",z(21,Xe))("ngClass",V(22,O,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var ti=(()=>{class t extends je{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(ae),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(fe),this.dayjsService=C(D)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:d,supplierID:m,pageNumber:Ue,rowCount:Le,pageSize:Ge,export:Ke,exportPageNumber:We,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(d),supplierID:this.fb.control(m),pageNumber:this.fb.control(Ue),rowCount:this.fb.control(Le),pageSize:this.fb.control(Ge,[pe.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(We),exportRowCount:this.fb.control($e)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(u({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(u({},this.store.filter()),{pageNumber:p+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(U(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-ap-journal"]],features:[Y([B]),W],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AP Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=y();r(0,"app-main-panel",8),X("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),E("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,Ze,1,1,"ng-template",null,0,v)(3,ot,10,10,"ng-template",null,1,v)(5,ut,27,24,"ng-template",null,2,v),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[De,ze,ke,Pe,Me,re,ee,te,ie,ne,oe,Ce,xe,be,Se,_e,ce,le,me,se,ue,de,Ne,Re,Je,Fe,he,ge,Oe,Be,Ve,Te,Ae,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ti as ApJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ke,b as Qe,c as Xe,d as Ye,e as Ze,f as et}from"./chunk-EDCDR4RJ.js";import{a as ze,b as Ue,c as qe}from"./chunk-B7WHT2EP.js";import{a as We,b as He}from"./chunk-HHDFSN55.js";import{a as Le}from"./chunk-P7Z64VPC.js";import{b as $e}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as Ve,b as je}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as Pe,b as Oe,d as ke,k as Re}from"./chunk-EW3R2HAB.js";import{a as Ne,b as Me}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Je}from"./chunk-XKCLERWG.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{a as Ge,b as Be}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import{a as De,b as we}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as X}from"./chunk-5R3XKSDM.js";import{h as M}from"./chunk-AWXT2WGR.js";import"./chunk-C7LM5UCK.js";import{a as j,b as $}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as H,o as N,w as J,x as V}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{Ia as Ie,Ma as Te,b as G,c as re,e as T,f as B,j as Ae,l as P,m as q,n as Ee,o as O,v as k,x as W,y as R}from"./chunk-FMVCTBCQ.js";import{a as Fe}from"./chunk-ZGXJEG37.js";import{a as ye}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as he,G as xe,N as Se,c as _e,f as be,l as Ce,m as I}from"./chunk-B63BKC6F.js";import{Ac as ne,Cb as g,Ga as z,Jc as ie,Kb as p,Kc as oe,L as pe,Mc as f,Nb as U,Qb as y,Sb as F,Tb as A,Ub as i,Vb as n,Wb as c,Y as ce,Z as w,_b as h,ba as ue,dc as E,ec as s,g as le,gb as a,ha as u,mb as se,pa as b,qa as C,qc as o,rc as x,s as me,sc as te,vc as de,wb as S,wc as fe,xc as ge,yc as ve,zc as D}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var _=(()=>{class t{#e=u(Fe);fetchLoaderConfiguration(){return this.#e.get("","api/SetupLoader/Load")}updateAccountingIntegrationConfiguration(e){return this.#e.post(void 0,"/api/setup/SubmitConfig",e)}fetchOpeningBalanceFormConfiguration(){return this.#e.get("","/api/setup/OpeningBalance/Form")}submitOpeningBalanceFormConfiguration(e){return this.#e.post("","api/setup/OpeningBalance/Submit",e)}fetchAPICredential(){return this.#e.get(void 0,"/api/AccountConfig")}updateAPICredential(e){return this.#e.put(void 0,"/api/AccountConfig",e)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ut=()=>({height:"calc(100vh - 100px)"});function st(t,m){if(t&1){let e=h();i(0,"div",4)(1,"a",5),o(2,"Cancel"),n(),i(3,"p-button",6),E("click",function(){b(e);let l=s();return C(l.updateAccountingIntegration())}),n()()}}function dt(t,m){if(t&1&&(i(0,"p-tab",8),o(1),n()),t&2){let e=m.$implicit,r=m.$index;p("value",r),a(),x(e)}}function ft(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",43),i(2,"label",44),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function gt(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",45),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function vt(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",46),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.key.toString()),a(),p("for",e.key),a(),x(e.value)}}function _t(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",47),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function bt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),F(4,dt,2,2,"p-tab",8,y),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),o(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),o(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),o(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),o(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),o(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),o(37,"Reset Every"),n(),i(38,"div",24),F(39,ft,4,4,"div",25,y),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),o(45,"Journal Generate"),n(),i(46,"p"),o(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),o(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),o(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),o(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),o(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),o(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),o(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),o(88,"Audit Journal Transaction"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),F(92,gt,5,4,"div",40,y),n()()()(),i(94,"div")(95,"label",41),o(96,"Accounting For Treatment"),n(),i(97,"div",12)(98,"div",39)(99,"div",12),F(100,vt,5,4,"div",40,y),n()()()(),i(102,"div")(103,"label",42),o(104,"Configure Report Access Control in COA"),n(),i(105,"div",12)(106,"div",39)(107,"div",12),F(108,_t,5,4,"div",40,y),n()()()()()()()()()()()()),t&2){let e,r,l,d,L,v=s();U(D(8,ut)),a(2),p("value",0)("formGroup",v.form),a(2),A(v.tabs()),a(3),p("value",0),a(26),p("options",(e=v.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),a(6),A((r=v.accountingIntegration())==null||r.options==null?null:r.options.resetPeriods),a(2),p("value",1),a(38),p("value",2),a(13),A((l=v.accountingIntegration())==null||l.options==null?null:l.options.auditType),a(8),A((d=v.accountingIntegration())==null||d.options==null?null:d.options.generatePrepaidJournal),a(8),A((L=v.accountingIntegration())==null||L.options==null?null:L.options.entityAccess)}}var nt=(()=>{class t{constructor(){this.accountingSetupService=u(_),this.fb=u(k).nonNullable,this.tabs=z(["Numbering","Journal","Report"]),this.accountingIntegration=z(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(w(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","accountingAuditType",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],["for","accountingEntityAccess",1,"fs-4","mb-2"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","accountingAuditType","formControlName","accountingAuditType",3,"value","inputId"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"],["name","accountingEntityAccess","formControlName","accountingEntityAccess",3,"value","inputId"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,st,4,0,"ng-template",null,0,f)(3,bt,110,9,"ng-template",null,1,f),n())},dependencies:[I,et,Ze,Ye,Xe,Ke,Qe,M,X,Oe,Pe,R,T,B,P,O,q,N,Be,Ge,je,Ve,Se,xe,V,J,we,De,Q,K],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var ht=()=>({height:"calc(100vh - 250px)"}),xt=()=>[],it=()=>({});function St(t,m){if(t&1){let e=h();i(0,"div")(1,"p-button",6),E("onClick",function(){b(e);let l=s();return C(l.submitForm())}),n()()}}function yt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Date"),n(),c(3,"p-datePicker",14),n())}function Ft(t,m){t&1&&(i(0,"tr")(1,"th",20),o(2,"Account Name"),n(),i(3,"th",21),o(4,"Debit"),n(),i(5,"th",21),o(6,"Credit"),n()())}function At(t,m){if(t&1&&(i(0,"tr",10)(1,"td",20),o(2),n(),i(3,"td"),c(4,"input",22),n(),i(5,"td"),c(6,"input",23),n()()),t&2){let e,r=m.$implicit,l=m.rowIndex,d=s(4);p("formGroupName",l),a(2),te(" ",(e=d.asFormGroup(r).get("accountName"))==null?null:e.value," "),a(2),p("autoNumeric",D(4,it)),a(2),p("autoNumeric",D(5,it))}}function Et(t,m){if(t&1&&(i(0,"div",10)(1,"h4",15),o(2),n(),i(3,"div",16)(4,"p-table",17),g(5,Ft,7,0,"ng-template",18)(6,At,7,6,"ng-template",19),n()()()),t&2){let e=m.$implicit,r=m.$index,l=s(3);p("formGroupName",r),a(2),te(" ",e.get("name").value," "),a(2),p("value",l.getItemsArray(l.asFormGroup(e)).controls)}}function It(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"p",24),o(3,"Total"),n()(),i(4,"td",25)(5,"p",24),o(6),ie(7,"number"),n()(),i(8,"td",25)(9,"p",24),o(10),ie(11,"number"),n()()()),t&2){let e=s(3);a(6),x(oe(7,2,e.subtotalDebit)),a(4),x(oe(11,4,e.subtotalCredit))}}function Tt(t,m){if(t&1&&(i(0,"p-panel",8),g(1,yt,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),F(6,Et,7,3,"div",10,y),n()(),i(8,"p-table",11),g(9,It,12,6,"ng-template",null,3,f),n()()),t&2){let e=s(2);p("formGroup",e.formGroups),a(4),U(D(4,ht)),a(2),A(e.formsArray.controls),a(2),p("value",D(5,xt))}}function Nt(t,m){if(t&1&&g(0,Tt,11,6,"p-panel",7),t&2){let e=s();p("ngIf",e.formGroups)}}var rt=(()=>{class t{constructor(){this.destroy$=new le,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(k),this.accSetupService=u(_),this.dayjsService=u($e),this.date=new Date,this.routes=u(he)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(pe(300),ce(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let r=e.map(l=>this.createItemGroup(l));return this.fb.array(r)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(me(e=>e.data),Je("response"),w(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(l=>l.items&&l.items.length>0).forEach(l=>{this.formsArray.push(this.createFormGroup(l))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(r=>{let l=this.getItemsArray(r),d=l.controls.reduce((v,Z)=>{let ee=Z.get("debitAmount").value||0;return v+ee},0),L=l.controls.reduce((v,Z)=>{let ee=Z.get("creditAmount").value||0;return v+ee},0);this.subtotalDebit+=d,this.subtotalCredit+=L})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((r,[l,d])=>(l==="date"?r[l]=d instanceof Date?this.dayjsService.format(d):d:l==="forms"?r.form=d:r[l]=d,r),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-acc-opening-balance-form"]],features:[ve([Ie])],decls:6,vars:0,consts:[["actionButton",""],["content",""],["header",""],["footer",""],["pageTitle","Opening Balance Form"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[3,"value"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],["formControlName","debitAmount",1,"fs-3","form-control",3,"autoNumeric"],["formControlName","creditAmount",1,"fs-3","form-control",3,"autoNumeric"],[1,"fw-semibold","fs-4"],[1,"text-end",2,"width","200px"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,St,2,0,"ng-template",null,0,f)(3,Nt,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",5))},dependencies:[M,X,Te,I,be,Ce,Me,Ne,Re,ke,Q,K,W,G,T,B,N,qe,V,J,$,j,Le,R,P,O,q,Ee,He,We],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var at=t=>({"ng-invalid ng-dirty":t});function Dt(t,m){if(t&1){let e=h();i(0,"p-button",4),E("onClick",function(){b(e);let l=s();return C(l.saveCredentials())}),o(1,"Update"),n()}}function wt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Account"),n(),i(3,"small",14),o(4,"Configure Client ID and Client Secret"),n()())}function Gt(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,wt,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),o(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),o(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=s();a(4),p("formGroup",e.credentialForm),a(5),p("ngClass",ne(3,at,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),a(5),p("ngClass",ne(5,at,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var lt=(()=>{class t{constructor(e){this.fb=e,this.setupService=u(_)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(w(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[re.required]],clientSecret:["",[re.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}static{this.\u0275fac=function(r){return new(r||t)(se(k))}}static{this.\u0275cmp=S({type:t,selectors:[["app-api-credential"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Dt,2,0,"ng-template",null,0,f)(3,Gt,15,7,"ng-template",null,1,f),n())},dependencies:[I,_e,R,G,T,B,P,O,N,H,$,j,M,V,J],encapsulation:2})}}return t})();function Bt(t,m){if(t&1){let e=h();i(0,"button",4),E("click",function(){b(e);let l=s();return C(l.onFormatJournal())}),o(1," Format "),n()}}function Pt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),o(3,"Journal Configuration"),n(),i(4,"small",15),o(5," Enter your account information to format journal entries "),n()()())}function Ot(t,m){if(t&1){let e=h();i(0,"div",5)(1,"p-panel"),g(2,Pt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),ge("ngModelChange",function(l){b(e);let d=s();return fe(d.subdomain,l)||(d.subdomain=l),C(l)}),n(),i(8,"label",10),o(9,"Subdomain"),n()(),i(10,"small",11),o(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=s();a(7),de("ngModel",e.subdomain)}}var mt=(()=>{class t{constructor(){this.setupService=u(_),this.subdomain=z(""),this.toastrService=u(ye)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Bt,2,0,"ng-template",null,0,f)(3,Ot,12,1,"ng-template",null,1,f),n())},dependencies:[I,W,G,T,Ae,N,H,M,$,j,Ue,ze],encapsulation:2})}}return t})();var pt=()=>u(_).fetchOpeningBalanceFormConfiguration();var _i=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"accounting-integration",component:nt},{path:"opening-balance-form",component:rt,resolve:{data:pt}},{path:"api-crendetial",component:lt},{path:"format-journal",component:mt},{path:"closing-entries",loadComponent:()=>import("./chunk-P37DL4A6.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-MZGANYF3.js").then(t=>t.ClosingFormComponent)}]}];export{_i as ACCOUNTING_SETUP_ROUTES};
|
|
1
|
+
import{a as Ke,b as Qe,c as Xe,d as Ye,e as Ze,f as et}from"./chunk-EDCDR4RJ.js";import{a as ze,b as Ue,c as qe}from"./chunk-B7WHT2EP.js";import{a as We,b as He}from"./chunk-HHDFSN55.js";import{a as Le}from"./chunk-P7Z64VPC.js";import{b as $e}from"./chunk-2PDTOOPI.js";import"./chunk-Y6H6VNCN.js";import{a as Ve,b as je}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as Pe,b as Oe,d as ke,k as Re}from"./chunk-EW3R2HAB.js";import{a as Ne,b as Me}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Je}from"./chunk-XKCLERWG.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{a as Ge,b as Be}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import{a as De,b as we}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as X}from"./chunk-5R3XKSDM.js";import{h as M}from"./chunk-AWXT2WGR.js";import"./chunk-C7LM5UCK.js";import{a as j,b as $}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as H,o as N,w as J,x as V}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{Ia as Ie,Ma as Te,b as G,c as re,e as T,f as B,j as Ae,l as P,m as q,n as Ee,o as O,v as k,x as W,y as R}from"./chunk-FMVCTBCQ.js";import{a as Fe}from"./chunk-ZGXJEG37.js";import{a as ye}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as he,G as xe,N as Se,c as _e,f as be,l as Ce,m as I}from"./chunk-B63BKC6F.js";import{Ac as ne,Cb as g,Ga as z,Jc as ie,Kb as p,Kc as oe,L as pe,Mc as f,Nb as U,Qb as y,Sb as F,Tb as A,Ub as i,Vb as n,Wb as c,Y as ce,Z as w,_b as h,ba as ue,dc as E,ec as s,g as le,gb as a,ha as u,mb as se,pa as b,qa as C,qc as o,rc as x,s as me,sc as te,vc as de,wb as S,wc as fe,xc as ge,yc as ve,zc as D}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var _=(()=>{class t{#e=u(Fe);fetchLoaderConfiguration(){return this.#e.get("","api/SetupLoader/Load")}updateAccountingIntegrationConfiguration(e){return this.#e.post(void 0,"/api/setup/SubmitConfig",e)}fetchOpeningBalanceFormConfiguration(){return this.#e.get("","/api/setup/OpeningBalance/Form")}submitOpeningBalanceFormConfiguration(e){return this.#e.post("","api/setup/OpeningBalance/Submit",e)}fetchAPICredential(){return this.#e.get(void 0,"/api/AccountConfig")}updateAPICredential(e){return this.#e.put(void 0,"/api/AccountConfig",e)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ut=()=>({height:"calc(100vh - 100px)"});function st(t,m){if(t&1){let e=h();i(0,"div",4)(1,"a",5),o(2,"Cancel"),n(),i(3,"p-button",6),E("click",function(){b(e);let l=s();return C(l.updateAccountingIntegration())}),n()()}}function dt(t,m){if(t&1&&(i(0,"p-tab",8),o(1),n()),t&2){let e=m.$implicit,r=m.$index;p("value",r),a(),x(e)}}function ft(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",43),i(2,"label",44),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function gt(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",45),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function vt(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",46),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.key.toString()),a(),p("for",e.key),a(),x(e.value)}}function _t(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",47),i(3,"label",44),o(4),n()()()),t&2){let e=m.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),x(e.value)}}function bt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),F(4,dt,2,2,"p-tab",8,y),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),o(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),o(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),o(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),o(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),o(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),o(37,"Reset Every"),n(),i(38,"div",24),F(39,ft,4,4,"div",25,y),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),o(45,"Journal Generate"),n(),i(46,"p"),o(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),o(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),o(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),o(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),o(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),o(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),o(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),o(88,"Audit Journal Transaction"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),F(92,gt,5,4,"div",40,y),n()()()(),i(94,"div")(95,"label",41),o(96,"Accounting For Treatment"),n(),i(97,"div",12)(98,"div",39)(99,"div",12),F(100,vt,5,4,"div",40,y),n()()()(),i(102,"div")(103,"label",42),o(104,"Configure Report Access Control in COA"),n(),i(105,"div",12)(106,"div",39)(107,"div",12),F(108,_t,5,4,"div",40,y),n()()()()()()()()()()()()),t&2){let e,r,l,d,L,v=s();U(D(8,ut)),a(2),p("value",0)("formGroup",v.form),a(2),A(v.tabs()),a(3),p("value",0),a(26),p("options",(e=v.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),a(6),A((r=v.accountingIntegration())==null||r.options==null?null:r.options.resetPeriods),a(2),p("value",1),a(38),p("value",2),a(13),A((l=v.accountingIntegration())==null||l.options==null?null:l.options.auditType),a(8),A((d=v.accountingIntegration())==null||d.options==null?null:d.options.generatePrepaidJournal),a(8),A((L=v.accountingIntegration())==null||L.options==null?null:L.options.entityAccess)}}var nt=(()=>{class t{constructor(){this.accountingSetupService=u(_),this.fb=u(k).nonNullable,this.tabs=z(["Numbering","Journal","Report"]),this.accountingIntegration=z(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(w(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","accountingAuditType",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],["for","accountingEntityAccess",1,"fs-4","mb-2"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","accountingAuditType","formControlName","accountingAuditType",3,"value","inputId"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"],["name","accountingEntityAccess","formControlName","accountingEntityAccess",3,"value","inputId"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,st,4,0,"ng-template",null,0,f)(3,bt,110,9,"ng-template",null,1,f),n())},dependencies:[I,et,Ze,Ye,Xe,Ke,Qe,M,X,Oe,Pe,R,T,B,P,O,q,N,Be,Ge,je,Ve,Se,xe,V,J,we,De,Q,K],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var ht=()=>({height:"calc(100vh - 250px)"}),xt=()=>[],it=()=>({});function St(t,m){if(t&1){let e=h();i(0,"div")(1,"p-button",6),E("onClick",function(){b(e);let l=s();return C(l.submitForm())}),n()()}}function yt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Date"),n(),c(3,"p-datePicker",14),n())}function Ft(t,m){t&1&&(i(0,"tr")(1,"th",20),o(2,"Account Name"),n(),i(3,"th",21),o(4,"Debit"),n(),i(5,"th",21),o(6,"Credit"),n()())}function At(t,m){if(t&1&&(i(0,"tr",10)(1,"td",20),o(2),n(),i(3,"td"),c(4,"input",22),n(),i(5,"td"),c(6,"input",23),n()()),t&2){let e,r=m.$implicit,l=m.rowIndex,d=s(4);p("formGroupName",l),a(2),te(" ",(e=d.asFormGroup(r).get("accountName"))==null?null:e.value," "),a(2),p("autoNumeric",D(4,it)),a(2),p("autoNumeric",D(5,it))}}function Et(t,m){if(t&1&&(i(0,"div",10)(1,"h4",15),o(2),n(),i(3,"div",16)(4,"p-table",17),g(5,Ft,7,0,"ng-template",18)(6,At,7,6,"ng-template",19),n()()()),t&2){let e=m.$implicit,r=m.$index,l=s(3);p("formGroupName",r),a(2),te(" ",e.get("name").value," "),a(2),p("value",l.getItemsArray(l.asFormGroup(e)).controls)}}function It(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"p",24),o(3,"Total"),n()(),i(4,"td",25)(5,"p",24),o(6),ie(7,"number"),n()(),i(8,"td",25)(9,"p",24),o(10),ie(11,"number"),n()()()),t&2){let e=s(3);a(6),x(oe(7,2,e.subtotalDebit)),a(4),x(oe(11,4,e.subtotalCredit))}}function Tt(t,m){if(t&1&&(i(0,"p-panel",8),g(1,yt,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),F(6,Et,7,3,"div",10,y),n()(),i(8,"p-table",11),g(9,It,12,6,"ng-template",null,3,f),n()()),t&2){let e=s(2);p("formGroup",e.formGroups),a(4),U(D(4,ht)),a(2),A(e.formsArray.controls),a(2),p("value",D(5,xt))}}function Nt(t,m){if(t&1&&g(0,Tt,11,6,"p-panel",7),t&2){let e=s();p("ngIf",e.formGroups)}}var rt=(()=>{class t{constructor(){this.destroy$=new le,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(k),this.accSetupService=u(_),this.dayjsService=u($e),this.date=new Date,this.routes=u(he)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(pe(300),ce(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let r=e.map(l=>this.createItemGroup(l));return this.fb.array(r)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(me(e=>e.data),Je("response"),w(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(l=>l.items&&l.items.length>0).forEach(l=>{this.formsArray.push(this.createFormGroup(l))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(r=>{let l=this.getItemsArray(r),d=l.controls.reduce((v,Z)=>{let ee=Z.get("debitAmount").value||0;return v+ee},0),L=l.controls.reduce((v,Z)=>{let ee=Z.get("creditAmount").value||0;return v+ee},0);this.subtotalDebit+=d,this.subtotalCredit+=L})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((r,[l,d])=>(l==="date"?r[l]=d instanceof Date?this.dayjsService.format(d):d:l==="forms"?r.form=d:r[l]=d,r),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-acc-opening-balance-form"]],features:[ve([Ie])],decls:6,vars:0,consts:[["actionButton",""],["content",""],["header",""],["footer",""],["pageTitle","Opening Balance Form"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[3,"value"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],["formControlName","debitAmount",1,"fs-3","form-control",3,"autoNumeric"],["formControlName","creditAmount",1,"fs-3","form-control",3,"autoNumeric"],[1,"fw-semibold","fs-4"],[1,"text-end",2,"width","200px"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,St,2,0,"ng-template",null,0,f)(3,Nt,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",5))},dependencies:[M,X,Te,I,be,Ce,Me,Ne,Re,ke,Q,K,W,G,T,B,N,qe,V,J,$,j,Le,R,P,O,q,Ee,He,We],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var at=t=>({"ng-invalid ng-dirty":t});function Dt(t,m){if(t&1){let e=h();i(0,"p-button",4),E("onClick",function(){b(e);let l=s();return C(l.saveCredentials())}),o(1,"Update"),n()}}function wt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Account"),n(),i(3,"small",14),o(4,"Configure Client ID and Client Secret"),n()())}function Gt(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,wt,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),o(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),o(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=s();a(4),p("formGroup",e.credentialForm),a(5),p("ngClass",ne(3,at,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),a(5),p("ngClass",ne(5,at,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var lt=(()=>{class t{constructor(e){this.fb=e,this.setupService=u(_)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(w(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[re.required]],clientSecret:["",[re.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}static{this.\u0275fac=function(r){return new(r||t)(se(k))}}static{this.\u0275cmp=S({type:t,selectors:[["app-api-credential"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Dt,2,0,"ng-template",null,0,f)(3,Gt,15,7,"ng-template",null,1,f),n())},dependencies:[I,_e,R,G,T,B,P,O,N,H,$,j,M,V,J],encapsulation:2})}}return t})();function Bt(t,m){if(t&1){let e=h();i(0,"button",4),E("click",function(){b(e);let l=s();return C(l.onFormatJournal())}),o(1," Format "),n()}}function Pt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),o(3,"Journal Configuration"),n(),i(4,"small",15),o(5," Enter your account information to format journal entries "),n()()())}function Ot(t,m){if(t&1){let e=h();i(0,"div",5)(1,"p-panel"),g(2,Pt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),ge("ngModelChange",function(l){b(e);let d=s();return fe(d.subdomain,l)||(d.subdomain=l),C(l)}),n(),i(8,"label",10),o(9,"Subdomain"),n()(),i(10,"small",11),o(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=s();a(7),de("ngModel",e.subdomain)}}var mt=(()=>{class t{constructor(){this.setupService=u(_),this.subdomain=z(""),this.toastrService=u(ye)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=S({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Bt,2,0,"ng-template",null,0,f)(3,Ot,12,1,"ng-template",null,1,f),n())},dependencies:[I,W,G,T,Ae,N,H,M,$,j,Ue,ze],encapsulation:2})}}return t})();var pt=()=>u(_).fetchOpeningBalanceFormConfiguration();var _i=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"accounting-integration",component:nt},{path:"opening-balance-form",component:rt,resolve:{data:pt}},{path:"api-crendetial",component:lt},{path:"format-journal",component:mt},{path:"closing-entries",loadComponent:()=>import("./chunk-P37DL4A6.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-JT7FHN7T.js").then(t=>t.ClosingFormComponent)}]}];export{_i as ACCOUNTING_SETUP_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-GY4LV6HX.js";import"./chunk-2PDTOOPI.js";import"./chunk-Y6H6VNCN.js";import{a as E,b as O}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-AWXT2WGR.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as F}from"./chunk-B63BKC6F.js";import{Cb as B,Jc as m,Kb as p,Kc as l,Mc as x,Nb as d,Ub as o,V as y,Vb as n,Wb as c,X as M,Z as b,_b as P,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as C,ra as S,s as u,sa as k,wb as w,yc as $,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
|