Compare commits

...

6 commits

6 changed files with 320 additions and 35 deletions

View file

@ -692,7 +692,7 @@ func connect() {
array5 := []string{}
array6 := []string{}
results, err := db.Query(`SELECT IFNULL(r.locationofconstruction, '') AS result, IFNULL(CONCAT(ro.occupancy, '-', rot.occupancyType), '') AS result2, IFNULL(em.employeename, '') AS result3, IFNULL(o.amount, '') AS result4, IFNULL(o.assessedDate, '') AS result5, IFNULL(oc.occupancyid, 0) AS result6
results, err := db.Query(`SELECT IFNULL(r.locationofconstruction, '') AS result, IFNULL(CONCAT(ro.occupancy, ' - ', rot.occupancyType), '') AS result2, IFNULL(em.employeename, '') AS result3, IFNULL(o.amount, '') AS result4, IFNULL(o.assessedDate, '') AS result5, IFNULL(oc.occupancyid, 0) AS result6
FROM occupancy oc LEFT JOIN receiving r ON oc.bldgApplicationNo = r.applicationNo JOIN ref_occupancy_type rot ON oc.ref_occupancy_typeid = rot.ref_occupancy_typeid JOIN ref_occupancy ro ON rot.ref_occupancyid = ro.ref_occupancyid JOIN occupancy_orderofpayment o ON oc.occupancyid = o.occupancyid JOIN employee em ON o.assessedbyid = em.employeeid
WHERE oc.controlNo = ?`, data)
if err != nil {
@ -779,26 +779,27 @@ func connect() {
})
case "get-printdetails-occupancy":
var result2, result3, result4, result5, result6, result7, result8 string
var result2, result3, result4, result5, result6, result7, result8, result9, result10 string
err := db.QueryRow(`SELECT DISTINCT IFNULL(o.controlNo, '') AS result, IFNULL(op.opDate, '') AS result2, IFNULL(r.locationofconstruction, '') AS result3, IFNULL(ro.occupancy, '') AS result4, IFNULL(rot.occupancyType, '') AS result5, IFNULL(o.noOfPermitsApplied, '') AS result6, IFNULL(e.employeename, '') AS result7,
IF(cu.firstName IS NULL OR cu.firstName = '', cu.lastName, CONCAT(cu.firstName, ' ', IF(cu.middleInitial IS NULL OR cu.middleInitial = '', '', CONCAT(cu.middleInitial, '. ')), cu.lastName) ) AS result8
err := db.QueryRow(`SELECT DISTINCT IFNULL(o.controlNo, '') AS result, IFNULL(op.opDate, '') AS result2, IFNULL(r.locationofconstruction, '') AS result3, IFNULL(ro.occupancy, '') AS result4, IFNULL(rot.occupancyType, '') AS result5, IFNULL(o.noOfPermitsApplied, '') AS result6, IFNULL(e.employeename, '') AS result7, IF(cu.firstName IS NULL OR cu.firstName = '', cu.lastName, CONCAT(cu.firstName, ' ', IF(cu.middleInitial IS NULL OR cu.middleInitial = '', '', CONCAT(cu.middleInitial, '. ')), cu.lastName) ) AS result8, IFNULL(op.numUnits, 0) AS result9, IFNULL(o.totalFloorArea, 0) AS result10
FROM occupancy o LEFT JOIN receiving r on o.bldgApplicationNo = r.applicationNo JOIN occupancy_orderofpayment op ON o.occupancyid = op.occupancyid JOIN ref_occupancy_type rot ON o.ref_occupancy_typeid = rot.ref_occupancy_typeid JOIN ref_occupancy ro ON rot.ref_occupancyid = ro.ref_occupancyid JOIN customer cu ON o.customerid = cu.customerid JOIN employee e ON op.assessedbyid = e.employeeid
WHERE op.is_approve = 1 AND op.for_approval = 1 AND op.is_release = 0 AND is_paid = 0 AND popstransmitted = 0 AND o.occupancyid = ?`, data).Scan(&result, &result2, &result3, &result4, &result5, &result6, &result7, &result8)
WHERE op.is_approve = 1 AND op.for_approval = 1 AND op.is_release = 0 AND is_paid = 0 AND popstransmitted = 0 AND o.occupancyid = ?`, data).Scan(&result, &result2, &result3, &result4, &result5, &result6, &result7, &result8, &result9, &result10)
if err != nil {
c.AbortWithError(http.StatusBadRequest, err)
c.String(http.StatusBadRequest, err.Error())
return
}
c.JSON(http.StatusOK, gin.H{
"result": result,
"result2": result2,
"result3": result3,
"result4": result4,
"result5": result5,
"result6": result6,
"result7": result7,
"result8": result8,
"result": result,
"result2": result2,
"result3": result3,
"result4": result4,
"result5": result5,
"result6": result6,
"result7": result7,
"result8": result8,
"result9": result9,
"result10": result10,
})
case "get-printdetails-electrical":

View file

@ -8,9 +8,10 @@ import { checkConnection, createPdf } from '../../utils/functions'
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 } from '../../stores/pdfinfo'
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate, _units, _totalUnits, _floorArea } from '../../stores/pdfinfo'
import { VsRefresh } from 'solid-icons/vs'
import { getApi, getApiMulti, postApi } from '../../utils/functions'
import createPdfOccupancy from '../../utils/functions/createPdfOccupancy'
const PESO = import.meta.env.VITE_PESO
@ -56,6 +57,17 @@ export default () => {
const name = response.result8
const type = `${response.result4} - ${response.result5}`
const assessor = response.result7
const units = response.result6
let totalUnits = 0
let floorArea = 0
if (division === 'occupancy') {
totalUnits = response.result9
floorArea = response.result10
_totalUnits.set(totalUnits)
_floorArea.set(floorArea)
}
_optn.set('M' + applicationno.split('-')[0] + applicationno.split('-')[1])
_applicationNo.set(applicationno)
@ -65,6 +77,7 @@ export default () => {
_type.set(type)
_assessor.set(assessor)
_assessorid.set(employeeId())
_units.set(units)
}
const getPrintDetailsFees = async (division: string, id: number) => {
@ -209,20 +222,22 @@ export default () => {
return
}
signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT PRINTED', '171', 'ELECOPPRINTED', 1)
if (!signed) return
// signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT PRINTED', '171', 'ELECOPPRINTED', 1)
// if (!signed) return
forprinting = await setNewStatus(division, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION', '98', 'ELECORVALIDATE', 0)
if (!forprinting) return
// forprinting = await setNewStatus(division, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION', '98', 'ELECORVALIDATE', 0)
// if (!forprinting) return
updateOrderofpayment = await updateOp(division)
// updateOrderofpayment = await updateOp(division)
if (updateOrderofpayment) {
postTransaction(application)
setPrintedApplication(application)
setPrinted(true)
// if (updateOrderofpayment) {
// postTransaction(application)
setPrintedApplication(application)
setPrinted(true)
if (division === 'electrical') {
createPdf()
}
} else createPdfOccupancy()
// }
}
const updateOp = async (division: string) => {

View file

@ -448,7 +448,7 @@ export default () => {
</Padding>
<Row>
<table class="table__disabled">
<table class="table">
<thead>
<tr>
<th>Application Number</th>
@ -463,15 +463,15 @@ export default () => {
<td>{nameListOccupancy()[index]}</td>
<td>
<Button
// class="modal"
<ModalButton
class="modal"
label="Show Details"
design="bo-link"
background="#121e2acc"
color="#ffffffec"
onClick={async () => {
setApology(true)
setErrorMessage('Modification of Occupancy Printing has not yet finished')
function={async () => {
// setApology(true)
// setErrorMessage('Modification of Occupancy Printing has not yet finished')
await getopdetails('occupancy', item)
}}
>
@ -517,7 +517,7 @@ export default () => {
<span class="modal__cancel">Click anywhere to cancel</span>
</Row>
</Padding>
</Button>
</ModalButton>
</td>
</tr>
))}

View file

@ -65,10 +65,6 @@ export default () => {
const base64 = await convertBase64(blob)
setBase64image(base64 as string)
// await ofetch(API + 'post-registration', {
// method: 'POST',
// body: { data: globalId, data2: globalHashPassword, data3: signature(), data4: base64 },
// })
await postApi('post-registration', { data: globalId, data2: globalHashPassword, data3: signature(), data4: base64 })
}

View file

@ -19,3 +19,7 @@ export const _signatureApprover = atom('')
export const _approvedDate = atom('')
export const _assessedDate = atom('')
export const _units = atom(0)
export const _totalUnits = atom(0)
export const _floorArea = atom(0)

File diff suppressed because one or more lines are too long