Charges/invoices update

This commit is contained in:
Senad Uka
2019-07-19 09:46:15 +02:00
parent e2dcb246f0
commit 4389aaa8da
16 changed files with 253 additions and 62 deletions

View File

@@ -81,7 +81,7 @@ class DateRangePicker extends Component {
const endDateValue = endDate.format(defaultDateFormat);
const buttonRender = (
<Grid.Column width={inlineButton ? 1 : null}>
<Grid.Column width={inlineButton ? 3 : null}>
{ inlineButton && <label>{'\u00A0'}</label> }
<Form.Button onClick={this.onButtonClick.bind(this)}>{buttonLabel}</Form.Button>
</Grid.Column>

View File

@@ -70,6 +70,19 @@ const SingleIncidentsTable = props => {
urlValue = `/practice-summary-report/${memberId}`;
cellValue = props.value;
break;
case 'resourceName':
if (props.row['_original'].resourceName){
cellValue = props.row['_original'].resourceName || '---';
}else{
const oldResourceName = props.row['_original'].oldResourceName || '---';
const newResourceName = props.row['_original'].newResourceName || '---';
if (oldResourceName !== newResourceName){
cellValue = `${oldResourceName}\n${newResourceName}`;
}else{
cellValue = oldResourceName;
}
}
break;
case 'reservation':
const bookingStart = props.row['_original'].bookingStart;
const bookingEnd = props.row['_original'].bookingEnd;
@@ -116,8 +129,8 @@ const SingleIncidentsTable = props => {
cellValue = `${oldBookingStart}\n${oldBookingEnd}`;
break;
case 'newReservation':
const newBookingStart = props.row['_original'].newBookingStart;
const newBookingEnd = props.row['_original'].newBookingEnd;
const newBookingStart = props.row['_original'].newBookingStart || '---';
const newBookingEnd = props.row['_original'].newBookingEnd || '---';
cellValue = `${newBookingStart}\n${newBookingEnd}`;
break;
default:

View File

@@ -3,7 +3,7 @@ import {Accordion, Label} from 'semantic-ui-react';
import SingleIncidentsTable from './components/SingleIncidentsTable';
import {
UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION, UNLOCKED_INCIDENT_STANDALONE, UNSCHEDULED_INCIDENT_AFTER_RESERVATION,
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE, BOOKING_MOVED_TO_ANOTHER_DAY, BOOKING_SHORTENED,
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE, BOOKING_MOVED_TO_ANOTHER_DAY, BOOKING_SHORTENED, BOOKING_CANCELED_LATE,
incidentTableTypes
} from '../../constants/enums';
@@ -29,6 +29,7 @@ export default function MemberIncidentsTables (props) {
break;
case BOOKING_MOVED_TO_ANOTHER_DAY:
case BOOKING_SHORTENED:
case BOOKING_CANCELED_LATE:
bookingChangeIncidents.push(incident);
break;
default:

View File

@@ -6,6 +6,7 @@ export const UNLOCKED_INCIDENT_STANDALONE = 5;
export const UNSCHEDULED_INCIDENT_STANDALONE = 6;
export const BOOKING_MOVED_TO_ANOTHER_DAY = 7;
export const BOOKING_SHORTENED = 8;
export const BOOKING_CANCELED_LATE = 9;
export const incidentDescriptions = {};
incidentDescriptions[UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION] = 'User left door unlocked';
@@ -15,6 +16,7 @@ incidentDescriptions[UNLOCKED_INCIDENT_STANDALONE] = 'User left door unlocked';
incidentDescriptions[UNSCHEDULED_INCIDENT_STANDALONE] = 'Unscheduled use';
incidentDescriptions[BOOKING_MOVED_TO_ANOTHER_DAY] = 'Reservation moved to another day';
incidentDescriptions[BOOKING_SHORTENED] = 'Reservation shortened';
incidentDescriptions[BOOKING_CANCELED_LATE] = 'Reservation canceled late';
export const incidentLevelDescriptions = {
UNLOCKED_0: 'First month',

View File

@@ -5,7 +5,7 @@ import {
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION,
UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION,
UNSCHEDULED_INCIDENT_AFTER_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE, UNLOCKED_INCIDENT_STANDALONE,
BOOKING_MOVED_TO_ANOTHER_DAY, BOOKING_SHORTENED,
BOOKING_MOVED_TO_ANOTHER_DAY, BOOKING_SHORTENED, BOOKING_CANCELED_LATE,
} from '../../../constants/enums';
const MemberSummary = props => {
@@ -29,6 +29,7 @@ const MemberSummary = props => {
break;
case BOOKING_MOVED_TO_ANOTHER_DAY:
case BOOKING_SHORTENED:
case BOOKING_CANCELED_LATE:
totalBookingChangeFees += parseFloat(incident.totalChargeFee);
break;
default: