Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AntPos/dev-dist/sw.js

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

2 changes: 1 addition & 1 deletion AntPos/dev-dist/sw.js.map

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

2 changes: 1 addition & 1 deletion AntPos/src/component/Customer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const customerResource = createListResource({
},
pageLength: Number.MAX_VALUE * 2,
auto: true,
onSuccess(data,params) {
onSuccess(data) {
errorHandled = false;
},
onError(error) {
Expand Down
1 change: 1 addition & 0 deletions AntPos/src/component/Dialog/Held.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ let salesInvoice = createResource({
});
const addvalues = async ()=>{
base.invoice = { ...salesInvoice.data.docs[0], status: null }
base.is_return =salesInvoice.data.docs[0].is_return
base.items = salesInvoice.data.docs[0].items;
base.discount_amount = salesInvoice.data.docs[0].discount_amount;
base.additional_discount_percentage = salesInvoice.data.docs[0].additional_discount_percentage;
Expand Down
7 changes: 5 additions & 2 deletions AntPos/src/component/Invoice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/>
</div>
<div class="grid grid-cols-2 gap-4 p-2 items-center" v-for="(mode, index) in base?.pos_profile?.payments" :key="index">

<FormControl
v-if="base.invoice?.payments?.[index] && base.invoice?.payments?.[index].amount !== undefined"
type="number"
Expand All @@ -51,6 +52,7 @@
@change="changePaymentAmount($event)"
/>
<Button
v-if="base.invoice?.payments?.[index] && base.invoice?.payments?.[index].amount !== undefined"
class="w-full h-full"
:variant="'solid'"
theme="gray"
Expand Down Expand Up @@ -227,7 +229,7 @@
</template>

<script setup>
import { Button, FormControl, createResource, DatePicker, dayjsLocal, createListResource } from 'frappe-ui'
import { Button, FormControl, createResource, DatePicker, dayjsLocal } from 'frappe-ui'
import { ref, inject, onMounted , watch, computed } from 'vue'
import { createToast } from '../utils';
import { showToast } from '../utils'
Expand All @@ -240,7 +242,7 @@ const addPayments = () => {

base.invoice.paid_amount = base.invoice.base_rounded_total
base.pos_profile.payments.forEach(element => {
if (!base.invoice.payments.some(payment => payment.mode_of_payment === element.mode_of_payment)) {
if (!base.invoice.payments.some(payment => payment.mode_of_payment === element.mode_of_payment) && (base.is_return && element.allow_in_returns || !base.is_return )) {
base.invoice.payments.push({
"mode_of_payment": element.mode_of_payment,
"amount": Number(element.default) ? Number(base.invoice.base_rounded_total) : 0.00,
Expand Down Expand Up @@ -324,6 +326,7 @@ const remove_invoice = () => {
base_rounded_total: 0,
delivery_date: '',
};
base.is_return = false
base.items = [];
base.customer = {};
};
Expand Down
2 changes: 1 addition & 1 deletion AntPos/src/component/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
:ref_for="true"
size="sm"
variant="subtle"
:disabled="!base.pos_profile.custom_edit_rate"
:disabled="!base.pos_profile.allow_rate_change"
label="Rate"
placeholder="0"
:value="Number(items.rate).toFixed(2)"
Expand Down
4 changes: 2 additions & 2 deletions AntPos/src/component/ItemDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
size="sm"
variant="subtle"
placeholder="0.00"
:disabled="false"
:disabled="!base.pos_profile.allow_discount_change"
label="Additional Discount (%)"
v-model="base.additional_discount_percentage"
/>
Expand All @@ -83,7 +83,7 @@
size="sm"
variant="subtle"
placeholder="0.00"
:disabled="false"
:disabled="!base.pos_profile.allow_discount_change"
:label="`Additional Discount (${base.pos_profile.currency})`"
v-model="base.discount_amount"
:value="Number(base.discount_amount).toFixed(2)"
Expand Down
Loading