Commit 246cfd3b authored by d.arizona's avatar d.arizona

apdet

parent e81216cf
......@@ -168,6 +168,8 @@ const create = (type = "") => {
const getReportParent = (body) => api.post('item_report/get_parent_item_report', body)
const deleteReportItems = (id) => api.post(`item_report/delete_item_report/${id}`)
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
const getAllParameter = () => api.get('/setting/get_all_setting')
......@@ -335,7 +337,9 @@ const create = (type = "") => {
createOpetaingInd,
uploadMasterBudget,
getAllSettingByType,
getOpetratingIndID
getOpetratingIndID,
createAllItemReport,
deleteAllItemReport
}
}
......
......@@ -182,7 +182,7 @@ export default class ProfitLoss extends Component {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: String(i[6]),
notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
......@@ -397,15 +397,23 @@ export default class ProfitLoss extends Component {
if (type === "actual") {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} else {
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = dataTable2[indexParent][tableMeta.columnIndex]
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else {
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) {
// // console.log(indexParent)
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// let jagain = dataTable2[indexParent][tableMeta.columnIndex]
// a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
// } else {
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) => {
......
......@@ -1170,7 +1170,7 @@ export default class BalanceSheet extends Component {
</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()}>
<MUIDataTable
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