Commit f2ac3d17 authored by faisalhamdi's avatar faisalhamdi

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

parents 6e90b9ac 644d4c0a
...@@ -249,14 +249,28 @@ const create = (type = "") => { ...@@ -249,14 +249,28 @@ const create = (type = "") => {
const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body) const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body)
const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body) const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body)
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver') const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver')
const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`)
const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body) const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body)
const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body) const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body)
const importRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/import_rolling_outlook', body) const importRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/import_rolling_outlook', body)
const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body) const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body)
const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body) const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body)
const createRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/create_rolling_outlook', body)
const checkImportRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/check_import', body)
const importRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/import_rolling_outlook', body)
const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body) const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body)
const createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body) const createRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/store_ro_tax_planning', body)
const getRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/get_report_hierarki', body) const getRollingOutlookCAT = (body) => api.post('transaction/cat/rolling_outlook/get_report_hierarki', body)
const getSubmitRollingOutlook = (body) => api.post('transaction/rolling_outlook/get_latest_periode_submit', body)
const getRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_operating_indicator_id', body)
const getHierarkiRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_report_hierarki', body)
const createRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/create_rolling_outlook', body)
const getLastestUpdateROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_latest_update', body)
const checkUploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/check_import', body)
const uploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook', body)
//REPORT NEW //REPORT NEW
...@@ -728,9 +742,21 @@ const create = (type = "") => { ...@@ -728,9 +742,21 @@ const create = (type = "") => {
getRollingOutlookLastUpdate, getRollingOutlookLastUpdate,
getRollingOutlookRevision, getRollingOutlookRevision,
getRollingOutlookIsApprover, getRollingOutlookIsApprover,
uploadAttachmentRO,
deleteAttachmentRO,
checkImportRollingOutlookBS, checkImportRollingOutlookBS,
importRollingOutlookBS, importRollingOutlookBS,
getRollingOutlookCAT getRollingOutlookCAT,
createRollingOutlookPL,
checkImportRollingOutlookPL,
importRollingOutlookPL,
getSubmitRollingOutlook,
getRollingOI,
getHierarkiRollingOI,
createRollingOI,
getLastestUpdateROOI,
checkUploadRollingOutlookOI,
uploadRollingOutlookOI
} }
} }
......
...@@ -50,7 +50,7 @@ export default class getAllDocument extends Component { ...@@ -50,7 +50,7 @@ export default class getAllDocument extends Component {
} }
this.setState({ loading: true }) this.setState({ loading: true })
api.create().getAllDocument(payload).then(response => { api.create().getAllDocument(payload).then(response => {
// console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -69,6 +69,7 @@ export default class getAllDocument extends Component { ...@@ -69,6 +69,7 @@ export default class getAllDocument extends Component {
String(Number(item.document_size) / 1000 + ' KB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
item.values
]) ])
} else { } else {
if (indexId !== -1) { if (indexId !== -1) {
...@@ -83,6 +84,7 @@ export default class getAllDocument extends Component { ...@@ -83,6 +84,7 @@ export default class getAllDocument extends Component {
String(Number(item.document_size) / 1000 + ' KB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
item.values
]) ])
} }
} }
...@@ -121,17 +123,18 @@ export default class getAllDocument extends Component { ...@@ -121,17 +123,18 @@ export default class getAllDocument extends Component {
} }
openPopUp = async (index, val, type) =>{ openPopUp = async (index, val, type) =>{
console.log(index)
if (type === 'download') { if (type === 'download') {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/document/download_document?documentName=`+this.state.docPath[val]+"&&fileType="+index[6] `${process.env.REACT_APP_URL_MAIN_BE}/public/document/download_document?documentName=`+this.state.docPath[val]+"&&fileType="+index[6]
) )
res = await res.blob() res = await res.blob()
// console.log(res) console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = index[1]; a.download = (String(index[3]).includes(":") ? String(index[3]).replace(":", " (") + ` )` : String(index[3])) +" - "+index[4]+" - "+index[5]+" - "+index[10]+"."+index[6];
a.click(); a.click();
} }
} }
...@@ -270,7 +273,14 @@ export default class getAllDocument extends Component { ...@@ -270,7 +273,14 @@ export default class getAllDocument extends Component {
); );
} }
} }
}, "File Name", "Description", },
{
name: "File Name",
options: {
display: false
}
},
"Description",
{ {
name: "Company Name", name: "Company Name",
options: { options: {
...@@ -289,7 +299,13 @@ export default class getAllDocument extends Component { ...@@ -289,7 +299,13 @@ export default class getAllDocument extends Component {
display: String(this.props.data.value).includes('Manual Book TIA') ? false : true display: String(this.props.data.value).includes('Manual Book TIA') ? false : true
} }
}, },
"Type", "File Size", "Created By", "Created Date" "Type", "File Size", "Created By", "Created Date",
{
name: "Category",
options: {
display: false
}
},
] ]
const loadingComponent = ( const loadingComponent = (
......
...@@ -80,7 +80,7 @@ export default class OperatingIndicator extends Component { ...@@ -80,7 +80,7 @@ export default class OperatingIndicator extends Component {
} }
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriodOI(this.state.company.company_id).then(response => { api.create().getLastPeriodOI(this.state.company.company_id).then(response => {
// console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
...@@ -190,7 +190,7 @@ export default class OperatingIndicator extends Component { ...@@ -190,7 +190,7 @@ export default class OperatingIndicator extends Component {
}) })
if (arrayBaru.length > 0) { if (arrayBaru.length > 0) {
arrayBaru = arrayBaru.sort((a,b) => a.company_name.localeCompare(b.company_name)) arrayBaru = arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name))
} }
let defaultProps = { let defaultProps = {
...@@ -315,22 +315,22 @@ export default class OperatingIndicator extends Component { ...@@ -315,22 +315,22 @@ export default class OperatingIndicator extends Component {
visibleDetailOpt: true, visibleDetailOpt: true,
visibleDetailMonthly: false, visibleDetailMonthly: false,
visibleDetailRolling: false visibleDetailRolling: false
}) })
} else if (String(item[1]).toLocaleLowerCase().includes("monthly report")) { } else if (String(item[1]).toLocaleLowerCase().includes("monthly report")) {
console.log(item); console.log(item);
let month = String(item[1]).toLocaleLowerCase().includes('jan') ? 1 : let month = String(item[1]).toLocaleLowerCase().includes('jan') ? 1 :
String(item[1]).toLocaleLowerCase().includes('feb') ? 2 : String(item[1]).toLocaleLowerCase().includes('feb') ? 2 :
String(item[1]).toLocaleLowerCase().includes('mar') ? 3 : String(item[1]).toLocaleLowerCase().includes('mar') ? 3 :
String(item[1]).toLocaleLowerCase().includes('apr') ? 4 : String(item[1]).toLocaleLowerCase().includes('apr') ? 4 :
String(item[1]).toLocaleLowerCase().includes('may') ? 5 : String(item[1]).toLocaleLowerCase().includes('may') ? 5 :
String(item[1]).toLocaleLowerCase().includes('jun') ? 6 : String(item[1]).toLocaleLowerCase().includes('jun') ? 6 :
String(item[1]).toLocaleLowerCase().includes('jul') ? 7 : String(item[1]).toLocaleLowerCase().includes('jul') ? 7 :
String(item[1]).toLocaleLowerCase().includes('aug') ? 8 : String(item[1]).toLocaleLowerCase().includes('aug') ? 8 :
String(item[1]).toLocaleLowerCase().includes('sep') ? 9 : String(item[1]).toLocaleLowerCase().includes('sep') ? 9 :
String(item[1]).toLocaleLowerCase().includes('oct') ? 10 : String(item[1]).toLocaleLowerCase().includes('oct') ? 10 :
String(item[1]).toLocaleLowerCase().includes('nov') ? 11 : String(item[1]).toLocaleLowerCase().includes('nov') ? 11 :
String(item[1]).toLocaleLowerCase().includes('dec') ? 12 : null String(item[1]).toLocaleLowerCase().includes('dec') ? 12 : null
this.setState({ this.setState({
statusDetail: String(item[2]).toLocaleLowerCase(), statusDetail: String(item[2]).toLocaleLowerCase(),
dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company }, dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company },
...@@ -339,18 +339,22 @@ export default class OperatingIndicator extends Component { ...@@ -339,18 +339,22 @@ export default class OperatingIndicator extends Component {
visibleDetailMonthly: true, visibleDetailMonthly: true,
visibleDetailRolling: false, visibleDetailRolling: false,
months: month months: month
}) })
} else if (String(item[1]).toLocaleLowerCase().includes("rolling outlook")) { } else if (String(item[1]).toLocaleLowerCase().includes("rolling outlook")) {
let quarter =String(item[1]).toLocaleLowerCase().includes('q1') ? "q1" :
String(item[1]).toLocaleLowerCase().includes('q2') ? "q2" :
String(item[1]).toLocaleLowerCase().includes('q3') ? "q3" : null
this.setState({ this.setState({
statusDetail: String(item[2]).toLocaleLowerCase(), statusDetail: String(item[2]).toLocaleLowerCase(),
dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company }, dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company },
visibleOperatingIndicator: false, visibleOperatingIndicator: false,
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: false, visibleDetailMonthly: false,
visibleDetailRolling: true visibleDetailRolling: true,
quartal: quarter
}) })
} else { } else {
this.setState({ this.setState({
...@@ -360,7 +364,7 @@ export default class OperatingIndicator extends Component { ...@@ -360,7 +364,7 @@ export default class OperatingIndicator extends Component {
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: false, visibleDetailMonthly: false,
visibleDetailRolling: true visibleDetailRolling: true
}) })
} }
...@@ -421,7 +425,7 @@ export default class OperatingIndicator extends Component { ...@@ -421,7 +425,7 @@ export default class OperatingIndicator extends Component {
} }
saveRollingOI(payload) { saveRollingOI(payload) {
api.create().createMonthlyReportOI(payload).then((response) => { api.create().createRollingOI(payload).then((response) => {
console.log(response); console.log(response);
this.getReport() this.getReport()
this.getOperatingID() this.getOperatingID()
...@@ -504,10 +508,10 @@ export default class OperatingIndicator extends Component { ...@@ -504,10 +508,10 @@ export default class OperatingIndicator extends Component {
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
tableMeta.rowData[4] ? // tableMeta.rowData[4] ?
this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2]) this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2])
: // :
null // null
} }
> >
<Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography> <Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
...@@ -640,7 +644,7 @@ export default class OperatingIndicator extends Component { ...@@ -640,7 +644,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveOperatingInd={this.saveOperatingInd.bind(this)} saveOperatingInd={this.saveOperatingInd.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
...@@ -658,7 +662,7 @@ export default class OperatingIndicator extends Component { ...@@ -658,7 +662,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveMonthlyOI={this.saveMonthlyOI.bind(this)} saveMonthlyOI={this.saveMonthlyOI.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
...@@ -669,7 +673,7 @@ export default class OperatingIndicator extends Component { ...@@ -669,7 +673,7 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail} data={this.state.dataDetail}
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
months={this.state.months} quartal={this.state.quartal}
company={this.state.company} company={this.state.company}
onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
...@@ -677,7 +681,7 @@ export default class OperatingIndicator extends Component { ...@@ -677,7 +681,7 @@ export default class OperatingIndicator extends Component {
})} })}
getReport={() => this.getOperatingID()} getReport={() => this.getOperatingID()}
saveRollingOI={this.saveRollingOI.bind(this)} saveRollingOI={this.saveRollingOI.bind(this)}
isSubmit={this.state.statusDetail == 'closed'? false : this.state.isSubmit} isSubmit={this.state.statusDetail == 'closed' ? false : this.state.isSubmit}
permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }} permission={{ create: this.state.buttonCreate, edit: this.state.buttonEdit, delete: this.state.buttonDelete }}
/> />
} }
......
...@@ -212,13 +212,15 @@ export default class RollingOutlook extends Component { ...@@ -212,13 +212,15 @@ export default class RollingOutlook extends Component {
getLatestPeriodSubmit() { getLatestPeriodSubmit() {
let body = { let body = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode,
"is_approver": this.state.isApprover,
"quartal": this.state.quarter.value
} }
api.create().getSubmitMasterBudget(body).then(response => { api.create().getSubmitRollingOutlook(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: true }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
this.getReport() this.getReport()
this.getReportAttachment() this.getReportAttachment()
}) })
...@@ -552,14 +554,14 @@ export default class RollingOutlook extends Component { ...@@ -552,14 +554,14 @@ export default class RollingOutlook extends Component {
} }
uploadAttachment(formData) { uploadAttachment(formData) {
// var object = {}; var object = {};
// formData.forEach(function (value, key) { formData.forEach(function (value, key) {
// object[key] = value; object[key] = value;
// }); });
// var json = JSON.stringify(object); var json = JSON.stringify(object);
// console.log(object) console.log(object)
// console.log(json) console.log(json)
api.create().uploadAttachment(formData).then(response => { api.create().uploadAttachmentRO(formData).then(response => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -572,7 +574,7 @@ export default class RollingOutlook extends Component { ...@@ -572,7 +574,7 @@ export default class RollingOutlook extends Component {
} }
deleteAttachment(item) { deleteAttachment(item) {
api.create().deleteAttachment(item.attachment_id).then(response => { api.create().deleteAttachmentRO(item.attachment_id).then(response => {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getRollingOutlookID() this.getRollingOutlookID()
...@@ -610,6 +612,17 @@ export default class RollingOutlook extends Component { ...@@ -610,6 +612,17 @@ export default class RollingOutlook extends Component {
let length = name.split(".").length let length = name.split(".").length
let fileType = name.split(".")[length - 1] let fileType = name.split(".")[length - 1]
console.log(fileType); console.log(fileType);
// console.log(fileurl);
let indexStrip = String(fileurl).indexOf("-")
let fileName = String(fileurl).substr(indexStrip + 1, String(fileurl).length)
let cobaSplit = String(fileName).split("-")
let mapSplit = ""
cobaSplit.map((item, index) => {
if (item != ""){
mapSplit+= index == 0 ? `${titleCase(item)}` : ` ${item}`
}
})
// console.log(mapSplit);
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
// console.log(url); // console.log(url);
let res = await fetch( let res = await fetch(
...@@ -621,7 +634,7 @@ export default class RollingOutlook extends Component { ...@@ -621,7 +634,7 @@ export default class RollingOutlook extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Rolling Outlook Attachment.xlsx'; a.download = "(Rolling Outlook Attachment) - " +mapSplit;
a.click(); a.click();
} }
} }
...@@ -760,9 +773,9 @@ export default class RollingOutlook extends Component { ...@@ -760,9 +773,9 @@ export default class RollingOutlook extends Component {
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
// tableMeta.rowData[5] == true ? tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
// : null : null
} }
> >
{/* {this.state.isApprover == true ? {/* {this.state.isApprover == true ?
...@@ -1251,8 +1264,9 @@ export default class RollingOutlook extends Component { ...@@ -1251,8 +1264,9 @@ export default class RollingOutlook extends Component {
rollingOutlookID={this.state.rollingOutlookID} rollingOutlookID={this.state.rollingOutlookID}
refresh={this.getRollingOutlookID.bind(this)} refresh={this.getRollingOutlookID.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })}
isApprover={'false'} isApprover={this.state.isApprover}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -1269,7 +1283,8 @@ export default class RollingOutlook extends Component { ...@@ -1269,7 +1283,8 @@ export default class RollingOutlook extends Component {
onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })}
refresh={this.getRollingOutlookID.bind(this)} refresh={this.getRollingOutlookID.bind(this)}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={'false'} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -1288,7 +1303,8 @@ export default class RollingOutlook extends Component { ...@@ -1288,7 +1303,8 @@ export default class RollingOutlook extends Component {
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={'false'} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
......
...@@ -64,6 +64,40 @@ export default class BalanceSheetRO extends Component { ...@@ -64,6 +64,40 @@ export default class BalanceSheetRO extends Component {
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
this.getSettingControl() this.getSettingControl()
this.handleViewOnly()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
} else {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
} }
getSettingControl() { getSettingControl() {
...@@ -212,7 +246,7 @@ export default class BalanceSheetRO extends Component { ...@@ -212,7 +246,7 @@ export default class BalanceSheetRO extends Component {
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`
) )
res = await res.blob() res = await res.blob()
// console.log(res) console.log(`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}`)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -1481,7 +1515,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1481,7 +1515,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1612,7 +1646,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1612,7 +1646,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1743,7 +1777,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1743,7 +1777,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1874,7 +1908,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1874,7 +1908,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2005,7 +2039,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2005,7 +2039,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2136,7 +2170,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2136,7 +2170,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -103,7 +103,7 @@ export default class ProfitLossROO extends Component { ...@@ -103,7 +103,7 @@ export default class ProfitLossROO extends Component {
this.getItemHierarki() this.getItemHierarki()
// this.getLatestUpdate() // this.getLatestUpdate()
// this.getSettingControl() // this.getSettingControl()
// this.handleViewOnly() this.handleViewOnly()
} }
handleViewOnly() { handleViewOnly() {
...@@ -395,7 +395,7 @@ export default class ProfitLossROO extends Component { ...@@ -395,7 +395,7 @@ export default class ProfitLossROO extends Component {
} }
console.log(payload); console.log(payload);
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create('UPLOAD').createRollingOutlookBS(payload).then(response => { api.create('UPLOAD').createRollingOutlookPL(payload).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -436,13 +436,21 @@ export default class ProfitLossROO extends Component { ...@@ -436,13 +436,21 @@ export default class ProfitLossROO extends Component {
if (i.length > 0) { if (i.length > 0) {
payload.push({ payload.push({
orders: i[0] === undefined ? "" : String(i[0]).trim(), orders: i[0] === undefined ? "" : String(i[0]).trim(),
item_report_id: i[1] === undefined ? "" : String(i[1]).trim(), "item_report_id": i[1] === undefined ? 0 : i[1],
item_report: i[2] === undefined ? "" : String(i[2]).trim(), "item_report": i[2] === undefined ? "" : String(i[2]).trim(),
notes: i[3] === undefined ? "" : String(i[3]).trim(), "notes": i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(), "january": i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
mtd_vs_mb: i[5] === undefined ? "" : String(i[5]).trim(), "february": i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
mtd_vs_rb: i[6] === undefined ? "" : String(i[6]).trim(), "march": i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
mtd_vs_previous_month: i[7] === undefined ? "" : String(i[7]).trim(), "april": i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(),
"may": i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
"june": i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
"july": i[10] === undefined ? "0" : reg.test(String(i[10])) === false ? "0" : String(i[10]).trim(),
"august": i[11] === undefined ? "0" : reg.test(String(i[11])) === false ? "0" : String(i[11]).trim(),
"september": i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
"october": i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
"november": i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
"december": i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
}) })
} }
}) })
...@@ -450,7 +458,8 @@ export default class ProfitLossROO extends Component { ...@@ -450,7 +458,8 @@ export default class ProfitLossROO extends Component {
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
months: this.props.month.month_id, quartal: this.props.quarter,
rolling_outlook_id: this.props.rollingOutlookID,
status: 'submitted', status: 'submitted',
profit_loss: payload profit_loss: payload
} }
...@@ -461,7 +470,7 @@ export default class ProfitLossROO extends Component { ...@@ -461,7 +470,7 @@ export default class ProfitLossROO extends Component {
} }
checkUpload() { checkUpload() {
api.create().checkUploadMonthlyReportPL(this.state.payload).then(response => { api.create().checkImportRollingOutlookPL(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -475,39 +484,31 @@ export default class ProfitLossROO extends Component { ...@@ -475,39 +484,31 @@ export default class ProfitLossROO extends Component {
item.formula, item.formula,
item.level, item.level,
item.item_report, item.item_report,
item.notes == null || item.notes == "null" ? "" : item.notes, item.notes,
item.rolling_outlook === null ? "" : item.rolling_outlook === "" ? "" : item.rolling_outlook, item.last_year_total === "" ? "0" : item.last_year_total,
item.master_budget === "" ? "" : item.master_budget, item.january === "" ? "0" : item.january,
item.rolling_budget === "" ? "" : item.rolling_budget, item.february === "" ? "0" : item.february,
item.actual === "" ? "" : item.actual, item.march === "" ? "0" : item.march,
0, item.april === "" ? "0" : item.april,
item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month, item.may === "" ? "0" : item.may,
// 0, item.june === "" ? "0" : item.june,
// 0, item.july === "" ? "0" : item.july,
// 0, item.august === "" ? "0" : item.august,
// 0, item.september === "" ? "0" : item.september,
// 0, item.october === "" ? "0" : item.october,
// 0, item.november === "" ? "0" : item.november,
item.amount_act_vs_previous_month, item.december === "" ? "0" : item.december,
item.percent_act_vs_previous_month, item.current_year_total === "" ? "0" : item.current_year_total,
item.amount_act_vs_mb, "",
item.percent_act_vs_mb, item.order,
item.amount_act_vs_rb,
item.percent_act_vs_rb,
item.mtd_vs_mb,
item.mtd_vs_rb,
item.mtd_vs_previous_month,
item.orders,
item.ytd_actual === null ? "" : item.ytd_actual === "" ? "" : item.ytd_actual,
item.error
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[24].length > 0) { // if (item[24].length > 0) {
// console.log('masuk') // // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true }) // this.setState({ buttonError: true, errorPreview: true })
} // }
}) })
// console.log(this.state.buttonError) // console.log(this.state.buttonError)
}) })
...@@ -517,27 +518,27 @@ export default class ProfitLossROO extends Component { ...@@ -517,27 +518,27 @@ export default class ProfitLossROO extends Component {
}) })
} }
uploadProfitLossMR(type) { uploadProfitLossRO(type) {
let data = [] let data = []
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]), "item_report": i[5],
rolling_outlook: String(Number(i[7]).toFixed(1)), "notes": String(i[6]),
master_budget: String(Number(i[8]).toFixed(1)), "last_year_total": String(Number(i[7]).toFixed(1)),
rolling_budget: String(Number(i[9]).toFixed(1)), "january": String(Number(i[8]).toFixed(1)),
actual: String(Number(i[10]).toFixed(1)), "february": String(Number(i[9]).toFixed(1)),
ytd_actual: String(Number(i[11]).toFixed(1)), "march": String(Number(i[10]).toFixed(1)),
actual_previous_month: String(Number(i[12]).toFixed(1)), "april": String(Number(i[11]).toFixed(1)),
amount_act_vs_previous_month: String(Number(i[13]).toFixed(1)), "may": String(Number(i[12]).toFixed(1)),
percent_act_vs_previous_month: i[14], "june": String(Number(i[13]).toFixed(1)),
amount_act_vs_mb: String(Number(i[15]).toFixed(1)), "july": String(Number(i[14]).toFixed(1)),
percent_act_vs_mb: i[16], "august": String(Number(i[15]).toFixed(1)),
amount_act_vs_rb: String(Number(i[17]).toFixed(1)), "september": String(Number(i[16]).toFixed(1)),
percent_act_vs_rb: i[18], "october": String(Number(i[17]).toFixed(1)),
mtd_vs_mb: String(i[19]), "november": String(Number(i[18]).toFixed(1)),
mtd_vs_rb: String(i[20]), "december": String(Number(i[19]).toFixed(1)),
mtd_vs_previous_month: String(i[21]), "current_year_total": String(Number(i[20]).toFixed(1)),
}) })
}) })
let body = { let body = {
...@@ -545,21 +546,19 @@ export default class ProfitLossROO extends Component { ...@@ -545,21 +546,19 @@ export default class ProfitLossROO extends Component {
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"periode": this.props.periode, "periode": this.props.periode,
"report_id": this.props.report_id, "report_id": this.props.report_id,
"months": this.props.month.month_id, "quartal": this.props.quarter,
"rolling_outlook_id": this.props.rollingOutlookID,
"status": type, "status": type,
"profit_loss": data "profit_loss": data
} }
console.log(data); console.log(data);
api.create('UPLOAD').uploadMonthlyReportPL(body).then(response => { api.create('UPLOAD').importRollingOutlookPL(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
if (type == 'submitted') { this.props.onClickClose()
this.props.saveToMonthlyReport('PL') this.props.refresh()
} else {
this.props.saveToMonthlyReport()
}
// this.props.onClickClose() // this.props.onClickClose()
// this.props.getReport() // this.props.getReport()
} else { } else {
...@@ -570,6 +569,8 @@ export default class ProfitLossROO extends Component { ...@@ -570,6 +569,8 @@ export default class ProfitLossROO extends Component {
window.location.reload(); window.location.reload();
}, 1000); }, 1000);
} }
this.props.onClickClose()
this.props.refresh()
}) })
// alert(response.data.status) // alert(response.data.status)
} }
...@@ -1343,7 +1344,7 @@ export default class ProfitLossROO extends Component { ...@@ -1343,7 +1344,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1441,7 +1442,7 @@ export default class ProfitLossROO extends Component { ...@@ -1441,7 +1442,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1539,7 +1540,7 @@ export default class ProfitLossROO extends Component { ...@@ -1539,7 +1540,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? true : false} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1637,7 +1638,7 @@ export default class ProfitLossROO extends Component { ...@@ -1637,7 +1638,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1735,7 +1736,7 @@ export default class ProfitLossROO extends Component { ...@@ -1735,7 +1736,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1833,7 +1834,7 @@ export default class ProfitLossROO extends Component { ...@@ -1833,7 +1834,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? true : false} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2608,7 +2609,7 @@ export default class ProfitLossROO extends Component { ...@@ -2608,7 +2609,7 @@ export default class ProfitLossROO extends Component {
: :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadProfitLossMR('draft') this.uploadProfitLossRO('draft')
}) })
} }
> >
...@@ -2625,7 +2626,7 @@ export default class ProfitLossROO extends Component { ...@@ -2625,7 +2626,7 @@ export default class ProfitLossROO extends Component {
: :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadProfitLossMR('submitted') this.uploadProfitLossRO('submitted')
})} })}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -2645,42 +2646,42 @@ export default class ProfitLossROO extends Component { ...@@ -2645,42 +2646,42 @@ export default class ProfitLossROO extends Component {
</div> </div>
{this.state.visibleUpload && ( {this.state.visibleUpload && (
alert("Coming Soon...") // alert("Coming Soon...")
// <div className="test app-popup-show"> <div className="test app-popup-show">
// <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
// <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}> <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
// <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}> <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
// <div className="popup-title"> <div className="popup-title">
// <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span> <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
// </div> </div>
// </div> </div>
// <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}> <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
// <button <button
// type="button" type="button"
// className="btn btn-circle btn-white" className="btn btn-circle btn-white"
// onClick={() => this.setState({ visibleUpload: false })} onClick={() => this.setState({ visibleUpload: false })}
// > >
// <img src={Images.close} /> <img src={Images.close} />
// </button> </button>
// </div> </div>
// </div> </div>
// <UploadFile <UploadFile
// type={this.state.uploadStatus} type={this.state.uploadStatus}
// percentage={this.state.percentage} percentage={this.state.percentage}
// result={this.state.result} result={this.state.result}
// acceptedFiles={["xlsx"]} acceptedFiles={["xlsx"]}
// onHandle={(dt) => { onHandle={(dt) => {
// this.fileHandler(dt) this.fileHandler(dt)
// this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
// }} }}
// onUpload={() => { onUpload={() => {
// String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ? String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ?
// this.checkUpload() : this.checkUpload() :
// this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
// }} }}
// /> />
// </div> </div>
// </div> </div>
)} )}
</div> </div>
) )
......
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