Commit 94219474 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !343
parents e81216cf 246cfd3b
...@@ -168,6 +168,8 @@ const create = (type = "") => { ...@@ -168,6 +168,8 @@ const create = (type = "") => {
const getReportParent = (body) => api.post('item_report/get_parent_item_report', body) const getReportParent = (body) => api.post('item_report/get_parent_item_report', body)
const deleteReportItems = (id) => api.post(`item_report/delete_item_report/${id}`) const deleteReportItems = (id) => api.post(`item_report/delete_item_report/${id}`)
const getAllSettingByType = (body) => api.post('setting/get_all_setting_by_type', body) const getAllSettingByType = (body) => api.post('setting/get_all_setting_by_type', body)
const createAllItemReport = (body) => api.post('item_report/create_all_item_report', body)
const deleteAllItemReport = (body) => api.post('/item_report/delete_all_item_report', body)
//PARAMETER //PARAMETER
const getAllParameter = () => api.get('/setting/get_all_setting') const getAllParameter = () => api.get('/setting/get_all_setting')
...@@ -335,7 +337,9 @@ const create = (type = "") => { ...@@ -335,7 +337,9 @@ const create = (type = "") => {
createOpetaingInd, createOpetaingInd,
uploadMasterBudget, uploadMasterBudget,
getAllSettingByType, getAllSettingByType,
getOpetratingIndID getOpetratingIndID,
createAllItemReport,
deleteAllItemReport
} }
} }
......
...@@ -182,7 +182,7 @@ export default class ProfitLoss extends Component { ...@@ -182,7 +182,7 @@ export default class ProfitLoss extends Component {
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
notes: String(i[6]), notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(i[7]), total_actual_before: String(i[7]),
january: String(i[8]), january: String(i[8]),
february: String(i[9]), february: String(i[9]),
...@@ -397,15 +397,23 @@ export default class ProfitLoss extends Component { ...@@ -397,15 +397,23 @@ export default class ProfitLoss extends Component {
if (type === "actual") { if (type === "actual") {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} else { } else {
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2]) // let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) { // if (indexParent > 0) {
// console.log(indexParent) // // console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) // let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = dataTable2[indexParent][tableMeta.columnIndex] // let jagain = dataTable2[indexParent][tableMeta.columnIndex]
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val)) // a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
} else { // } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// }
let total = 0
dataTable2[tableMeta.rowIndex].map((item,index) => {
if (index >= 8 && index <= 19) {
let valItem = item == undefined || item == ""? 0 : item
total += Number(valItem)
} }
})
dataTable2[tableMeta.rowIndex][20] = total
} }
} }
const handleNotes = (value, tableMeta) => { const handleNotes = (value, tableMeta) => {
......
...@@ -1170,7 +1170,7 @@ export default class BalanceSheet extends Component { ...@@ -1170,7 +1170,7 @@ export default class BalanceSheet extends Component {
</div> </div>
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}> {!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
......
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