| @@ -395,8 +395,36 @@ | ||
| 395 | 395 | $('#easy-invoice-confirmation-modal').addClass('hidden'); |
| 396 | 396 | }, |
| 397 | 397 | |
| 398 | 398 | /** |
| 399 | + * Send invoice or quote by email — uses easyInvoice.i18n when available. | |
| 400 | + * | |
| 401 | + * @param {'invoice'|'quote'} kind Document type | |
| 402 | + * @param {Function} onConfirm Called when user confirms | |
| 403 | + */ | |
| 404 | + confirmSendDocument: function(kind, onConfirm) { | |
| 405 | + var i18n = (window.easyInvoice && window.easyInvoice.i18n) ? window.easyInvoice.i18n : {}; | |
| 406 | + var isQuote = kind === 'quote'; | |
| 407 | + var title = isQuote | |
| 408 | + ? (i18n.confirm_send_quote_title || 'Send quote by email') | |
| 409 | + : (i18n.confirm_send_invoice_title || 'Send invoice by email'); | |
| 410 | + var message = isQuote | |
| 411 | + ? (i18n.confirm_send_quote_message || 'The quote will be emailed to the client using your template.') | |
| 412 | + : (i18n.confirm_send_invoice_message || 'The invoice will be emailed to the client using your template.'); | |
| 413 | + var confirmText = i18n.confirm_send_confirm || i18n.send_invoice || 'Send'; | |
| 414 | + var cancelText = i18n.confirm_cancel || i18n.cancel || 'Cancel'; | |
| 415 | + | |
| 416 | + this.show({ | |
| 417 | + title: title, | |
| 418 | + message: message, | |
| 419 | + confirmText: confirmText, | |
| 420 | + cancelText: cancelText, | |
| 421 | + confirmClass: 'bg-indigo-600 hover:bg-indigo-700', | |
| 422 | + onConfirm: typeof onConfirm === 'function' ? onConfirm : function() {} | |
| 423 | + }); | |
| 424 | + }, | |
| 425 | + | |
| 426 | + /** | |
| 399 | 427 | * Quick confirmation for common actions |
| 400 | 428 | * |
| 401 | 429 | * @param {string} action Action type (delete, trash, draft, etc.) |
| 402 | 430 | * @param {string} itemName Name of the item being acted upon |