1import{d as B,E as V,i as s,r as f,c as r,o as O,m as U,w as d,u as l,U as $,a as R,e as i,f as F,$ as L,_ as j}from"./index-BL4aZdeF.js";import{P as K,d as b}from"./PageLayout.DaZ59nrc.js";import{P as q}from"./PolicySelector.DzQB2QJC.js";import{U as z}from"./UserTypeBranch.CWy0-m3U.js";import{H as G,M as J}from"./HaslaResponsiveTable.DAJBnIqt.js";import{H as Q}from"./HaslaSeparator.Bmyto971.js";import{H as W}from"./HaslaSearchPanel.CcY6oUJV.js";import{a as X}from"./format.EyZGh_5S.js";import{p as N,g as I,f as Z}from"./tableFilter.CmeC51eh.js";import{i as tt}from"./iulAccountCode.Dy_nX7BY.js";import"./useTranslation.Cltfu1Qj.js";import"./productCode.B3mDhN5G.js";import"./HaslaNoResult.CrUeQMCs.js";import"./HaslaPagination.By1pVutX.js";import"./HaslaSelect.DmIfwJxM.js";import"./lodash.nwSpMGvW.js";import"./useTableFilterPanel.k1M1Ji6R.js";import"./HaslaTableDesktop.D375JmuQ.js";import"./HaslaDatePicker.Ca5OD5la.js";import"./HaslaCard.Ms-RIL1P.js";const et=B({__name:"creditingInterestPaymentHistory",setup(at){const n=V(),_=s.global.locale.value,p=s.global.messages.value[_],u=f(0),m=f([]),y=f([]),v=tt,M=r(()=>!n.isBrokerSavePolicy&&n.currentUserType===$.BROKER),w=r(()=>{var e,a;const t=(e=n.policyInfoData)==null?void 0:e.policy;return t?(a=t[u.value])==null?void 0:a.policyInfoView:!1}),S=t=>{var a;const e=(a=n.policyInfoData)==null?void 0:a.policy.findIndex(o=>o.policyInfoView.policyNo===t);u.value=e,Y()},k=r(()=>{var o,c;const t=(c=(o=n.policyInfoData)==null?void 0:o.policy[u.value])==null?void 0:c.creditInterestPaymentHistory,a=[{label:p.common_dropdown_default,value:""}];return t==null||t.forEach(C=>{const D=v[C.accountName][_];a.find(P=>P.value===D)||a.push({label:D,value:D})}),{accountNameOptions:a}}),g=r(()=>I("start")),h=r(()=>I("end")),E=r(()=>[{key:"accountName",label:p.iul_payment_history_account_name,type:"select-filterable",options:k.value.accountNameOptions},{key:"paymentDateStart",label:p.iul_rate_history_effective_start_date,type:"date",startDate:g.value,endDate:h.value},{key:"paymentDateEnd",label:p.iul_rate_history_effective_end_date,type:"date",startDate:g.value,endDate:h.value}]),x=[{title:s.global.t("iul_payment_history_account_name"),key:"accountName"},{title:s.global.t("policy_detail_payment_history_payment_date"),key:"paymentDate"},{title:s.global.t("iul_payment_history_interest_account"),key:"interestAmount"}],H=t=>{if(t.paymentDateStart&&t.paymentDateEnd&&new Date(t.paymentDateStart)>new Date(t.paymentDateEnd)){L.error(s.global.t("error_message_date_range_invalid"));return}const e={};t.accountName&&(e.accountName=[{rule:"contain",value:t.accountName.trim()}]),t.paymentDateStart&&(e.paymentDate??(e.paymentDate=[]),e.paymentDate.push({rule:"day-gte",value:b(t.paymentDateStart,"YYYY-MM-DD")})),t.paymentDateEnd&&(e.paymentDate??(e.paymentDate=[]),e.paymentDate.push({rule:"day-lte",value:b(t.paymentDateEnd,"YYYY-MM-DD")})),y.value=Z(e,m.value)},T=()=>{y.value=[...m.value]},A=()=>{var e,a;const t=((a=(e=n.policyInfoData)==null?void 0:e.policy[u.value])==null?void 0:a.creditInterestPaymentHistory)||[];return t.sort((o,c)=>o.accountName!==c.accountName?o.accountName.localeCompare(c.accountName):+new Date(N(c.paymentDate,"DD/MM/YYYY"))-+new Date(N(o.paymentDate,"DD/MM/YYYY"))),t.map(o=>({...o,accountName:v[o.accountName][_],interestAmount:X(o.interestAmount),paymentDate:o.paymentDate}))},Y=()=>{m.value=A(),y.value=[...m.value]};return O(()=>{var t;!M.value&&((t=n.policyInfoData)!=null&&t.policy)&&Y()}),(t,e)=>{const a=F;return R(),U(l(K),null,{default:d(()=>[i(a,{class:"hasla-page"},{default:d(()=>[i(a,{class:"hasla-container-v2"},{default:d(()=>[i(l(z),null,{default:d(()=>[i(l(q),{onPolicyNumberChange:S,policyInfoView:w.value},null,8,["policyInfoView"]),i(l(W),{title:t.$t("cash_dividend_history_search_panel_title"),fields:E.value,onFilter:H,onReset:T},null,8,["title","fields"]),i(l(Q)),i(l(G),{columns:x,tableData:y.value,noDataText:t.$t("common_no_result"),showPagination:"",mode:l(J).ALL},null,8,["tableData","noDataText","mode"])]),_:1})]),_:1})]),_:1})]),_:1})}}}),Nt=j(et,[["__scopeId","data-v-87695be7"]]);export{Nt 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.