Added detection for bldg additional
This commit is contained in:
parent
291876985c
commit
e82a2c14f5
1 changed files with 55 additions and 11 deletions
|
|
@ -8,7 +8,7 @@ import { checkConnection, createPdfOccupancy, createPdfElectrical } from '../../
|
|||
import { FaSolidThumbsUp } from 'solid-icons/fa'
|
||||
import { _employeeName, _employeeId } from '../../stores/employee'
|
||||
import { useNavigate } from '@solidjs/router'
|
||||
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate, _units, _totalUnits, _floorArea } from '../../stores/pdfinfo'
|
||||
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate, _units, _totalUnits, _floorArea, _additional, _additionalFeeList, _additionalAmountList, _additionalCodeList, _additionalUnitList } from '../../stores/pdfinfo'
|
||||
import { VsRefresh } from 'solid-icons/vs'
|
||||
import { getApi, getApiMulti, postApi } from '../../utils/functions'
|
||||
|
||||
|
|
@ -90,6 +90,22 @@ export default () => {
|
|||
_feeList.set(feeList)
|
||||
_codeList.set(accountCodeList)
|
||||
_amountList.set(amountList)
|
||||
|
||||
_additional.set(false)
|
||||
|
||||
if (division === 'occupancy' && bldgadditional) {
|
||||
const response = await getApiMulti('get-printdetailsfees-bldgadditional', id)
|
||||
const feeList = response.result
|
||||
const accountCodeList = response.result2
|
||||
const amountList = response.result3
|
||||
const unitList = response.result4
|
||||
|
||||
_additional.set(true)
|
||||
_additionalFeeList.set(feeList)
|
||||
_additionalCodeList.set(accountCodeList)
|
||||
_additionalAmountList.set(amountList)
|
||||
_additionalUnitList.set(unitList)
|
||||
}
|
||||
}
|
||||
|
||||
// const calculateAmounts = () => {
|
||||
|
|
@ -142,6 +158,10 @@ export default () => {
|
|||
// if (division === 'occupancy') op = await getApiMulti('get-opdetails-occupancy', applicationNo)
|
||||
// if (division === 'electrical') op = await getApiMulti('get-opdetails-electrical', applicationNo)
|
||||
|
||||
const additionalResult = await getApi('check-bldgadditional-printing', applicationNo)
|
||||
bldgadditional = additionalResult > 0
|
||||
console.log('additionalResult', additionalResult)
|
||||
|
||||
const op = await getApiMulti(`get-opdetails-${division}`, applicationNo)
|
||||
|
||||
setLocation(op.result[0])
|
||||
|
|
@ -227,9 +247,6 @@ export default () => {
|
|||
await setNewStatus(division, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION', '98', 'ELECORVALIDATE', 0)
|
||||
await updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING')
|
||||
} else if (division === 'occupancy') {
|
||||
const additionalResult = await getApi('check-bldgadditional-approval', application)
|
||||
bldgadditional = additionalResult > 0
|
||||
|
||||
await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT PRINTED', '173', 'OCCOPPRINTED', 1)
|
||||
await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT RELEASED', '174', 'OCCOPRELEASED', 1)
|
||||
await setNewStatus(division, 'ORDER OF PAYMENT RELEASE FOR BUREAU OF FIRE', '24', 'OCOOPRELEASE', 0)
|
||||
|
|
@ -242,14 +259,19 @@ export default () => {
|
|||
postTransaction(application)
|
||||
setPrintedApplication(application)
|
||||
setPrinted(true)
|
||||
|
||||
if (division === 'electrical') {
|
||||
createPdfElectrical()
|
||||
} else createPdfOccupancy()
|
||||
} else if (division === 'occupancy') {
|
||||
createPdfOccupancy()
|
||||
} else console.log('building')
|
||||
}
|
||||
}
|
||||
|
||||
const updateOp = async (division: string) => {
|
||||
const post = await postApi(`update-opprinted-${division}`, { data: parseInt(applicationId().toString()) })
|
||||
const post = await postApi(`update-opprinted-${division}`, {
|
||||
data: parseInt(applicationId().toString()),
|
||||
})
|
||||
return post
|
||||
}
|
||||
|
||||
|
|
@ -258,12 +280,23 @@ export default () => {
|
|||
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
const statusid = parseInt(applicationId().toString())
|
||||
|
||||
const post = await postApi(`post-newstatus-${division}`, { data: statusid, data2: formattedDate, data3: status, data4: tag, data5: tagword, data6: parseInt(approved.toString()), data7: parseInt(employeeId().toString()) })
|
||||
const post = await postApi(`post-newstatus-${division}`, {
|
||||
data: statusid,
|
||||
data2: formattedDate,
|
||||
data3: status,
|
||||
data4: tag,
|
||||
data5: tagword,
|
||||
data6: parseInt(approved.toString()),
|
||||
data7: parseInt(employeeId().toString()),
|
||||
})
|
||||
return post
|
||||
}
|
||||
|
||||
const updateDocflow = async (division: string, application: string, status: string) => {
|
||||
await postApi(`update-docflow-${division}`, { data: status, data2: application })
|
||||
await postApi(`update-docflow-${division}`, {
|
||||
data: status,
|
||||
data2: application,
|
||||
})
|
||||
}
|
||||
|
||||
const getSignatureImage = async (id: number) => {
|
||||
|
|
@ -296,7 +329,11 @@ export default () => {
|
|||
const today = new Date()
|
||||
const formatedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
||||
await postApi('post-esigntransaction', { data: parseInt(id), data2: application, data3: formatedDate })
|
||||
await postApi('post-esigntransaction', {
|
||||
data: parseInt(id),
|
||||
data2: application,
|
||||
data3: formatedDate,
|
||||
})
|
||||
}
|
||||
|
||||
const getApprovedDate = async (id: number, application: string) => {
|
||||
|
|
@ -348,6 +385,7 @@ export default () => {
|
|||
|
||||
createEffect(async () => {
|
||||
if (filter() !== '') {
|
||||
console.log('empty')
|
||||
if (isBuilding()) await getListForPrinting('building')
|
||||
if (isOccupancy()) await getListForPrinting('occupancy')
|
||||
if (isElectrical()) await getListForPrinting('electrical')
|
||||
|
|
@ -504,7 +542,10 @@ export default () => {
|
|||
<section class="modal__row">
|
||||
<span class="modal__row__label">Total Fee:</span>
|
||||
<span class="modal__row__detail__price">
|
||||
{PESO} {totalOp().toLocaleString('en-US', { minimumFractionDigits: 2 })}
|
||||
{PESO}{' '}
|
||||
{totalOp().toLocaleString('en-US', {
|
||||
minimumFractionDigits: 2,
|
||||
})}
|
||||
</span>
|
||||
</section>
|
||||
</Padding>
|
||||
|
|
@ -592,7 +633,10 @@ export default () => {
|
|||
<section class="modal__row">
|
||||
<span class="modal__row__label">Total Fee:</span>
|
||||
<span class="modal__row__detail__price">
|
||||
{PESO} {totalOp().toLocaleString('en-US', { minimumFractionDigits: 2 })}
|
||||
{PESO}{' '}
|
||||
{totalOp().toLocaleString('en-US', {
|
||||
minimumFractionDigits: 2,
|
||||
})}
|
||||
</span>
|
||||
</section>
|
||||
</Padding>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue