@rero/rero-ils-ui
Version:
User interface for RERO integrated library system (RERO ILS).
2 lines (1 loc) • 7.44 kB
JavaScript
import{a as re}from"./chunk-7UZA4ZXC.js";import{a as ee}from"./chunk-5F2RIK45.js";import{a as T,b as I}from"./chunk-FCC5WNRC.js";import{a as ne}from"./chunk-BR2J44KJ.js";import{a as te,b as ie}from"./chunk-32FZIPT5.js";import{a as ae}from"./chunk-CGU6MK6Q.js";import{R as Y,j as X,ra as Z}from"./chunk-4GRLSOJZ.js";import{Eb as D,Nb as J,O as $,P as z,hc as K,mc as B}from"./chunk-MTJX6JRK.js";import{b as O,c as j}from"./chunk-GQ5FIRIY.js";import{la as U,ma as W}from"./chunk-4MYHQLZQ.js";import{g as Q,h as H}from"./chunk-DUSRDOA3.js";import{W as N,ha as G,ua as k}from"./chunk-WKOKZ3JO.js";import{Bb as V,Eb as C,H as M,Hc as n,Ic as x,Jc as d,Vb as _,X as q,Xb as v,Xc as s,Yc as L,ac as u,bc as t,cc as i,dc as A,dd as c,ed as l,fd as m,gb as r,hd as y,ia as f,jd as E,r as S,sc as b,vd as h,yb as F}from"./chunk-3WD6XLXL.js";var oe=(()=>{class a{transform(e){return 0-Math.abs(e)}static{this.\u0275fac=function(p){return new(p||a)}}static{this.\u0275pipe=V({name:"negativeAmount",type:a,pure:!0})}}return a})();var g=a=>({"text-error":a}),le=(a,o)=>({"text-success":a,"text-error":o}),me=a=>["/acquisition","records","acq_accounts","detail",a];function ue(a,o){a&1&&(t(0,"p-message",1),n(1),c(2,"translate"),i()),a&2&&(r(),d(" ",l(2,1,"Fiscal year closed")," "))}function se(a,o){a&1&&(t(0,"span",15),n(1,"Details"),i())}function fe(a,o){if(a&1&&(t(0,"dt",5),n(1,"Parent account"),i(),t(2,"dd")(3,"a",16),n(4),c(5,"getRecord"),c(6,"async"),i()()),a&2){let e=b();r(3),u("routerLink",s(9,me,e.parent.pid)),r(),d(" ",l(6,7,y(5,2,e.parent.pid,"acq_accounts","field","name"))," ")}}function xe(a,o){a&1&&(t(0,"span",15),n(1,"Accounting informations"),i())}function ge(a,o){if(a&1&&(_(0,ue,3,3,"p-message",1),t(1,"h1"),n(2),i(),t(3,"div",2)(4,"p-panel",3),C(5,se,2,0,"ng-template",null,0,E),t(7,"dl",4)(8,"dt",5),n(9,"Account number"),i(),t(10,"dd"),n(11),i(),t(12,"dt",5),n(13,"Budget"),i(),t(14,"dd"),n(15),c(16,"getRecord"),c(17,"async"),i(),t(18,"dt",5),n(19,"Library"),i(),t(20,"dd"),n(21),c(22,"getRecord"),c(23,"async"),i(),_(24,fe,7,11),i()(),t(25,"p-panel",3),C(26,xe,2,0,"ng-template",null,0,E),t(28,"div",6)(29,"table",7)(30,"tbody")(31,"tr",8)(32,"td",9),n(33,"Allocated amount"),i(),t(34,"td",10),n(35),c(36,"currency"),i()(),t(37,"tr")(38,"td",9),n(39,"Distribution"),i(),t(40,"td",11),n(41),c(42,"negativeAmount"),c(43,"currency"),i()(),t(44,"tr")(45,"td",12),n(46,"Current encumbrance"),i(),t(47,"td",12),n(48,"Self"),i(),t(49,"td",11),n(50),c(51,"negativeAmount"),c(52,"currency"),i()(),t(53,"tr"),A(54,"td"),t(55,"td",12),n(56,"Children"),i(),t(57,"td",11),n(58),c(59,"negativeAmount"),c(60,"currency"),i()(),t(61,"tr")(62,"td",12),n(63,"Current expenditure"),i(),t(64,"td",12),n(65,"Self"),i(),t(66,"td",11),n(67),c(68,"negativeAmount"),c(69,"currency"),i()(),t(70,"tr"),A(71,"td"),t(72,"td",12),n(73,"Children"),i(),t(74,"td",11),n(75),c(76,"negativeAmount"),c(77,"currency"),i()(),t(78,"tr",13)(79,"td",9),n(80,"Balance"),i(),t(81,"td",11),n(82),c(83,"currency"),i()(),t(84,"tr")(85,"td",9),n(86,"Allowed encumbrance exceedance"),i(),t(87,"td",14),n(88),i(),t(89,"td",14),n(90),c(91,"currency"),i()(),t(92,"tr")(93,"td",9),n(94,"Allowed expenditure exceedance"),i(),t(95,"td",14),n(96),i(),t(97,"td",14),n(98),c(99,"currency"),i()()()()()()()),a&2){let e=o,p=b();v(e.is_active?-1:0),r(2),x(e.name),r(9),x(e.number),r(4),x(l(17,28,y(16,23,e.budget.pid,"budgets","field","name"))),r(6),x(l(23,35,y(22,30,e.library.pid,"libraries","field","name"))),r(3),v(e.parent?24:-1),r(11),d(" ",m(36,37,e.allocated_amount,p.organisation.default_currency)," "),r(5),u("ngClass",s(74,g,e.distribution>0)),r(),d(" ",m(43,42,l(42,40,e.distribution),p.organisation.default_currency)," "),r(8),u("ngClass",s(76,g,e.encumbrance_amount.self>0)),r(),d(" ",m(52,47,l(51,45,e.encumbrance_amount.self),p.organisation.default_currency)," "),r(7),u("ngClass",s(78,g,e.encumbrance_amount.children>0)),r(),d(" ",m(60,52,l(59,50,e.encumbrance_amount.children),p.organisation.default_currency)," "),r(8),u("ngClass",s(80,g,e.expenditure_amount.self>0)),r(),d(" ",m(69,57,l(68,55,e.expenditure_amount.self),p.organisation.default_currency)," "),r(7),u("ngClass",s(82,g,e.expenditure_amount.children>0)),r(),d(" ",m(77,62,l(76,60,e.expenditure_amount.children),p.organisation.default_currency)," "),r(6),u("ngClass",L(84,le,e.remaining_balance.self>0,e.remaining_balance.self<0)),r(),d(" ",m(83,65,e.remaining_balance.self,p.organisation.default_currency)," "),r(6),d("",e.encumbrance_exceedance.value,"%"),r(2),d(" ",m(91,68,e.encumbrance_exceedance.amount,p.organisation.default_currency)," "),r(6),d("",e.expenditure_exceedance.value,"%"),r(2),d(" ",m(99,71,e.expenditure_exceedance.amount,p.organisation.default_currency)," ")}}var ce=(()=>{class a{constructor(){this.acqAccountApiService=f(ee),this.appStore=f(Y),this.record=h(),this.type=h(""),this.esRecord=z($(this.record).pipe(M(e=>!!e?.metadata?.pid),q(e=>this.acqAccountApiService.getAccount(e.metadata.pid))),{initialValue:null})}get organisation(){return this.appStore.organisation()}static{this.\u0275fac=function(p){return new(p||a)}}static{this.\u0275cmp=F({type:a,selectors:[["admin-acquisition-account-detail-view"]],inputs:{record:[1,"record"],type:[1,"type"]},decls:1,vars:1,consts:[["header",""],["severity","warn","showTransitionOptions","0ms"],[1,"ui:flex","ui:flex-col","ui:gap-y-4","ui:mt-5"],[1,"ui:pb-3"],[1,"metadata","ui:mx-4"],["translate",""],[1,"ui:mx-3"],[1,"ui:w-full","ui:border-spacing-0"],[1,"ui:p-2"],["colspan","2","translate","",1,"ui:font-bold"],["colspan","2",1,"text-success","ui:text-right"],["colspan","2",1,"ui:text-right",3,"ngClass"],["translate","",1,"ui:font-bold"],[1,"ui:bg-surface-100"],[1,"ui:text-right"],["translate","",1,"ui:text-xl"],[3,"routerLink"]],template:function(p,w){if(p&1&&_(0,ge,100,87),p&2){let P;v((P=w.organisation&&w.esRecord())?0:-1,P)}},dependencies:[O,W,N,H,Q,ie,te,G,k,J,j,oe],encapsulation:2,changeDetection:0})}}return a})();var pe=a=>{let o=f(U),e=a.queryParams.budget;return e?re("budgets",e):(o.navigate(["/errors/400"],{skipLocationChange:!0}),S(!1))};var He=[{label:"CSV",format:"csv",disableMaxRestResultsSize:!0}],Je=()=>new R().getTypes(),Ke=[{path:"detail/:pid",component:K,title:"Accounts",canActivate:[I],data:{action:T.READ}},{path:"edit/:pid",component:B,title:"Account",canActivate:[I],canDeactivate:[D],data:{action:T.UPDATE}},{path:"new",component:B,title:"Account",canActivate:[ne,pe],canDeactivate:[D],data:{permissions:[X.ACAC_CREATE]}}],R=class extends ae{constructor(){super(...arguments),this.name="acq_accounts",this.recordType="acq_accounts"}getTypes(){return[{key:this.name,label:"Acquisition account",detailComponent:ce,permissions:o=>this.routeToolService.permissions(o,this.recordType),preCreateRecord:o=>this._addDefaultInformation(o),redirectUrl:()=>S("/acquisition/accounts"),formFieldMap:(o,e)=>e.widget?.formlyConfig?.props?.fieldMap==="amount"?this._amountSymbol(o):o}]}_addDefaultInformation(o){return o.library={$ref:this.routeToolService.apiService.getRefEndpoint("libraries",this.routeToolService.appStore.currentLibraryPid())},o.budget={$ref:this.routeToolService.apiService.getRefEndpoint("budgets",this.routeToolService.getRouteQueryParam("budget"))},o}_amountSymbol(o){let e=this.routeToolService.appStore.organisation();return e&&(o.props.addonLeft=[Z.currencySymbol(this.routeToolService.translateService.getCurrentLang(),e.default_currency)]),o}};export{He as a,Je as b,Ke as c};