Minor fixes + translations

This commit is contained in:
David Bomba 2023-05-31 14:36:35 +10:00
parent 60030c4e9a
commit cb6a9fb9f9
6 changed files with 36 additions and 16 deletions

View File

@ -422,8 +422,12 @@ class CompanyController extends BaseController
if($request->has('e_invoice_certificate') && !is_null($request->file("e_invoice_certificate"))){ 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->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); $this->uploadLogo($request->file('company_logo'), $company, $company);

View File

@ -37,7 +37,9 @@ class UpdateCompanyRequest extends Request
*/ */
public function authorize() : bool 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() public function rules()

View File

@ -251,6 +251,7 @@ class Client extends BaseModel implements HasLocalePreference
'number', 'number',
'routing_id', 'routing_id',
'is_tax_exempt', 'is_tax_exempt',
'has_valid_vat_number',
]; ];
protected $with = [ protected $with = [

View File

@ -728,12 +728,16 @@ class BaseDriver extends AbstractPaymentDriver
App::setLocale($this->client->company->locale()); App::setLocale($this->client->company->locale());
if (! $this->payment_hash || !$this->client) 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 = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: null;
$invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string); $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 = substr($invoices_string,0,22);
$invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT); $invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT);

View File

@ -386,11 +386,6 @@ $LANG = array(
'invoice_issued_to' => 'Invoice issued to', 'invoice_issued_to' => 'Invoice issued to',
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix', 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
'mark_sent' => 'Mark Sent', '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' => 'More designs',
'more_designs_title' => 'Additional Invoice Designs', 'more_designs_title' => 'Additional Invoice Designs',
'more_designs_cloud_header' => 'Go Pro for more 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.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email', 'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent', 'confirmation_resent' => 'The confirmation email was resent',
'gateway_help_42' => ':link to sign up for BitPay.<br/>Note: use a Legacy API Key, not an API token.',
'payment_type_credit_card' => 'Credit Card', 'payment_type_credit_card' => 'Credit Card',
'payment_type_paypal' => 'PayPal', 'payment_type_paypal' => 'PayPal',
'payment_type_bitcoin' => 'Bitcoin', 'payment_type_bitcoin' => 'Bitcoin',
@ -590,7 +584,6 @@ $LANG = array(
'prefix' => 'Prefix', 'prefix' => 'Prefix',
'counter' => 'Counter', 'counter' => 'Counter',
'payment_type_dwolla' => 'Dwolla', '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', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO', 'pro_plan_title' => 'NINJA PRO',
@ -1096,8 +1089,6 @@ $LANG = array(
'user_create_all' => 'Create clients, invoices, etc.', 'user_create_all' => 'Create clients, invoices, etc.',
'user_view_all' => 'View all clients, invoices, etc.', 'user_view_all' => 'View all clients, invoices, etc.',
'user_edit_all' => 'Edit 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', 'partial_due' => 'Partial Due',
'restore_vendor' => 'Restore Vendor', 'restore_vendor' => 'Restore Vendor',
'restored_vendor' => 'Successfully restored vendor', 'restored_vendor' => 'Successfully restored vendor',
@ -2281,7 +2272,6 @@ $LANG = array(
'product_notes' => 'Product Notes', 'product_notes' => 'Product Notes',
'app_version' => 'App Version', 'app_version' => 'App Version',
'ofx_version' => 'OFX 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 <code>php artisan ninja:update-key</code>', 'error_app_key_set_to_default' => 'Error: APP_KEY is set to a default value, to update it backup your database and then run <code>php artisan ninja:update-key</code>',
'charge_late_fee' => 'Charge Late Fee', 'charge_late_fee' => 'Charge Late Fee',
'late_fee_amount' => 'Late Fee Amount', 'late_fee_amount' => 'Late Fee Amount',
@ -2521,7 +2511,6 @@ $LANG = array(
'videos' => 'Videos', 'videos' => 'Videos',
'video' => 'Video', 'video' => 'Video',
'return_to_invoice' => 'Return to Invoice', 'return_to_invoice' => 'Return to Invoice',
'gateway_help_13' => 'To use ITN leave the PDT Key field blank.',
'partial_due_date' => 'Partial Due Date', 'partial_due_date' => 'Partial Due Date',
'task_fields' => 'Task Fields', 'task_fields' => 'Task Fields',
'product_fields_help' => 'Drag and drop fields to change their order', 'product_fields_help' => 'Drag and drop fields to change their order',
@ -4677,7 +4666,6 @@ $LANG = array(
'vat' => 'VAT', 'vat' => 'VAT',
'view_map' => 'View Map', 'view_map' => 'View Map',
'set_default_design' => 'Set Default Design', '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', 'purchase_order_issued_to' => 'Purchase Order issued to',
'archive_task_status' => 'Archive Task Status', 'archive_task_status' => 'Archive Task Status',
'delete_task_status' => 'Delete Task Status', 'delete_task_status' => 'Delete Task Status',
@ -5095,6 +5083,18 @@ $LANG = array(
'total_invoices_outstanding' => 'Total Invoices Outstanding', 'total_invoices_outstanding' => 'Total Invoices Outstanding',
'recent_activity' => 'Recent Activity', 'recent_activity' => 'Recent Activity',
'enable_auto_bill' => 'Enable auto billing', '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',
); );

View File

@ -5078,9 +5078,18 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
'e_invoice' => 'Facture électronique', 'e_invoice' => 'Facture électronique',
'light_dark_mode' => 'Mode clair/sombre', 'light_dark_mode' => 'Mode clair/sombre',
'activities' => 'Activités', '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; return $LANG;
?> ?>