Skip to content

Commit

Permalink
Merge pull request #989 from AbleKSaju/fix-remove-free-items
Browse files Browse the repository at this point in the history
fix: prevent removal of free items when unrelated item is removed
  • Loading branch information
akshayitzme authored Oct 22, 2024
2 parents 2fdaef3 + 9355d66 commit bf78475
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/POS/SelectedItemRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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 =
this.row.parentdoc?.pricingRuleDetail?.length;
Expand Down

0 comments on commit bf78475

Please sign in to comment.