From ed16c47b421cee6aa5475bce591305e1c36e9d58 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 29 Dec 2021 11:31:29 +0530 Subject: [PATCH] fix: patch 0 for null currency values --- patches/0.0.4/convertCurrencyToStrings.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/patches/0.0.4/convertCurrencyToStrings.js b/patches/0.0.4/convertCurrencyToStrings.js index a4a72ca7..84bcd8ac 100644 --- a/patches/0.0.4/convertCurrencyToStrings.js +++ b/patches/0.0.4/convertCurrencyToStrings.js @@ -29,10 +29,7 @@ export default async function execute() { const rows = await frappe.db.knex(name); const convertedRows = rows.map((row) => { for (let field of fields) { - if (row[field] === null) { - continue; - } - row[field] = frappe.pesa(row[field]).store; + row[field] = frappe.pesa(row[field] ?? 0).store; } return row; });