Revert "Start for Dev Branch"

This reverts commit acf5d1c2ea
This commit is contained in:
2024-12-20 17:49:24 +00:00
parent acf5d1c2ea
commit 8abfce0fa1
16 changed files with 170 additions and 598 deletions

View File

@@ -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,