@@ -622,7 +622,7 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
maxWidth: 240
|
||||
})
|
||||
|
||||
console.log(row)
|
||||
console.log(row.text.match(/.{1,35}/g))
|
||||
|
||||
if(invoiceData.type !== "deliveryNotes") {
|
||||
pages[pageCounter - 1].drawText(row.text.match(/.{1,35}/g).join("\n"), {
|
||||
@@ -933,8 +933,6 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
//console.log(rowHeight)
|
||||
//rowHeight += 25
|
||||
|
||||
let endTextDiff = 45
|
||||
|
||||
if(invoiceData.type !== "deliveryNotes"){
|
||||
pages[pageCounter - 1].drawRectangle({
|
||||
...getCoordinatesForPDFLib(20,rowHeight, page1),
|
||||
@@ -1014,86 +1012,11 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
if(invoiceData.total.totalGrossAlreadyPaid !== "0,00 €") {
|
||||
pages[pageCounter - 1].drawText("Bereits bezahlt:", {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+21, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font: fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.total.totalGrossAlreadyPaid, {
|
||||
y: getCoordinatesForPDFLib(21,rowHeight+21,page1).y,
|
||||
x: getCoordinatesForPDFLib(21,rowHeight+21,page1).x + 500 - fontBold.widthOfTextAtSize(invoiceData.total.totalGrossAlreadyPaid,11),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawRectangle({
|
||||
...getCoordinatesForPDFLib(20,rowHeight +32, page1),
|
||||
width: 180 * 2.83,
|
||||
height: 8 * 2.83,
|
||||
color: rgb(0,0,0),
|
||||
opacity: 0.25
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText("Offene Summe:", {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+29, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font: fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.total.totalSumToPay, {
|
||||
y: getCoordinatesForPDFLib(21,rowHeight+29,page1).y,
|
||||
x: getCoordinatesForPDFLib(21,rowHeight+29,page1).x + 500 - fontBold.widthOfTextAtSize(invoiceData.total.totalSumToPay,11),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
invoiceData.usedAdvanceInvoices.forEach((advanceInvoice,index) => {
|
||||
//For Each Advance Invoice
|
||||
|
||||
pages[pageCounter - 1].drawText(String(advanceInvoice.documentNumber), {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+36+5*index, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
endTextDiff = 22
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.endText,{
|
||||
...getCoordinatesForPDFLib(20,rowHeight+endTextDiff, page1),
|
||||
...getCoordinatesForPDFLib(20,rowHeight+22, page1),
|
||||
size: 10,
|
||||
color: rgb(0,0,0),
|
||||
lineHeight: 10,
|
||||
|
||||
Reference in New Issue
Block a user