2
0
mirror of https://github.com/frappe/books.git synced 2024-11-12 16:36:27 +00:00

fix: undefined name error when canceling sales invoice

This commit is contained in:
AbleKSaju 2024-09-11 12:22:03 +05:30
parent 8b9bdff938
commit c7ac373534

View File

@ -773,6 +773,10 @@ export async function removeLoyaltyPoint(doc: Doc) {
},
})) as { name: string; loyaltyPoints: number; expiryDate: Date }[];
if (!data.length) {
return;
}
const loyalityPointEntryDoc = await doc.fyo.doc.getDoc(
ModelNameEnum.LoyaltyPointEntry,
data[0].name