Skip to content

Commit

Permalink
CM-771: add possibility to disable the payment plan (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski authored Mar 18, 2024
1 parent 0ae12a2 commit 57240d1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
24 changes: 23 additions & 1 deletion src/components/PaymentPlanHeadPanel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Fragment } from "react";
import { Grid, Divider, Typography } from "@material-ui/core";
import { Grid, Divider, Typography, Button } from "@material-ui/core";
import {
withModulesManager,
formatMessage,
Expand Down Expand Up @@ -178,6 +178,28 @@ class PaymentPlanHeadPanel extends FormPanel {
<Divider />
</Fragment>
)}
{paymentPlan.id && (
<Button
onClick={() => {
const currentDateObject = new Date();
const currentDate = currentDateObject.toISOString();
paymentPlan.dateValidTo = currentDate;
this.updateAttribute("dateValidTo", currentDate);
}}
variant="outlined"
color="#DFEDEF"
className={classes.button}
style={{
border: "0px",
textAlign: "right",
display: "block",
marginLeft: "auto",
marginRight: 0
}}
>
{formatMessage(intl, "paymentPlan", "paymentPlan.deactivatePaymentPlan")}
</Button>
)}
<Grid container className={classes.item}>
<Grid item xs={GRID_ITEM_SIZE} className={classes.item}>
<PaymentPlanTypePicker
Expand Down
2 changes: 1 addition & 1 deletion src/components/PaymentPlanSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PaymentPlanSearcher extends Component {
value={paymentPlan.calculation}
readOnly
/> : "",
paymentPlan => {
paymentPlan => {
const objectBenefitPlan = typeof paymentPlan.benefitPlan === 'object' ?
paymentPlan.benefitPlan : JSON.parse(paymentPlan.benefitPlan || '{}');
paymentPlan.benefitPlan = objectBenefitPlan;
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"paymentPlan.advancedCriteria.button.clearAllFilters": "Clear All Criteria",
"paymentPlan.advancedCriteria.button.cancel": "Cancel",
"paymentPlan.advancedCriteria.button.filter": "Confirm Filters",
"paymentPlanPicker.label": "Payment Plan Picker"
"paymentPlanPicker.label": "Payment Plan Picker",
"paymentPlan.deactivatePaymentPlan": "Deactivate Payment Plan"
}

0 comments on commit 57240d1

Please sign in to comment.