Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- fix #1027: translation on the POS cart
- updated: translation
  • Loading branch information
Blair2004 committed Sep 4, 2022
1 parent 3a8a68c commit 7d8e21d
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 14,649 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/ExtractTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ private function extracting()
}
} else {
$files = array_merge(
Storage::disk( 'ns' )->allFiles( 'app' ),
Storage::disk( 'ns' )->allFiles( 'resources' ),
Storage::disk( 'ns' )->allFiles( 'app' )
);

if ( $this->option( 'lang' ) === 'all' ) {
Expand Down
7 changes: 4 additions & 3 deletions app/Http/Controllers/Dashboard/OrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ public function showPOS()
__( 'POS — %s' ),
ns()->option->get( 'ns_store_name', 'NexoPOS' )
),
'orderTypes' => collect( config( 'nexopos.orders.types' ) )->filter( function( $type, $label ) {
return in_array( $label, ns()->option->get( 'ns_pos_order_types' ) ?: [] );
}),
'orderTypes' => collect( $this->ordersService->getTypeOptions() )
->filter( function( $type, $label ) {
return in_array( $label, ns()->option->get( 'ns_pos_order_types' ) ?: [] );
}),
'options' => Hook::filter( 'ns-pos-options', [
'ns_pos_printing_document' => ns()->option->get( 'ns_pos_printing_document', 'receipt' ),
'ns_orders_allow_partial' => ns()->option->get( 'ns_orders_allow_partial', 'no' ),
Expand Down
28 changes: 24 additions & 4 deletions app/Services/OrdersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2311,10 +2311,30 @@ public function getProcessStatus( $type )
*/
public function getTypeLabels()
{
return Hook::filter( 'ns-order-types', [
'delivery' => __( 'Delivery' ),
'takeaway' => __( 'Take Away' ),
'not-available' => __( 'Not Available' ),
$types = Hook::filter( 'ns-order-types-labels', collect( $this->getTypeOptions() )->mapWithKeys( function( $option ) {
return [
$option[ 'identifier' ] => $option[ 'label' ]
];
})->toArray() );

return $types;
}

public function getTypeOptions()
{
return Hook::filter( 'ns-orders-types', [
'takeaway' => [
'identifier' => 'takeaway',
'label' => __( 'Take Away' ),
'icon' => '/images/groceries.png',
'selected' => false,
],
'delivery' => [
'identifier' => 'delivery',
'label' => __( 'Delivery' ),
'icon' => '/images/delivery.png',
'selected' => false,
],
]);
}

Expand Down
3 changes: 2 additions & 1 deletion app/Settings/pos/features.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use App\Services\Helper;
use App\Services\OrdersService;

return [
'label' => __( 'Features' ),
Expand Down Expand Up @@ -90,7 +91,7 @@
'value' => ns()->option->get( 'ns_pos_order_types' ),
'label' => __( 'Order Types' ),
'type' => 'multiselect',
'options' => Helper::kvToJsOptions( config( 'nexopos.orders.types-labels' ) ),
'options' => Helper::kvToJsOptions( app()->make( OrdersService::class )->getTypeLabels() ),
'description' => __( 'Control the order type enabled.' ),
], [
'name' => 'ns_pos_numpad',
Expand Down
2,090 changes: 1 addition & 2,089 deletions lang/ar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/en.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/es.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/fr.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/it.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/pt.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/tr.json

Large diffs are not rendered by default.

2,090 changes: 1 addition & 2,089 deletions lang/vi.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/bootstrap.min/5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/bootstrap.min/613.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/pos.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"/js/cashier.min.js": "/js/cashier.min.js?id=4c016a8c4dbb333eeddd1b93ac5e6d5b",
"/js/update.min.js": "/js/update.min.js?id=bf8500f045bef05fab17d96f91bda0a2",
"/js/pos-init.min.js": "/js/pos-init.min.js?id=4622b1c92d80a390a9aff605d6dc8709",
"/js/pos.min.js": "/js/pos.min.js?id=5d80ebf19814295cb583930be521c860",
"/js/pos.min.js": "/js/pos.min.js?id=e52c784aa131c353e83c0f390a444df6",
"/js/auth.min.js": "/js/auth.min.js?id=c381025f9d70b0604c6d32ffffcd7ae2",
"/js/setup.min.js": "/js/setup.min.js?id=f25aa9ad76ea027ffb57e585329d3039",
"/js/popups.min.js": "/js/popups.min.js?id=9a080524639b86512828d04d27f4503f",
"/js/manifest.js": "/js/manifest.js?id=32e6145d53654a974a874e7574a06ed9",
"/js/manifest.js": "/js/manifest.js?id=fe412583626384cda3b08c3d9034022f",
"/js/vendor.js": "/js/vendor.js?id=97099856bc8dcb5a1680b6faba52c863"
}
1 change: 0 additions & 1 deletion resources/lang

This file was deleted.

20 changes: 10 additions & 10 deletions resources/ts/pages/dashboard/pos/ns-pos-cart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
<a v-if="allowQuantityModification( product )" @click="openDiscountPopup( product, 'product' )" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Discount' ) }} <span v-if="product.discount_type === 'percentage'">{{ product.discount_percentage }}%</span> : {{ product.discount | currency }}</a>
</div>
<div class="px-1 w-1/2 md:w-auto mb-1 lg:hidden">
<a v-if="allowQuantityModification( product )" @click="changeQuantity( product )" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Quantity :' ) }} {{ product.quantity }}</a>
<a v-if="allowQuantityModification( product )" @click="changeQuantity( product )" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Quantity' ) }}: {{ product.quantity }}</a>
</div>
<div class="px-1 w-1/2 md:w-auto mb-1 lg:hidden">
<span class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Total :' ) }} {{ product.total_price | currency }}</span>
<span class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Total' ) }}: {{ product.total_price | currency }}</span>
</div>
</div>
</div>
Expand All @@ -122,14 +122,14 @@
<table class="table ns-table w-full text-sm " v-if="visibleSection === 'both'">
<tr>
<td width="200" class="border p-2">
<a @click="selectCustomer()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Customer :' ) }} {{ customerName }}</a>
<a @click="selectCustomer()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Customer' ) }}: {{ customerName }}</a>
</td>
<td width="200" class="border p-2">{{ __( 'Sub Total' ) }}</td>
<td width="200" class="border p-2 text-right">{{ order.subtotal | currency }}</td>
</tr>
<tr>
<td width="200" class="border p-2">
<a @click="openOrderType()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Type :' ) }} {{ selectedType }}</a>
<a @click="openOrderType()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Type' ) }}: {{ selectedType }}</a>
</td>
<td width="200" class="border p-2">
<span>{{ __( 'Discount' ) }}</span>
Expand All @@ -149,8 +149,8 @@
</tr>
<tr class="success">
<td width="200" class="border p-2">
<a v-if="order && options.ns_pos_gross_price_used === 'no'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax :' ) }} {{ order.total_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'yes'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax Included :' ) }} {{ order.tax_value + order.products_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'no'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax' ) }}: {{ order.total_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'yes'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax Included' ) }}: {{ order.tax_value + order.products_tax_value | currency }}</a>
</td>
<td width="200" class="border p-2">{{ __( 'Total' ) }}</td>
<td width="200" class="border p-2 text-right">{{ order.total | currency }}</td>
Expand All @@ -159,7 +159,7 @@
<table class="table ns-table w-full text-sm" v-if="visibleSection === 'cart'">
<tr>
<td width="200" class="border p-2">
<a @click="selectCustomer()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Customer :' ) }} {{ customerName }}</a>
<a @click="selectCustomer()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Customer' ) }}: {{ customerName }}</a>
</td>
<td width="200" class="border p-2">
<div class="flex justify-between">
Expand All @@ -170,7 +170,7 @@
</tr>
<tr>
<td width="200" class="border p-2">
<a @click="openOrderType()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Type :' ) }} {{ selectedType }}</a>
<a @click="openOrderType()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Type' ) }}: {{ selectedType }}</a>
</td>
<td width="200" class="border p-2">
<div class="flex justify-between items-center">
Expand All @@ -192,8 +192,8 @@
</tr>
<tr class="success">
<td width="200" class="border p-2">
<a v-if="order && options.ns_pos_gross_price_used === 'no'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax :' ) }} {{ order.total_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'yes'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax Included :' ) }} {{ order.tax_value + order.products_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'no'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax' ) }}: {{ order.total_tax_value | currency }}</a>
<a v-if="order && options.ns_pos_gross_price_used === 'yes'" @click="openTaxSummary()" class="cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm">{{ __( 'Tax Included' ) }}: {{ order.tax_value + order.products_tax_value | currency }}</a>
</td>
<td width="200" class="border p-2">
<div class="flex justify-between w-full">
Expand Down

0 comments on commit 7d8e21d

Please sign in to comment.