show rounded decimals for default values; handle zero as normal input
This commit is contained in:
@@ -292,12 +292,12 @@ class SingleIncidentsTable extends Component {
|
|||||||
totalFee = changedFee;
|
totalFee = changedFee;
|
||||||
priceFontColor = 'red';
|
priceFontColor = 'red';
|
||||||
}else{
|
}else{
|
||||||
totalFee = (props.row['_original'].incidentPrice || props.value) || 0;
|
totalFee = parseFloat((props.row['_original'].incidentPrice || props.value) || 0).toFixed(2);
|
||||||
}
|
}
|
||||||
const totalFeeFormatted = parseFloat(totalFee).toFixed(2);
|
// const totalFeeFormatted = parseFloat(totalFee).toFixed(2);
|
||||||
priceAsNumber = totalFee;
|
priceAsNumber = totalFee;
|
||||||
priceInputID = `${props.row['_original'].incidentType || ''}-${props.row['_original'].incidentId || ''}`;
|
priceInputID = `${props.row['_original'].incidentType || ''}-${props.row['_original'].incidentId || ''}`;
|
||||||
cellValue = `$ ${totalFeeFormatted}`;
|
// cellValue = `$ ${totalFeeFormatted}`;
|
||||||
columnContentsAlignment = columnAlignments.right;
|
columnContentsAlignment = columnAlignments.right;
|
||||||
break;
|
break;
|
||||||
case 'oldReservation':
|
case 'oldReservation':
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ const updateBookingChangeIncidentsById = (incidentFees) => {
|
|||||||
const asyncUpdateActions = [];
|
const asyncUpdateActions = [];
|
||||||
|
|
||||||
incidentIds.forEach((incidentId) => {
|
incidentIds.forEach((incidentId) => {
|
||||||
const newFeeCharge = incidentFees[incidentId] ? parseFloat(incidentFees[incidentId]) : null;
|
const newFeeCharge = parseFloat(incidentFees[incidentId]);
|
||||||
|
|
||||||
if (newFeeCharge || (newFeeCharge === 0)){
|
if (newFeeCharge || (newFeeCharge === 0)){
|
||||||
asyncUpdateActions.push(db.bookingChangeIncident.update({chargeFee: newFeeCharge}, {where: {id: incidentId}}));
|
asyncUpdateActions.push(db.bookingChangeIncident.update({chargeFee: newFeeCharge}, {where: {id: incidentId}}));
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const updateUnscheduledIncidentsById = (incidentFees) => {
|
|||||||
const asyncUpdateActions = [];
|
const asyncUpdateActions = [];
|
||||||
|
|
||||||
incidentIds.forEach((incidentId) => {
|
incidentIds.forEach((incidentId) => {
|
||||||
const newFeeCharge = incidentFees[incidentId] ? parseFloat(incidentFees[incidentId]) : null;
|
const newFeeCharge = parseFloat(incidentFees[incidentId]);
|
||||||
|
|
||||||
if (newFeeCharge || (newFeeCharge === 0)){
|
if (newFeeCharge || (newFeeCharge === 0)){
|
||||||
asyncUpdateActions.push(db.unscheduledIncident.update({
|
asyncUpdateActions.push(db.unscheduledIncident.update({
|
||||||
@@ -150,7 +150,7 @@ const updateUnlockedIncidentsById = (incidentFees) => {
|
|||||||
const asyncUpdateActions = [];
|
const asyncUpdateActions = [];
|
||||||
|
|
||||||
incidentIds.forEach((incidentId) => {
|
incidentIds.forEach((incidentId) => {
|
||||||
const newFeeCharge = incidentFees[incidentId] ? parseFloat(incidentFees[incidentId]) : null;
|
const newFeeCharge = parseFloat(incidentFees[incidentId]);
|
||||||
|
|
||||||
if (newFeeCharge || (newFeeCharge === 0)){
|
if (newFeeCharge || (newFeeCharge === 0)){
|
||||||
asyncUpdateActions.push(db.unlockedIncident.update({incidentLevelPrice: newFeeCharge}, {where: {id: incidentId}}));
|
asyncUpdateActions.push(db.unlockedIncident.update({incidentLevelPrice: newFeeCharge}, {where: {id: incidentId}}));
|
||||||
|
|||||||
Reference in New Issue
Block a user