Updated pdf

This commit is contained in:
Patrick Alvin Alcala 2025-10-09 18:05:42 +08:00
parent 217b7fa3d7
commit 7e0bc1f666

View file

@ -1,9 +1,7 @@
import jsPDF from 'jspdf' import jsPDF from 'jspdf'
// @ts-ignore // @ts-ignore
import jspdfBarcode from 'jspdf-barcode' import jspdfBarcode from 'jspdf-barcode'
// import { ofetch } from 'ofetch' import { _optn, _applicationNo, _date, _name, _type, _location, _assessor, _feeList, _codeList, _amountList } from '../../stores/pdfinfo'
// import dayjs from 'dayjs'
import { _optn, _applicationNo, _date, _name, _type, _location } from '../../stores/pdfinfo'
export default async () => { export default async () => {
const PESO = import.meta.env.VITE_PESO const PESO = import.meta.env.VITE_PESO
@ -17,9 +15,11 @@ export default async () => {
const TYPE = _type.get() const TYPE = _type.get()
const CODE = '40201010-5-3' const CODE = '40201010-5-3'
const AMOUNT = 100 const AMOUNT = 100
const ASSESSOR = _assessor.get()
// const ASSESSOR = 'ENGR. BATMAN' const APPROVER = 'AR. KHASHAYAR L. TOGHYANI'
// const APPROVER = 'AR. KHASHAYAR L. TOGHYANI' const FEES = _feeList.get()
const CODES = _codeList.get()
const AMOUNTS = _amountList.get()
const doc = new jsPDF({ const doc = new jsPDF({
orientation: 'l', orientation: 'l',
@ -158,29 +158,53 @@ export default async () => {
doc.text('AMOUNT', getTextWidth('ACCOUNT DESCRIPTION', 8) + getTextWidth('ACCOUNT CODE', 8) + 65, 84) doc.text('AMOUNT', getTextWidth('ACCOUNT DESCRIPTION', 8) + getTextWidth('ACCOUNT CODE', 8) + 65, 84)
doc.setFont('arial', 'normal') doc.setFont('arial', 'normal')
doc.text('SAMPLE FEE', 16, 92) // doc.text('SAMPLE FEE', 16, 92)
doc.text('ANOTHER SAMPLE FEE', 16, 96) // doc.text('ANOTHER SAMPLE FEE', 16, 96)
doc.text(CODE, 76, 92) let yPosition = 92
doc.text(CODE, 76, 96) FEES.forEach((fee) => {
doc.text(fee, 16, yPosition)
yPosition += 4
})
yPosition = 92
CODES.forEach((code) => {
doc.text(code, 76, yPosition)
yPosition += 4
})
yPosition = 92
AMOUNTS.forEach((amount) => {
doc.text(`${PESO} ${parseInt(amount).toFixed(2)}`, 122, yPosition)
yPosition += 4
})
doc.text(`P ${AMOUNT.toFixed(2)}`, 122, 92)
doc.text(`P ${AMOUNT.toFixed(2)}`, 122, 96)
doc.text('x1', 140, 92) doc.text('x1', 140, 92)
doc.text('x1', 140, 96) doc.text('x1', 140, 96)
doc.text('=', 148, 92) doc.text('=', 148, 92)
doc.text('=', 148, 96) doc.text('=', 148, 96)
doc.setFont('arial-bold', 'bold')
doc.text(`P ${AMOUNT.toFixed(2)}`, 156, 92) yPosition = 92
doc.text(`P ${AMOUNT.toFixed(2)}`, 156, 96) AMOUNTS.forEach((amount) => {
doc.text(`${PESO} ${parseInt(amount).toFixed(2)}`, 156, yPosition)
yPosition += 4
})
doc.setFont('arial-bold', 'bold') doc.setFont('arial-bold', 'bold')
doc.text('Assessed By :', 16, 112) doc.text('Assessed By :', 16, 112)
doc.text('Approved By :', 142, 112) doc.text('Approved By :', 142, 112)
doc.text(ASSESSOR, 16, 128)
doc.text(APPROVER, 142, 128)
doc.setFont('arial', 'normal')
doc.setFontSize(6)
doc.text('Officer-in-Charge', 154, 132)
// doc.text(CODE, 76, 96) // doc.text(CODE, 76, 96)
// doc.setFont('arial', 'normal') doc.setFont('arial-bold', 'bold')
doc.text('Please use the OPTN when paying online.', 16, 136) doc.setFontSize(7)
doc.text('Please use the OPTN when paying online.', 16, 140)
const note = doc.splitTextToSize('Note: The 72 Hours Transaction Policy of the City Mayor, shall commence upon submission of the Bureau of Fire Protection clearance/certificate and other requirement stated in the notice to comply to be issued by this office.', 185) const note = doc.splitTextToSize('Note: The 72 Hours Transaction Policy of the City Mayor, shall commence upon submission of the Bureau of Fire Protection clearance/certificate and other requirement stated in the notice to comply to be issued by this office.', 185)
doc.text(note, 16, 144) doc.text(note, 16, 144)