PageSourceSearch

https://b2b.sweehing.com.my/build/assets/columns-C9QbgLfW.js

js sweehing.com.my collected 2026-10-04 14:06:23 UTC 2,595 bytes, 1 lines download raw bytes

1import{j as t,S as s}from"./app-sePEkTLw.js";import{D as n}from"./data-table-actions-J-RWnr4k.js";import{B as o}from"./badge-B20EKH-5.js";import{S as c}from"./sortable-header-DSUWNb7m.js";import{C as u}from"./circle-check-big-B1fvzMr7.js";/* empty css            */import"./button-CLMNZ1jK.js";import"./dialog-eWPjQLBQ.js";import"./index-BjYeLQoY.js";import"./chevrons-up-down-znIMtJWa.js";function d(r){var a,e,l;return[((a=r.tyre_brand)==null?void 0:a.name)??r.brand_other,((e=r.tyre_size)==null?void 0:e.value)??r.tyre_size_other,(l=r.rim_diameter)!=null&&l.value?`R${r.rim_diameter.value}`:null].filter(Boolean).join(" / ")||"-"}function m(r,i){const a=i.find(e=>e.value===r);return(a==null?void 0:a.label)??r}function S(r,i){return[{accessorKey:"created_at",header:({column:e})=>t.jsx(c,{column:e,title:"Date"}),cell:({row:e})=>new Date(e.original.created_at).toLocaleDateString("sv-SE")},{accessorKey:"marketplace_tyre",header:"Tyre",cell:({row:e})=>d(e.original.marketplace_tyre)},{accessorKey:"marketplace_tyre.batch_no",header:"Batch",cell:({row:e})=>e.original.marketplace_tyre.batch_no?`${e.original.marketplace_tyre.batch_no} ${e.original.marketplace_tyre.batch_week?`(Week ${e.original.marketplace_tyre.batch_week})`:""}`:"-"},{accessorKey:"qty",header:()=>t.jsx("div",{children:"Qty"}),cell:({row:e})=>e.original.qty},...i==="buy"?[{accessorKey:"unit_selling_price",header:()=>t.jsx("div",{children:"Unit Purchase Price"}),cell:({row:e})=>t.jsxs("div",{children:["RM ",Number(e.original.unit_selling_price).toFixed(2)]})}]:[],...i==="sell"?[{accessorKey:"unit_purchase_price",header:()=>t.jsx("div",{children:"Unit Selling Price"}),cell:({row:e})=>t.jsxs("div",{children:["RM ",Number(e.original.unit_purchase_price).toFixed(2)]})}]:[],{accessorKey:"sub_total",header:({column:e})=>t.jsx(c,{column:e,title:"Sub Total"}),cell:({row:e})=>{const l=i==="sell"?e.original.qty*Number(e.original.unit_purchase_price):Number(e.original.sub_total);return t.jsxs("div",{children:["RM ",l.toFixed(2)]})}},{accessorKey:"status",header:"Status",cell:({row:e})=>t.jsx(o,{variant:e.original.status==="Pending"?"secondary":e.original.status==="Completed"?"success":"destructive",children:m(e.original.status,r)})},...i==="sell"?[{id:"action",header:"",cell:({row:e})=>{const l=e.original;return l.status==="Pending"?t.jsx(n,{mainActions:[{title:"Complete",icon:u,onClick:()=>{confirm("Mark this sale as completed? Stock will be deducted from your listing.")&&s.post(route("public.marketplace.transaction.complete",l.id),{},{preserveScroll:!0})}}]}):null}}]:[]]}export{S as getTransactionColumns};

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.