Compare commits

..

4 commits

4 changed files with 124 additions and 34 deletions

View file

@ -40,7 +40,7 @@ func getCORSConfig(env string) cors.Config {
}
case "prod":
return cors.Config{
AllowOrigins: []string{"https://ocboapps.davaocity.gov.ph", "https://esign.patalcala.com", "http://localhost:8080", "http://192.168.7.183"},
AllowOrigins: []string{"https://ocboapps.davaocity.gov.ph", "https://esign.patalcala.com"},
AllowMethods: []string{"GET", "POST", "OPTIONS", "DELETE"},
// AllowHeaders: []string{"Origin", "OCBO-Token", "Content-Length", "Content-Type", "X-Server", "Authorization"},
AllowHeaders: []string{"*"},
@ -1492,7 +1492,18 @@ func connect() {
})
case "check-esigntransaction":
err := db.QueryRow("SELECT COUNT(esign_transactionsid) FROM esign_transactions WHERE referenceNo = ?", data).Scan(&result)
err := db.QueryRow("SELECT COUNT(esign_transactionsid) AS result FROM esign_transactions WHERE referenceNo = ?", data).Scan(&result)
if err != nil {
c.AbortWithError(http.StatusBadRequest, err)
c.String(http.StatusBadRequest, err.Error())
return
}
c.JSON(http.StatusOK, gin.H{
"result": result,
})
case "check-esignlock":
err := db.QueryRow("SELECT COUNT(esign_lockid) AS result FROM esign_lock WHERE referenceNo = ?", data).Scan(&result)
if err != nil {
c.AbortWithError(http.StatusBadRequest, err)
c.String(http.StatusBadRequest, err.Error())
@ -2707,7 +2718,7 @@ func connect() {
c.Writer.Header().Set("Content-Security-Policy", "default-src 'self'; img-src 'self';")
c.Writer.Header().Set("X-Server", "OCBO Server")
dbpost, err := dbpop.Prepare("DELETE FROM esign_transactions WHERE referenceNo = ?")
dbpost, err := db.Prepare("DELETE FROM esign_transactions WHERE referenceNo = ?")
if err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
c.String(http.StatusInternalServerError, "Internal Server Error")
@ -2732,5 +2743,49 @@ func connect() {
}
})
router.DELETE("/api/delete-esignlock", middleware.TokenChecker(), func(c *gin.Context) {
type DeleteLock struct {
Data string `json:"data"`
}
var deleteLock DeleteLock
if err := c.ShouldBindJSON(&deleteLock); err != nil {
c.String(http.StatusBadRequest, "Invalid request body")
return
}
c.Writer.Header().Set("X-XSS-Protection", "1; mode=block")
c.Writer.Header().Set("X-Content-Type-Options", "nosniff")
c.Writer.Header().Set("X-DNS-Prefetch-Control", "off")
c.Writer.Header().Set("X-Frame-Options", "DENY")
c.Writer.Header().Set("X-Download-Options", "noopen")
c.Writer.Header().Set("Referrer-Policy", "no-referrer")
c.Writer.Header().Set("Content-Security-Policy", "default-src 'self'; img-src 'self';")
c.Writer.Header().Set("X-Server", "OCBO Server")
dbpost, err := db.Prepare("DELETE FROM esign_lock WHERE referenceNo = ?")
if err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
c.String(http.StatusInternalServerError, "Internal Server Error")
return
}
defer dbpost.Close()
exec, err := dbpost.Exec(deleteLock.Data)
if err != nil {
panic(err.Error())
}
affect, err := exec.RowsAffected()
if err != nil {
panic(err.Error())
}
if affect > 0 {
c.String(http.StatusOK, "Success on Deleting eSign Lock")
} else {
c.String(http.StatusInternalServerError, "Failed on Deleting eSign Lock")
}
})
router.Run(":4320")
}

View file

@ -190,6 +190,7 @@ export default () => {
const closeNotification = async () => {
setPrinted(false)
setVoidNotification(false)
await checkDivision()
if (isBuilding()) await getListForPrinting('building')
if (isOccupancy()) await getListForPrinting('occupancy')
@ -394,7 +395,7 @@ export default () => {
return
}
setLoadingText('Processing for Re-approval')
setLoadingText('Processing for Re-approval Status')
if (division === 'electrical') {
await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT VOIDED', '173', 'ELECOPVOIDED', 1)
await setNewStatus(division, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL', '94', 'ELECOPAPPROVE', 0)
@ -403,28 +404,28 @@ export default () => {
if (checkOpPrinting) {
await updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING')
}
setLoadingText('Processing for Re-approval')
const checkOrValidation = await checkDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION')
if (checkOrValidation) {
await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION')
}
// await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION')
await updateOpForApproval(division, application)
setLoadingText('Processing for Re-approval')
setLoadingText('Clearing transactions and locked data')
await clearEsignTransactions(application)
await clearEsignLock(application)
} else if (division === 'occupancy') {
await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT VOIDED', '174', 'OCCOPVOIDED', 1)
//UNFINISH
await updateDocflow(division, application, 'APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT')
}
setLoadingText('Voiding POPS record')
const successVoid = BACKEND.includes('localhost') ? await voidPopsOpLocal(application) : await voidPopsOp(application)
if (successVoid) {
await postTransaction(application)
setIsLoading(false)
setPrintedApplication(application)
setVoidNotification(true)
setIsLoading(false)
} else {
setIsLoading(false)
}
@ -584,6 +585,18 @@ export default () => {
}
}
const clearEsignLock = async (application: string) => {
let deleteLock
const check = await getApi('check-esignlock', application)
if (parseInt(check) > 0) {
deleteLock = await deleteApi('delete-esignlock', { data: application })
return deleteLock
} else {
return 0
}
}
const saveConfig = async () => {
if (configNewName() !== '') await saveNewName(parseInt(employeeId().toString()), configNewName())
if (configNewPassword() !== '') await saveNewPassword(parseInt(employeeId().toString()), configNewEncPassword())
@ -1173,7 +1186,7 @@ export default () => {
</Modal>
</div>
<div onClick={() => setVoidNotification(false)}>
<div onClick={closeNotification}>
<Modal trigger={voidNotification() === true} background="#123220ff" color="#cdfbe1f0" opacity={0.8}>
<Padding top={1} bottom={1} left={2} right={2}>
<Column>

View file

@ -39,6 +39,12 @@
&__last
@extend .modal-tooltip__subinfo
padding: 0 0 .55rem 4.45rem
&__nextline
padding: 0 0 0 4.95rem
&__bold
font-weight: 700
&__category
padding: 0.15rem 0.55rem
@ -68,3 +74,11 @@
&__note-info
padding: 0 0 0.25rem 0
font-size: 0.75rem
.modal-h3
margin: 0
.modal-h5
@extend .modal-h3
padding: 0.25rem 0 0.5rem 0
opacity: 0.8

View file

@ -1,6 +1,6 @@
import { useNavigate } from '@solidjs/router'
import { IoChevronBack } from 'solid-icons/io'
import { createEffect, createSignal } from 'solid-js'
import { createEffect, createSignal, onMount } from 'solid-js'
import { Show } from 'solid-js/web'
import { Box, Button, Column, Combobox, Display, Input, Link, Logo, Modal, Padding, Page, Radio, Row, Clickable } from '../../components'
import { _employeeId, _employeeName } from '../../stores/employee'
@ -77,11 +77,21 @@ export default () => {
sessionStorage.setItem('name', _employeeName.get())
}
const closeChangesNotification = () => {
setOpenChanges(false)
sessionStorage.setItem('auto_open_changes', 'false')
}
createEffect(() => {
if (role() === 'Approver') setName(APPROVERNAME)
else if (role() !== 'Approver' && name() === APPROVERNAME) setName('')
})
onMount(() => {
const auto = sessionStorage.getItem('auto_open_changes')
if (!auto) setOpenChanges(true)
})
return (
<>
<Page alignment="column">
@ -272,64 +282,62 @@ export default () => {
</Modal>
</div>*/}
<div onClick={() => setOpenChanges(false)}>
<Modal trigger={openChanges()} background="#252525ff" color="#dfe7fbf0" opacity={0.8} width="35rem">
<div onClick={closeChangesNotification}>
<Modal trigger={openChanges()} background="#252525ff" color="#dfe7fbf0" opacity={0.8} width="37rem">
<h3 class="modal-h3">Changelog</h3>
<h5 class="modal-h5">Latest update: March 30, 2026</h5>
<Padding top={1} bottom={1} left={1.5} right={1.5}>
<section class="modal-tooltip">
<div class="modal-tooltip__group">
<span class="modal-tooltip__title">Login</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__red">Removed</span>
<span class="modal-tooltip__category__red">Removal</span>
<span class="modal-tooltip__info">Removed version selection of encryption.</span>
</Row>
<span class="modal-tooltip__subinfo">* All active users are using version 2.</span>
<span class="modal-tooltip__subinfo">* All active users are already using version 2; selection is no longer needed.</span>
</div>
<div class="modal-tooltip__group">
<span class="modal-tooltip__title">Both Printing and Approval</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__yellow">Info</span>
<span class="modal-tooltip__category__yellow">Explain</span>
<span class="modal-tooltip__info">Loading</span>
</Row>
<span class="modal-tooltip__subinfo">* Clicking too fast lead to .</span>
<span class="modal-tooltip__subinfo__last">* Use this if the original order of payment is lost.</span>
<span class="modal-tooltip__subinfo">* To prevent double entry and incomplete transactions.</span>
<span class="modal-tooltip__subinfo">* Clicking on another application while background processes are still actively running</span>
<span class="modal-tooltip__subinfo modal-tooltip__nextline">was the main cause of transaction problems.</span>
<span class="modal-tooltip__subinfo__last">* Adding loading screen was the fix.</span>
</div>
<div class="modal-tooltip__group">
<span class="modal-tooltip__title">Printing</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__yellow">Info</span>
<span class="modal-tooltip__category__yellow">Explain</span>
<span class="modal-tooltip__info">Reprint (No Change)</span>
</Row>
<span class="modal-tooltip__subinfo">* Reprints a duplicate of the order of payment without any changes to its data.</span>
<span class="modal-tooltip__subinfo__last">* Use this if the original order of payment is lost.</span>
<span class="modal-tooltip__subinfo">* Reprints a duplicate of Order of Payment without any changes to its data.</span>
<span class="modal-tooltip__subinfo__last modal-tooltip__bold">* Use this if the original Order of Payment is lost or you want to print an extra copy.</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__green">New</span>
<span class="modal-tooltip__info">Void (Back to Approval)</span>
</Row>
<span class="modal-tooltip__subinfo">* Returns the application back to approval.</span>
<span class="modal-tooltip__subinfo">* Deletes the existing order of payment to make room for the newly generated one.</span>
<span class="modal-tooltip__subinfo">* All applications listed are unpaid and safe to remove.</span>
<span class="modal-tooltip__subinfo">* Use this if duplicate values occur or there is any mistake in its data.</span>
<span class="modal-tooltip__subinfo">* All listed applications are unpaid and can be safely re-approved.</span>
<span class="modal-tooltip__subinfo modal-tooltip__bold">* Use this if duplicate values occur or there is any mistake in its data.</span>
</div>
<div class="modal-tooltip__group">
<span class="modal-tooltip__title">Approval</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__yellow">Info</span>
<span class="modal-tooltip__info">Data Lock</span>
</Row>
<span class="modal-tooltip__subinfo">* To avoid .</span>
<span class="modal-tooltip__subinfo">* Use this if the original order of payment is lost.</span>
<Row content="left" gap={0.5}>
<span class="modal-tooltip__category__green">New</span>
<span class="modal-tooltip__info">Data Lock</span>
<span class="modal-tooltip__info">Order of Payment Data Lock</span>
</Row>
<span class="modal-tooltip__subinfo">* To avoid .</span>
<span class="modal-tooltip__subinfo">* Use this if the original order of payment is lost.</span>
<span class="modal-tooltip__subinfo">* An encrypted copy of the Order of Payment is created when approved.</span>
<span class="modal-tooltip__subinfo">* Protection against alteration of data after approval.</span>
<span class="modal-tooltip__subinfo">* If the Order of Payment is voided and re-approved, locked data will be overridden.</span>
</div>
<Row>