2
0
mirror of https://github.com/frappe/books.git synced 2025-01-03 07:12:21 +00:00

fix: prevent removal of free items when unrelated item is removed

This commit is contained in:
AbleKSaju 2024-10-21 15:42:37 +05:30
parent 657c1e8423
commit 9355d66304

View File

@ -274,8 +274,9 @@ import { defineComponent } from 'vue';
import { SalesInvoiceItem } from 'models/baseModels/SalesInvoiceItem/SalesInvoiceItem';
import { Money } from 'pesa';
import { DiscountType } from './types';
import { t } from 'fyo';
import { validateSerialNumberCount } from 'src/utils/pos';
import { getPricingRule } from 'models/helpers';
import { SalesInvoice } from 'models/baseModels/SalesInvoice/SalesInvoice';
import { ApplicablePricingRules } from 'models/baseModels/Invoice/types';
export default defineComponent({
@ -374,8 +375,9 @@ export default defineComponent({
}
},
async updatePricingRuleItem() {
const pricingRule =
(await this.row.parentdoc?.getPricingRule()) as ApplicablePricingRules[];
const pricingRule = (await getPricingRule(
this.row.parentdoc as SalesInvoice
)) as ApplicablePricingRules[];
let appliedPricingRuleCount: number;
setTimeout(async () => {