Added Agriculture Module to Invoice Creation

This commit is contained in:
2024-11-13 19:13:45 +01:00
parent a246263424
commit 947fe710a3
3 changed files with 200 additions and 36 deletions

View File

@@ -633,8 +633,8 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
console.log(textAutoLines)
if(row.description) {
pages[pageCounter - 1].drawText(row.description.match(/.{1,70}/g).join("\n"), {
if(row.descriptionText) {
pages[pageCounter - 1].drawText(row.descriptionText.match(/.{1,70}/g).join("\n"), {
...getCoordinatesForPDFLib(52,rowHeight + ( textAutoLines * 4), page1),
size:10,
color:rgb(0,0,0),
@@ -678,9 +678,9 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
if(row.description) {
let lineBreaks = (row.description.match(/\n/g) || []).length
let autoLines = (row.description.match(/.{1,70}/g) || []).length
if(row.descriptionText) {
let lineBreaks = (row.descriptionText.match(/\n/g) || []).length
let autoLines = (row.descriptionText.match(/.{1,70}/g) || []).length
rowHeight += 12 + (lineBreaks + autoLines + textAutoLines) * 2.5
} else {
rowHeight += 12 + textAutoLines * 2.5
@@ -860,8 +860,8 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
//console.log(textAutoLines)
if(row.description) {
pages[pageCounter - 1].drawText(row.description.match(/.{1,80}/g).join("\n"), {
if(row.descriptionText) {
pages[pageCounter - 1].drawText(row.descriptionText.match(/.{1,80}/g).join("\n"), {
...getCoordinatesForPDFLib(21,rowHeight + ( textAutoLines * 4), page1),
size:10,
color:rgb(0,0,0),
@@ -870,7 +870,7 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
})
}
let addHeight = (row.description.match(/.{1,80}/g) || []).length * 4 + 10
let addHeight = (row.descriptionText.match(/.{1,80}/g) || []).length * 4 + 10
console.log(addHeight)
rowHeight += addHeight