diff --git a/VERSION.txt b/VERSION.txt index 9de379774e28..1885318d63c4 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.76 \ No newline at end of file +5.5.77 \ No newline at end of file diff --git a/app/Http/Controllers/BankTransactionController.php b/app/Http/Controllers/BankTransactionController.php index ff223acdf0cf..6c7839769eb1 100644 --- a/app/Http/Controllers/BankTransactionController.php +++ b/app/Http/Controllers/BankTransactionController.php @@ -531,7 +531,6 @@ class BankTransactionController extends BaseController */ public function match(MatchBankTransactionRequest $request) { - // MatchBankTransactions::dispatch(auth()->user()->company()->id, auth()->user()->company()->db, $request->all()); $bts = (new MatchBankTransactions(auth()->user()->company()->id, auth()->user()->company()->db, $request->all()))->handle(); diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 010d656c951f..baf03996b3c7 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -58,7 +58,7 @@ class ProductController extends BaseController * summary="Gets a list of products", * description="Lists products, search and filters allow fine grained lists to be generated. - Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available", + * Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available", * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), * @OA\Parameter(ref="#/components/parameters/include"), diff --git a/app/Http/Livewire/PaymentMethodsTable.php b/app/Http/Livewire/PaymentMethodsTable.php index ea6ad6d34e75..1c8d8166b8af 100644 --- a/app/Http/Livewire/PaymentMethodsTable.php +++ b/app/Http/Livewire/PaymentMethodsTable.php @@ -15,7 +15,7 @@ class PaymentMethodsTable extends Component use WithPagination; use WithSorting; - public int $per_page = 10; + public $per_page = 10; public Client $client; diff --git a/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php b/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php index 12946ad42d9d..34c328028533 100644 --- a/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php +++ b/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php @@ -12,6 +12,7 @@ namespace App\Http\Requests\BankTransaction; use App\Http\Requests\Request; +use App\Models\BankTransaction; use App\Models\Expense; use App\Models\Payment; @@ -24,7 +25,7 @@ class MatchBankTransactionRequest extends Request */ public function authorize() : bool { - return auth()->user()->isAdmin(); + return auth()->user()->isAdmin() || auth()->user()->can('create', BankTransaction::class) || auth()->user()->hasPermission('edit_bank_transaction'); } public function rules() diff --git a/app/Http/Requests/Preview/PreviewInvoiceRequest.php b/app/Http/Requests/Preview/PreviewInvoiceRequest.php index 75375c620934..ab0586f5a5f8 100644 --- a/app/Http/Requests/Preview/PreviewInvoiceRequest.php +++ b/app/Http/Requests/Preview/PreviewInvoiceRequest.php @@ -31,7 +31,7 @@ class PreviewInvoiceRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('create', Invoice::class) || auth()->user()->can('create', Quote::class) || auth()->user()->can('create', RecurringInvoice::class) || auth()->user()->can('create', Credit::class); + return auth()->user()->hasIntersectPermissionsOrAdmin(['view_invoice', 'view_quote', 'view_recurring_invoice', 'view_credit', 'create_invoice', 'create_quote', 'create_recurring_invoice', 'create_credit','edit_invoice', 'edit_quote', 'edit_recurring_invoice', 'edit_credit']); } public function rules() diff --git a/app/Http/Requests/Preview/PreviewPurchaseOrderRequest.php b/app/Http/Requests/Preview/PreviewPurchaseOrderRequest.php index eae0e42b36b0..6b3ce83cd85e 100644 --- a/app/Http/Requests/Preview/PreviewPurchaseOrderRequest.php +++ b/app/Http/Requests/Preview/PreviewPurchaseOrderRequest.php @@ -28,7 +28,7 @@ class PreviewPurchaseOrderRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('create', PurchaseOrder::class); + return auth()->user()->hasIntersectPermissionsOrAdmin(['create_purchase_order', 'edit_purchase_order', 'view_purchase_order']); } public function rules() diff --git a/app/Http/Requests/Product/UpdateProductRequest.php b/app/Http/Requests/Product/UpdateProductRequest.php index f824cc954ae0..b66dfd00601f 100644 --- a/app/Http/Requests/Product/UpdateProductRequest.php +++ b/app/Http/Requests/Product/UpdateProductRequest.php @@ -26,7 +26,7 @@ class UpdateProductRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('create', Product::class); + return auth()->user()->can('edit', $this->product); } public function rules() diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index 1d1954dfa0c5..758c12a8ef67 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -54,6 +54,14 @@ class BaseImport public $transformer; + public ?array $column_map = []; + + public ?string $hash; + + public ?string $import_type; + + public ?bool $skip_header; + public function __construct(array $request, Company $company) { $this->company = $company; @@ -78,6 +86,7 @@ class BaseImport public function getCsvData($entity_type) { $base64_encoded_csv = Cache::pull($this->hash.'-'.$entity_type); + if (empty($base64_encoded_csv)) { return null; } @@ -636,6 +645,14 @@ class BaseImport ksort($keys); $data = array_map(function ($row) use ($keys) { + + $row_count = count($row); + $key_count = count($keys); + + if($key_count > $row_count) { + $row = array_pad($row, $key_count, ' '); + } + return array_combine($keys, array_intersect_key($row, $keys)); }, $data); diff --git a/app/Jobs/Import/CSVIngest.php b/app/Jobs/Import/CSVIngest.php index cdeaab860c28..e34629d7524c 100644 --- a/app/Jobs/Import/CSVIngest.php +++ b/app/Jobs/Import/CSVIngest.php @@ -42,7 +42,7 @@ class CSVIngest implements ShouldQueue public ?string $skip_header; - public $column_map; + public ?array $column_map = []; public array $request; diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index b99aac92a702..e4ef35eba5f2 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -50,6 +50,7 @@ class BankTransactionTransformer extends EntityTransformer { return [ 'id' => (string) $this->encodePrimaryKey($bank_transaction->id), + 'user_id' => (string) $this->encodePrimaryKey($bank_transaction->user_id), 'bank_integration_id' => (string) $this->encodePrimaryKey($bank_transaction->bank_integration_id), 'transaction_id' => (int) $bank_transaction->transaction_id, 'amount' => (float) $bank_transaction->amount ?: 0, diff --git a/config/ninja.php b/config/ninja.php index b3da052a2a64..cf403ccda892 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.76', - 'app_tag' => '5.5.76', + 'app_version' => '5.5.77', + 'app_tag' => '5.5.77', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/resources/views/email/auth/verify.blade.php b/resources/views/email/auth/verify.blade.php index 4c3e94fe58c2..b786b3457dc4 100644 --- a/resources/views/email/auth/verify.blade.php +++ b/resources/views/email/auth/verify.blade.php @@ -2,20 +2,29 @@

{{ ctrans('texts.confirmation_message') }}

- - - - - - -
- confirmation_code}") }}" target="_blank" style="border: 0 !important;font-size: 18px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; display: inline-block;"> - {{ ctrans('texts.confirm') }} - -
- +
+ + + + + + + +
+ confirmation_code}") }}" target="_blank" class="new_button" style="text-decoration: none; border: 1px solid '.$this->settings->primary_color.'; display: inline-block; border-radius: 2px; padding-top: 15px; padding-bottom: 15px; padding-left: 25px; padding-right: 25px; font-size: 20px; color: #fff"> + {{ ctrans('texts.confirm') }} + +
+ +
@endcomponent diff --git a/resources/views/email/billing/passwordless-login.blade.php b/resources/views/email/billing/passwordless-login.blade.php index b9bb676770e9..095c5f996a94 100644 --- a/resources/views/email/billing/passwordless-login.blade.php +++ b/resources/views/email/billing/passwordless-login.blade.php @@ -3,17 +3,29 @@

{{ ctrans('texts.login_link_requested_label') }}

{{ ctrans('texts.login_link_requested') }}

- - - - - - -
- - {{ ctrans('texts.login')}} - -
+
+ + + + + + + +
+ + {{ ctrans('texts.login') }} + +
+ +
@endcomponent diff --git a/resources/views/email/gateways/ach-verification-notification.blade.php b/resources/views/email/gateways/ach-verification-notification.blade.php index 6c75d66bf454..ac01d0384444 100644 --- a/resources/views/email/gateways/ach-verification-notification.blade.php +++ b/resources/views/email/gateways/ach-verification-notification.blade.php @@ -3,17 +3,29 @@

{{ ctrans('texts.ach_verification_notification_label') }}

{{ ctrans('texts.ach_verification_notification') }}

- - - - - - -
- - {{ ctrans('texts.complete_verification') }} - -
+
+ + + + + + + +
+ + {{ ctrans('texts.complete_verification') }} + +
+ +
@endcomponent diff --git a/resources/views/email/import/completed.blade.php b/resources/views/email/import/completed.blade.php index 6883db8aceb1..f9b4ed35532c 100644 --- a/resources/views/email/import/completed.blade.php +++ b/resources/views/email/import/completed.blade.php @@ -96,17 +96,29 @@ @endif - - - - - - -
- - {{ ctrans('texts.account_login') }} - -
+
+ + + + + + + +
+ + {{ ctrans('texts.account_login') }} + +
+ +

{{ ctrans('texts.email_signature')}}

{{ ctrans('texts.email_from') }}

diff --git a/resources/views/email/import/csv_completed.blade.php b/resources/views/email/import/csv_completed.blade.php index 9b915a9e6129..7a77de0aabec 100644 --- a/resources/views/email/import/csv_completed.blade.php +++ b/resources/views/email/import/csv_completed.blade.php @@ -91,17 +91,30 @@ @endif - - - - - - -
- - {{ ctrans('texts.account_login') }} - -
+
+ + + + + + + +
+ + {{ ctrans('texts.account_login') }} + +
+ +
+

{{ ctrans('texts.email_signature')}}

{{ ctrans('texts.email_from') }}

diff --git a/resources/views/email/migration/completed.blade.php b/resources/views/email/migration/completed.blade.php index d6879ef6debd..6bdd41abc656 100644 --- a/resources/views/email/migration/completed.blade.php +++ b/resources/views/email/migration/completed.blade.php @@ -2,20 +2,30 @@

{{ ctrans('texts.migration_completed')}}

{{ ctrans('texts.migration_completed_description')}}

- - - - - -
- - {{ ctrans('texts.account_login') }} - -
+
+ + + + + + + +
+ + {{ ctrans('texts.account_login') }} + +
+ +

{{ ctrans('texts.email_signature')}}
{{ ctrans('texts.email_from') }}