handle saving a zero fee
parent
50a881a009
commit
3429f07d3f
|
|
@ -20,7 +20,9 @@ export async function updateFee(feeForm, requestSession) {
|
|||
recordUpdate_timeMillis = ?
|
||||
where recordDelete_timeMillis is null
|
||||
and feeId = ?`)
|
||||
.run(feeForm.feeCategoryId, feeForm.feeName, feeForm.feeDescription, feeForm.occupancyTypeId === '' ? undefined : feeForm.occupancyTypeId, feeForm.lotTypeId === '' ? undefined : feeForm.lotTypeId, feeForm.feeAmount ?? undefined, feeForm.feeFunction ?? undefined, feeForm.taxAmount ?? undefined, feeForm.taxPercentage ?? undefined, feeForm.includeQuantity === '' ? 0 : 1, feeForm.quantityUnit, feeForm.isRequired === '' ? 0 : 1, requestSession.user.userName, rightNowMillis, feeForm.feeId);
|
||||
.run(feeForm.feeCategoryId, feeForm.feeName, feeForm.feeDescription, feeForm.occupancyTypeId === '' ? undefined : feeForm.occupancyTypeId, feeForm.lotTypeId === '' ? undefined : feeForm.lotTypeId, feeForm.feeAmount === undefined || feeForm.feeAmount === ''
|
||||
? 0
|
||||
: feeForm.feeAmount, feeForm.feeFunction ?? undefined, feeForm.taxAmount ?? undefined, feeForm.taxPercentage ?? undefined, feeForm.includeQuantity === '' ? 0 : 1, feeForm.quantityUnit, feeForm.isRequired === '' ? 0 : 1, requestSession.user.userName, rightNowMillis, feeForm.feeId);
|
||||
database.release();
|
||||
return result.changes > 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ export async function updateFee(
|
|||
feeForm.feeDescription,
|
||||
feeForm.occupancyTypeId === '' ? undefined : feeForm.occupancyTypeId,
|
||||
feeForm.lotTypeId === '' ? undefined : feeForm.lotTypeId,
|
||||
feeForm.feeAmount ?? undefined,
|
||||
feeForm.feeAmount === undefined || feeForm.feeAmount === ''
|
||||
? 0
|
||||
: feeForm.feeAmount,
|
||||
feeForm.feeFunction ?? undefined,
|
||||
feeForm.taxAmount ?? undefined,
|
||||
feeForm.taxPercentage ?? undefined,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let feeCategories = exports.feeCategories;
|
||||
delete exports.feeCategories;
|
||||
function renderFeeCategories() {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
||||
if (feeCategories.length === 0) {
|
||||
feeCategoriesContainerElement.innerHTML = `<div class="message is-warning">
|
||||
<p class="message-body">There are no available fees.</p>
|
||||
|
|
@ -126,19 +126,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
'<br />' +
|
||||
'<small>Fee Function</small>'
|
||||
: '$' +
|
||||
fee.feeAmount.toFixed(2) +
|
||||
((_l = fee.feeAmount) !== null && _l !== void 0 ? _l : 0).toFixed(2) +
|
||||
'<br />' +
|
||||
'<small>Fee</small>') +
|
||||
'</div>') +
|
||||
('<div class="column has-text-centered">' +
|
||||
(fee.taxPercentage
|
||||
? fee.taxPercentage.toString() + '%'
|
||||
: '$' + fee.taxAmount.toFixed(2)) +
|
||||
: '$' + ((_m = fee.taxAmount) !== null && _m !== void 0 ? _m : 0).toFixed(2)) +
|
||||
'<br /><small>Tax</small>' +
|
||||
'</div>') +
|
||||
('<div class="column has-text-centered">' +
|
||||
(fee.includeQuantity
|
||||
? cityssm.escapeHTML((_l = fee.quantityUnit) !== null && _l !== void 0 ? _l : '') +
|
||||
? cityssm.escapeHTML((_o = fee.quantityUnit) !== null && _o !== void 0 ? _o : '') +
|
||||
'<br />' +
|
||||
'<small>Quantity</small>'
|
||||
: '') +
|
||||
|
|
|
|||
|
|
@ -157,14 +157,14 @@ declare const bulmaJS: BulmaJS
|
|||
'<br />' +
|
||||
'<small>Fee Function</small>'
|
||||
: '$' +
|
||||
fee.feeAmount!.toFixed(2) +
|
||||
(fee.feeAmount ?? 0).toFixed(2) +
|
||||
'<br />' +
|
||||
'<small>Fee</small>') +
|
||||
'</div>') +
|
||||
('<div class="column has-text-centered">' +
|
||||
(fee.taxPercentage
|
||||
? fee.taxPercentage.toString() + '%'
|
||||
: '$' + fee.taxAmount!.toFixed(2)) +
|
||||
: '$' + (fee.taxAmount ?? 0).toFixed(2)) +
|
||||
'<br /><small>Tax</small>' +
|
||||
'</div>') +
|
||||
('<div class="column has-text-centered">' +
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue