Compare commits

..

6 commits

6 changed files with 320 additions and 35 deletions

View file

@ -692,7 +692,7 @@ func connect() {
array5 := []string{} array5 := []string{}
array6 := []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 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) WHERE oc.controlNo = ?`, data)
if err != nil { if err != nil {
@ -779,26 +779,27 @@ func connect() {
}) })
case "get-printdetails-occupancy": 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, 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
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
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 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 { if err != nil {
c.AbortWithError(http.StatusBadRequest, err) c.AbortWithError(http.StatusBadRequest, err)
c.String(http.StatusBadRequest, err.Error()) c.String(http.StatusBadRequest, err.Error())
return return
} }
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"result": result, "result": result,
"result2": result2, "result2": result2,
"result3": result3, "result3": result3,
"result4": result4, "result4": result4,
"result5": result5, "result5": result5,
"result6": result6, "result6": result6,
"result7": result7, "result7": result7,
"result8": result8, "result8": result8,
"result9": result9,
"result10": result10,
}) })
case "get-printdetails-electrical": case "get-printdetails-electrical":

View file

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

View file

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

View file

@ -65,10 +65,6 @@ export default () => {
const base64 = await convertBase64(blob) const base64 = await convertBase64(blob)
setBase64image(base64 as string) 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 }) 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 _approvedDate = atom('')
export const _assessedDate = 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