tweak connectedDatabase undefined check
parent
3eb4958f65
commit
7d8a63dfb4
|
|
@ -47,7 +47,7 @@ export function addLotOccupancy(lotOccupancyForm, requestSession, connectedDatab
|
||||||
occupantComment: lotOccupancyForm.occupantComment
|
occupantComment: lotOccupancyForm.occupantComment
|
||||||
}, requestSession, database);
|
}, requestSession, database);
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancyId;
|
return lotOccupancyId;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ export function addLotOccupancy(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export function addLotOccupancyOccupant(lotOccupancyOccupantForm, requestSession
|
||||||
recordUpdate_userName, recordUpdate_timeMillis)
|
recordUpdate_userName, recordUpdate_timeMillis)
|
||||||
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
||||||
.run(lotOccupancyOccupantForm.lotOccupancyId, lotOccupantIndex, lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment ?? '', lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
.run(lotOccupancyOccupantForm.lotOccupancyId, lotOccupantIndex, lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment ?? '', lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupantIndex;
|
return lotOccupantIndex;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export function addLotOccupancyOccupant(
|
||||||
rightNowMillis
|
rightNowMillis
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export function addOrUpdateLotField(lotFieldForm, requestSession, connectedDatab
|
||||||
values (?, ?, ?, ?, ?, ?, ?)`)
|
values (?, ?, ?, ?, ?, ?, ?)`)
|
||||||
.run(lotFieldForm.lotId, lotFieldForm.lotTypeFieldId, lotFieldForm.lotFieldValue, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
.run(lotFieldForm.lotId, lotFieldForm.lotTypeFieldId, lotFieldForm.lotFieldValue, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ export function addOrUpdateLotField(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export function addOrUpdateLotOccupancyField(lotOccupancyFieldForm, requestSessi
|
||||||
values (?, ?, ?, ?, ?, ?, ?)`)
|
values (?, ?, ?, ?, ?, ?, ?)`)
|
||||||
.run(lotOccupancyFieldForm.lotOccupancyId, lotOccupancyFieldForm.occupancyTypeFieldId, lotOccupancyFieldForm.lotOccupancyFieldValue, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
.run(lotOccupancyFieldForm.lotOccupancyId, lotOccupancyFieldForm.occupancyTypeFieldId, lotOccupancyFieldForm.lotOccupancyFieldValue, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ export function addOrUpdateLotOccupancyField(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export function addWorkOrderLotOccupancy(workOrderLotOccupancyForm, requestSessi
|
||||||
values (?, ?, ?, ?, ?, ?)`)
|
values (?, ?, ?, ?, ?, ?)`)
|
||||||
.run(workOrderLotOccupancyForm.workOrderId, workOrderLotOccupancyForm.lotOccupancyId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
.run(workOrderLotOccupancyForm.workOrderId, workOrderLotOccupancyForm.lotOccupancyId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export function addWorkOrderLotOccupancy(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function deleteLotField(lotId, lotTypeFieldId, requestSession, connectedD
|
||||||
where lotId = ?
|
where lotId = ?
|
||||||
and lotTypeFieldId = ?`)
|
and lotTypeFieldId = ?`)
|
||||||
.run(requestSession.user.userName, rightNowMillis, lotId, lotTypeFieldId);
|
.run(requestSession.user.userName, rightNowMillis, lotId, lotTypeFieldId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export function deleteLotField(
|
||||||
)
|
)
|
||||||
.run(requestSession.user!.userName, rightNowMillis, lotId, lotTypeFieldId)
|
.run(requestSession.user!.userName, rightNowMillis, lotId, lotTypeFieldId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function deleteLotOccupancyField(lotOccupancyId, occupancyTypeFieldId, re
|
||||||
where lotOccupancyId = ?
|
where lotOccupancyId = ?
|
||||||
and occupancyTypeFieldId = ?`)
|
and occupancyTypeFieldId = ?`)
|
||||||
.run(requestSession.user.userName, rightNowMillis, lotOccupancyId, occupancyTypeFieldId);
|
.run(requestSession.user.userName, rightNowMillis, lotOccupancyId, occupancyTypeFieldId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export function deleteLotOccupancyField(
|
||||||
occupancyTypeFieldId
|
occupancyTypeFieldId
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export function getFee(feeId, connectedDatabase) {
|
||||||
where f.recordDelete_timeMillis is null
|
where f.recordDelete_timeMillis is null
|
||||||
and f.feeId = ?`)
|
and f.feeId = ?`)
|
||||||
.get(feeId);
|
.get(feeId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return fee;
|
return fee;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export function getFee(
|
||||||
)
|
)
|
||||||
.get(feeId)
|
.get(feeId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ export function getFees(feeCategoryId, additionalFilters, connectedDatabase) {
|
||||||
expectedOrderNumber += 1;
|
expectedOrderNumber += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return fees;
|
return fees;
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ export function getFees(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function getLotComments(lotId, connectedDatabase) {
|
||||||
and lotId = ?
|
and lotId = ?
|
||||||
order by lotCommentDate desc, lotCommentTime desc, lotCommentId desc`)
|
order by lotCommentDate desc, lotCommentTime desc, lotCommentId desc`)
|
||||||
.all(lotId);
|
.all(lotId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotComments;
|
return lotComments;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function getLotComments(
|
||||||
)
|
)
|
||||||
.all(lotId)
|
.all(lotId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export function getLotFields(lotId, connectedDatabase) {
|
||||||
and f.lotTypeFieldId not in (select lotTypeFieldId from LotFields where lotId = ? and recordDelete_timeMillis is null)
|
and f.lotTypeFieldId not in (select lotTypeFieldId from LotFields where lotId = ? and recordDelete_timeMillis is null)
|
||||||
order by lotTypeOrderNumber, f.orderNumber, f.lotTypeField`)
|
order by lotTypeOrderNumber, f.orderNumber, f.lotTypeField`)
|
||||||
.all(lotId, lotId, lotId, lotId);
|
.all(lotId, lotId, lotId, lotId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotFields;
|
return lotFields;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export function getLotFields(
|
||||||
)
|
)
|
||||||
.all(lotId, lotId, lotId, lotId)
|
.all(lotId, lotId, lotId, lotId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export function getLotOccupancies(filters, options, connectedDatabase) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ export function getLotOccupancies(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export function getLotOccupancy(lotOccupancyId, connectedDatabase) {
|
||||||
offset: 0
|
offset: 0
|
||||||
}, database).workOrders;
|
}, database).workOrders;
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancy;
|
return lotOccupancy;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ export function getLotOccupancy(
|
||||||
).workOrders
|
).workOrders
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function getLotOccupancyComments(lotOccupancyId, connectedDatabase) {
|
||||||
and lotOccupancyId = ?
|
and lotOccupancyId = ?
|
||||||
order by lotOccupancyCommentDate desc, lotOccupancyCommentTime desc, lotOccupancyCommentId desc`)
|
order by lotOccupancyCommentDate desc, lotOccupancyCommentTime desc, lotOccupancyCommentId desc`)
|
||||||
.all(lotOccupancyId);
|
.all(lotOccupancyId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === null) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotComments;
|
return lotComments;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function getLotOccupancyComments(
|
||||||
)
|
)
|
||||||
.all(lotOccupancyId)
|
.all(lotOccupancyId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === null) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export function getLotOccupancyFees(lotOccupancyId, connectedDatabase) {
|
||||||
and o.lotOccupancyId = ?
|
and o.lotOccupancyId = ?
|
||||||
order by o.recordCreate_timeMillis`)
|
order by o.recordCreate_timeMillis`)
|
||||||
.all(lotOccupancyId);
|
.all(lotOccupancyId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancyFees;
|
return lotOccupancyFees;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ export function getLotOccupancyFees(
|
||||||
)
|
)
|
||||||
.all(lotOccupancyId)
|
.all(lotOccupancyId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export function getLotOccupancyFields(lotOccupancyId, connectedDatabase) {
|
||||||
and f.occupancyTypeFieldId not in (select occupancyTypeFieldId from LotOccupancyFields where lotOccupancyId = ? and recordDelete_timeMillis is null)
|
and f.occupancyTypeFieldId not in (select occupancyTypeFieldId from LotOccupancyFields where lotOccupancyId = ? and recordDelete_timeMillis is null)
|
||||||
order by occupancyTypeOrderNumber, f.orderNumber, f.occupancyTypeField`)
|
order by occupancyTypeOrderNumber, f.orderNumber, f.occupancyTypeField`)
|
||||||
.all(lotOccupancyId, lotOccupancyId, lotOccupancyId, lotOccupancyId);
|
.all(lotOccupancyId, lotOccupancyId, lotOccupancyId, lotOccupancyId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancyFields;
|
return lotOccupancyFields;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export function getLotOccupancyFields(
|
||||||
)
|
)
|
||||||
.all(lotOccupancyId, lotOccupancyId, lotOccupancyId, lotOccupancyId)
|
.all(lotOccupancyId, lotOccupancyId, lotOccupancyId, lotOccupancyId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export function getLotOccupancyOccupants(lotOccupancyId, connectedDatabase) {
|
||||||
and o.lotOccupancyId = ?
|
and o.lotOccupancyId = ?
|
||||||
order by t.orderNumber, t.lotOccupantType, o.occupantName, o.lotOccupantIndex`)
|
order by t.orderNumber, t.lotOccupantType, o.occupantName, o.lotOccupantIndex`)
|
||||||
.all(lotOccupancyId);
|
.all(lotOccupancyId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancyOccupants;
|
return lotOccupancyOccupants;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export function getLotOccupancyOccupants(
|
||||||
)
|
)
|
||||||
.all(lotOccupancyId)
|
.all(lotOccupancyId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export function getLotOccupancyTransactions(lotOccupancyId, connectedDatabase) {
|
||||||
and lotOccupancyId = ?
|
and lotOccupancyId = ?
|
||||||
order by transactionDate, transactionTime, transactionIndex`)
|
order by transactionDate, transactionTime, transactionIndex`)
|
||||||
.all(lotOccupancyId);
|
.all(lotOccupancyId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotOccupancyTransactions;
|
return lotOccupancyTransactions;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function getLotOccupancyTransactions(
|
||||||
)
|
)
|
||||||
.all(lotOccupancyId)
|
.all(lotOccupancyId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export function getLotTypeFields(lotTypeId, connectedDatabase) {
|
||||||
}
|
}
|
||||||
expectedOrderNumber += 1;
|
expectedOrderNumber += 1;
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return lotTypeFields;
|
return lotTypeFields;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ export function getLotTypeFields(
|
||||||
expectedOrderNumber += 1
|
expectedOrderNumber += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ export function getLots(filters, options, connectedDatabase) {
|
||||||
count = lots.length;
|
count = lots.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ export function getLots(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export function getNextWorkOrderNumber(connectedDatabase) {
|
||||||
' where userFn_matchesWorkOrderNumberSyntax(workOrderNumber) = 1' +
|
' where userFn_matchesWorkOrderNumberSyntax(workOrderNumber) = 1' +
|
||||||
" order by cast(substr(workOrderNumber, instr(workOrderNumber, '-') + 1) as integer) desc")
|
" order by cast(substr(workOrderNumber, instr(workOrderNumber, '-') + 1) as integer) desc")
|
||||||
.get();
|
.get();
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
let workOrderNumberIndex = 0;
|
let workOrderNumberIndex = 0;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ export function getNextWorkOrderNumber(
|
||||||
)
|
)
|
||||||
.get()
|
.get()
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export function getOccupancyTypeFields(occupancyTypeId, connectedDatabase) {
|
||||||
}
|
}
|
||||||
expectedOrderNumber += 1;
|
expectedOrderNumber += 1;
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return occupancyTypeFields;
|
return occupancyTypeFields;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ export function getOccupancyTypeFields(
|
||||||
expectedOrderNumber += 1
|
expectedOrderNumber += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export function getOccupancyTypePrints(occupancyTypeId, connectedDatabase) {
|
||||||
}
|
}
|
||||||
prints.push(result.printEJS);
|
prints.push(result.printEJS);
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return prints;
|
return prints;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ export function getOccupancyTypePrints(
|
||||||
prints.push(result.printEJS)
|
prints.push(result.printEJS)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function _getWorkOrder(sql, workOrderIdOrWorkOrderNumber, options, connectedData
|
||||||
}, database);
|
}, database);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return workOrder;
|
return workOrder;
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ function _getWorkOrder(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function getWorkOrderComments(workOrderId, connectedDatabase) {
|
||||||
and workOrderId = ?
|
and workOrderId = ?
|
||||||
order by workOrderCommentDate desc, workOrderCommentTime desc, workOrderCommentId desc`)
|
order by workOrderCommentDate desc, workOrderCommentTime desc, workOrderCommentId desc`)
|
||||||
.all(workOrderId);
|
.all(workOrderId);
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return workOrderComments;
|
return workOrderComments;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function getWorkOrderComments(
|
||||||
)
|
)
|
||||||
.all(workOrderId)
|
.all(workOrderId)
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ export function getWorkOrderMilestones(filters, options, connectedDatabase) {
|
||||||
}, database).lotOccupancies;
|
}, database).lotOccupancies;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return workOrderMilestones;
|
return workOrderMilestones;
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ export function getWorkOrderMilestones(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ export function getWorkOrders(filters, options, connectedDatabase) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close();
|
database.close();
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ export function getWorkOrders(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectedDatabase) {
|
if (connectedDatabase === undefined) {
|
||||||
database.close()
|
database.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue