Skip to content

Commit a724e1e

Browse files
authored
Merge pull request #300 from Blair2004/v4.5.x
V4.5.3
2 parents f6b39ac + 3ad2bd2 commit a724e1e

File tree

16 files changed

+89
-48
lines changed

16 files changed

+89
-48
lines changed

.do/deploy.template.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
spec:
2+
name: nexopos
3+
databases:
4+
- name: nexopos
5+
engine: MYSQL
6+
production: true
7+
cluster_name: ns
8+
services:
9+
- environment_slug: php
10+
name: nexopos
11+
git:
12+
repo_clone_url: https://github.com/blair2004/NexoPOS-4x
13+
branch: master
14+
build_command:
15+
npm install
16+
composer install
17+
cp .env.example .env
18+
php artisan key:generate
19+
php artisan storage:link
20+
run_command: heroku-php-apache2 public/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Latest Stable Version](https://poser.pugx.org/blair2004/nexopos/v)](//packagist.org/packages/blair2004/nexopos) [![Total Downloads](https://poser.pugx.org/blair2004/nexopos/downloads)](//packagist.org/packages/blair2004/nexopos) [![Latest Unstable Version](https://poser.pugx.org/blair2004/nexopos/v/unstable)](//packagist.org/packages/blair2004/nexopos) [![License](https://poser.pugx.org/blair2004/nexopos/license)](//packagist.org/packages/blair2004/nexopos)
22

3+
[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/blair2004/NexoPOS-4x/tree/v4.5.x&refcode=ebdb80cb0ec7)
4+
35
# About NexoPOS 4.x
46
NexoPOS 4 is a free point of sale system build using Laravel, TailwindCSS, Vue and other open-source resources. This POS System focuses on utilities and functionalities to offer for most businesses all the tools they need to manage better their store. NexoPOS 4.x include a responsive and beautiful dashboard that ease the interaction either on a smartphone, tables or desktops.
57

app/Console/Commands/GenerateModuleCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class GenerateModuleCommand extends Command
2929
*
3030
* @var string
3131
*/
32-
protected $description = 'Create a new Tendoo module';
32+
protected $description = 'Create a new NexoPOS 4.x module';
3333

3434
/**
3535
* Create a new command instance.
@@ -52,7 +52,7 @@ public function handle()
5252
if ( ns()->installed() ) {
5353
$this->askInformations();
5454
} else {
55-
$this->info( 'Tendoo is not yet installed.' );
55+
$this->info( 'NexoPOS 4.x is not yet installed.' );
5656
}
5757
}
5858

app/Crud/CustomerCrud.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use App\Models\CustomerBillingAddress;
1717
use App\Models\CustomerGroup;
1818
use App\Models\CustomerShippingAddress;
19+
use App\Services\Users;
1920
use Exception;
2021
use TorMorten\Eventy\Facades\Events as Hook;
2122

@@ -565,7 +566,7 @@ public function bulkAction( Request $request )
565566
* Deleting licence is only allowed for admin
566567
* and supervisor.
567568
*/
568-
$user = app()->make( 'Tendoo\Core\Services\Users' );
569+
$user = app()->make( Users::class );
569570
if ( ! $user->is([ 'admin', 'supervisor' ]) ) {
570571
return response()->json([
571572
'status' => 'failed',

app/Crud/ProductCategoryCrud.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ public function bulkAction( Request $request )
393393
* and supervisor.
394394
*/
395395
$user = app()->make( Users::class );
396+
396397
if ( ! $user->is([ 'admin', 'supervisor' ]) ) {
397398
return response()->json([
398399
'status' => 'failed',

app/Http/Controllers/Dashboard/CrudController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ public function crudBulkActions( String $namespace, Request $request )
382382
* assuming we're bulk deleting
383383
* but the action might be different later
384384
*/
385-
$response = $resource->bulkAction( $request );
385+
$response = Hook::filter( get_class( $resource ) . '@bulkAction', $resource->bulkAction( $request ), $request );
386386

387387
return [
388388
'status' => 'success',
@@ -462,9 +462,9 @@ public function getConfig( string $namespace )
462462
get_class( $resource ) . '@getColumns',
463463
$resource->getColumns()
464464
),
465-
'labels' => $resource->getLabels(),
466-
'links' => $resource->getLinks() ?? [],
467-
'bulkActions' => $resource->getBulkActions(),
465+
'labels' => Hook::filter( get_class( $resource ) . '@getLabels', $resource->getLabels() ),
466+
'links' => Hook::filter( get_class( $resource ) . '@getLinks', $resource->getLinks() ?? [] ),
467+
'bulkActions' => Hook::filter( get_class( $resource ) . '@getBulkActions', $resource->getBulkActions() ),
468468
'namespace' => $namespace,
469469
];
470470
}
@@ -499,8 +499,8 @@ public function getFormConfig( string $namespace, $id = null )
499499
$form = Hook::filter( get_class( $resource )::method( 'getForm' ), $resource->getForm( $model ), compact( 'model' ) );
500500
$config = [
501501
'form' => $form,
502-
'labels' => $resource->getLabels(),
503-
'links' => @$resource->getLinks(),
502+
'labels' => Hook::filter( get_class( $resource ) . '@getLabels', $resource->getLabels() ),
503+
'links' => Hook::filter( get_class( $resource ) . '@getLinks', $resource->getLinks() ),
504504
'namespace' => $namespace,
505505
];
506506

app/Http/Controllers/Dashboard/CustomersController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public function getCustomersRewards( Customer $customer )
268268
public function editCustomerReward( Customer $customer, CustomerReward $reward )
269269
{
270270
return CustomerRewardCrud::form( $reward, [
271-
'returnUrl' => ns()->route( 'ns.dashboard.customers-rewards', [ 'customer' => $customer->id ]),
271+
'returnUrl' => ns()->route( 'ns.dashboard.customers-rewards-list', [ 'customer' => $customer->id ]),
272272
'queryParams' => [
273273
'customer_id' => $customer->id
274274
]

app/Services/AuthService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ public function lostPasswordUnsecured( $fields )
510510
/**
511511
* Check recaptcha using predefined
512512
* values as POST data
513+
* @deprecated
513514
* @return void
514515
*/
515516
public function checkReCaptcha( $data = [])

app/Services/CoreService.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ public function url( $url )
125125
return url( Hook::filter( 'ns-url', $url ) );
126126
}
127127

128+
/**
129+
* Returns a filtred URL to which
130+
* apply the filter "ns-url" hook.
131+
*
132+
* @param string $url
133+
* @return string $url
134+
*/
135+
public function asset( $url )
136+
{
137+
return url( Hook::filter( 'ns-asset', $url ) );
138+
}
139+
128140
/**
129141
* check if a use is allowed to
130142
* access a page or trigger an error. This should not be used

app/Services/OrdersService.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,7 @@ public function __checkDiscountVality( $fields )
637637
})->sum();
638638

639639
if ( $fields['discount'] > $productsTotal ) {
640-
throw new NotAllowedException([
641-
'status' => 'failed',
642-
'message' => __('A discount cannot exceed the sub total value of an order.')
643-
]);
640+
throw new NotAllowedException( __('A discount cannot exceed the sub total value of an order.') );
644641
}
645642
}
646643
}

0 commit comments

Comments
 (0)