PageSourceSearch

https://web.roapp.io/static/dist/js/13043.5367d2765490ab219bb3.js

js roapp.io collected 2026-09-24 12:53:42 UTC 8,724 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunkorderry=self.webpackChunkorderry||[]).push([[13043],{13043:function(Bt,G,t){t.r(G),t.d(G,{default:function(){return xt}});var e=t(74848),E=t(96540),h=t(62770),p=t(47069),W=t(68125),R=t(49785),b=t(86462),C=t(25716),z=t(29549),f=t(14756),D=t(72859),X=t(79080),Y=t(64375);const O={PRICE_DECIMAL_PRECISION:"price_display_precision"},K=1234,J=()=>{const{PRICE_DISPLAY_PRECISION:s}=t(91530);return{[O.PRICE_DECIMAL_PRECISION]:s||2}},Z=()=>[{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}];function w(){const{CURRENCY_SYMBOL:s,CURRENCY_SYMBOL_LEFT:o,DECIMAL_SEP:i=","}=t(91530),{t:n}=(0,h.Bd)(),r=Z(),d=J(),[a,{isLoading:c}]=(0,D.ms)(),S=(0,R.mN)({defaultValues:d}),{formState:{errors:I},watch:v,handleSubmit:m}=S,u=v(O.PRICE_DECIMAL_PRECISION),A=`${K.toFixed(u).replace(".",i)}`,P=`${n("Example:")} ${o?`${s} ${A}`:`${A} ${s}`}`,j=async V=>{try{const B=await a({data:{...V}}).unwrap();(0,Y.$)(B)}catch{return}X.o.success(n("Changes saved"))};return(0,e.jsxs)(R.Op,{...S,children:[(0,e.jsx)(C.A,{name:O.PRICE_DECIMAL_PRECISION,labelProps:{label:n("Number of decimal places"),postContent:(0,e.jsx)(z.A,{placement:"right",showTrigger:"click",hideTrigger:"click",minWidth:200,content:n("Set the number of decimal places to display prices in the interface, printed documents, and exports. Does not affect calculations.")})},errors:I,description:P,children:(0,e.jsx)(b.A,{options:r,name:O.PRICE_DECIMAL_PRECISION})}),(0,e.jsx)(C.A,{children:(0,e.jsx)(f.A,{text:n("Save"),onClick:m(j),isLoading:c})})]})}var k=(0,E.memo)(w),y=t(60799),L=t(62209);const N={SPONSOR:"sponsor"},q=()=>{const{DISCOUNT_SPONSOR:s}=t(91530);return{[N.SPONSOR]:s!=null?s:L.BL.DISCOUNT}},_=()=>{const{t:s}=(0,h.Bd)();return(0,E.useMemo)(()=>[{label:s("Discount"),value:L.BL.DISCOUNT},{label:s("Company discount"),value:L.BL.COMPANY_DISCOUNT}],[])};function tt(){const{t:s}=(0,h.Bd)(),o=(0,R.mN)({defaultValues:q()}),{handleSubmit:i,watch:n}=o,[r,{isLoading:d}]=(0,D.eO)(),a=_(),c=n(N.SPONSOR),S=async I=>{try{const v=await r({data:I}).unwrap();t(91530).setState(v)}catch{return}y.Ay.success(s("Changes saved"))};return(0,e.jsxs)(R.Op,{...o,children:[(0,e.jsx)(C.A,{name:N.SPONSOR,description:s(c?"Employee wages calculation is based on the sum and discount. This way the company discount decreases the piecework employee wages.":"Employee wages calculation is based on the sum regardless of discount. This way the company discount won't affect the piecework employee wages."),labelProps:{label:s("The default orders and sales include")},children:(0,e.jsx)(b.A,{name:N.SPONSOR,options:a})}),(0,e.jsx)(C.A,{children:(0,e.jsx)(f.A,{text:s("Save"),onClick:i(S),isLoading:d})})]})}var st=(0,E.memo)(tt),et=t(15360),nt=t(52594),x=t(89150),F=t(78931),ot=t(240),at=t(43233),g=t(28168),it=t(48676),M=t(13555),rt=t(49466),ct=t(3653),lt=t(23356),H=t(70881),dt=t(75268),Q=t(19619),$=t(95944);const l={REPAIR_DEFAULT_GOOD:"repair_margin_good_id",SHOP_DEFAULT_GOOD:"shop_margin_good_id",INVOICE_DEFAULT_GOOD:"invoice_margin_good_id",REPAIR_DEFAULT_SERVICE:"repair_margin_service_id",SHOP_DEFAULT_SERVICE:"shop_margin_service_id",INVOICE_DEFAULT_SERVICE:"invoice_margin_service_id",IS_SERVICE_QUANTITY_FROM_DURATION:"is_service_quantity_from_duration"},T="settings/prices",mt=()=>s=>{setTimeout(()=>{var o;(o=s.current)==null||o.scrollIntoView({behavior:"smooth"})},500)};var ut="qaWbC";function It(s){const{type:o,marginId:i}=s,n=(0,Q.wA)(),{ACTIVE_BRANCHES:r,MARGINS:d}=t(91530),a=d.find(({id:m,entityType:u})=>m===i&&u===o),c=r.filter(m=>{var u;return!((u=a==null?void 0:a.branchIds)!=null&&u.includes(m.id))&&!(a!=null&&a.isGlobal)}),S=mt(),I=()=>{(0,dt.p)({dispatch:n,tableName:T,id:i})},v=async m=>{n((0,$.to)(H.BranchModalName,{preloader:()=>n(D.Ay.endpoints.getBranches.initiate({params:{branch_id:m}},{forceRefetch:!0})),condition:({error:u})=>!u,onUpdate:I,onCreate:I,onArchive:I,onDelete:I,onInitModal:S}))};return c.length>0&&(0,e.jsx)(F.o,{color:"grey_50",children:(0,e.jsxs)(h.x6,{children:["This price isn\u2019t available for:"," ",(0,e.jsx)(ct.A,{i18nIsDynamicList:!0,children:c.map((m,u)=>{const A=u===c.length-1;return(0,e.jsx)(lt.A,{type:"link",size:"small",className:ut,onClick:()=>v(m.id),children:`${m.name}${A?"":","}`})})}),". Choose a default price in location settings, or the 'Remember the last one' option will apply automatically."]})})}var Et=(0,E.memo)(It),ht=t(66940),St=t(75522),Ct=t(97717),vt=t(23582),At=t(88586),Rt=t(95176),Dt=t(96159);const Pt=()=>{const{t:s}=(0,h.Bd)();return(0,E.useMemo)(()=>[{field:"title",title:s("Name"),cell:(0,At.x)("title"),width:320,minWidth:320,system:!0},{field:"margin",title:s("Markup, %"),cell:(0,Dt.E)({tpl:"margin"}),width:120,minWidth:120,system:!0,align:"right"},{field:"branchIds",title:s("Locations"),cell:Rt.b,width:160,minWidth:160,system:!0}],[])},Ot=s=>{const{showPriceModal:o,type:i,margins:n}=s,{t:r}=(0,h.Bd)(),d=Pt(),a=n.filter(c=>c.entityType===i);return{name:T,alignKey:"title",countLabel:r("v2 Total"),zeroHeaderMargin:!0,withoutFilters:!0,isBigTable:!1,table:{data:a},addNewButton:{label:r("Price"),onClick:()=>o()},fields:d,onDblClickRow:{cb:()=>c=>o(c),fullData:!0}}};function Nt(s){const{type:o,margins:i,refetch:n}=s,r=(0,Q.wA)(),d=c=>{r((0,$.to)(H.PriceModalName,{data:c,tableName:T,entityType:o,onSave:n,onDelete:n}))};(0,ht.C)(()=>{r((0,vt.pE)({shouldUpdateTable:!0,tableName:T}))},[o,i]);const a=Ot({showPriceModal:d,type:o,margins:i});return(0,e.jsx)(St.Q,{children:(0,e.jsx)(Ct.A,{...a})})}var gt=(0,E.memo)(Nt);const Tt=()=>{const{DEFAULT_MARGINS:{SHOP_MARGIN_GOOD_ID:s,SHOP_MARGIN_SERVICE_ID:o,REPAIR_MARGIN_GOOD_ID:i,REPAIR_MARGIN_SERVICE_ID:n,INVOICE_MARGIN_GOOD_ID:r,INVOICE_MARGIN_SERVICE_ID:d},IS_SERVICE_QUANTITY_FROM_DURATION:a}=t(91530);return{[l.REPAIR_DEFAULT_GOOD]:i,[l.SHOP_DEFAULT_GOOD]:s,[l.INVOICE_DEFAULT_GOOD]:r,[l.REPAIR_DEFAULT_SERVICE]:n,[l.SHOP_DEFAULT_SERVICE]:o,[l.INVOICE_DEFAULT_SERVICE]:d,[l.IS_SERVICE_QUANTITY_FROM_DURATION]:a!=null?a:!1}};var pt="f31IV";function ft(){const{t:s}=(0,h.Bd)(),o=(0,et.W6)(),{[it.A.PERMISSION_COMPANY_BRANCHES]:i}=(0,rt.S)(),n=(0,R.mN)({defaultValues:Tt()}),{formState:{errors:r},handleSubmit:d}=n,{data:{data:a}={data:[]},isLoading:c,refetch:S}=(0,D.Ni)({}),[I,{isLoading:v}]=(0,D.ol)(),[m,{isLoading:u}]=(0,D.eX)(),A=v||u,[P,j]=(0,E.useState)(g.P.SERVICE),V=()=>
1{if(!i){y.Ay.error(s("Access denied. You don\u2019t have required permissions."));return}o.push(M.vc.SETTINGS.BRANCHES)},B=async Ft=>{const{[l.IS_SERVICE_QUANTITY_FROM_DURATION]:Mt,...Ut}=Ft;try{const jt=await I({data:Ut}).unwrap();t(91530).setState(jt);const Vt=await m({data:{[l.IS_SERVICE_QUANTITY_FROM_DURATION]:Mt}}).unwrap();(0,Y.$)(Vt)}catch{return}y.Ay.success(s("Changes saved"))};return(0,e.jsxs)(R.Op,{...n,children:[(0,e.jsxs)(x.tU,{value:P,onChange:j,className:pt,children:[(0,e.jsx)(x.oz,{value:g.P.SERVICE,label:s("Services")}),(0,e.jsx)(x.oz,{value:g.P.PRODUCT,label:s("Products_general")})]}),(0,e.jsx)(C.A,{children:(0,e.jsx)(gt,{type:P,margins:a,refetch:S})}),(0,e.jsx)(F.o,{variant:"subheading1",bottomOffset:8,children:P===g.P.SERVICE?s("Company default prices for services"):s("Company default prices for products")}),(0,e.jsx)(F.o,{color:"grey_50",bottomOffset:16,children:(0,e.jsxs)(h.x6,{children:["Here you can set default prices that will be applied to all locations. For each location, you can specify other default prices on the"," ",(0,e.jsxs)(nt.N_,{to:i?M.vc.SETTINGS.BRANCHES:M.vc.SETTINGS.PRICES,onClick:V,children:["Settings ",">"," Locations page."]})]})}),(0,e.jsx)(at.A,{type:P,description:Et,margins:a,isLoading:c}),(0,e.jsx)(C.A,{forCheckbox:!0,name:l.IS_SERVICE_QUANTITY_FROM_DURATION,errors:r,description:s("For services with time-based units, use the service duration as the initial quantity when adding them to documents."),labelProps:{label:s("Use service duration as quantity"),htmlFor:l.IS_SERVICE_QUANTITY_FROM_DURATION},children:(0,e.jsx)(ot.A,{id:l.IS_SERVICE_QUANTITY_FROM_DURATION,name:l.IS_SERVICE_QUANTITY_FROM_DURATION,disabled:A})}),(0,e.jsx)(C.A,{children:(0,e.jsx)(f.A,{text:s("Save"),onClick:d(B),isLoading:A})})]})}var yt=(0,E.memo)(ft),Gt="zGYDm",U="oRL6x";function Lt(){const{t:s}=(0,h.Bd)();return(0,e.jsxs)(W.f,{children:[(0,e.jsx)(p.B,{title:s("Prices"),rightPartClassName:U,withDivider:!0,children:(0,e.jsx)(k,{})}),(0,e.jsx)(p.B,{title:s("Product and service prices"),description:s("Create prices for services and products across all or selected locations, and define company-wide defaults."),rightPartClassName:U,withDivider:!0,children:(0,e.jsx)(yt,{})}),(0,e.jsx)(p.B,{title:s("Discounts"),rightPartClassName:U,children:(0,e.jsx)(st,{})})]})}var xt=(0,E.memo)(Lt)}}]);
2
3//# sourceMappingURL=13043.5367d2765490ab219bb3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.