From cb6a9fb9f99356dc3a38a65122771054a20938e9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 31 May 2023 14:36:35 +1000 Subject: [PATCH] Minor fixes + translations --- app/Http/Controllers/CompanyController.php | 6 ++++- .../Requests/Company/UpdateCompanyRequest.php | 4 +++- app/Models/Client.php | 1 + app/PaymentDrivers/BaseDriver.php | 6 ++++- lang/en/texts.php | 24 +++++++++---------- lang/fr_CA/texts.php | 11 ++++++++- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index 61777161bb11..aff67f98cb0a 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -422,8 +422,12 @@ class CompanyController extends BaseController if($request->has('e_invoice_certificate') && !is_null($request->file("e_invoice_certificate"))){ $company->e_invoice_certificate = base64_encode($request->file("e_invoice_certificate")->get()); - $company->save(); + $settings = $company->settings; + $settings->enable_e_invoice = true; + + $company->save(); + } $this->uploadLogo($request->file('company_logo'), $company, $company); diff --git a/app/Http/Requests/Company/UpdateCompanyRequest.php b/app/Http/Requests/Company/UpdateCompanyRequest.php index d4ce94df41e7..965e8025d953 100644 --- a/app/Http/Requests/Company/UpdateCompanyRequest.php +++ b/app/Http/Requests/Company/UpdateCompanyRequest.php @@ -37,7 +37,9 @@ class UpdateCompanyRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('edit', $this->company); + /** @var \App\Models\User $user */ + $user = auth()->user(); + return $user->can('edit', $this->company); } public function rules() diff --git a/app/Models/Client.php b/app/Models/Client.php index 7da043f11ab6..da032e1c8724 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -251,6 +251,7 @@ class Client extends BaseModel implements HasLocalePreference 'number', 'routing_id', 'is_tax_exempt', + 'has_valid_vat_number', ]; protected $with = [ diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index e02e1f6d01ef..88725d43ddfc 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -728,12 +728,16 @@ class BaseDriver extends AbstractPaymentDriver App::setLocale($this->client->company->locale()); if (! $this->payment_hash || !$this->client) - return 'x'; + return 'Descriptor'; $invoices_string = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: null; $invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string); + if(is_numeric($invoices_string)){ + $invoices_string = "I-".$invoices_string; + } + $invoices_string = substr($invoices_string,0,22); $invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT); diff --git a/lang/en/texts.php b/lang/en/texts.php index b73e5f782c6e..14f9071949be 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -386,11 +386,6 @@ $LANG = array( 'invoice_issued_to' => 'Invoice issued to', 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix', 'mark_sent' => 'Mark Sent', - 'gateway_help_1' => ':link to sign up for Authorize.net.', - 'gateway_help_2' => ':link to sign up for Authorize.net.', - 'gateway_help_17' => ':link to get your PayPal API signature.', - 'gateway_help_27' => ':link to sign up for 2Checkout.com. To ensure payments are tracked set :complete_link as the redirect URL under Account > Site Management in the 2Checkout portal.', - 'gateway_help_60' => ':link to create a WePay account.', 'more_designs' => 'More designs', 'more_designs_title' => 'Additional Invoice Designs', 'more_designs_cloud_header' => 'Go Pro for more invoice designs', @@ -505,7 +500,6 @@ $LANG = array( 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'resend_confirmation' => 'Resend confirmation email', 'confirmation_resent' => 'The confirmation email was resent', - 'gateway_help_42' => ':link to sign up for BitPay.
Note: use a Legacy API Key, not an API token.', 'payment_type_credit_card' => 'Credit Card', 'payment_type_paypal' => 'PayPal', 'payment_type_bitcoin' => 'Bitcoin', @@ -590,7 +584,6 @@ $LANG = array( 'prefix' => 'Prefix', 'counter' => 'Counter', 'payment_type_dwolla' => 'Dwolla', - 'gateway_help_43' => ':link to sign up for Dwolla', 'partial_value' => 'Must be greater than zero and less than the total', 'more_actions' => 'More Actions', 'pro_plan_title' => 'NINJA PRO', @@ -1096,8 +1089,6 @@ $LANG = array( 'user_create_all' => 'Create clients, invoices, etc.', 'user_view_all' => 'View all clients, invoices, etc.', 'user_edit_all' => 'Edit all clients, invoices, etc.', - 'gateway_help_20' => ':link to sign up for Sage Pay.', - 'gateway_help_21' => ':link to sign up for Sage Pay.', 'partial_due' => 'Partial Due', 'restore_vendor' => 'Restore Vendor', 'restored_vendor' => 'Successfully restored vendor', @@ -2281,7 +2272,6 @@ $LANG = array( 'product_notes' => 'Product Notes', 'app_version' => 'App Version', 'ofx_version' => 'OFX Version', - 'gateway_help_23' => ':link to get your Stripe API keys.', 'error_app_key_set_to_default' => 'Error: APP_KEY is set to a default value, to update it backup your database and then run php artisan ninja:update-key', 'charge_late_fee' => 'Charge Late Fee', 'late_fee_amount' => 'Late Fee Amount', @@ -2521,7 +2511,6 @@ $LANG = array( 'videos' => 'Videos', 'video' => 'Video', 'return_to_invoice' => 'Return to Invoice', - 'gateway_help_13' => 'To use ITN leave the PDT Key field blank.', 'partial_due_date' => 'Partial Due Date', 'task_fields' => 'Task Fields', 'product_fields_help' => 'Drag and drop fields to change their order', @@ -4677,7 +4666,6 @@ $LANG = array( 'vat' => 'VAT', 'view_map' => 'View Map', 'set_default_design' => 'Set Default Design', - 'add_gateway_help_message' => 'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments', 'purchase_order_issued_to' => 'Purchase Order issued to', 'archive_task_status' => 'Archive Task Status', 'delete_task_status' => 'Delete Task Status', @@ -5095,6 +5083,18 @@ $LANG = array( 'total_invoices_outstanding' => 'Total Invoices Outstanding', 'recent_activity' => 'Recent Activity', 'enable_auto_bill' => 'Enable auto billing', + 'email_count_invoices' => 'Email :count invoices', + 'invoice_task_item_description' => 'Invoice Task Item Description', + 'invoice_task_item_description_help' => 'Add the item description to the invoice line items', + 'next_send_time' => 'Next Send Time', + 'uploaded_certificate' => 'Successfully uploaded certificate', + 'certificate_set' => 'Certificate set', + 'certificate_not_set' => 'Certificate not set', + 'passphrase_set' => 'Passphrase set', + 'passphrase_not_set' => 'Passphrase not set', + 'upload_certificate' => 'Upload Certificate', + 'certificate_passphrase' => 'Certificate Passphrase', + 'valid_vat_number' => 'Valid VAT Number', ); diff --git a/lang/fr_CA/texts.php b/lang/fr_CA/texts.php index 380a7c18a10c..3865d7950563 100644 --- a/lang/fr_CA/texts.php +++ b/lang/fr_CA/texts.php @@ -5078,9 +5078,18 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette 'e_invoice' => 'Facture électronique', 'light_dark_mode' => 'Mode clair/sombre', 'activities' => 'Activités', + 'recent_transactions' => "Voici les transations les plus récentes de votre entreprise:", + 'country_Palestine' => "Palestine", + 'country_Taiwan' => 'Taiwan', + 'duties' => 'Droits', + 'order_number' => 'Numéro de commande', + 'order_id' => 'Commande', + 'total_invoices_outstanding' => 'Total des factures impayées', + 'recent_activity' => 'Activité récente', + 'enable_auto_bill' => 'Activer l\'autofacturation', ); return $LANG; -?> +?> \ No newline at end of file