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.

4 changes: 2 additions & 2 deletions AntPos/src/component/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,16 @@ const calculateRateTotal = () => {
};

onMounted( async () => {
emitter.emit('calctotal');
calculateRateTotal();
validateQty(props.items.qty);
if(props.items.selected_serial_no) adjustSerialNumbers(props.items.selected_serial_no.length);
if(props.items.selected_serial_no) add_serial_no();
if(props.items.selected_serial_no) add_serial_no();
await get_batch.fetch({
item_code: props.items.item_code,
warehouse: base.pos_profile.warehouse,
})
await get_serial_no.fetch()
emitter.emit('calctotal');

});

Expand Down
2 changes: 1 addition & 1 deletion AntPos/src/component/ItemDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const getPayments = () => {
return payments;
};
const calcuateDiscount = () => {
let amount = base.pos_profile.apply_discount_on === 'grand_total' ? base.invoice.grand_total : base.invoice.net_total;
let amount = base.pos_profile.apply_discount_on === 'grand_total' ? base.invoice.grand_total : base.invoice.base_net_total + base.invoice?.discount_amount ;
if (base.pos_profile.custom_use_percentage_discount) {
base.discount_amount= (amount * 100) / base.additional_discount_percentage;
} else {
Expand Down
16 changes: 11 additions & 5 deletions AntPos/src/component/ItemSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<script setup>
import { FormControl, FeatherIcon, createResource } from 'frappe-ui';
import { ref, inject, watch } from 'vue';
import { ref, inject } from 'vue';
import { createToast } from '../utils';
import { showToast } from '../utils'

Expand Down Expand Up @@ -254,10 +254,16 @@ const runDocMethod = createResource({
onSuccess(data){
base.invoice=data;
data.items.forEach(n => {
const e = base.items.find(b => b.custom_id === n.custom_id);
if (!e) return;
for (const k in n) if (k !== 'custom_id' && e[k] !== n[k]) e[k] = n[k];
});
const e = base.items.find(b => b.custom_id === n.custom_id);
if (!e) return;
for (const k in n) {
if (k !== 'custom_id' && e[k] !== n[k]) {
if (JSON.stringify(e[k]) !== JSON.stringify(n[k])) {
e[k] = n[k];
}
}
}
})

errorHandled = false;
},
Expand Down
2 changes: 1 addition & 1 deletion ant_pos/ant_pos/api/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def items(pos_profile, search_value, customer):
"price_list": "Standard Selling",
"price_list_currency": company.default_currency,
"company": company.name,
"ignore_pricing_rule": 0,
"ignore_pricing_rule": pos_profile_doc.ignore_pricing_rule,
"doctype": "Sales Invoice",
"stock_uom": item.get("stock_uom"),
"pos_profile": pos_profile_doc.name,
Expand Down
25 changes: 13 additions & 12 deletions ant_pos/ant_pos/api/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ def calculate_invoice_item_taxes(doc):
invoice.flags.ignore_permissions = True
invoice.set_missing_values()
invoice.calculate_taxes_and_totals()
for item in invoice.items:
data=get_price_list_rate_for(
{
'price_list': 'Standard Selling',
"customer": invoice.customer,
"uom":item.uom,
"transaction_date": invoice.posting_date,
"batch_no": item.batch_no,
},
item.item_code
)
item.price_list_rate=data
if not invoice.ignore_pricing_rule:
for item in invoice.items:
data=get_price_list_rate_for(
{
'price_list': 'Standard Selling',
"customer": invoice.customer,
"uom":item.uom,
"transaction_date": invoice.posting_date,
"batch_no": item.batch_no,
},
item.item_code
)
item.price_list_rate=data
return invoice.as_dict()
Loading