From ab4a44ff18ffd9d0370e5f978fa7ee4f59eb6672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 30 Jan 2020 02:24:38 +0100 Subject: [PATCH 1/6] Export settings with company array (#3264) --- .../Controllers/Migration/StepsController.php | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/app/Http/Controllers/Migration/StepsController.php b/app/Http/Controllers/Migration/StepsController.php index 8b8ffc7023bd..1357a7d12250 100644 --- a/app/Http/Controllers/Migration/StepsController.php +++ b/app/Http/Controllers/Migration/StepsController.php @@ -111,6 +111,85 @@ class StepsController extends BaseController //'uses_inclusive_taxes' => $this->account->inclusive_taxes, 'created_at' => $this->account->created_at ? $this->account->created_at->toDateString() : null, 'updated_at' => $this->account->updated_at ? $this->account->updated_at->toDateString() : null, + 'settings' => $this->getCompanySettings(), + ]; + } + + public function getCompanySettings() + { + // In v1: custom_invoice_taxes1 & custom_invoice_taxes2, v2: 'invoice_taxes'. What do to with this? + // V1: invoice_number_prefix, v2: invoice_number_pattern.. same with quote_number, client_number, + + return [ + 'timezone_id' => $this->account->timezone_id, + 'date_format_id' => $this->account->date_format_id, + 'currency_id' => $this->account->currency_id, + 'name' => $this->account->name, + 'address1' => $this->account->address1, + 'address2' => $this->account->address2, + 'city' => $this->account->city, + 'state' => $this->account->state, + 'postal_code' => $this->account->postal_code, + 'country_id' => $this->account->country_id, + 'invoice_terms' => $this->account->invoice_terms, + 'enabled_item_tax_rates' => $this->account->invoice_item_taxes, + 'invoice_design_id' => $this->account->invoice_design_id, + 'phone' => $this->account->work_phone, + 'email' => $this->account->work_email, + 'language_id' => $this->account->language_id, + 'custom_value1' => $this->account->custom_value1, + 'custom_value2' => $this->account->custom_value2, + 'hide_paid_to_date' => $this->account->hide_paid_to_date, + 'vat_number' => $this->account->vat_number, + 'shared_invoice_quote_counter' => $this->account->share_counter, // @verify, + 'id_number' => $this->account->id_number, + 'invoice_footer' => $this->account->invoice_footer, + 'pdf_email_attachment' => $this->account->pdf_email_attachment, + 'font_size' => $this->account->font_size, + 'invoice_labels' => $this->account->invoice_labels, + 'military_time' => $this->account->military_time, + 'invoice_number_pattern' => $this->account->invoice_number_pattern, + 'quote_number_pattern' => $this->account->quote_number_pattern, + 'quote_terms' => $this->account->quote_terms, + 'website' => $this->account->website, + 'auto_convert_quote' => $this->account->auto_convert_quote, + 'all_pages_footer' => $this->account->all_pages_footer, + 'all_pages_header' => $this->account->all_pages_header, + 'show_currency_code' => $this->account->show_currency_code, + 'enable_client_portal_password' => $this->account->enable_portal_password, + 'send_portal_password' => $this->account->send_portal_password, + 'recurring_number_prefix' => $this->account->recurring_invoice_number_prefix, // @verify + 'enable_client_portal' => $this->account->enable_client_portal, + 'invoice_fields' => $this->account->invoice_fields, + 'company_logo' => $this->account->logo, + 'embed_documents' => $this->account->invoice_embed_documents, + 'document_email_attachment' => $this->account->document_email_attachment, + 'enable_client_portal_dashboard' => $this->account->enable_client_portal_dashboard, + 'page_size' => $this->account->page_size, + 'show_accept_invoice_terms' => $this->account->show_accept_invoice_terms, + 'show_accept_quote_terms' => $this->account->show_accept_quote_terms, + 'require_invoice_signature' => $this->account->require_invoice_signature, + 'require_quote_signature' => $this->account->require_quote_signature, + 'client_number_counter' => $this->account->client_number_counter, + 'client_number_pattern' => $this->account->client_number_pattern, + 'payment_terms' => $this->account->payment_terms, + 'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id, + 'payment_type_id' => $this->account->payment_type_id, + 'reset_counter_date' => $this->account->reset_counter_date, + 'tax_name1' => $this->account->tax_name1, + 'tax_rate1' => $this->account->tax_rate1, + 'tax_name2' => $this->account->tax_name2, + 'tax_rate2' => $this->account->tax_rate2, + 'quote_design_id' => $this->account->quote_design_id, + 'credit_number_counter' => $this->account->credit_number_counter, + 'credit_number_pattern' => $this->account->credit_number_pattern, + 'default_task_rate' => $this->account->task_rate, + 'inclusive_taxes' => $this->account->inclusive_taxes, + 'signature_on_pdf' => $this->account->signature_on_pdf, + 'ubl_email_attachment' => $this->account->ubl_email_attachment, + 'auto_archive_invoice' => $this->account->auto_archive_invoice, + 'auto_archive_quote' => $this->account->auto_archive_quote, + 'auto_email_invoice' => $this->account->auto_email_invoice, ]; } From ddf376090a9b477464c1eea69b65819038a94602 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 30 Jan 2020 12:24:55 +1100 Subject: [PATCH 2/6] Revert "Export settings with company array (#3264)" (#3265) This reverts commit ab4a44ff18ffd9d0370e5f978fa7ee4f59eb6672. --- .../Controllers/Migration/StepsController.php | 79 ------------------- 1 file changed, 79 deletions(-) diff --git a/app/Http/Controllers/Migration/StepsController.php b/app/Http/Controllers/Migration/StepsController.php index 1357a7d12250..8b8ffc7023bd 100644 --- a/app/Http/Controllers/Migration/StepsController.php +++ b/app/Http/Controllers/Migration/StepsController.php @@ -111,85 +111,6 @@ class StepsController extends BaseController //'uses_inclusive_taxes' => $this->account->inclusive_taxes, 'created_at' => $this->account->created_at ? $this->account->created_at->toDateString() : null, 'updated_at' => $this->account->updated_at ? $this->account->updated_at->toDateString() : null, - 'settings' => $this->getCompanySettings(), - ]; - } - - public function getCompanySettings() - { - // In v1: custom_invoice_taxes1 & custom_invoice_taxes2, v2: 'invoice_taxes'. What do to with this? - // V1: invoice_number_prefix, v2: invoice_number_pattern.. same with quote_number, client_number, - - return [ - 'timezone_id' => $this->account->timezone_id, - 'date_format_id' => $this->account->date_format_id, - 'currency_id' => $this->account->currency_id, - 'name' => $this->account->name, - 'address1' => $this->account->address1, - 'address2' => $this->account->address2, - 'city' => $this->account->city, - 'state' => $this->account->state, - 'postal_code' => $this->account->postal_code, - 'country_id' => $this->account->country_id, - 'invoice_terms' => $this->account->invoice_terms, - 'enabled_item_tax_rates' => $this->account->invoice_item_taxes, - 'invoice_design_id' => $this->account->invoice_design_id, - 'phone' => $this->account->work_phone, - 'email' => $this->account->work_email, - 'language_id' => $this->account->language_id, - 'custom_value1' => $this->account->custom_value1, - 'custom_value2' => $this->account->custom_value2, - 'hide_paid_to_date' => $this->account->hide_paid_to_date, - 'vat_number' => $this->account->vat_number, - 'shared_invoice_quote_counter' => $this->account->share_counter, // @verify, - 'id_number' => $this->account->id_number, - 'invoice_footer' => $this->account->invoice_footer, - 'pdf_email_attachment' => $this->account->pdf_email_attachment, - 'font_size' => $this->account->font_size, - 'invoice_labels' => $this->account->invoice_labels, - 'military_time' => $this->account->military_time, - 'invoice_number_pattern' => $this->account->invoice_number_pattern, - 'quote_number_pattern' => $this->account->quote_number_pattern, - 'quote_terms' => $this->account->quote_terms, - 'website' => $this->account->website, - 'auto_convert_quote' => $this->account->auto_convert_quote, - 'all_pages_footer' => $this->account->all_pages_footer, - 'all_pages_header' => $this->account->all_pages_header, - 'show_currency_code' => $this->account->show_currency_code, - 'enable_client_portal_password' => $this->account->enable_portal_password, - 'send_portal_password' => $this->account->send_portal_password, - 'recurring_number_prefix' => $this->account->recurring_invoice_number_prefix, // @verify - 'enable_client_portal' => $this->account->enable_client_portal, - 'invoice_fields' => $this->account->invoice_fields, - 'company_logo' => $this->account->logo, - 'embed_documents' => $this->account->invoice_embed_documents, - 'document_email_attachment' => $this->account->document_email_attachment, - 'enable_client_portal_dashboard' => $this->account->enable_client_portal_dashboard, - 'page_size' => $this->account->page_size, - 'show_accept_invoice_terms' => $this->account->show_accept_invoice_terms, - 'show_accept_quote_terms' => $this->account->show_accept_quote_terms, - 'require_invoice_signature' => $this->account->require_invoice_signature, - 'require_quote_signature' => $this->account->require_quote_signature, - 'client_number_counter' => $this->account->client_number_counter, - 'client_number_pattern' => $this->account->client_number_pattern, - 'payment_terms' => $this->account->payment_terms, - 'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id, - 'payment_type_id' => $this->account->payment_type_id, - 'reset_counter_date' => $this->account->reset_counter_date, - 'tax_name1' => $this->account->tax_name1, - 'tax_rate1' => $this->account->tax_rate1, - 'tax_name2' => $this->account->tax_name2, - 'tax_rate2' => $this->account->tax_rate2, - 'quote_design_id' => $this->account->quote_design_id, - 'credit_number_counter' => $this->account->credit_number_counter, - 'credit_number_pattern' => $this->account->credit_number_pattern, - 'default_task_rate' => $this->account->task_rate, - 'inclusive_taxes' => $this->account->inclusive_taxes, - 'signature_on_pdf' => $this->account->signature_on_pdf, - 'ubl_email_attachment' => $this->account->ubl_email_attachment, - 'auto_archive_invoice' => $this->account->auto_archive_invoice, - 'auto_archive_quote' => $this->account->auto_archive_quote, - 'auto_email_invoice' => $this->account->auto_email_invoice, ]; } From d45ae2c50b24965eb06d78e23dd0b5ff3883a890 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 30 Jan 2020 12:25:44 +1100 Subject: [PATCH 3/6] Revert "Revert "Export settings with company array (#3264)" (#3265)" (#3266) This reverts commit ddf376090a9b477464c1eea69b65819038a94602. --- .../Controllers/Migration/StepsController.php | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/app/Http/Controllers/Migration/StepsController.php b/app/Http/Controllers/Migration/StepsController.php index 8b8ffc7023bd..1357a7d12250 100644 --- a/app/Http/Controllers/Migration/StepsController.php +++ b/app/Http/Controllers/Migration/StepsController.php @@ -111,6 +111,85 @@ class StepsController extends BaseController //'uses_inclusive_taxes' => $this->account->inclusive_taxes, 'created_at' => $this->account->created_at ? $this->account->created_at->toDateString() : null, 'updated_at' => $this->account->updated_at ? $this->account->updated_at->toDateString() : null, + 'settings' => $this->getCompanySettings(), + ]; + } + + public function getCompanySettings() + { + // In v1: custom_invoice_taxes1 & custom_invoice_taxes2, v2: 'invoice_taxes'. What do to with this? + // V1: invoice_number_prefix, v2: invoice_number_pattern.. same with quote_number, client_number, + + return [ + 'timezone_id' => $this->account->timezone_id, + 'date_format_id' => $this->account->date_format_id, + 'currency_id' => $this->account->currency_id, + 'name' => $this->account->name, + 'address1' => $this->account->address1, + 'address2' => $this->account->address2, + 'city' => $this->account->city, + 'state' => $this->account->state, + 'postal_code' => $this->account->postal_code, + 'country_id' => $this->account->country_id, + 'invoice_terms' => $this->account->invoice_terms, + 'enabled_item_tax_rates' => $this->account->invoice_item_taxes, + 'invoice_design_id' => $this->account->invoice_design_id, + 'phone' => $this->account->work_phone, + 'email' => $this->account->work_email, + 'language_id' => $this->account->language_id, + 'custom_value1' => $this->account->custom_value1, + 'custom_value2' => $this->account->custom_value2, + 'hide_paid_to_date' => $this->account->hide_paid_to_date, + 'vat_number' => $this->account->vat_number, + 'shared_invoice_quote_counter' => $this->account->share_counter, // @verify, + 'id_number' => $this->account->id_number, + 'invoice_footer' => $this->account->invoice_footer, + 'pdf_email_attachment' => $this->account->pdf_email_attachment, + 'font_size' => $this->account->font_size, + 'invoice_labels' => $this->account->invoice_labels, + 'military_time' => $this->account->military_time, + 'invoice_number_pattern' => $this->account->invoice_number_pattern, + 'quote_number_pattern' => $this->account->quote_number_pattern, + 'quote_terms' => $this->account->quote_terms, + 'website' => $this->account->website, + 'auto_convert_quote' => $this->account->auto_convert_quote, + 'all_pages_footer' => $this->account->all_pages_footer, + 'all_pages_header' => $this->account->all_pages_header, + 'show_currency_code' => $this->account->show_currency_code, + 'enable_client_portal_password' => $this->account->enable_portal_password, + 'send_portal_password' => $this->account->send_portal_password, + 'recurring_number_prefix' => $this->account->recurring_invoice_number_prefix, // @verify + 'enable_client_portal' => $this->account->enable_client_portal, + 'invoice_fields' => $this->account->invoice_fields, + 'company_logo' => $this->account->logo, + 'embed_documents' => $this->account->invoice_embed_documents, + 'document_email_attachment' => $this->account->document_email_attachment, + 'enable_client_portal_dashboard' => $this->account->enable_client_portal_dashboard, + 'page_size' => $this->account->page_size, + 'show_accept_invoice_terms' => $this->account->show_accept_invoice_terms, + 'show_accept_quote_terms' => $this->account->show_accept_quote_terms, + 'require_invoice_signature' => $this->account->require_invoice_signature, + 'require_quote_signature' => $this->account->require_quote_signature, + 'client_number_counter' => $this->account->client_number_counter, + 'client_number_pattern' => $this->account->client_number_pattern, + 'payment_terms' => $this->account->payment_terms, + 'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id, + 'payment_type_id' => $this->account->payment_type_id, + 'reset_counter_date' => $this->account->reset_counter_date, + 'tax_name1' => $this->account->tax_name1, + 'tax_rate1' => $this->account->tax_rate1, + 'tax_name2' => $this->account->tax_name2, + 'tax_rate2' => $this->account->tax_rate2, + 'quote_design_id' => $this->account->quote_design_id, + 'credit_number_counter' => $this->account->credit_number_counter, + 'credit_number_pattern' => $this->account->credit_number_pattern, + 'default_task_rate' => $this->account->task_rate, + 'inclusive_taxes' => $this->account->inclusive_taxes, + 'signature_on_pdf' => $this->account->signature_on_pdf, + 'ubl_email_attachment' => $this->account->ubl_email_attachment, + 'auto_archive_invoice' => $this->account->auto_archive_invoice, + 'auto_archive_quote' => $this->account->auto_archive_quote, + 'auto_email_invoice' => $this->account->auto_email_invoice, ]; } From 139e0a4b0ecafc81d702cecf090d025982167f0a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 12 Feb 2020 07:54:36 +1100 Subject: [PATCH 4/6] Update credit_card.blade.php --- resources/views/payments/credit_card.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/payments/credit_card.blade.php b/resources/views/payments/credit_card.blade.php index 0729bf3ef582..893458fb715b 100644 --- a/resources/views/payments/credit_card.blade.php +++ b/resources/views/payments/credit_card.blade.php @@ -632,7 +632,7 @@

 

@if (isset($invitation)) - {!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo($invitation->getLink()) !!} + {!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo(HTMLUtils::previousUrl('/')) !!}    @endif From aadda80988f355dd56b3fab9d2b39907163883e8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 16 Feb 2020 17:41:23 +1100 Subject: [PATCH 5/6] fixes for checkout.com (#3337) --- resources/views/payments/checkoutcom/partial.blade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/views/payments/checkoutcom/partial.blade.php b/resources/views/payments/checkoutcom/partial.blade.php index 00500cf15d7e..27d5544298d6 100644 --- a/resources/views/payments/checkoutcom/partial.blade.php +++ b/resources/views/payments/checkoutcom/partial.blade.php @@ -12,7 +12,11 @@ paymentToken: '{{ $transactionToken }}', customerEmail: '{{ $contact->email }}', customerName: '{{ $contact->getFullName() }}', + @if( $invoice->getCurrencyCode() == 'BHD' || $invoice->getCurrencyCode() == 'KWD' || $invoice->getCurrencyCode() == 'OMR') + value: {{ $invoice->getRequestedAmount() * 1000 }}, + @else value: {{ $invoice->getRequestedAmount() * 100 }}, + @endif currency: '{{ $invoice->getCurrencyCode() }}', widgetContainerSelector: '.payment-form', widgetColor: '#333', From a98ad5ba024db275112504571284453e76261b23 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 17 Feb 2020 06:52:43 +1100 Subject: [PATCH 6/6] Additional fixes for Checkout.com --- .../CheckoutComPaymentDriver.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Ninja/PaymentDrivers/CheckoutComPaymentDriver.php b/app/Ninja/PaymentDrivers/CheckoutComPaymentDriver.php index 47eed79ab921..3664e1d6739c 100644 --- a/app/Ninja/PaymentDrivers/CheckoutComPaymentDriver.php +++ b/app/Ninja/PaymentDrivers/CheckoutComPaymentDriver.php @@ -6,8 +6,24 @@ class CheckoutComPaymentDriver extends BasePaymentDriver { public function createTransactionToken() { + if( $this->invoice()->getCurrencyCode() == 'BHD') + { + $amount = $this->invoice()->getRequestedAmount()/10; + } + elseif($this->invoice()->getCurrencyCode() == 'KWD') + { + $amount = $this->invoice()->getRequestedAmount()*10; + + } + elseif($this->invoice()->getCurrencyCode() == 'OMR') + { + $amount = $this->invoice()->getRequestedAmount(); + } + else + $amount = $this->invoice()->getRequestedAmount(); + $response = $this->gateway()->purchase([ - 'amount' => $this->invoice()->getRequestedAmount(), + 'amount' => $amount, 'currency' => $this->client()->getCurrencyCode(), ])->send();