Skip to content

Commit 3ad2bd2

Browse files
committed
Changelog
- Fixed: asset extensibility for MultiStore - Fixed: invalid argument for NotAllowedException - Fixed: barcode not working on mutlistore - FIxed: CreateOrderTest failling for unpaid orders
1 parent 420baae commit 3ad2bd2

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ vendor
33
error.log
44
node_modules
55
composer-lock.json
6+
package-lock.json
67
composer.lock
78
.env.testing
89
.phpunit.result.cache

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
}

config/nexopos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
return [
3-
'version' => '4.5.2',
3+
'version' => '4.5.3',
44
'languages' => [
55
'en' => 'English',
66
'fr' => 'Français',

resources/views/pages/dashboard/products/print-labels.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<span>@{{ item.selectedUnitQuantity.sale_price | currency }}</span>
305305
</div>
306306
<div class="flex justify-center flex-col py-1">
307-
<img :style="{ height: form.barcode_height + 'px' }" :src="'{{ asset( 'storage/products/barcodes' ) }}/' + item.selectedUnitQuantity.barcode + '.png'" :alt="item.selectedUnitQuantity.barcode">
307+
<img :style="{ height: form.barcode_height + 'px' }" :src="'{{ ns()->asset( 'storage/products/barcodes' ) }}/' + item.selectedUnitQuantity.barcode + '.png'" :alt="item.selectedUnitQuantity.barcode">
308308
<div class="flex justify-center w-full">
309309
<span class="-mt-4 bg-white inline-block p-1">@{{ item.selectedUnitQuantity.barcode }}</span>
310310
</div>

tests/Feature/CreateOrderTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,13 @@ public function processOrders( $currentDate, $callback )
257257
* Let's test wether the cash
258258
* flow has been created for this sale
259259
*/
260-
$this->assertTrue(
261-
CashFlow::where( 'order_id', $responseData[ 'data' ][ 'order' ][ 'id' ] )->first()
262-
instanceof CashFlow,
263-
__( 'No cash flow were created for this order.' )
264-
);
260+
if ( $responseData[ 'data' ][ 'order' ][ 'payment_status' ] !== 'unpaid' ) {
261+
$this->assertTrue(
262+
CashFlow::where( 'order_id', $responseData[ 'data' ][ 'order' ][ 'id' ] )->first()
263+
instanceof CashFlow,
264+
__( 'No cash flow were created for this order.' )
265+
);
266+
}
265267

266268
/**
267269
* if a custom callback is provided

0 commit comments

Comments
 (0)