Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- Removed: useless settings
- Updated: Procurement form flexibility
- Added: quick product can be disabled
- Added: customer creation can be disabled
  • Loading branch information
Blair2004 committed Nov 17, 2021
1 parent 8645619 commit 1722dd0
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 26 deletions.
2 changes: 2 additions & 0 deletions app/Forms/ProcurementForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

class ProcurementForm extends SettingsPage
{
public $form;

public function __construct()
{
if ( ! empty( request()->route( 'identifier' ) ) ) {
Expand Down
10 changes: 0 additions & 10 deletions app/Settings/pos/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@
'no' => __( 'No' )
]),
'description' => __( 'Allow quick product to be created from the POS.' ),
], [
'name' => 'ns_pos_order_sms',
'value' => $options->get( 'ns_pos_order_sms' ),
'label' => __( 'SMS Order Confirmation' ),
'type' => 'switch',
'options' => Helper::kvToJsOptions([
'yes' => __( 'Yes' ),
'no' => __( 'No' )
]),
'description' => __( 'Will send SMS to the customer once the order is placed.' ),
], [
'name' => 'ns_pos_unit_price_ediable',
'value' => $options->get( 'ns_pos_unit_price_ediable' ),
Expand Down
6 changes: 4 additions & 2 deletions public/css/app.css

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/dashboard.min.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/popups.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion resources/ts/pages/dashboard/pos/ns-pos-cart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<span class="ml-1 hidden md:inline-block">{{ __( 'Settings' ) }}</span>
</button>
</div>
<div>
<div v-if="options.ns_pos_quick_product === 'yes'">
<button @click="openAddQuickProduct()" class="w-full h-10 px-3 bg-gray-200 border-r border-gray-300 outline-none flex items-center">
<i class="las la-plus"></i>
<span class="ml-1 hidden md:inline-block">{{ __( 'Product' ) }}</span>
Expand Down Expand Up @@ -255,6 +255,8 @@ export default {
products: [],
visibleSection: null,
visibleSectionSubscriber: null,
optionsSubscriber: null,
options: {},
typeSubscribe: null,
orderSubscribe: null,
productSubscribe: null,
Expand All @@ -279,6 +281,9 @@ export default {
}
},
mounted() {
this.optionsSubscriber = POS.options.subscribe( options => {
this.options = options;
});
this.typeSubscribe = POS.types.subscribe( types => this.types = types );
this.orderSubscribe = POS.order.subscribe( order => {
this.order = order;
Expand All @@ -302,6 +307,7 @@ export default {
this.orderSubscribe.unsubscribe();
this.productSubscribe.unsubscribe();
this.settingsSubscribe.unsubscribe();
this.optionsSubscriber.unsubscribe();
},
methods: {
__,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export default {
<template v-if="form.main">
<div class="flex flex-col">
<div class="flex justify-between items-center">
<label for="title" class="font-bold my-2 text-gray-700"><slot name="title">{{ __( 'No title is provided' ) }}</slot></label>
<label for="title" class="font-bold my-2 text-gray-700">{{ form.main.label || __( 'No title is provided' ) }}</label>
<div for="title" class="text-sm my-2 text-gray-700">
<a v-if="returnUrl" :href="returnUrl" class="rounded-full border border-gray-400 hover:bg-red-600 hover:text-white bg-white px-2 py-1">{{ __( 'Go Back' ) }}</a>
</div>
Expand Down
16 changes: 16 additions & 0 deletions resources/ts/popups/ns-pos-customers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
<ns-tabs :active="activeTab" @active="activeTab = $event">
<ns-tabs-item identifier="create-customers" label="New Customer">
<ns-crud-form
v-if="options.ns_pos_customers_creation_enabled === 'yes'"
@updated="prefillForm( $event )"
@save="handleSavedCustomer( $event )"
submit-url="/api/nexopos/v4/crud/ns.customers"
src="/api/nexopos/v4/crud/ns.customers/form-config">
<template v-slot:title>{{ __( 'Customer Name' ) }}</template>
<template v-slot:save>{{ __( 'Save Customer' ) }}</template>
</ns-crud-form>
<div class="h-full flex-col w-full flex items-center justify-center">
<i class="lar la-hand-paper text-6xl text-gray-700"></i>
<h3 class="font-medium text-2xl text-gray-700">{{ __( 'Not Authorized' ) }}</h3>
<p class="text-gray-600">{{ __( 'Creating customers has been explicitly disabled from the settings.' ) }}</p>
</div>
</ns-tabs-item>
<ns-tabs-item identifier="account-payment" :label="__( 'Customer Account' )" class="flex" style="padding:0!important">
<div class="flex-auto w-full flex items-center justify-center flex-col p-4" v-if="customer === null">
Expand Down Expand Up @@ -224,6 +230,8 @@ export default {
customer: null,
subscription: null,
orders: [],
options: {},
optionsSubscriber: null,
selectedTab: 'orders',
isLoadingCoupons: false,
isLoadingRewards: false,
Expand All @@ -235,9 +243,17 @@ export default {
components: {
nsPaginate
},
destroyed() {
this.subscription.unsubscribe();
this.optionsSubscriber.unsubscribe();
},
mounted() {
this.closeWithOverlayClicked();
this.optionsSubscriber = POS.options.subscribe( options => {
this.options = options;
});
this.subscription = POS.order.subscribe( order => {
this.order = order;
Expand Down

0 comments on commit 1722dd0

Please sign in to comment.