More fixes
This commit is contained in:
parent
a464d48b88
commit
afa9c9f731
|
|
@ -82,13 +82,13 @@ func main() {
|
|||
goRouter.HandleFunc("/attachments/{id}", attachmentHandler.Get).Methods("GET")
|
||||
goRouter.HandleFunc("/attachments/{id}", attachmentHandler.Delete).Methods("DELETE")
|
||||
|
||||
// PDF generation routes
|
||||
goRouter.HandleFunc("/pdf/generate-invoice", handlers.GenerateInvoicePDF).Methods("POST")
|
||||
goRouter.HandleFunc("/pdf/generate-quote", handlers.GenerateQuotePDF).Methods("POST")
|
||||
goRouter.HandleFunc("/pdf/generate-po", handlers.GeneratePurchaseOrderPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/pdf/generate-packinglist", handlers.GeneratePackingListPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/pdf/generate-orderack", handlers.GenerateOrderAckPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/pdf/count-pages", handlers.CountPages).Methods("POST")
|
||||
// PDF generation routes (under /api/pdf/* to avoid conflict with file server)
|
||||
goRouter.HandleFunc("/api/pdf/generate-invoice", handlers.GenerateInvoicePDF).Methods("POST")
|
||||
goRouter.HandleFunc("/api/pdf/generate-quote", handlers.GenerateQuotePDF).Methods("POST")
|
||||
goRouter.HandleFunc("/api/pdf/generate-po", handlers.GeneratePurchaseOrderPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/api/pdf/generate-packinglist", handlers.GeneratePackingListPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/api/pdf/generate-orderack", handlers.GenerateOrderAckPDF).Methods("POST")
|
||||
goRouter.HandleFunc("/api/pdf/count-pages", handlers.CountPages).Methods("POST")
|
||||
|
||||
// Serve generated PDFs
|
||||
pdfDir := os.Getenv("PDF_OUTPUT_DIR")
|
||||
|
|
|
|||
|
|
@ -331,7 +331,6 @@ func (g *Generator) AddQuoteDetailsTable(data *QuotePDFData) {
|
|||
|
||||
// Set column widths for a 3-column table
|
||||
colWidth := 50.0
|
||||
colY := g.pdf.GetY()
|
||||
|
||||
// Row 1: Delivery Time | Payment Terms | Days Valid
|
||||
g.pdf.SetX(15)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Generate the Invoice PDF by calling the Go service instead of TCPDF.
|
||||
|
||||
$goBaseUrl = AppController::getGoBaseUrlOrFail();
|
||||
$goEndpoint = $goBaseUrl . '/go/pdf/generate-invoice';
|
||||
$goEndpoint = $goBaseUrl . '/go/api/pdf/generate-invoice';
|
||||
|
||||
$outputDir = Configure::read('pdf_directory');
|
||||
|
||||
|
|
@ -70,9 +70,13 @@ $curlErr = curl_error($ch);
|
|||
curl_close($ch);
|
||||
|
||||
if ($httpCode < 200 || $httpCode >= 300) {
|
||||
echo "<p>Failed to generate PDF via Go service (HTTP $httpCode).";
|
||||
echo "<p>Failed to generate PDF via Go service (HTTP $httpCode).<br>";
|
||||
echo "Endpoint: " . htmlspecialchars($goEndpoint) . "<br>";
|
||||
if ($curlErr) {
|
||||
echo " Error: $curlErr";
|
||||
echo "Error: " . htmlspecialchars($curlErr) . "<br>";
|
||||
}
|
||||
if (!empty($response)) {
|
||||
echo "Response: " . htmlspecialchars($response) . "<br>";
|
||||
}
|
||||
echo "</p>";
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue