PageSourceSearch

https://magnito.ir/assets/TradeAccounting-DW4ksCOc.js

js magnito.ir collected 2026-10-05 03:55:30 UTC 4,950 bytes, 1 lines download raw bytes

1import{r,j as s,N as y,bJ as C,bL as f,av as R,an as O,ar as P}from"./vendor-BfMWLsNp.js";import{u as S,n as T,o as z,H as j,j as g,S as A}from"./index-dvlLwTFf.js";import{S as M}from"./SlidingTabs-Dws7-wwg.js";import{P as $}from"./PaymentDocsPanel-DKj1X9L5.js";import{R as I}from"./ReleaseCargoModal-BN5lndlq.js";import{O as q}from"./OrderProgress-CY1cYl9M.js";import{u as L,f as E}from"./useAccordion-DUTYZeAt.js";import{w as F,s as B}from"./tradeModel-BZkdY0Sn.js";import"./query-BGFRPW9A.js";import"./FileUpload-A1orN8gR.js";import"./money-X5as0cTg.js";import"./orderModel-Duz1k1x8.js";import"./SchemaForm-BiL5USTi.js";import"./Switch-D20CiSOX.js";import"./JalaliDatePicker-DfzpD83Q.js";import"./NumberField-B0I2EUBh.js";import"./SearchableSelect-CPKfRTW4.js";import"./SubmitReason-DbNLo7gl.js";function ne(){const{user:N}=S(),o=e=>A(N?.sections,e),{data:d=[],isLoading:b}=T(),{data:m=[]}=z(),v=r.useMemo(()=>{const e=new Map;for(const t of m){const c=e.get(t.orderId??"");c?c.push(t):e.set(t.orderId??"",[t])}return e},[m]),[a,k]=r.useState("invoice"),[n,x]=r.useState(""),[p,u]=r.useState(null),i=r.useMemo(()=>{const e=d.filter(t=>!t.projected&&t.status!=="cancelled"&&t.outcome!=="lost");return{invoice:e.filter(t=>(t.inspectedTonnage??0)>0&&!t.invoiceNo),release:e.filter(t=>!!t.invoiceNo&&(t.releaseRemaining??0)>.001)}},[d]),l=r.useMemo(()=>{const e=j(n.trim());return i[a].filter(t=>!e||j(`${t.product} ${t.orderNo??""} ${t.customerName??""}`).includes(e))},[i,a,n]),h=L(E(l)),w=e=>B(e,v.get(e.id)??[],"payment-docs");return s.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(y,{size:22,className:"text-[#e0a06f]"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-white text-xl font-black",children:"حسابداریِ معاملاتی"}),s.jsx("p",{className:"text-[#566275] text-xs",children:"صدورِ فاکتور و آزادسازیِ بارِ سفارش‌های معاملاتی."})]})]}),s.jsx(M,{items:[{key:"invoice",label:"آمادهٔ صدور فاکتور",icon:C,badge:i.invoice.length||void 0},{key:"release",label:"آمادهٔ آزادسازی",icon:f,badge:i.release.length||void 0}],active:a,onChange:e=>k(e)}),s.jsxs("div",{className:"flex items-center gap-2 neu-inset rounded-xl px-3 py-2 my-3",children:[s.jsx(R,{size:15,className:"text-[#566275] flex-shrink-0"}),s.jsx("input",{value:n,onChange:e=>x(e.target.value),placeholder:"جستجو: محصول، شمارهٔ سفارش، مشتری…",className:"flex-1 min-w-0 bg-transparent text-white text-sm outline-none placeholder-[#44515f]"}),n&&s.jsx("button",{onClick:()=>x(""),className:"text-[#7a8a9c]",children:s.jsx(O,{size:15})})]}),b?s.jsxs("div",{className:"text-[#566275] text-sm py-12 text-center",children:[s.jsx(P,{size:16,className:"animate-spin inline"})," در حال بارگذاری…"]}):l.length===0?s.jsx("div",{className:"text-center py-14 text-[#7a8a9c] text-sm leading-7",children:a==="invoice"?"سفارشی که کالایش تایید شده باشد اینجا منتظرِ فاکتور می‌ماند.":"سفارشی که فاکتورش صادر شده و تناژِ قابلِ آزادسازی دارد اینجا می‌آید."}):s.jsx("div",{className:"space-y-2.5",children:l.map(e=>{const t=F(e.side),c=h.isOpen(e.id);return s.jsxs("div",{className:"neu-card rounded-2xl overflow-hidden","data-order-toggle":e.id,children:[s.jsxs("button",{onClick:()=>h.toggle(e.id),className:"w-full text-right px-3.5 py-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"block text-white text-sm font-black truncate",children:[e.product,e.grade?` · ${e.grade}`:""]}),s.jsxs("span",{className:"block text-[#7a8a9c] text-[11px] truncate mt-0.5",children:[s.jsx("span",{dir:"ltr",children:e.orderNo})," · ",t.order,e.customerName?` · ${e.customerName}`:""]})]}),s.jsxs("span",{className:"text-left flex-shrink-0",children:[s.jsx("span",{className:"block text-emerald-400 text-sm font-black tabular-nums",children:g(a==="invoice"?e.inspectedTonnage??0:e.releaseRemaining??0)}),s.jsx("span",{className:"block text-[#566275] text-[10px]",children:a==="invoice"?"تنِ تاییدشده":"تنِ قابلِ آزادسازی"})]})]}),s.jsx("div",{className:"mt-2.5",children:s.jsx(q,{order:e,compact:!0})})]}),c&&s.jsxs("div",{className:"px-3.5 pb-3.5 border-t border-[#2c3542] pt-3 space-y-2.5",children:[s.jsx($,{order:e,may:o,blocked:w(e)}),a==="release"&&o("trade-release")&&s.jsxs("button",{onClick:()=>u(e),className:"w-full inline-flex items-center justify-center gap-1.5 btn-ember text-xs font-bold rounded-xl py-2.5",children:[s.jsx(f,{size:14})," آزادسازیِ بار — ",g(e.releaseRemaining??0)," تن ممکن"]})]})]},e.id)})}),p&&s.jsx(I,{order:p,onClose:()=>u(null)})]})}export{ne 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.