From 957ddb2a818c22352066d763f1e0c94fef8ae7c3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 18 Jun 2024 09:36:22 +1000 Subject: [PATCH] Fixes for wave imports --- app/Filters/ExpenseFilters.php | 2 +- .../Transformer/Wave/InvoiceTransformer.php | 2 +- app/Models/BaseModel.php | 7 +++- lang/en/texts.php | 36 ++----------------- 4 files changed, 10 insertions(+), 37 deletions(-) diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index 108dc359d8..ca2b1b09bd 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -79,7 +79,7 @@ class ExpenseFilters extends QueryFilters $this->builder->where(function ($query) use ($status_parameters) { if (in_array('logged', $status_parameters)) { $query->orWhere(function ($query) { - $query->where('amount', '>', 0) + $query->where('amount', '>=', 0) ->whereNull('invoice_id') ->whereNull('payment_date') ->where('should_be_invoiced', false); diff --git a/app/Import/Transformer/Wave/InvoiceTransformer.php b/app/Import/Transformer/Wave/InvoiceTransformer.php index c1d5df1e40..8908a5c0cf 100644 --- a/app/Import/Transformer/Wave/InvoiceTransformer.php +++ b/app/Import/Transformer/Wave/InvoiceTransformer.php @@ -50,7 +50,7 @@ class InvoiceTransformer extends BaseTransformer 'client_id' => $this->getClient($customer_name = $this->getString($invoice_data, $customer_key), null), 'number' => $invoice_number = $this->getString($invoice_data, 'Invoice Number'), 'date' => $this->parseDate($invoice_data[$date_key]) ?: now()->format('Y-m-d'), //27-01-2022 - 'currency_id' => $this->getCurrencyByCode($invoice_data, 'Currency'), + // 'currency_id' => $this->getCurrencyByCode($invoice_data, 'Currency'), 'status_id' => Invoice::STATUS_SENT, 'due_date' => array_key_exists('Due Date', $invoice_data) ? $this->parseDate($invoice_data['Due Date']) : null, ]; diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index 727b2adfe1..065e3c577c 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -374,7 +374,12 @@ class BaseModel extends Model $files->push($company_docs); - $pdf = (new PdfMerge($files->flatten()->toArray()))->run(); + try{ + $pdf = (new PdfMerge($files->flatten()->toArray()))->run(); + } + catch(\Exception $e){ + nlog("Exception:: BaseModel:: PdfMerge::" . $e->getMessage()); + } return $pdf; } diff --git a/lang/en/texts.php b/lang/en/texts.php index 4ade52e4d5..758575e06c 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -2934,13 +2934,6 @@ $lang = array( 'mime_types' => 'Mime types', 'mime_types_placeholder' => '.pdf , .docx, .jpg', 'mime_types_help' => 'Comma separated list of allowed mime types, leave blank for all', - 'ticket_number_start_help' => 'Ticket number must be greater than the current ticket number', - 'new_ticket_template_id' => 'New ticket', - 'new_ticket_autoresponder_help' => 'Selecting a template will send an auto response to a client/contact when a new ticket is created', - 'update_ticket_template_id' => 'Updated ticket', - 'update_ticket_autoresponder_help' => 'Selecting a template will send an auto response to a client/contact when a ticket is updated', - 'close_ticket_template_id' => 'Closed ticket', - 'close_ticket_autoresponder_help' => 'Selecting a template will send an auto response to a client/contact when a ticket is closed', 'default_priority' => 'Default priority', 'alert_new_comment_id' => 'New comment', 'alert_comment_ticket_help' => 'Selecting a template will send a notification (to agent) when a comment is made.', @@ -2957,8 +2950,6 @@ $lang = array( 'alert_ticket_overdue_email' => 'Additional overdue ticket notifications', 'alert_ticket_overdue_email_help' => 'Comma separated emails to bcc on ticket overdue.', 'alert_ticket_overdue_agent_id_help' => 'Selecting a template will send a notification (to agent) when a ticket becomes overdue.', - 'ticket_master' => 'Ticket Master', - 'ticket_master_help' => 'Has the ability to assign and transfer tickets. Assigned as the default agent for all tickets.', 'default_agent' => 'Default Agent', 'default_agent_help' => 'If selected will automatically be assigned to all inbound tickets', 'show_agent_details' => 'Show agent details on responses', @@ -2966,43 +2957,19 @@ $lang = array( 'remove_avatar' => 'Remove avatar', 'ticket_not_found' => 'Ticket not found', 'add_template' => 'Add Template', - 'ticket_template' => 'Ticket Template', - 'ticket_templates' => 'Ticket Templates', 'updated_ticket_template' => 'Updated Ticket Template', 'created_ticket_template' => 'Created Ticket Template', 'archive_ticket_template' => 'Archive Template', 'restore_ticket_template' => 'Restore Template', 'archived_ticket_template' => 'Successfully archived template', 'restored_ticket_template' => 'Successfully restored template', - 'close_reason' => 'Let us know why you are closing this ticket', - 'reopen_reason' => 'Let us know why you are reopening this ticket', 'enter_ticket_message' => 'Please enter a message to update the ticket', 'show_hide_all' => 'Show / Hide all', 'subject_required' => 'Subject required', 'mobile_refresh_warning' => 'If you\'re using the mobile app you may need to do a full refresh.', - 'enable_proposals_for_background' => 'To upload a background image :link to enable the proposals module.', - 'ticket_assignment' => 'Ticket :ticket_number has been assigned to :agent', - 'ticket_contact_reply' => 'Ticket :ticket_number has been updated by client :contact', - 'ticket_new_template_subject' => 'Ticket :ticket_number has been created.', - 'ticket_updated_template_subject' => 'Ticket :ticket_number has been updated.', - 'ticket_closed_template_subject' => 'Ticket :ticket_number has been closed.', - 'ticket_overdue_template_subject' => 'Ticket :ticket_number is now overdue', 'merge' => 'Merge', 'merged' => 'Merged', 'agent' => 'Agent', - 'parent_ticket' => 'Parent Ticket', - 'linked_tickets' => 'Linked Tickets', - 'merge_prompt' => 'Enter ticket number to merge into', - 'merge_from_to' => 'Ticket #:old_ticket merged into Ticket #:new_ticket', - 'merge_closed_ticket_text' => 'Ticket #:old_ticket was closed and merged into Ticket#:new_ticket - :subject', - 'merge_updated_ticket_text' => 'Ticket #:old_ticket was closed and merged into this ticket', - 'merge_placeholder' => 'Merge ticket #:ticket into the following ticket', - 'select_ticket' => 'Select Ticket', - 'new_internal_ticket' => 'New internal ticket', - 'internal_ticket' => 'Internal ticket', - 'create_ticket' => 'Create ticket', - 'allow_inbound_email_tickets_external' => 'New Tickets by email (Client)', - 'allow_inbound_email_tickets_external_help' => 'Allow clients to create new tickets by email', 'include_in_filter' => 'Include in filter', 'custom_client1' => ':VALUE', 'custom_client2' => ':VALUE', @@ -5334,7 +5301,8 @@ $lang = array( 'btcpay_refund_body' => 'A refund intended for you has been issued. To claim it via BTCPay, please click on this link:', 'currency_mauritanian_ouguiya' => 'Mauritanian Ouguiya', 'currency_bhutan_ngultrum' => 'Bhutan Ngultrum', - 'end_of_month' => 'End Of Month' + 'end_of_month' => 'End Of Month', + 'merge_e_invoice_to_pdf' => 'Merge E-Invoice and PDF', ); return $lang; \ No newline at end of file