PageSourceSearch

https://client.apikurir.id/_next/static/chunks/pages/postpaid-invoice-0fe7d3d43f9ca09e.js

js apikurir.id collected 2026-10-02 06:30:21 UTC 15,634 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5290],{55406:function(e,a,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/postpaid-invoice",function(){return l(68040)}])},15135:function(e,a,l){"use strict";var t=l(85893);a.Z=function(e){let{children:a}=e;return(0,t.jsx)("div",{class:"mx-auto container",children:(0,t.jsx)("div",{class:"flex flex-col gap-y-4",children:a})})}},70850:function(e,a,l){"use strict";var t=l(85893),i=l(28611),n=l(27484),s=l.n(n);let r=e=>{let{value:a,onChange:l,style:n={},className:r=""}=e,o=[{label:"Yesterday",value:[s()().add(-1,"d"),s()().add(-1,"d")]},{label:"Today",value:[s()(),s()()]},{label:"This Month",value:[s()().startOf("month"),s()()]},{label:"Last Month",value:[s()().add(-1,"month").startOf("month"),s()().add(-1,"month").endOf("month")]},{label:"Last 7 Days",value:[s()().add(-7,"d"),s()()]},{label:"Last 14 Days",value:[s()().add(-14,"d"),s()()]},{label:"Last 30 Days",value:[s()().add(-30,"d"),s()()]},{label:"Last 90 Days",value:[s()().add(-90,"d"),s()()]}];return(0,t.jsx)(i.Z.RangePicker,{className:r,style:n,value:a,onChange:l,presets:o})};a.Z=r},50349:function(e,a,l){"use strict";var t=l(85893),i=l(83473),n=l(7851),s=l(76920),r=l(67294);let o=(0,r.forwardRef)((e,a)=>{let{url:l,search:o,pageSize:d=10,className:c,rowKey:u,pageSizeOptions:h=[10,20,50,100],setCustomLoading:p=()=>{},onLoad:m}=e,x={current:1,pageSize:d,pageSizeOptions:h,showSizeChanger:!0,showTotal:e=>"Total ".concat((0,i.W_)(e))},[v,f]=(0,r.useState)([]),[j,g]=(0,r.useState)(!1),[Z,y]=(0,r.useState)({pagination:x}),b=(e,a,l)=>{y({pagination:e,filters:a,...l})},S=()=>{g(!0),p&&p(!0),l&&n.api.get(l,{params:{search:JSON.stringify(o),current:Z.pagination.current,pageSize:Z.pagination.pageSize,sort:Z.field?"".concat(Z.field,":").concat(Z.order||"descend"):void 0}}).then(e=>{let{data:a,total:l}=e.data;g(!1),p&&p(!1),f(a),m&&"function"==typeof m&&m(e.data),y({...Z,pagination:{...x,...Z.pagination,total:l}})}).catch(e=>{g(!1),p&&p(!1)})};(0,r.useEffect)(()=>{S()},[Z.field,Z.order,Z.pagination.current,Z.pagination.pageSize]);let w=(0,r.useRef)(!0);return(0,r.useEffect)(()=>{if(w.current){w.current=!1;return}Z.pagination.current>1?y(e=>({...e,pagination:{...e.pagination,current:1}})):S()},[o,l]),a&&(a.reload=S,a.loading=j),(0,t.jsx)("div",{className:c,children:(0,t.jsx)(s.Z,{...e,rowKey:e=>"function"==typeof u?u(e):e.id||e._id,pagination:Z.pagination,dataSource:v,loading:j,onChange:b,scroll:{x:!0}})})});a.Z=o},68040:function(e,a,l){"use strict";l.r(a),l.d(a,{default:function(){return D}});var t=l(85893),i=l(67294),n=l(9008),s=l.n(n),r=l(75556),o=l(15135),d=l(83473),c=l(59734),u=l(92477),h=l(26855),p=l(71577),m=l(26713),x=l(73016),v=l(4393),f=l(34041),j=l(27484),g=l.n(j),Z=l(50349),y=l(70850),b=l(7851);l(62616);var S=function(e){let{destroy:a,useMutate:l}=e,[n]=u.Z.useForm(),[s,r]=(0,i.useState)(!1),[o,m]=(0,i.useState)(!1),[x,v]=(0,i.useState)(""),[j,g]=(0,i.useState)([]),Z=e=>{v(e)},{data:S,error:w}=(0,c.ZP)(["".concat(d.v2,"/api/user/member/search?q=").concat(x,"&postpaid=1"),(0,b.getAccessToken)()],d._i);return(0,i.useEffect)(()=>{if(null==S?void 0:S.data){var e;let a=null==S?void 0:null===(e=S.data)||void 0===e?void 0:e.map(e=>({value:e.id,label:"".concat(e.name," - ").concat(e.email," - ").concat(e.phone)}));g(a)}},[S]),(0,t.jsxs)(u.Z,{form:n,layout:"vertical",onFinish:function(){n.validateFields().then(e=>{r(!0),b.api.post("/api/postpaid/proforma",e).then(e=>{l(),r(!1),a()}).catch(e=>{var a;let{response:l}=e;(null==l?void 0:null===(a=l.data)||void 0===a?void 0:a.message)&&h.Z.warning({message:null==l?void 0:l.data.message}),r(!1)})})},children:[(0,t.jsx)(u.Z.Item,{name:"type",label:"Jenis Invoice",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsxs)(f.Z,{placeholder:"Semua Transaksi",children:[(0,t.jsx)(f.Z.Option,{value:"reconsiliation",children:"Rekonsiliasi COD"}),(0,t.jsx)(f.Z.Option,{value:"bill",children:"Tagihan Ongkir"})]})}),(0,t.jsx)(u.Z.Item,{name:"user",label:"Seller",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsx)(f.Z,{showSearch:!0,placeholder:"Ketikan Nama/No.HP/Email Seller",optionFilterProp:"children",loading:!S&&!w,dropdownMatchSelectWidth:!1,allowClear:!0,onSearch:Z,name:"user",filterOption(e,a){var l;return(null!==(l=null==a?void 0:a.label)&&void 0!==l?l:"").toLowerCase().includes(e.toLowerCase())},options:j})}),(0,t.jsx)(u.Z.Item,{name:"date",label:"Tanggal",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsx)(y.Z,{})}),(0,t.jsx)("div",{className:"modal-form-button",children:(0,t.jsx)(p.ZP,{type:"primary",disabled:o,loading:s,htmlType:"submit",children:"Export Invoice"})})]})},w=l(48702),k=l(30381),C=l.n(k),P=function(){let e=(0,i.useRef)(),{showModal:a}=(0,i.useContext)(w.Z),[l]=u.Z.useForm(),n={status:"",createdAt:[g()().subtract(1,"month"),g()()]},[s,r]=(0,i.useState)(n),j=()=>{e.reload()},k=e=>{let a=e.type.includes("bill")?"bill":"recon";b.api.post("/api/attachment",{file:"postpaid/".concat(a,"-").concat(e.no_invoice,".xlsx")}).then(e=>{window.open(e.data.url,"_blank")}
1).catch(()=>{h.Z.error({message:"File Tidak Ditemukan"})})},[P,I]=(0,i.useState)(""),[O,N]=(0,i.useState)([]),T=e=>{I(e)},{data:F,error:M}=(0,c.ZP)(["".concat(d.v2,"/api/user/member/search?q=").concat(P,"&postpaid=1"),(0,b.getAccessToken)()],d._i);return(0,i.useEffect)(()=>{if(null==F?void 0:F.data){var e;let a=null==F?void 0:null===(e=F.data)||void 0===e?void 0:e.map(e=>({value:e.id,label:"".concat(e.name," - ").concat(e.email," - ").concat(e.phone)}));N(a)}},[F]),(0,t.jsx)(o.Z,{children:(0,t.jsx)(v.Z,{title:"Invoice Proforma",children:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(u.Z,{form:l,initialValues:n,onValuesChange:function(e){let a=l.getFieldsValue();e.search?setTimeout(()=>{let e=l.getFieldsValue();r(e)},1e3):r(a)},children:(0,t.jsxs)("div",{className:"flex sm:gap-4 gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex sm:gap-4 gap-2 flex-auto flex-wrap",children:[(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"status",children:(0,t.jsxs)(f.Z,{placeholder:"Semua Status",children:[(0,t.jsx)(f.Z.Option,{value:"",children:"Semua Status"}),(0,t.jsx)(f.Z.Option,{value:"Waiting",children:"Waiting"}),(0,t.jsx)(f.Z.Option,{value:"Pending",children:"Pending"}),(0,t.jsx)(f.Z.Option,{value:"Complete",children:"Ready"}),(0,t.jsx)(f.Z.Option,{value:"Expired",children:"Expired"}),(0,t.jsx)(f.Z.Option,{value:"Cancel",children:"Cancel"})]})}),(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"createdAt",children:(0,t.jsx)(y.Z,{})}),(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"user",children:(0,t.jsx)(f.Z,{showSearch:!0,placeholder:"Ketikan Nama/No.HP/Email Seller",optionFilterProp:"children",loading:!F&&!M,dropdownMatchSelectWidth:!1,allowClear:!0,onSearch:T,name:"user",filterOption(e,a){var l;return(null!==(l=null==a?void 0:a.label)&&void 0!==l?l:"").toLowerCase().includes(e.toLowerCase())},options:O})})]}),(0,t.jsx)("div",{className:"flex sm:gap-4 gap-2 flex-none flex-wrap",children:(0,t.jsx)(p.ZP,{onClick:function(){let{destroy:e,update:l}=a();l({title:"Generate Proforma",closable:!0,width:500,content:(0,t.jsx)(S,{useMutate:j,destroy:e}),icon:null,maskClosable:!0,okButtonProps:{style:{display:"none"}}})},type:"primary",children:"Generate Proforma"})})]})}),(0,t.jsx)(Z.Z,{ref:e,size:"small",columns:[{title:"No. Transaction",dataIndex:"no_invoice",key:"no_invoice",render:(e,a)=>(0,t.jsxs)(i.Fragment,{children:[(0,t.jsx)("div",{children:e}),"Complete"==a.status&&(0,t.jsx)(p.ZP,{danger:!0,type:"dashed",size:"small",onClick:()=>k(a),children:"Download File"})]})},{title:"Tipe",dataIndex:"type",key:"type",render(e,a){var l,i;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{children:e.includes("bill")?"Tagihan Ongkir":"Rekonsiliasi COD"}),(0,t.jsxs)("div",{className:"whitespace-nowrap",children:[C()(null==a?void 0:null===(l=a.metadata)||void 0===l?void 0:l.from).format("DD MMM YYYY")," - ",C()(null==a?void 0:null===(i=a.metadata)||void 0===i?void 0:i.to).format("DD MMM YYYY")]})]})}},{title:"User",dataIndex:"xuser",key:"xuser",render:e=>(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{children:e.name}),(0,t.jsx)("div",{children:e.email}),(0,t.jsx)("div",{children:e.phone})]})},{title:"Status",dataIndex:"status",key:"status",render:e=>"Complete"==e?"Ready":e},{title:"Tanggal",dataIndex:"createdAt",key:"createdAt",render:(e,a)=>(0,t.jsx)(i.Fragment,{children:(0,t.jsx)(m.Z,{direction:"vertical",size:0,children:(0,t.jsx)(x.Z.Text,{children:g()(e).format("dddd, DD MMM YYYY")})})})}],url:"/api/postpaid/proforma",search:s})]})})})},I=l(11486),O=l(45036),N=l(88484),T=function(e){let{destroy:a,useMutate:l}=e,[n]=u.Z.useForm(),[s,r]=(0,i.useState)(!1),[o,m]=(0,i.useState)(!1),[x,v]=(0,i.useState)(null),[j,g]=(0,i.useState)(""),[Z,S]=(0,i.useState)([]),w=e=>{g(e)},{data:k,error:C}=(0,c.ZP)(["".concat(d.v2,"/api/user/member/search?q=").concat(j,"&postpaid=1"),(0,b.getAccessToken)()],d._i);(0,i.useEffect)(()=>{if(null==k?void 0:k.data){var e;let a=null==k?void 0:null===(e=k.data)||void 0===e?void 0:e.map(e=>({value:e.id,label:"".concat(e.name," - ").concat(e.email," - ").concat(e.phone)}));S(a)}},[k]);let P=e=>Array.isArray(e)?e:null==e?void 0:e.fileList,T=e=>{v(e.fileList)};return(0,t.jsxs)(u.Z,{form:n,layout:"vertical",onFinish:function(){n.validateFields().then(e=>{r(!0),e.file=x;let t=new FormData;t.set("type",e.type),t.set("note",e.note),t.set("user",e.user),t.set("from",e.date[0]),t.set("to",e.date[1]),t.set("file",e.file[0].originFileObj),(0,b.api)({method:"post",url:"/api/postpaid/invoice",data:t,headers:{"Content-Type":"multipart/form-data",Accept:"application/json"}}).then(e=>{l(),r(!1),a()}).catch(e=>{var a;let{response:l}=e;(null==l?void 0:null===(a=l.data)||void 0===a?void 0:a.message)&&h.Z.warning({message:null==l?void 0:l.data.message}),r(!1)})})},children:[(0,t.jsx)(u.Z.Item,{name:"type",label:"Jenis Invoice",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsxs)(f.Z,{placeholder:"Semua Transaksi",children:[(0,t.jsx)(f.Z.Option,{value:"reconsiliation",children:"Rekonsiliasi COD"}),(0,t.jsx)(f.Z.Option,{value:"bill",children:"Tagihan Ongkir"})]})}),(0,t.jsx)(u.Z.Item,{name:"user",label:"Seller",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsx)(f.Z,{showSearch:!0,placeholder:"Ketikan Nama/No.HP/Email Seller",optionFilterProp:"children",loading:!k&&!C,dropdownMatchSelectWidth:!1,allowClear:!0,onSearch:w,name:"user",filterOption(e,a){var l;return(null!==(l=null==a?void 0:a.label)&&void 0!==l?l:"").toLowerCase().includes(e.toLowerCase())},options:Z})}),(0,t.jsx)(u.Z.Item,{name:"date",label:"Tanggal",rules:[{required:!0,message:"${label} harus diisi"}],children:(0,t.jsx)(y.Z,{})}),(0,t.jsx)(u.Z.Item,{name:"note",label:"Catatan",children:(0,t.jsx)(I.Z,{placeholder:"Catatan"})}),(0,t.jsx)(u.Z.Item,{name:"file",label:"Upload File",valuePropName:"fileList",getValueFromEvent:P,rules:[{required:!0,message:"${label} harus di isi"}],children:(0,t.jsx)(O.Z,{name:"logo",maxCount:1,onChange:T,children:(0,t.jsx)(p.ZP,{icon:(0,t.jsx)(N.Z,{}),children:"Upload File"})})}),(0,t.jsx)("div",{className:"modal-form-button",children:(0,t.jsx)(p.ZP,{type:"primary",disabled:o,loading:s,htmlType:"submit",children:"Upload Invoice"})})]})},F=function(){let e=(0,i.useRef)(),{showModal:a}=(0,i.useContext)(w.Z),[l]=u.Z.useForm(),n={status:"",createdAt:[g()().subtract(1,"month"),g()()]},[s,r]=(0,i.useState)(n),j=()=>{e.reload()},S=e=>{let a=e.type.includes("bill")?"bill":"recon";b.api.post("/api/attachment",{file:"postpaid-final/".concat(a,"-").concat(e.no_invoice,".xlsx")}).then(e=>{window.open(e.data.url,"_blank")}
1).catch(()=>{h.Z.error({message:"File Tidak Ditemukan"})})},[k,P]=(0,i.useState)(""),[I,O]=(0,i.useState)([]),N=e=>{P(e)},{data:F,error:M}=(0,c.ZP)(["".concat(d.v2,"/api/user/member/search?q=").concat(k,"&postpaid=1"),(0,b.getAccessToken)()],d._i);return(0,i.useEffect)(()=>{if(null==F?void 0:F.data){var e;let a=null==F?void 0:null===(e=F.data)||void 0===e?void 0:e.map(e=>({value:e.id,label:"".concat(e.name," - ").concat(e.email," - ").concat(e.phone)}));O(a)}},[F]),(0,t.jsx)(o.Z,{children:(0,t.jsx)(v.Z,{title:"Invoice Proforma",children:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(u.Z,{form:l,initialValues:n,onValuesChange:function(e){let a=l.getFieldsValue();e.search?setTimeout(()=>{let e=l.getFieldsValue();r(e)},1e3):r(a)},children:(0,t.jsxs)("div",{className:"flex sm:gap-4 gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex sm:gap-4 gap-2 flex-auto flex-wrap",children:[(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"status",children:(0,t.jsxs)(f.Z,{placeholder:"Semua Status",children:[(0,t.jsx)(f.Z.Option,{value:"",children:"Semua Status"}),(0,t.jsx)(f.Z.Option,{value:"Waiting",children:"Waiting"}),(0,t.jsx)(f.Z.Option,{value:"Pending",children:"Pending"}),(0,t.jsx)(f.Z.Option,{value:"Complete",children:"Ready"}),(0,t.jsx)(f.Z.Option,{value:"Expired",children:"Expired"}),(0,t.jsx)(f.Z.Option,{value:"Cancel",children:"Cancel"})]})}),(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"createdAt",children:(0,t.jsx)(y.Z,{})}),(0,t.jsx)(u.Z.Item,{noStyle:!0,name:"user",children:(0,t.jsx)(f.Z,{showSearch:!0,placeholder:"Ketikan Nama/No.HP/Email Seller",optionFilterProp:"children",loading:!F&&!M,dropdownMatchSelectWidth:!1,allowClear:!0,onSearch:N,name:"user",filterOption(e,a){var l;return(null!==(l=null==a?void 0:a.label)&&void 0!==l?l:"").toLowerCase().includes(e.toLowerCase())},options:I})})]}),(0,t.jsx)("div",{className:"flex sm:gap-4 gap-2 flex-none flex-wrap",children:(0,t.jsx)(p.ZP,{onClick:function(){let{destroy:e,update:l}=a();l({title:"Upload Invoice",closable:!0,width:500,content:(0,t.jsx)(T,{useMutate:j,destroy:e}),icon:null,maskClosable:!0,okButtonProps:{style:{display:"none"}}})},type:"primary",children:"Upload Invoice"})})]})}),(0,t.jsx)(Z.Z,{ref:e,size:"small",columns:[{title:"No. Transaction",dataIndex:"no_invoice",key:"no_invoice",render:(e,a)=>(0,t.jsxs)(i.Fragment,{children:[(0,t.jsx)("div",{children:e}),(0,t.jsx)(p.ZP,{danger:!0,type:"dashed",size:"small",onClick:()=>S(a),children:"Download File"})]})},{title:"Tipe",dataIndex:"type",key:"type",render(e,a){var l,i;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{children:e.includes("bill")?"Tagihan Ongkir":"Rekonsiliasi COD"}),(0,t.jsxs)("div",{className:"whitespace-nowrap",children:[C()(null==a?void 0:null===(l=a.metadata)||void 0===l?void 0:l.from).format("DD MMM YYYY")," - ",C()(null==a?void 0:null===(i=a.metadata)||void 0===i?void 0:i.to).format("DD MMM YYYY")]})]})}},{title:"User",dataIndex:"user",key:"user",render:e=>(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{children:e.name}),(0,t.jsx)("div",{children:e.email}),(0,t.jsx)("div",{children:e.phone})]})},{title:"Status",dataIndex:"status",key:"status"},{title:"Tanggal",dataIndex:"createdAt",key:"createdAt",render:(e,a)=>(0,t.jsx)(i.Fragment,{children:(0,t.jsx)(m.Z,{direction:"vertical",size:0,children:(0,t.jsx)(x.Z.Text,{children:g()(e).format("dddd, DD MMM YYYY")})})})}],url:"/api/postpaid/invoice",search:s})]})})})},M=function(){let e=[{key:"invoice",label:"Invoice",children:(0,t.jsx)(F,{})},{key:"proforma",label:"Proforma",children:(0,t.jsx)(P,{})}];return(0,t.jsx)(o.Z,{children:(0,t.jsx)(r.Z,{items:e})})};function _(){return(0,t.jsxs)(i.Fragment,{children:[(0,t.jsxs)(s(),{children:[(0,t.jsx)("title",{children:"Postpaid Invoice"}),(0,t.jsx)("meta",{name:"Postpaid Invoice",content:"Postpaid Invoice Lincah.id"})]}),(0,t.jsx)("main",{children:(0,t.jsx)(M,{})})]})}_.layout="main";var D=_}},function(e){e.O(0,[4310,4393,2808,5742,4533,6920,8611,9774,2888,179],function(){return e(e.s=55406)}),_N_E=e.O()}]);

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.