Commit 087a67f5 authored by faisalhamdi's avatar faisalhamdi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into faisal

parents 9cca2c95 b04e6584
...@@ -103,7 +103,7 @@ export default class ProfitLoss extends Component { ...@@ -103,7 +103,7 @@ export default class ProfitLoss extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
// console.log(response); console.log(response);
let dataTable = [] let dataTable = []
this.setState({ visibleProfitLoss: true }) this.setState({ visibleProfitLoss: true })
if (response.data) { if (response.data) {
...@@ -122,18 +122,18 @@ export default class ProfitLoss extends Component { ...@@ -122,18 +122,18 @@ export default class ProfitLoss extends Component {
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes, item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january, this.props.status === 'CLOSED' ? Number(item.profit_loss.january).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.january, formula: item.profit_loss.january_formula } : Number(item.profit_loss.january).toFixed(1),
item.profit_loss.february, this.props.status === 'CLOSED' ? Number(item.profit_loss.february).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.february, formula: item.profit_loss.february_formula } : Number(item.profit_loss.february).toFixed(1),
item.profit_loss.march, this.props.status === 'CLOSED' ? Number(item.profit_loss.march).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.march, formula: item.profit_loss.march_formula } : Number(item.profit_loss.march).toFixed(1),
item.profit_loss.april, this.props.status === 'CLOSED' ? Number(item.profit_loss.april).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.april, formula: item.profit_loss.april_formula } : Number(item.profit_loss.april).toFixed(1),
item.profit_loss.may, this.props.status === 'CLOSED' ? Number(item.profit_loss.may).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.may, formula: item.profit_loss.may_formula } : Number(item.profit_loss.may).toFixed(1),
item.profit_loss.june, this.props.status === 'CLOSED' ? Number(item.profit_loss.june).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.june, formula: item.profit_loss.june_formula } : Number(item.profit_loss.june).toFixed(1),
item.profit_loss.july, this.props.status === 'CLOSED' ? Number(item.profit_loss.july).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.july, formula: item.profit_loss.july_formula } : Number(item.profit_loss.july).toFixed(1),
item.profit_loss.august, this.props.status === 'CLOSED' ? Number(item.profit_loss.august).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.august, formula: item.profit_loss.august_formula } : Number(item.profit_loss.august).toFixed(1),
item.profit_loss.september, this.props.status === 'CLOSED' ? Number(item.profit_loss.september).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.september, formula: item.profit_loss.september_formula } : Number(item.profit_loss.september).toFixed(1),
item.profit_loss.october, this.props.status === 'CLOSED' ? Number(item.profit_loss.october).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.october, formula: item.profit_loss.october_formula } : Number(item.profit_loss.october).toFixed(1),
item.profit_loss.november, this.props.status === 'CLOSED' ? Number(item.profit_loss.november).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.november, formula: item.profit_loss.november_formula } : Number(item.profit_loss.november).toFixed(1),
item.profit_loss.december, this.props.status === 'CLOSED' ? Number(item.profit_loss.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.december, formula: item.profit_loss.december_formula } : Number(item.profit_loss.december).toFixed(1),
item.profit_loss.total_current_year, item.profit_loss.total_current_year,
item.profit_loss.total_next_year, item.profit_loss.total_next_year,
item.profit_loss.total_more_year, item.profit_loss.total_more_year,
...@@ -158,18 +158,18 @@ export default class ProfitLoss extends Component { ...@@ -158,18 +158,18 @@ export default class ProfitLoss extends Component {
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes, item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january, this.props.status === 'CLOSED' ? Number(item.profit_loss.january).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.january, formula: item.profit_loss.january_formula } : Number(item.profit_loss.january).toFixed(1),
item.profit_loss.february, this.props.status === 'CLOSED' ? Number(item.profit_loss.february).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.february, formula: item.profit_loss.february_formula } : Number(item.profit_loss.february).toFixed(1),
item.profit_loss.march, this.props.status === 'CLOSED' ? Number(item.profit_loss.march).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.march, formula: item.profit_loss.march_formula } : Number(item.profit_loss.march).toFixed(1),
item.profit_loss.april, this.props.status === 'CLOSED' ? Number(item.profit_loss.april).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.april, formula: item.profit_loss.april_formula } : Number(item.profit_loss.april).toFixed(1),
item.profit_loss.may, this.props.status === 'CLOSED' ? Number(item.profit_loss.may).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.may, formula: item.profit_loss.may_formula } : Number(item.profit_loss.may).toFixed(1),
item.profit_loss.june, this.props.status === 'CLOSED' ? Number(item.profit_loss.june).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.june, formula: item.profit_loss.june_formula } : Number(item.profit_loss.june).toFixed(1),
item.profit_loss.july, this.props.status === 'CLOSED' ? Number(item.profit_loss.july).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.july, formula: item.profit_loss.july_formula } : Number(item.profit_loss.july).toFixed(1),
item.profit_loss.august, this.props.status === 'CLOSED' ? Number(item.profit_loss.august).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.august, formula: item.profit_loss.august_formula } : Number(item.profit_loss.august).toFixed(1),
item.profit_loss.september, this.props.status === 'CLOSED' ? Number(item.profit_loss.september).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.september, formula: item.profit_loss.september_formula } : Number(item.profit_loss.september).toFixed(1),
item.profit_loss.october, this.props.status === 'CLOSED' ? Number(item.profit_loss.october).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.october, formula: item.profit_loss.october_formula } : Number(item.profit_loss.october).toFixed(1),
item.profit_loss.november, this.props.status === 'CLOSED' ? Number(item.profit_loss.november).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.november, formula: item.profit_loss.november_formula } : Number(item.profit_loss.november).toFixed(1),
item.profit_loss.december, this.props.status === 'CLOSED' ? Number(item.profit_loss.december).toFixed(1) : item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.profit_loss.december, formula: item.profit_loss.december_formula } : Number(item.profit_loss.december).toFixed(1),
item.profit_loss.total_current_year, item.profit_loss.total_current_year,
item.profit_loss.total_next_year, item.profit_loss.total_next_year,
item.profit_loss.total_more_year, item.profit_loss.total_more_year,
...@@ -465,7 +465,7 @@ export default class ProfitLoss extends Component { ...@@ -465,7 +465,7 @@ export default class ProfitLoss extends Component {
handleValidate() { handleValidate() {
let data = [] let data = []
// console.log(this.state.dataTable) console.log(JSON.stringify(this.state.dataTable))
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
...@@ -785,7 +785,46 @@ export default class ProfitLoss extends Component { ...@@ -785,7 +785,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -800,7 +839,6 @@ export default class ProfitLoss extends Component { ...@@ -800,7 +839,6 @@ export default class ProfitLoss extends Component {
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}} }}
/> />
} }
...@@ -844,16 +882,6 @@ export default class ProfitLoss extends Component { ...@@ -844,16 +882,6 @@ export default class ProfitLoss extends Component {
// null // null
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
// value === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value)}
// />
null null
: :
null null
...@@ -874,7 +902,46 @@ export default class ProfitLoss extends Component { ...@@ -874,7 +902,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -964,7 +1031,46 @@ export default class ProfitLoss extends Component { ...@@ -964,7 +1031,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1054,7 +1160,46 @@ export default class ProfitLoss extends Component { ...@@ -1054,7 +1160,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1144,7 +1289,46 @@ export default class ProfitLoss extends Component { ...@@ -1144,7 +1289,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1234,7 +1418,46 @@ export default class ProfitLoss extends Component { ...@@ -1234,7 +1418,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1324,7 +1547,46 @@ export default class ProfitLoss extends Component { ...@@ -1324,7 +1547,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1414,7 +1676,46 @@ export default class ProfitLoss extends Component { ...@@ -1414,7 +1676,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1504,7 +1805,46 @@ export default class ProfitLoss extends Component { ...@@ -1504,7 +1805,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1594,7 +1934,46 @@ export default class ProfitLoss extends Component { ...@@ -1594,7 +1934,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1684,7 +2063,46 @@ export default class ProfitLoss extends Component { ...@@ -1684,7 +2063,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1774,7 +2192,46 @@ export default class ProfitLoss extends Component { ...@@ -1774,7 +2192,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1864,7 +2321,46 @@ export default class ProfitLoss extends Component { ...@@ -1864,7 +2321,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96, textAlign: 'right' }}> <div style={{ width: 96, textAlign: 'right' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null : tableMeta.rowData[0] === 2 ? null : tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1911,7 +2407,46 @@ export default class ProfitLoss extends Component { ...@@ -1911,7 +2407,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -2001,7 +2536,46 @@ export default class ProfitLoss extends Component { ...@@ -2001,7 +2536,46 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ? {
this.props.status === 'CLOSED' ?
tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -25,8 +25,8 @@ export default class SummaryOfTriputra extends Component { ...@@ -25,8 +25,8 @@ export default class SummaryOfTriputra extends Component {
{ value: 1, label: 'MTD Report' }, { value: 1, label: 'MTD Report' },
{ value: 2, label: 'YTD Report' }, { value: 2, label: 'YTD Report' },
{ value: 3, label: 'CPSM Report' }, { value: 3, label: 'CPSM Report' },
{ value: 5, label: 'Historical' }, { value: 4, label: 'Historical' },
{ value: 6, label: 'Dashboard Financial' }, { value: 5, label: 'Dashboard Financial' },
], ],
report: null, report: null,
loading: false, loading: false,
...@@ -646,10 +646,7 @@ export default class SummaryOfTriputra extends Component { ...@@ -646,10 +646,7 @@ export default class SummaryOfTriputra extends Component {
} }
render() { render() {
let datas = [
["ABCD", { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
]
const loadingComponent = ( const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> <div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader <PropagateLoader
...@@ -686,20 +683,6 @@ export default class SummaryOfTriputra extends Component { ...@@ -686,20 +683,6 @@ export default class SummaryOfTriputra extends Component {
value={this.state.report} value={this.state.report}
/> />
</div> </div>
<div style={{ marginTop: 15 }}>
<Autocomplete
{...this.state.listCompany}
id="company"
disabled={this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true, previewTable: false }, () => {
this.getSubmission()
})}
disableClearable
style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.company}
/>
</div>
<div style={{ marginTop: 15 }}> <div style={{ marginTop: 15 }}>
<Autocomplete <Autocomplete
{...this.state.listPeriode} {...this.state.listPeriode}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment