186186 </table >
187187 </div >
188188 <div class =" h-16 flex flex-shrink-0 border-t border-gray-200" >
189- <div @click =" payOrder()" class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-green-500 text-white hover:bg-green-600 border-r border-green-600 flex-auto" >
189+ <div @click =" payOrder()" id = " pay-button " class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-green-500 text-white hover:bg-green-600 border-r border-green-600 flex-auto" >
190190 <i class =" mr-2 text-xl lg:text-3xl las la-cash-register" ></i >
191191 <span class =" text-lg lg:text-2xl" >Pay</span >
192192 </div >
193- <div @click =" holdOrder()" class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-blue-500 text-white border-r hover:bg-blue-600 border-blue-600 flex-auto" >
193+ <div @click =" holdOrder()" id = " hold-button " class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-blue-500 text-white border-r hover:bg-blue-600 border-blue-600 flex-auto" >
194194 <i class =" mr-2 text-xl lg:text-3xl las la-pause" ></i >
195195 <span class =" text-lg lg:text-2xl" >Hold</span >
196196 </div >
197- <div @click =" openDiscountPopup( order, 'cart' )" class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-white border-r border-gray-200 hover:bg-indigo-100 flex-auto text-gray-700" >
197+ <div @click =" openDiscountPopup( order, 'cart' )" id = " discount-button " class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-white border-r border-gray-200 hover:bg-indigo-100 flex-auto text-gray-700" >
198198 <i class =" mr-2 text-xl lg:text-3xl las la-percent" ></i >
199199 <span class =" text-lg lg:text-2xl" >Discount</span >
200200 </div >
201- <div @click =" voidOngoingOrder( order )" class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-red-500 text-white border-gray-200 hover:bg-red-600 flex-auto" >
201+ <div @click =" voidOngoingOrder( order )" id = " void-button " class =" flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-red-500 text-white border-gray-200 hover:bg-red-600 flex-auto" >
202202 <i class =" mr-2 text-xl lg:text-3xl las la-trash" ></i >
203203 <span class =" text-lg lg:text-2xl" >Void</span >
204204 </div >
@@ -216,7 +216,7 @@ import nsPosQuantityPopupVue from '@/popups/ns-pos-quantity-popup.vue';
216216import { ProductQuantityPromise } from " ./queues/products/product-quantity" ;
217217import nsPosDiscountPopupVue from ' @/popups/ns-pos-discount-popup.vue' ;
218218import nsPosOrderTypePopupVue from ' @/popups/ns-pos-order-type-popup.vue' ;
219- import { nsSnackBar } from ' @/bootstrap' ;
219+ import { nsHooks , nsSnackBar } from ' @/bootstrap' ;
220220import nsPosCustomerPopupVue from ' @/popups/ns-pos-customer-select-popup.vue' ;
221221import { ProductsQueue } from " ./queues/order/products-queue" ;
222222import { CustomerQueue } from " ./queues/order/customer-queue" ;
@@ -343,11 +343,13 @@ export default {
343343 return nsSnackBar .error ( ' Unable to hold an order which payment status has been updated already.' ).subscribe ();
344344 }
345345
346- const queues = [
346+ const queues = nsHooks . applyFilters ( ' ns-hold-queue ' , [
347347 ProductsQueue,
348348 CustomerQueue,
349349 TypeQueue,
350- ];
350+ ]);
351+
352+ console .log ( queues );
351353
352354 for ( let index in queues ) {
353355 try {
@@ -362,25 +364,34 @@ export default {
362364 }
363365 }
364366
365- const promise = new Promise ( ( resolve , reject ) => {
366- Popup .show ( nsPosHoldOrdersPopupVue, { resolve, reject, order : this .order });
367- });
367+ /**
368+ * overriding hold popup
369+ * This will be useful to inject custom
370+ * hold popup.
371+ */
372+ const popup = nsHooks .applyFilters ( ' ns-override-hold-popup' , () => {
373+ const promise = new Promise ( ( resolve , reject ) => {
374+ Popup .show ( nsPosHoldOrdersPopupVue, { resolve, reject, order : this .order });
375+ });
368376
369- promise .then ( result => {
370- this .order .title = result .title ;
371- this .order .payment_status = ' hold' ;
372- POS .order .next ( this .order );
377+ promise .then ( result => {
378+ this .order .title = result .title ;
379+ this .order .payment_status = ' hold' ;
380+ POS .order .next ( this .order );
373381
374- const popup = Popup .show ( nsPosLoadingPopupVue );
375-
376- POS .submitOrder ().then ( result => {
377- popup .close ();
378- nsSnackBar .success ( result .message ).subscribe ();
379- }, ( error ) => {
380- popup .close ();
381- nsSnackBar .error ( error .message ).subscribe ();
382- });
383- })
382+ const popup = Popup .show ( nsPosLoadingPopupVue );
383+
384+ POS .submitOrder ().then ( result => {
385+ popup .close ();
386+ nsSnackBar .success ( result .message ).subscribe ();
387+ }, ( error ) => {
388+ popup .close ();
389+ nsSnackBar .error ( error .message ).subscribe ();
390+ });
391+ })
392+ });
393+
394+ popup ();
384395 },
385396
386397 openDiscountPopup ( reference , type ) {
0 commit comments