пути к полям правильные
{{#ifCond ../prolong.status "==" "PercentPaidBeforePlanDate" "||" ../prolong.status "==" "PercentPaidOnOrAfterPlanDate"}}
<input
readonly
class="prolongation-submit mt-4 w-100"
name="prolongCredit"
id="prolongCredit"
value="Активировать продление"
/>
{{else}}
<input
readonly
class="prolongation-submit mt-4 w-100"
name="prolongCredit"
id="prolongCredit"
value="Оплатить"
/>
{{/ifCond}}
module.exports = function () {
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
case '<':
return (v1 < v2) ? options.fn(this) : options.inverse(this);
case '<=':
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
case '>':
return (v1 > v2) ? options.fn(this) : options.inverse(this);
case '>=':
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
case '&&':
return (v1 && v2) ? options.fn(this) : options.inverse(this);
case '||':
return (v1 || v2) ? options.fn(this) : options.inverse(this);
default:
return options.inverse(this);
}
});
}