Skip to content

Commit

Permalink
Changelog
Browse files Browse the repository at this point in the history
- Fixed: asset extensibility for MultiStore
- Fixed: invalid argument for NotAllowedException
- Fixed: barcode not working on mutlistore
- FIxed: CreateOrderTest failling for unpaid orders
  • Loading branch information
Blair2004 committed Sep 13, 2021
1 parent 420baae commit 3ad2bd2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ vendor
error.log
node_modules
composer-lock.json
package-lock.json
composer.lock
.env.testing
.phpunit.result.cache
Expand Down
12 changes: 12 additions & 0 deletions app/Services/CoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ public function url( $url )
return url( Hook::filter( 'ns-url', $url ) );
}

/**
* Returns a filtred URL to which
* apply the filter "ns-url" hook.
*
* @param string $url
* @return string $url
*/
public function asset( $url )
{
return url( Hook::filter( 'ns-asset', $url ) );
}

/**
* check if a use is allowed to
* access a page or trigger an error. This should not be used
Expand Down
5 changes: 1 addition & 4 deletions app/Services/OrdersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,7 @@ public function __checkDiscountVality( $fields )
})->sum();

if ( $fields['discount'] > $productsTotal ) {
throw new NotAllowedException([
'status' => 'failed',
'message' => __('A discount cannot exceed the sub total value of an order.')
]);
throw new NotAllowedException( __('A discount cannot exceed the sub total value of an order.') );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/nexopos.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
return [
'version' => '4.5.2',
'version' => '4.5.3',
'languages' => [
'en' => 'English',
'fr' => 'Français',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
<span>@{{ item.selectedUnitQuantity.sale_price | currency }}</span>
</div>
<div class="flex justify-center flex-col py-1">
<img :style="{ height: form.barcode_height + 'px' }" :src="'{{ asset( 'storage/products/barcodes' ) }}/' + item.selectedUnitQuantity.barcode + '.png'" :alt="item.selectedUnitQuantity.barcode">
<img :style="{ height: form.barcode_height + 'px' }" :src="'{{ ns()->asset( 'storage/products/barcodes' ) }}/' + item.selectedUnitQuantity.barcode + '.png'" :alt="item.selectedUnitQuantity.barcode">
<div class="flex justify-center w-full">
<span class="-mt-4 bg-white inline-block p-1">@{{ item.selectedUnitQuantity.barcode }}</span>
</div>
Expand Down
12 changes: 7 additions & 5 deletions tests/Feature/CreateOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ public function processOrders( $currentDate, $callback )
* Let's test wether the cash
* flow has been created for this sale
*/
$this->assertTrue(
CashFlow::where( 'order_id', $responseData[ 'data' ][ 'order' ][ 'id' ] )->first()
instanceof CashFlow,
__( 'No cash flow were created for this order.' )
);
if ( $responseData[ 'data' ][ 'order' ][ 'payment_status' ] !== 'unpaid' ) {
$this->assertTrue(
CashFlow::where( 'order_id', $responseData[ 'data' ][ 'order' ][ 'id' ] )->first()
instanceof CashFlow,
__( 'No cash flow were created for this order.' )
);
}

/**
* if a custom callback is provided
Expand Down

0 comments on commit 3ad2bd2

Please sign in to comment.