*
*/
import React, { Component } from "react";
import Helmet from "react-helmet";
import {
import { BaseContext } from "frontend-react-f4-base-commons";
import {
import TextArea from "../../components/TextArea/TextArea";
import moment from "moment";
import { Modal } from "antd";
import
import MaintenanceApprovalPanel from "../../components/MaintenanceApprovalPanel/MaintenanceApprovalPanel";
import CitrineFunctionCodes from "../../enums/CitrineFunctionCodes";
import MaintenanceApprovalAckPanel from "../../components/MaintenanceApprovalAckPanel/MaintenanceApprovalAckPanel";
import ViewPage from "../../components/ViewPage/ViewPage";
import AckMessage from "../../components/AckMessage/AckMessage";
import _ from "underscore";
import
import BoNoRecords
import
import
const { connect } =
const
strings,
// F4DataTable,
FeedbackModal1,
Feedback,
F4Confirmation,
ActionButton
const { strings, F4Stepper, Feedback } = BaseComponents;
import ClientConfig from "../../config/ClientConfig";
@observer
@connect
class
constructor(props) {
super(props);
this.state = {
pages: {
initial: 0,
confirm: 1,
ack: 2,
view: 3,
viewForConfirmAck: 4,
ackForSingle: 5
},
showErrorModal: false,
errorModalMsg: "",
prevPage: 0,
isForView: false,
clickedApprove: false,
clickedReject: false
};
}
const { SessionStore, auth } = this.context.store;
SessionStore.checkFuncAuthorization(
auth.sessionUser.user.grp.id,
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_DEL
).then(hasAuth => {
if (hasAuth) {
this.setState({
hasAuth: hasAuth
});
}
});
};
onClickCd = data =>
const { RestrictedPayeeStore } = this.context.store;
RestrictedPayeeStore.
console.log("id input: ", RestrictedPayeeStore.restrictedPayeeInputs);
RestrictedPayeeStore.restrictedPayeeList = null;
RestrictedPayeeStore.resetSearchFields();
RestrictedPayeeStore.resetErrorList();
RestrictedPayeeStore.selectedMenuOnSearch = 1;
// browserHistory.push("/bo-bsc/departmentSearch");
};
_createData = () => {
return [
{
headerTitle: strings.global_restrictedpayeenm,
name: "payeeName",
type: "text",
width: 100,
cell: props => (
className="linkInTable"
onClick={() =>
if (onLoadResults && onLoadResults === true) {
this.
>
{props.data.payeeName}
)
},
{
headerTitle: strings.global_amount,
name: "amount",
type: "text",
width: 100,
align: "right"
},
{
headerTitle: strings.global_action,
name: "isAllowedStr",
type: "text",
width: 100,
sortBy: "isAllowed"
},
{
headerTitle: strings.global_character_ignore,
name: "charToIgnore",
type: "text",
width: 100
},
{
headerTitle: null,
name: "actions",
type: "text",
width: 80,
isSortable: false,
hideInColumnDisplay: true,
hideInGrouping: true,
isInReport: false,
cell: props => (
showDelete={props.data.showDelete}
onEdit={() => this.onEdit(props.data)}
onDelete={() => this.confirmDelete(false, props.data)}
/>
)
}
];
};
showIcon
}
}
redirectTo =
let icon = iconDirectory;
return (
{" "}
{" "}
);
};
onClickDownload = multiSort
const { RestrictedPayeeStore } = this.context.store;
};
confirmOnClickBack = () =>
const { MaintenanceStore, RestrictedPayeeStore } = this.context.store;
MaintenanceStore.approveList = null;
RestrictedPayeeStore.resetApprovalFields();
this.redirectTo(
this.state.isForView ? this.state.pages.view : this.state.pages.initial
);
this.setState({ isForView: false });
};
confirmOnClickSubmit = (isApprove, succCB) => {
const { auth, RestrictedPayeeStore, SettingsStore } = this.context.store;
SettingsStore.isScreenLoading = true;
this.setState({ prevPage: this.state.pages.confirm });
RestrictedPayeeStore.approveListReqModel.localUserCd =
auth.sessionUser.user.cd;
RestrictedPayeeStore.approveListReqModel.isApprove = isApprove;
RestrictedPayeeStore.approveListReqModel.remarks =
RestrictedPayeeStore.
RestrictedPayeeStore.approveListReqModel.maintenanceList =
RestrictedPayeeStore.approvalConfirmProps.dataList;
if (isApprove) {
RestrictedPayeeStore.validateApproval(
RestrictedPayeeStore.
multiSort,
res => {
console.
if (res.body &&
_.each(res.body.error.errors, errStr => {
RestrictedPayeeStore.errors.push(errStr.message);
});
} else if (res.body.error.message) {
RestrictedPayeeStore.errors.push(res.body.error.message);
}
SettingsStore.isScreenLoading = false;
this.setState({ clickedApprove: false });
succCB && succCB();
} else {
this.approveList(isApprove, succCB);
// SettingsStore.isScreenLoading = false;
}
}
);
} else {
this.approveList(isApprove, succCB);
// SettingsStore.isScreenLoading = false;
}
};
approveList = (isApprove, succCB) => {
const { RestrictedPayeeStore, SettingsStore } = this.context.store;
let message = isApprove
? strings.formatString(
strings.feedback_success_approval,
strings.global_restrictedpayeenm,
"approved"
)
: strings.formatString(
strings.feedback_success_approval,
strings.global_restrictedpayeenm,
"rejected"
);
let messageSingle = isApprove
? "Restricted Payee Name was approved."
: "Restricted Payee Name was rejected.";
RestrictedPayeeStore.approveList(
RestrictedPayeeStore.approveListReqModel,
res => {
console.log("Approve List: ", res);
if (!res.body && res.text) {
RestrictedPayeeStore.approvalAckProps = {
dataList: RestrictedPayeeStore.approvalConfirmProps.dataList,
action: isApprove
? strings.global_approve.toLowerCase()
: strings.global_reject.toLowerCase(),
remarks: RestrictedPayeeStore.approvalConfirmProps.remarks,
refNo: res.text,
message: this.state.isForView ? messageSingle : message
};
if (this.state.isForView) {
let maintenanceList =
RestrictedPayeeStore.approvalAckProps.dataList;
RestrictedPayeeStore.restrictedPayeeDtlString =
maintenanceList &&
maintenanceList.length > 0 &&
JSON.parse(maintenanceList[0].dtlString);
this.redirectTo(this.state.pages.ackForSingle);
this.setState({
prevPage: this.state.pages.ackForSingle
});
} else {
this.redirectTo(this.state.pages.ack);
this.setState({ prevPage: this.state.pages.ack });
}
SettingsStore.isScreenLoading = false;
succCB && succCB();
} else {
if (res.body.error.errors) {
_.each(res.body.error.errors, errStr => {
RestrictedPayeeStore.errors.push(errStr.message);
});
} else if (res.body.error.message) {
RestrictedPayeeStore.errors.push(res.body.error.message);
}
SettingsStore.isScreenLoading = false;
succCB && succCB();
}
}
);
};
onClickRefNo = data => {
const { RestrictedPayeeStore, MaintenanceStore } = this.context.store;
RestrictedPayeeStore.resetErrorList();
RestrictedPayeeStore.viewPageMaintenanceData = data;
MaintenanceStore.remarks = null;
RestrictedPayeeStore.resetApprovalFields();
this.redirectTo(this.state.pages.view);
this.setState({
readOnly: false,
prevPage: this.state.pages.confirm,
isForView: true
});
};
const { RestrictedPayeeStore,
this.redirectTo(this.state.pages.viewForConfirmAck);
this.setState({ readOnly: true });
};
onClickApprove = (maintenanceList, remarks, succCB) => {
const {
RestrictedPayeeStore,
MaintenanceStore,
auth,
SettingsStore
} = this.context.store;
MaintenanceStore.errors = [];
SettingsStore.isScreenLoading = true;
this.setState({ clickedApprove: true });
RestrictedPayeeStore.
)
onClickDownload={this.onClickDownload}
downloadProps={{
isDynamic: true,
params: console.log("Res on Validate Payee Approval: ", res);
if (res.body && res.body.error) {
if (res.body.error.errors) {
_.each(res.body.error.errors, errStr => {
MaintenanceStore.errors.push(errStr.message);
RestrictedPayeeStore.errors.push(errStr.message);
});
} else if (res.body.error.message) {
MaintenanceStore.errors.push(res.body.error.message);
RestrictedPayeeStore.errors.push(res.body.error.message);
}
MaintenanceStore.remarks = null;
SettingsStore.isScreenLoading = false;
this.setState({ clickedApprove: false });
succCB && succCB();
} else {
console.log("No Errors.");
MaintenanceStore.validateApprovalReqModel.isApprove = true;
MaintenanceStore.validateApprovalReqModel.maintenanceList = maintenanceList;
MaintenanceStore.validateApprovalReqModel.modelNm =
strings.global_payee;
MaintenanceStore.validateApprovalReqModel.remarks = remarks;
MaintenanceStore.validateApprovalReqModel.requiresApprovalFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL;
//CitrineFunctionCodes.COURIER_MAINTENANCE_REQUIRES_APPROVAL;
MaintenanceStore.validateApprovalReqModel.userCd =
auth.sessionUser.user.cd;
MaintenanceStore.validateApproval(
MaintenanceStore.validateApprovalReqModel,
res => {
if (res.body && res.body.error) {
_.each(res.body.error.errors, errStr => {
strings.global_reportobj,
strings.global_restrictedpayeenm
)
},
fileName: "Restricted_Payee_Report"
}}
dataTableRef={table => (RestrictedPayeeStore.dataTableRef
});
this.setState({ clickedApprove: false });
SettingsStore.isScreenLoading =
options={this._createData()}
data={
succCB && succCB();
} else {
console.log("No Errors.");
RestrictedPayeeStore.
?
action: strings.global_approve.toLowerCase(),
remarks: remarks,
dataList: maintenanceList
};
RestrictedPayeeStore.
: null
if (this.state.isForView) {
this.confirmOnClickSubmit(true, null);
} else {
this.redirectTo(this.state.pages.confirm);
this.setState({
prevPage: this.state.pages.confirm
});
SettingsStore.isScreenLoading = false;
}
MaintenanceStore.remarks = null;
this.setState({ clickedApprove: false });
succCB && succCB();
}
\n
\n );\n }\n\n {" "}\n {this.showIcon(searchIcon)}\n
{" "}\n
\n {" "}\n
\n {strings.message_searchusingrightpanel}\n
\n );
}
});
};
const {
RestrictedPayeeStore,
MaintenanceStore,
auth,
SettingsStore
} = this.context.store;
SettingsStore.isScreenLoading = true;
MaintenanceStore.errors = [];
this.setState({ clickedReject: true });
MaintenanceStore.validateApprovalReqModel.isApprove = false;
MaintenanceStore.validateApprovalReqModel.maintenanceList = maintenanceList;
MaintenanceStore.validateApprovalReqModel.modelNm = strings.global_payee;
MaintenanceStore.validateApprovalReqModel.remarks = remarks;
MaintenanceStore.validateApprovalReqModel.requiresApprovalFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL;
// CitrineFunctionCodes.COURIER_MAINTENANCE_REQUIRES_APPROVAL;
MaintenanceStore.validateApprovalReqModel.userCd = auth.sessionUser.user.cd;
MaintenanceStore.validateApproval(
MaintenanceStore.validateApprovalReqModel,
res => {
if (res.body && res.body.error) {
_.each(res.body.error.errors, errStr => {
MaintenanceStore.errors.push(errStr.message);
});
this.setState({
showErrorModal: true,
errorModalMsg: MaintenanceStore.errors[0],
clickedReject: false
});
SettingsStore.isScreenLoading = false;
succCB && succCB();
} else {
console.
let searchIcon
RestrictedPayeeStore.approvalConfirmProps =
return (
{this.showIcon(searchIcon)}
{strings.message_searchusingrightpanel}
action: strings.global_reject.toLowerCase(),
remarks: remarks,
dataList: maintenanceList
};
RestrictedPayeeStore.resetErrorList();
if (this.state.isForView) {
this.confirmOnClickSubmit(false, () => {
this.setState({
clickedReject: false
});
});
} else {
this.redirectTo(this.state.pages.confirm);
this.setState({
prevPage: this.state.pages.confirm,
clickedReject: false
});
}
SettingsStore.isScreenLoading = false;
succCB && succCB();
}
MaintenanceStore.remarks = null;
}
);
};
onSearch = multiSort => {
const {
multiSort = {
page: 0,
count: 10,
sortList: [
{
direction: "desc",
sort: "updatedDt"
}
]
};
}
let fields = RestrictedPayeeStore.
{
fields != undefined &&
fields.map(
field =>
);
}
MaintenanceStore.searchRequestModel.notCreatedBy = auth.sessionUser.user.
RestrictedPayeeStore.searchFilter.filterList
MaintenanceStore.searchRequestModel.filterTypeOne =
RestrictedPayeeStore.searchFilter.payeeName,
RestrictedPayeeStore.searchFilter.amount,
RestrictedPayeeStore.searchFilter.isAllowed,
RestrictedPayeeStore.searchFilter.charToIgnore
];
RestrictedPayeeStore.findBySearchModelForMaintenance(
RestrictedPayeeStore.searchFilter,
isCaseSensitive: false,
isEq: true
};
MaintenanceStore.searchRequestModel.filterTypeTwo = {
isCaseSensitive: false,
isEq: false
};
MaintenanceStore.searchRequestModel.funcCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL;
//CitrineFunctionCodes.COURIER_MAINTENANCE_REQUIRES_APPROVAL;
MaintenanceStore.findBySearchModel(
MaintenanceStore.searchRequestModel,
multiSort,
res => {
RestrictedPayeeStore.
MaintenanceStore.responseBody = res.body;
let data =
RestrictedPayeeStore.
MaintenanceStore.dataTableRef.setState({
data: data,
copyOfData: data,
totalItemsCount: res.body.totalElements
});
MaintenanceStore.dataTableRef.forceUpdate();
} else {
console.
// this.setState({ hasClickedSearch: true });
}
);
};
RestrictedPayeeStore.resetSearchFields();
RestrictedPayeeStore.restrictedPayeeInputs = data;
console.log("id input: ", RestrictedPayeeStore.restrictedPayeeInputs);
//console.log("props datas: ", props.data);
RestrictedPayeeStore.restrictedPayeeList = null;
browserHistory.push("/bo-bsc/restrictedPayeeEdit");
};
confirmDelete = (isMultiple, data) => {
const {
RestrictedPayeeStore,
auth,
SettingsStore,
MaintenanceStore
} = this.context.store;
MaintenanceStore.requestModel.localUserCd = auth.sessionUser.user.cd;
MaintenanceStore.requestModel.requiresApprovalFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL;
MaintenanceStore.requestModel.editFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_EDIT;
MaintenanceStore.requestModel.deleteFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_DEL;
MaintenanceStore.requestModel.actnFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_DEL;
MaintenanceStore.requestModel.approveRejectFuncCd =
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_APPROVE_REJECT;
MaintenanceStore.requestModel.modelNm = strings.global_payee;
MaintenanceStore.requestModel.grpId = auth.sessionUser.user.grp.id;
MaintenanceStore.requestModel.dtlString = JSON.stringify({
id: data.id,
payeeName: data.payeeName,
amount: data.amount,
isAllowed: data.isAllowed,
charToIgnore: data.charToIgnore
});
if (!isMultiple) {
SettingsStore.confirm(
strings.message_del,
() => {
MaintenanceStore.requestModel.filterValues = [
data.payeeName,
data.amount,
data.isAllowed,
data.charToIgnore
];
MaintenanceStore.requestModel.uniqueCds = [data.payeeName];
MaintenanceStore.saveOrUpdate(
MaintenanceStore.requestModel,
response => {
RestrictedPayeeStore.resetErrorList();
if (response.body && response.body.error) {
console.log("Error on Del: ", response);
MaintenanceStore.errors = [];
response.body.error.errors.map(error => {
MaintenanceStore.errors.push(error.message);
});
this.setState({
showErrorModal: true,
errorModalMsg: MaintenanceStore.errors
});
SettingsStore.isScreenLoading = false;
} else if (!response.body && response.text) {
console.log("Res on Del: ", response);
RestrictedPayeeStore.ackMessage = {
header: strings.formatString(
strings.feedback_success_forapproval,
strings.formatString(
strings.global_deleteobj,
strings.global_restrictedpayeenm
)
),
refNo: response.text
};
SettingsStore.modalSettings.message = (
refNo={RestrictedPayeeStore.ackMessage.refNo}
/>
);
SettingsStore.modalSettings.showModal = true;
SettingsStore.isScreenLoading = false;
RestrictedPayeeStore.isForApproval = true;
RestrictedPayeeStore.resetSearchFields();
RestrictedPayeeStore.restrictedPayeeList = null;
RestrictedPayeeStore.reset();
RestrictedPayeeStore.dataTableRef.forceUpdate();
} else if (!response.text) {
let request = data;
request.localUserCd = auth.sessionUser.user.cd;
if (request && request.localUserCd) {
this.onDelete(request);
}
}
}
);
},
() => {
SettingsStore.isScreenLoading = false;
}
);
} else {
if (data.length > 0)
{
{
data.map(item => {
maintenanceList.push({
localUserCd: auth.sessionUser.user.cd,
requiresApprovalFuncCd:
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL,
editFuncCd: CitrineFunctionCodes.RESTRICTED_PAYEE_NM_EDIT,
deleteFuncCd: CitrineFunctionCodes.RESTRICTED_PAYEE_NM_DEL,
approveRejectFuncCd:
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_APPROVE_REJECT,
actnFuncCd: CitrineFunctionCodes.RESTRICTED_PAYEE_NM_DEL,
modelNm:
grpId: auth.sessionUser.user.grp.id,
isAdd: false,
dtlString: JSON.stringify({
id: item.id,
payeeName: item.payeeName,
amount: item.amount,
isAllowed: item.isAllowed,
charToIgnore: item.charToIgnore
}),
filterValues: [
item.payeeName,
item.amount,
item.isAllowed,
item.charToIgnore
],
uniqueCds: [item.payeeName]
});
});
}
SettingsStore.confirm(
name: "refNo",
type: "link",
width: 100,
cell: props => (
className="linkInTable"
onClick={() => this.onClickRefNo(props.data)}
>
{" "}
{props.data.refNo}{" "}
)
},
{
headerTitle: strings.
() => {
SettingsStore.isScreenLoading = true;
MaintenanceStore.saveOrUpdateMultiple(
{
requiresApprovalFuncCd:
CitrineFunctionCodes.RESTRICTED_PAYEE_NM_REQUIRES_APPROVAL,
grpId: auth.sessionUser.user.grp.id,
list: maintenanceList,
localUserCd: auth.sessionUser.user.cd
},
response => {
MaintenanceStore.errors = [];
if (response.body && response.body.error.errors) {
console.log("Error on Del: ", response);
MaintenanceStore.errors = [];
response.body.error.errors.map(error => {
MaintenanceStore.errors.push(error.message);
});
this.setState({
showErrorModal: true,
errorModalMsg: MaintenanceStore.errors
});
SettingsStore.isScreenLoading = false;
RestrictedPayeeStore.restrictedPayeeList = null;
RestrictedPayeeStore.reset();
} else if (!response.body && response.text) {
console.log("Res on saveOrUpdate DelMultiple: ", response);
SettingsStore.modalSettings.message = (
name: "filterOne",
type: "text",
width: 100
},
{
headerTitle: strings.
name: "filterTwo",
type: "text",
width: 100
},
{
headerTitle: strings.
// name: "actnFuncCd",
name: "actnFunc.description",
type: "text",
width: 150,
sortBy: "actnFunc.description",
cell: props => (
{props.data.actnFunc.description}
)
},
{
headerTitle: strings.
name: "createdBy",
type: "text",
width: 150
},
{
headerTitle: strings.
)
)}
refNo={response.text}
/>
);
SettingsStore.modalSettings.showModal = true;
RestrictedPayeeStore.isForApproval = true;
RestrictedPayeeStore.resetSearchFields();
RestrictedPayeeStore.restrictedPayeeList = null;
RestrictedPayeeStore.reset();
SettingsStore.isScreenLoading = false;
} else if (!response.body && !response.text) {
this.onDeleteMultiple(data);
}
}
);
},
() => {
SettingsStore.isScreenLoading = false;
}
);
name: "createdDt",
type: "text",
width: 150,
formatter: "date"
}
};
if (resBody && resBody.error) {
RestrictedPayeeStore.resetErrorList();
if (resBody.error.errors && resBody.error.errors.length > 0)
{
name: "refNo",
type: "link",
width: 100,
cell: props =>
RestrictedPayeeStore.errors.push(err.message);
});
} else
className="linkInTable"
onClick={() => this.onClickRefNoForConfirmAck(props.data)}
>
{" "}
{props.data.refNo}{" "}
)
},
{
name: "filterOne",
type: "text",
width: 100
},
{
headerTitle: strings.global_amount,
name: "filterTwo",
type: "text",
width: 100
},
{
headerTitle: strings.global_func,
// name: "actnFuncCd",
name: "actnFunc.description",
type: "text",
width: 150,
sortBy: "actnFunc.description",
cell: props => (
{props.data.actnFunc.description}
)
},
{
headerTitle: strings.global_creatdby,
name: "createdBy",
type: "text",
width: 150
},
{
headerTitle: strings.global_createdt,
name: "createdDt",
type: "text",
width: 120,
formatter: "date"
}
};
const {
console.log("ID TO BE DELETED: ", payeee);
RestrictedPayeeStore.deleteRestrictedPayee(payeee, res
return new Promise(resolve => {
MaintenanceStore.searchRequestModel,
multiSort,
res => {
if (res.body && !res.body.error) {
}
}
);
this.setState({
errorModalMsg: "Selected transaction is still pending for approval",
showModal: true
});
// SettingsStore.modalSettings = {
// status: "error",
// message: "Selected transaction is still pending for approval",
// showModal: true
// };
SettingsStore.isScreenLoading = false;
}
};
const {
onClickDownload: this.onClickDownload,
reportHeader2: "Approve/Reject Checkbook Type Report",
fileName: "Approve_Reject_Payee"
}}
title={strings.formatString(
strings.portlet_title_maintenance,
strings.global_restrictedpayeenm
)}
initialFields={RestrictedPayeeStore.approvalFields}
funcCd={CitrineFunctionCodes.RESTRICTED_PAYEE_NM_APPROVE_REJECT}
//funcCd={CitrineFunctionCodes.COURIER_MAINTENANCE_APPROVE_REJECT}
columnHeaders={this._createData()}
onSearchApprove={this.onSearch}
onApprove={this.onClickApprove}
onReject={this.onClickReject}
/>
);
}
_showMaintenanceApprovalConfirmPanel() {
const { MaintenanceStore, RestrictedPayeeStore } = this.
this.checkAuth();
let isApprove =
RestrictedPayeeStore.approvalConfirmProps.action === "approve";
return (
isAck={false}
isConfirm={true}
columnHeaders={this._createDataForConfirmAck()}
action={RestrictedPayeeStore.approvalConfirmProps.action}
remarks={RestrictedPayeeStore.approvalConfirmProps.remarks}
dataList={RestrictedPayeeStore.approvalConfirmProps.dataList}
onClickBack={() => {
MaintenanceStore.remarks = null;
RestrictedPayeeStore.resetErrorList();
this.confirmOnClickBack();
}}
onClickSubmit={() => this.confirmOnClickSubmit(isApprove, null)}
errorFeedback={RestrictedPayeeStore.errors}
stepWizardHeader={"Confirm Details"}
modelName={strings.global_payee}
/>
);
}
_showMaintenanceApprovalAckPanel() {
const { MaintenanceStore, RestrictedPayeeStore } = this.context.store;
return (
isAck={true}
isConfirm={false}
header={RestrictedPayeeStore.approvalAckProps.message}
refNo={RestrictedPayeeStore.approvalAckProps.refNo}
columnHeaders={this._createDataForConfirmAck()}
action={RestrictedPayeeStore.approvalAckProps.action}
remarks={RestrictedPayeeStore.approvalAckProps.remarks}
dataList={RestrictedPayeeStore.approvalAckProps.dataList}
hasButtons
modelName={strings.global_payee}
backButtonLabel={strings.formatString(
strings.button_middle_backxtopage,
strings.formatString(
strings.global_approveobj,
strings.global_restrictedpayeenms
)
)}
onClickBack={() => {
MaintenanceStore.remarks = null;
RestrictedPayeeStore.resetApprovalFields();
MaintenanceStore.approveList = null;
this.redirectTo(this.state.pages.initial);
}}
stepWizardHeader={strings.global_acknowledgement}
/>
);
}
_showViewPage(actionButtons) {
const { RestrictedPayeeStore, MaintenanceStore } = this.context.store;
let dtlStringData = RestrictedPayeeStore.viewPageMaintenanceData
? JSON.parse(RestrictedPayeeStore.viewPageMaintenanceData.dtlString)
: null;
let funcDscp =
RestrictedPayeeStore.viewPageMaintenanceData &&
RestrictedPayeeStore.viewPageMaintenanceData.actnFunc.description;
return (
isApproveReject
funcDscp={funcDscp}
hasBackButton
backButtonLabel={strings.formatString(
strings.global_approveobj,
strings.global_restrictedpayeenm
)}
store={MaintenanceStore}
modelNm={strings.global_payee}
viewPanel={
data={dtlStringData ? dtlStringData : null}
/>
}
onClickBack={() => {
MaintenanceStore.resetRemarks();
MaintenanceStore.errors = [];
RestrictedPayeeStore.resetErrorList();
MaintenanceStore.approveList = null;
this.setState({ isForView: false });
this.redirectTo(this.state.pages.initial);
}}
onClickApprove={() => {
this.setState({ isForView: true });
let data = [];
data.push(RestrictedPayeeStore.viewPageMaintenanceData);
this.onClickApprove(data, MaintenanceStore.remarks);
MaintenanceStore.errors = [];
}}
onClickReject={() => {
this.setState({ isForView: true });
let data = [];
data.push(RestrictedPayeeStore.viewPageMaintenanceData);
this.checkIfHasRemarks(data);
MaintenanceStore.errors = [];
}}
/>
);
}
_showViewPageForConfirmAck() {
const { RestrictedPayeeStore, MaintenanceStore } = this.context.store;
let dtlStringData = this.showViewPageConfirmAckData();
return (
errorList={RestrictedPayeeStore.errors}
// isApproveReject
hasBackButton
backButtonLabel={
this.state.prevPage == this.state.pages.ack
? strings.global_acknowledgement
: strings.global_confirm
}
store={MaintenanceStore}
modelNm={strings.global_payee}
viewPanel={
data={dtlStringData ? dtlStringData : null}
/>
}
onClickBack={() => {
this.state.prevPage == this.state.pages.ack
? this.redirectTo(this.state.pages.ack)
: this.redirectTo(this.state.pages.confirm);
}}
/>
);
}
_showAckForSingle() {
const { MaintenanceStore, RestrictedPayeeStore } = this.context.store;
let data = RestrictedPayeeStore.restrictedPayeeDtlString;
let funcDscp =
RestrictedPayeeStore.viewPageMaintenanceData &&
RestrictedPayeeStore.viewPageMaintenanceData.actnFunc.description;
return (
isConfirm={false}
funcDscp={funcDscp}
columnHeaders={this._createDataForConfirmAck()}
action={RestrictedPayeeStore.approvalAckProps.action}
remarks={RestrictedPayeeStore.approvalAckProps.remarks}
dataList={RestrictedPayeeStore.approvalAckProps.dataList}
hasButtons
modelName={strings.global_payee}
backButtonLabel={strings.formatString(
strings.button_middle_backxtopage,
strings.formatString(
strings.global_approveobj,
strings.global_restrictedpayeenm
)
)}
onClickBack={() => {
MaintenanceStore.remarks = null;
MaintenanceStore.approveList = null;
RestrictedPayeeStore.resetApprovalFields();
this.redirectTo(this.state.pages.initial);
this.setState({
isForView: false
});
}}
viewPanel={
refNo={RestrictedPayeeStore.approvalAckProps.refNo}
isConfirm={false}
isAck={true}
data={data ? data : null}
store={MaintenanceStore}
errorFeedback={MaintenanceStore.errors}
hideStepper={true}
/>
}
/>
);
}
showViewPageConfirmAckData() {
const { RestrictedPayeeStore } = this.context.store;
return RestrictedPayeeStore.viewPageMaintenanceData
? JSON.parse(RestrictedPayeeStore.viewPageMaintenanceData.dtlString)
: null;
}
handleCancel = () => {
this.setState({
showErrorModal: false,
errorModalMsg: ""
});
};
handleKeyDown = e => {
const { MaintenanceStore } = this.context.store;
MaintenanceStore.remarks = e.target.value;
};
checkIfHasRemarks = data => {
const { MaintenanceStore, SettingsStore } = this.context.store;
if (!MaintenanceStore.remarks) {
let errorList = [
strings.formatString(
strings.feedback_bad_isrequired,
strings.global_remarks
)
];
RestrictedPayeeStore.errors = errorList;
this.setState({
showErrorModal: true,
errorModalMsg: errorList[0]
});
SettingsStore.isScreenLoading = false;
} else {
this.onClickReject(data, MaintenanceStore.remarks);
}
};
render() {
const { RestrictedPayeeStore,
return
const actionButtons = (
className="forSearch">
{strings.formatString(
strings.global_searchobj,
strings.global_restrictedpayeenm
)}
(this.confirmation = r)} isBo isYesNo />
title="Success"
modalSettings={SettingsStore.modalSettings}
/>
{this.showDataTable()}
initialFields={RestrictedPayeeStore.searchRestrictedPayeeFields}
onClickSearch={e => {
this.onSearch(null);
RestrictedPayeeStore.dataTableRef &&
RestrictedPayeeStore.dataTableRef.reset();
}}
funcCd={CitrineFunctionCodes.RESTRICTED_PAYEE_NM_SEARCH}
hasSuggestedLinks
hasSearchFilters
hasAddToBookmarks
className="row approval-remarks">
labelField={strings.global_remarks}
value={MaintenanceStore.remarks}
placeHolder={strings.global_remarks}
onChange={this.handleKeyDown}
maxLength="255"
/>
{strings.formatString(
strings.global_searchobj,
strings.global_restrictedpayeenm
)}
modalSettings={SettingsStore.modalSettings}
/>
{this.showDataTable()}
onClickSearch={e => {
this.onSearch(null);
RestrictedPayeeStore.dataTableRef &&
RestrictedPayeeStore.dataTableRef.reset();
}}
funcCd={CitrineFunctionCodes.RESTRICTED_PAYEE_NM_SEARCH}
hasSuggestedLinks
hasSearchFilters
hasAddToBookmarks
className="row approval-remarks">
labelField={strings.global_remarks}
value={MaintenanceStore.remarks}
placeHolder={strings.global_remarks}
onChange={this.handleKeyDown}
maxLength="255"
/>
strings.global_approveobj,
strings.global_restrictedpayeenm
)}
rejectMessage={strings.formatString(
strings.global_rejectobj,
strings.global_restrictedpayeenm
)}
onClickApprove={() => {
this.setState({ isForView: true });
let data = [];
data.push(RestrictedPayeeStore.viewPageMaintenanceData);
this.onClickApprove(data, MaintenanceStore.remarks);
MaintenanceStore.errors = [];
}}
onClickReject={() => {
this.setState({ isForView: true });
let data = [];
data.push(RestrictedPayeeStore.viewPageMaintenanceData);
this.checkIfHasRemarks(data);
MaintenanceStore.errors = [];
}}
/>
);
const data = [
{ key: 0, content: this._showMaintenanceApprovalPanel() },
{ key: 1, content: this._showMaintenanceApprovalConfirmPanel() },
{ key: 2, content: this._showMaintenanceApprovalAckPanel() },
{ key: 3, content: this._showViewPage(actionButtons) },
{ key: 4, content: this._showViewPageForConfirmAck() },
{ key: 5, content: this._showAckForSingle() }
];
return (
closable={true}
onClose={this.handleCancel}
onCancel={this.handleCancel}
okButtonProps={{
style: { display: "none" }
}}
cancelButtonProps={{
style: { display: "none" }
}}
destroyOnClose={true}
className="errorModalFeedback"
>
{this.state.showErrorModal ? (
class="swal2-icon swal2-error swal2-animate-error-icon"
style={{ display: "flex" }}
>
{this.state.errorModalMsg}