Skip to content

Commit

Permalink
feat: add return functionality in modern POS
Browse files Browse the repository at this point in the history
  • Loading branch information
AbleKSaju committed Jan 9, 2025
1 parent 13f6741 commit 4db441e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
38 changes: 36 additions & 2 deletions src/pages/POS/ModernPOS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
"
/>

<ReturnSalesInvoiceModal
:open-modal="openReturnSalesInvoiceModal"
:modal-status="openReturnSalesInvoiceModal"
@selected-return-invoice="(value:any) => emitEvent('selectedReturnInvoice', value)"
@toggle-modal="emitEvent('toggleModal', 'ReturnSalesInvoice')"
/>

<AlertModal
:open-modal="openAlertModal"
@toggle-modal="emitEvent('toggleModal', 'Alert')"
Expand Down Expand Up @@ -185,7 +192,7 @@
>
<slot>
<p class="uppercase text-lg text-white font-semibold">
{{ t`held` }}
{{ t`Held` }}
</p>
</slot>
</Button>
Expand All @@ -202,8 +209,19 @@
</p>
</slot>
</Button>

<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
class="mt-2 w-full bg-orange-500 dark:bg-orange-700 py-5"
@click="emitEvent('toggleModal', 'ReturnSalesInvoice', true)"
>
<slot>
<p class="uppercase text-lg text-white font-semibold">
{{ t`Return` }}
</p>
</slot>
</Button>
<Button
v-else
class="mt-2 w-full bg-green-500 dark:bg-green-700 py-5"
:disabled="disablePayButton"
@click="emitEvent('toggleModal', 'Payment', true)"
Expand All @@ -216,6 +234,18 @@
</Button>
</div>
</div>
<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
class="mt-2 w-full bg-green-500 dark:bg-green-700 py-5"
:disabled="disablePayButton"
@click="emitEvent('toggleModal', 'Payment', true)"
>
<slot>
<p class="uppercase text-lg text-white font-semibold">
{{ t`Buy` }}
</p>
</slot>
</Button>
</div>
</div>
</div>
Expand Down Expand Up @@ -329,6 +359,7 @@ import SavedInvoiceModal from './SavedInvoiceModal.vue';
import Barcode from 'src/components/Controls/Barcode.vue';
import ClosePOSShiftModal from './ClosePOSShiftModal.vue';
import LoyaltyProgramModal from './LoyaltyProgramModal.vue';
import ReturnSalesInvoiceModal from './ReturnSalesInvoiceModal.vue';
import MultiLabelLink from 'src/components/Controls/MultiLabelLink.vue';
import { POSItem, PosEmits, ItemQtyMap } from 'src/components/POS/types';
import { SalesInvoice } from 'models/baseModels/SalesInvoice/SalesInvoice';
Expand Down Expand Up @@ -362,6 +393,7 @@ export default defineComponent({
ModernPOSItemsTable,
WeightEnabledBarcode,
FloatingLabelFloatInput,
ReturnSalesInvoiceModal,
FloatingLabelCurrencyInput,
ModernPOSSelectedItemTable,
},
Expand All @@ -380,6 +412,7 @@ export default defineComponent({
openSavedInvoiceModal: Boolean,
openLoyaltyProgramModal: Boolean,
openAppliedCouponsModal: Boolean,
openReturnSalesInvoiceModal: Boolean,
totalQuantity: {
type: Number,
default: 0,
Expand Down Expand Up @@ -430,6 +463,7 @@ export default defineComponent({
'createTransaction',
'setTransferAmount',
'selectedInvoiceName',
'selectedReturnInvoice',
'setTransferClearanceDate',
],
data() {
Expand Down
1 change: 1 addition & 0 deletions src/pages/POS/POS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
:open-saved-invoice-modal="openSavedInvoiceModal"
:open-loyalty-program-modal="openLoyaltyProgramModal"
:open-applied-coupons-modal="openAppliedCouponsModal"
:open-return-sales-invoice-modal="openReturnSalesInvoiceModal"
@add-item="addItem"
@toggle-view="toggleView"
@set-sinv-doc="setSinvDoc"
Expand Down

0 comments on commit 4db441e

Please sign in to comment.