Skip to content

Commit

Permalink
fix: removed returnInvoice option from POSsettings schema
Browse files Browse the repository at this point in the history
  • Loading branch information
AbleKSaju committed Jan 14, 2025
1 parent 792c676 commit 26cfbb2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 34 deletions.
7 changes: 0 additions & 7 deletions schemas/app/inventory/Point of Sale/POSSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@
"default": false,
"hidden": true
},
{
"fieldname": "returnInvoice",
"label": "Return Invoice",
"fieldtype": "Check",
"default": true,
"section": "Default"
},
{
"fieldname": "weightEnabledBarcode",
"label": "Weigth Enabled Barcode",
Expand Down
36 changes: 11 additions & 25 deletions src/pages/POS/ClassicPOS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,7 @@
<div class="w-full flex gap-2">
<Button
class="w-full bg-violet-500 dark:bg-violet-700"
:class="`${
fyo.doc.singles.POSSettings.returnInvoice
? 'py-5'
: 'py-6'
}`"
:class="`${isEnableInvoiceReturn ? 'py-5' : 'py-6'}`"
:disabled="!sinvDoc?.party || !sinvDoc?.items?.length"
@click="$emit('saveInvoiceAction')"
>
Expand All @@ -269,11 +265,7 @@
</Button>
<Button
class="w-full bg-red-500 dark:bg-red-700"
:class="`${
fyo.doc.singles.POSSettings.returnInvoice
? 'py-5'
: 'py-6'
}`"
:class="`${isEnableInvoiceReturn ? 'py-5' : 'py-6'}`"
:disabled="!sinvDoc?.items?.length"
@click="() => $emit('clearValues')"
>
Expand All @@ -286,17 +278,11 @@
</div>
<div
class="w-full flex gap-2"
:class="`${
fyo.doc.singles.POSSettings.returnInvoice ? 'mt-2' : 'mt-4'
}`"
:class="`${isEnableInvoiceReturn ? 'mt-2' : 'mt-4'}`"
>
<Button
class="w-full bg-blue-500 dark:bg-blue-700"
:class="`${
fyo.doc.singles.POSSettings.returnInvoice
? 'py-5'
: 'py-6'
}`"
:class="`${isEnableInvoiceReturn ? 'py-5' : 'py-6'}`"
@click="emitEvent('toggleModal', 'SavedInvoice', true)"
>
<slot>
Expand All @@ -307,7 +293,7 @@
</Button>

<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
v-if="isEnableInvoiceReturn"
class="w-full bg-orange-500 dark:bg-orange-700 py-5"
@click="
emitEvent('toggleModal', 'ReturnSalesInvoice', true)
Expand All @@ -322,11 +308,7 @@
<Button
v-else
class="w-full bg-green-500 dark:bg-green-700"
:class="`${
fyo.doc.singles.POSSettings.returnInvoice
? 'py-5'
: 'py-6'
}`"
:class="`${isEnableInvoiceReturn ? 'py-5' : 'py-6'}`"
:disabled="disablePayButton"
@click="emitEvent('toggleModal', 'Payment', true)"
>
Expand All @@ -338,7 +320,7 @@
</Button>
</div>
<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
v-if="isEnableInvoiceReturn"
class="w-full bg-green-500 mt-2 dark:bg-green-700 py-5"
:disabled="disablePayButton"
@click="emitEvent('toggleModal', 'Payment', true)"
Expand Down Expand Up @@ -487,6 +469,10 @@ export default defineComponent({
itemSearchTerm: '',
};
},
computed: {
isEnableInvoiceReturn: () =>
fyo.singles.AccountingSettings?.enableInvoiceReturns ?? undefined,
},
methods: {
emitEvent(
eventName: PosEmits,
Expand Down
8 changes: 6 additions & 2 deletions src/pages/POS/ModernPOS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
</slot>
</Button>
<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
v-if="isEnableInvoiceReturn"
class="mt-2 w-full bg-orange-500 dark:bg-orange-700 py-5"
@click="emitEvent('toggleModal', 'ReturnSalesInvoice', true)"
>
Expand All @@ -235,7 +235,7 @@
</div>
</div>
<Button
v-if="fyo.doc.singles.POSSettings.returnInvoice"
v-if="isEnableInvoiceReturn"
class="mt-2 w-full bg-green-500 dark:bg-green-700 py-5"
:disabled="disablePayButton"
@click="emitEvent('toggleModal', 'Payment', true)"
Expand Down Expand Up @@ -476,6 +476,10 @@ export default defineComponent({
itemSearchTerm: '',
};
},
computed: {
isEnableInvoiceReturn: () =>
fyo.singles.AccountingSettings?.enableInvoiceReturns ?? undefined,
},
methods: {
emitEvent(
eventName: PosEmits,
Expand Down

0 comments on commit 26cfbb2

Please sign in to comment.