1import{N as L,al as V,a3 as K,ak as Y,q as j,c as U,f as e,at as Q,a6 as o,a5 as b,i as T,U as P,a1 as x,S as u,aa as W,K as G,a2 as J,a as f,a8 as X,t as p,as as Z,ax as ee,$ as k,F as te}from"./index-f75dd54b.js";import{B as re,b as ne,a as ae}from"./context-43fcf907.js";import{C as m,c as le,T as c,I as H}from"./createTable-580a55e1.js";import{g as ie}from"./utils-2b128cbc.js";import{l as w}from"./PagesEntry-f3d22274.js";import{P as ue,a as ce}from"./Pagination-0cef1b64.js";import{L as oe}from"./Link-246515ff.js";import{C as de}from"./Card-35133f4e.js";import{c as ge}from"./createDropdownState-3f122f26.js";import{D as O}from"./DropMenu-3e944618.js";import{T as me}from"./TextInput-04c4dd73.js";import{A as $}from"./ActionButton-5de514a9.js";import{T as z}from"./Tag-346ec638.js";import{D as se}from"./DeliveryRequestDialog-39de824b.js";import"./Skeleton-792c755e.js";import"./Checkbox-d537db11.js";import"./dashboard.data-a937925e.js";import"./createInteractOutside-50610e11.js";const he=p("<form>"),Se=p("<a>"),M=p("<br>"),fe=p("<div><br>"),C=[{name:"Vorgangs- oder Belegnummer",value:"documentNo"},{name:"Artikel/EAN/LAN",value:"numbers"},{name:"Kommission",value:"remark"},{name:"Artikelbezeichnung",value:"description"}],Ee=n=>{let r;const s=()=>{let l=[];
1return C.forEach(g=>{(n.activeScope.includes(g.value)||n.activeScope.length===0)&&l.push(g.name)}),l.join(", ")};function _(){n.setSearch(""),r.focus()}const{triggerProps:v,dropdownProps:E}=ge(),d=l=>{const{setScope:g,activeScope:D}=n;D.includes(l)?g(h=>[...h.filter(R=>R!==l)]):g(h=>[...h,l])};return e(me,{ref(l){const g=r;typeof g=="function"?g(l):r=l},size:"sm",full:!0,type:"text",name:"searchParam",get placeHolder(){return s()},onValueChange:l=>n.setSearch(l),get value(){return n.search},endAdornment:()=>e(H,{alignY:"center",get children(){return[e(u,{get when(){return n.search.length>0},keyed:!0,get children(){return e($,{icon:"Close",size:"sm",onClick:()=>_()})}}),e(P,k({size:"sm",variant:"silent",get iconRight(){return e(x,{icon:"SelectArrow"})}},v,{get children(){return e(u,{get when(){return C.length!==n.activeScope.length&&n.activeScope.length!==0},fallback:"Alle Felder",get children(){return[f(()=>n.activeScope.length)," Felder"]}})}})),e(O,k(E,{placement:"bottom-end",get children(){return e(te,{each:C,children:l=>e(O.CheckboxItem,{get isChecked(){return n.activeScope.includes(l.value)},onCheckedChanged:g=>d(l.value),get children(){return l.name}})})}}))]}})})};function Pe(n){var A;const r=L(),{residues:s}=V(),{customerMode:_}=K(),v=[{id:"document",title:r("RESIDUES_DOCUMENT"),width:m.numeric,responsive:{label:!0,orientation:"horizontal"}},{id:"title",title:r("RESIDUES_TITLE"),width:m.textLong,responsive:{title:!1,divider:!0}},{id:"articleNumber",title:r("ARTICLE_NO"),width:m.textShort,responsiveOnly:!0,responsive:{label:!0,orientation:"horizontal"}},{id:"mpn",title:r("ARTICLE_MPN"),width:m.textShort,responsiveOnly:!0,responsive:{label:!0,orientation:"horizontal"}},{id:"ordered_amount",title:r("RESIDUES_ORDERED_AMOUNT"),width:m.numeric,responsive:{label:!0,orientation:"horizontal"}},{id:"delivered_amount",title:r("RESIDUES_DELIVERED_AMOUNT"),width:m.numeric,responsive:{label:!0,orientation:"horizontal"}},{id:"delivery_estimation",title:r("RESIDUES_DELIVERY_ESTIMATION"),width:m.date,responsive:{label:!0,orientation:"horizontal"}},{id:"remark",title:r("RESIDUES_REMARK"),width:m.textShort,responsive:{orientation:"vertical",label:!0}},{id:"total",title:r("RESIDUES_TOTAL"),width:m.numeric,responsive:{label:!0,orientation:"horizontal"}}],E=le({columns:()=>v,items:()=>s.data.list,selectable:!1,itemKey:a=>a.id,canOpen:a=>!1}),[d,F]=Y(),l=j(),[g,D]=U((d==null?void 0:d.searchParam)||""),[h,R]=U(((A=d==null?void 0:d.searchScope)==null?void 0:A.split(","))||[...C.map(a=>a.value)]),q=a=>{a.preventDefault();let t={};const S=new FormData(a.currentTarget);S.get("searchParam")&&(t.searchParam=S.get("searchParam")),h().length!==C.length&&(t.searchScope=h().join(",")),l(w("document_residues",{query:t}))},B=()=>e(Z,{severity:"info",size:"lg",withIcon:!1,get children(){return r("DOCUMENT_SEARCH_NO_RESULT")}});return e(u,{get when(){return s.data},get children(){return[e(re,{level:1,id:"document_residues",get href(){return w("document_residues")},get name(){return r("DOCUMENT_RESIDUES")}}),e(ne,{get label(){return r("DOCUMENT_RESIDUES")},get children(){return e(Q,{get children(){return e(o,{variant:"heading",size:"lg",bold:!0,get children(){return r("DOCUMENT_RESIDUES")}})}})}}),e(ae,{}),e(b,{gap:"lg",get children(){return[e(de,{get children(){const a=he();return a.addEventListener("submit",q),T(a,e(b,{direction:"row",gap:"md","sm-direction":"column",get children(){return[e(Ee,{get activeScope(){return h()},setScope:R,get search(){return g()},setSearch:D}),e(P,{size:"sm",variant:"primary",type:"submit",get iconRight(){return e(x,{icon:"Search"})},get children(){return r("SEARCH")}})]}})),a}}),e(u,{get when(){return s.data},children:a=>e(u,{get when(){return a().total>0},get fallback(){return e(B,{})},get children(){return[e(c,{table:E,get children(){return[e(c.Heading,{get children(){return e(b,{direction:"row",justifyContent:"space-between",alignItems:"center",get children(){return e(ue,{size:"md",get total(){return a().total},get offset(){return a().pagination.offset},get limit(){return a().pagination.limit},get entityName(){return r("RESIDUES_ENTITIES")}})}})}}),e(c.Content,{get children(){return e(u,{get when(){return!s.isFetching},fallback:()=>e(c.Placeholder,{amount:24}),get children(){return e(c.Items,{children:(t,S)=>e(c.Row,{item:t,key:S,get children(){return[e(c.Cell,{columnId:"document",class:"cell-with-tag",get children(){return[e(u,{get when(){return t.documentId},fallback:()=>e(o,{get children(){return t.documentNo}}),get children(){return e(oe,{get href(){return ie("order",t.documentNo)},get children(){return t.documentNo}})}}),e(u,{get when(){var i;return t.document!==void 0&&((i=t.document)==null?void 0:i.orderType)==="Auftrag"},get children(){return e(z,{variant:"info",get children(){return r("DOCUMENT_TYPE_ORDER")}})}}),e(u,{get when(){var i;return t.document!==void 0&&((i=t.document)==null?void 0:i.orderType)==="R-Schein"},get children(){return e(z,{variant:"neutral",get children(){return r("DOCUMENT_R_SCHEIN")}})}})]}}),e(c.Cell,{columnId:"title",get children(){return e(b,{direction:"row",gap:"md",get children(){return[e(W,{width:76,get src(){var i;return(i=t==null?void 0:t.article)==null?void 0:i.icon}}),(()=>{const i=fe(),N=i.firstChild;return T(i,e(u,{get when(){var I;return(I=t.article)==null?void 0:I.link},fallback:()=>[e(o,{size:"lg",get children(){return t.title}}
1),M()],get children(){return[(()=>{const I=Se();return T(I,e(o,{bold:!0,size:"lg",get children(){return t.title}})),G(()=>{var y;return J(I,"href",(y=t==null?void 0:t.article)==null?void 0:y.link)}),I})(),M()]}}),N),T(i,e(o,{color:"primary",get children(){return t.subtitle}}),N),T(i,e(H,{class:"hidden-t hidden-m",get children(){return[e(o,{get children(){return[f(()=>r("ARTICLE_NO")),":Â ",e(o,{bold:!0,get children(){return t.articleNo}})]}}),e(u,{get when(){return t.manufacturerArticleNo},get children(){return e(o,{get children(){return[f(()=>r("ARTICLE_MPN_SHORT")),":Â ",e(o,{bold:!0,get children(){return t.manufacturerArticleNo}})]}})}})]}}),null),i})()]}})}}),e(c.Cell,{columnId:"articleNumber",get children(){return e(o,{bold:!0,get children(){return t.articleNo}})}}),e(c.Cell,{columnId:"mpn",get children(){return e(o,{bold:!0,get children(){return t.manufacturerArticleNo}})}}),e(c.Cell,{columnId:"ordered_amount",get children(){return e(u,{get when(){return t.orderedAmount},get children(){return e(o,{get children(){return[f(()=>t.orderedAmount)," ",f(()=>t.amountUnit.description)]}})}})}}),e(c.Cell,{columnId:"delivered_amount",get children(){return e(u,{get when(){return typeof t.deliveredAmount=="number"},get children(){return e(o,{get children(){return[f(()=>t.deliveredAmount)," ",f(()=>t.amountUnit.description)]}})}})}}),e(c.Cell,{columnId:"delivery_estimation",get children(){return[e(u,{get when(){return t.termInfo},fallback:"-",get children(){return t.termInfo}}),e(Ie,{position:t})]}}),e(c.Cell,{columnId:"remark",get children(){return t.remark}}),e(c.Cell,{columnId:"total",get children(){return e(u,{get when(){return!_()},get children(){return e(o,{bold:!0,get children(){var i;return X((i=t.itemValue)==null?void 0:i.total)}})}})}})]}})})}})}})]}}),e(b,{alignItems:"center",get children(){return e(ce,{get total(){return a().total},get pageSize(){var t;return(t=a().pagination)==null?void 0:t.limit},get pageIndex(){var t,S;return parseInt(d==null?void 0:d.pageNr)||((S=(t=a())==null?void 0:t.pagination)==null?void 0:S.current)},buildHref:t=>w("document_residues",{query:{...d,pageNr:t}})})}})]}})})]}})]}})}const Ie=n=>{const{open:r,setOpen:s,modalProps:_}=ee(),v=L();return e(u,{get when(){var E;return n.position.document!==void 0&&((E=n.position.document)==null?void 0:E.orderType)==="Auftrag"},get children(){return[e($,{class:"",size:"sm",get title(){return v("DOCUMENT_FEEDBACK_DELIVERY_DATE_REQUEST_TITLE")},onClick:()=>s(!0),icon:"CalendarWarning"}),e(se,{get open(){return r()},modalProps:_,get id(){return n.position.document.id},get documentType(){return n.position.document.type},get number(){return n.position.document.title},get position(){return n.position},requestType:"date"})]}})};export{Pe as default};
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.