Commit b28f51f7 authored by d.arizona's avatar d.arizona

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

parents d32dd49a 3a2002bb
......@@ -265,8 +265,7 @@ const create = (type = "") => {
// const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body)
const getHierarkiMontlyReportTP = (body) => api.post('transaction/tax_planning/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/get_report_hierarki', body)
// const getHierarkiMontlyReportFAM = (body) => api.post('transaction/fam/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportFAM = (body) => api.post('transaction/monthly_report/fam/get_report_hierarki', body)
const getHierarkiMontlyReportFAM = (body) => api.post('transaction/fam/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportCF = (body) => api.post('transaction/cash_flow/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportCAT = (body) => api.post('/transaction/cat/monthly_report/get_report_hierarki', body)
const getLastPeriodMonthly = (idCompany) => api.get(`transaction/monthly_report/get_last_periode/${idCompany}`)
......@@ -281,22 +280,19 @@ const create = (type = "") => {
const createMonthlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/create_monthly_report', body)
// const createMonthlyReportTP = (body) => api.post('transaction/monthly_report_tp/create_monthly_report', body)
const createMonthlyReportTP = (body) => api.post('transaction/tax_planning/monthly_report/create_monthly_report', body)
// const createMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/create_monthly_report', body)
const createMonthlyReportFAM = (body) => api.post('transaction/monthly_report/fam/create_monthly_report', body)
const createMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/create_monthly_report', body)
const createMonthlyReportOI = (body) => api.post('transaction/monthly_report_oi/create_monthly_report', body)
const createMonthlyReportCAT = (body) => api.post('transaction/cat/monthly_report/create_monthly_report', body)
// const checkUploadMonthlyReportTP = (body) => api.post('transaction/monthly_report_tp/check_import', body)
const checkUploadMonthlyReportTP = (body) => api.post('transaction/tax_planning/monthly_report/check_import', body)
// const checkUploadMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/check_import', body)
const checkUploadMonthlyReportFAM = (body) => api.post('transaction/monthly_report/fam/check_import', body)
const checkUploadMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/check_import', body)
// const checkUploadMonthlyReportBS = (body) => api.post('transaction/monthly_report_bs/check_import', body)
const checkUploadMonthlyReportBS = (body) => api.post('transaction/balance_sheet/monthly_report/check_import', body)
const checkUploadMonthlyReportOI = (body) => api.post('transaction/monthly_report_oi/check_import', body)
const checkUploadMonthlyReportCAT = (body) => api.post('transaction/cat/monthly_report/check_import', body)
// const uploadMonthlyReportBS = (body) => api.post('transaction/monthly_report_bs/import_monthly_report', body)
const uploadMonthlyReportBS = (body) => api.post('transaction/balance_sheet/monthly_report/import_monthly_report', body)
// const uploadMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/import_monthly_report', body)
const uploadMonthlyReportFAM = (body) => api.post('transaction/monthly_report/fam/import_monthly_report', body)
const uploadMonthlyReportFAM = (body) => api.post('transaction/fam/monthly_report/import_monthly_report', body)
// const uploadMonthlyReportTP = (body) => api.post('transaction/monthly_report_tp/import_monthly_report', body)
const uploadMonthlyReportTP = (body) => api.post('transaction/tax_planning/monthly_report/import_monthly_report', body)
const uploadMonthlyReportOI = (body) => api.post('transaction/monthly_report_oi/import_monthly_report', body)
......
......@@ -54,6 +54,7 @@ export default class BalanceSheetMR extends Component {
notes: "",
judulColumn: null,
get_for: "view",
viewOnly : true,
kansas: 0
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -62,6 +63,36 @@ export default class BalanceSheetMR extends Component {
componentDidMount() {
this.getSettingControl()
this.getLatestUpdate()
this.handleViewOnly()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = 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})
}
getLatestUpdate() {
......@@ -2598,7 +2629,7 @@ export default class BalanceSheetMR extends Component {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
className="button"
type="button"
style={{
......
......@@ -1801,14 +1801,14 @@ export default class CorporateAnnualTargetMR extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1825,7 +1825,7 @@ export default class CorporateAnnualTargetMR extends Component {
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1833,7 +1833,7 @@ export default class CorporateAnnualTargetMR extends Component {
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
......@@ -1943,14 +1943,14 @@ export default class CorporateAnnualTargetMR extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1967,7 +1967,7 @@ export default class CorporateAnnualTargetMR extends Component {
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1975,7 +1975,7 @@ export default class CorporateAnnualTargetMR extends Component {
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
......
......@@ -48,7 +48,8 @@ export default class FixedAssetsMovementMR extends Component {
visibleFAMMR: true,
updateBy: '-',
notesUpdate: '-',
get_for: 'view'
get_for: 'view',
viewOnly : true
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -56,6 +57,7 @@ export default class FixedAssetsMovementMR extends Component {
componentDidMount() {
this.getItemHierarki()
this.getLatestUpdate()
this.handleViewOnly()
}
handleGetFor(type) {
......@@ -65,6 +67,35 @@ export default class FixedAssetsMovementMR extends Component {
})
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = 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})
}
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
......@@ -1328,7 +1359,7 @@ export default class FixedAssetsMovementMR extends Component {
<div className="col-2"></div>
:
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
className="button"
type="button"
style={{
......@@ -1375,14 +1406,14 @@ export default class FixedAssetsMovementMR extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1396,10 +1427,10 @@ export default class FixedAssetsMovementMR extends Component {
</button>}
{this.state.get_for == 'edit' && <button
type="button"
disabled={this.state.buttonError}
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1407,7 +1438,7 @@ export default class FixedAssetsMovementMR extends Component {
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
......@@ -1493,14 +1524,14 @@ export default class FixedAssetsMovementMR extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
......@@ -1517,7 +1548,7 @@ export default class FixedAssetsMovementMR extends Component {
disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
......@@ -1525,7 +1556,7 @@ export default class FixedAssetsMovementMR extends Component {
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
......
......@@ -65,6 +65,7 @@ export default class OperatingIndicatorMR extends Component {
templateNull: true,
judulColumn: null,
saveDraft: true,
viewOnly : true,
get_for: 'view'
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -73,9 +74,39 @@ export default class OperatingIndicatorMR extends Component {
componentDidMount() {
// this.getItemHierarki()
this.getSettingControl()
this.handleViewOnly()
// this.getLatestUpdate()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = 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})
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getSettingControl()
......@@ -1678,7 +1709,7 @@ export default class OperatingIndicatorMR extends Component {
</button>
</div>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 2 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
type="button"
onClick={() => {
this.setState({loading: true}, () => {
......
......@@ -92,6 +92,7 @@ export default class ProfitLossMR extends Component {
handleTekTekTek: 0,
saveDraft: true,
buttonError: true,
viewOnly : true,
get_for: 'view'
}
......@@ -102,6 +103,36 @@ export default class ProfitLossMR extends Component {
// this.getItemHierarki()
this.getLatestUpdate()
this.getSettingControl()
this.handleViewOnly()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = 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})
}
handleGetFor(type) {
......@@ -2118,7 +2149,7 @@ export default class ProfitLossMR extends Component {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
className="button"
type="button"
style={{
......
......@@ -54,7 +54,8 @@ export default class TaxPlanningMR extends Component {
handleTekTekTek: 0,
saveDraft: true,
buttonError: true,
get_for: "view"
get_for: "view",
viewOnly : true
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -64,6 +65,36 @@ export default class TaxPlanningMR extends Component {
this.getSettingControl()
// this.getItemHierarki()
this.getLatestUpdate()
this.handleViewOnly()
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = 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})
}
handleGetFor(type) {
......@@ -1560,7 +1591,7 @@ export default class TaxPlanningMR extends Component {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
className="button"
type="button"
style={{
......@@ -1610,7 +1641,8 @@ export default class TaxPlanningMR extends Component {
type="button"
onClick={() =>
this.state.saveDraft === true ?
null :
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
setTimeout(() => {
......@@ -1620,7 +1652,7 @@ export default class TaxPlanningMR extends Component {
}
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -1635,7 +1667,7 @@ export default class TaxPlanningMR extends Component {
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
......@@ -1646,7 +1678,7 @@ export default class TaxPlanningMR extends Component {
}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
......@@ -1726,13 +1758,13 @@ export default class TaxPlanningMR extends Component {
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.state.saveDraft === true ?
null
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
......@@ -1750,12 +1782,12 @@ export default class TaxPlanningMR extends Component {
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => this.state.editable === true ?
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
......
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