feat: Implement invoice generation and emailing functionality
- Added invoice generation logic using DomPDF. - Integrated invoice data retrieval from the API. - Implemented language determination for invoices based on customer data. - Added options to email invoices to customers and admin. - Included HTML output option for direct viewing in the browser. - Ensured proper redirection and error handling throughout the process.
This commit is contained in:
@@ -119,7 +119,10 @@ async function connectDevice() {
|
||||
// Log connection failure details
|
||||
await logCommunication(`Serial connection failed: ${error.message || 'Unknown error'}`, 'disconnected');
|
||||
|
||||
if (openPort = 1){
|
||||
// Check for specific "No port selected" error and show user-friendly message
|
||||
if (error.message && error.message.includes('No port selected by the user')) {
|
||||
progressBar("100", "No device selected, please try again", "#ff6666");
|
||||
} else if (openPort = 1){
|
||||
closePort();
|
||||
console.log("Closing port");
|
||||
alert("System is still trying to close the serial port. If this message continues to come up please refresh this page.");
|
||||
|
||||
Reference in New Issue
Block a user