|
@@ -8,6 +8,7 @@
|
|
|
* @version
|
|
|
*/
|
|
|
const Ledger = require('../lib/ledger');
|
|
|
+const tenderConst = require('../const/tender');
|
|
|
|
|
|
module.exports = app => {
|
|
|
|
|
@@ -72,10 +73,12 @@ module.exports = app => {
|
|
|
* @private
|
|
|
*/
|
|
|
async checkBackupLedgerHistory(tid, sid = 0, rid = '') {
|
|
|
- const sbCount = await this.ctx.service.ledger.count({ tender_id: tid });
|
|
|
- const spCount = await this.ctx.service.pos.count({ tid: tid });
|
|
|
- const ledgerHis = await this.ctx.service.ledgerHistory.getLatestHistory(tid);
|
|
|
- if (sbCount === ledgerHis.bills_count && spCount === ledgerHis.pos_count) return ledgerHis.id;
|
|
|
+ if (this.ctx.tender.data.measure_type === tenderConst.measureType.tz.value) {
|
|
|
+ const sbCount = await this.ctx.service.ledger.count({ tender_id: tid });
|
|
|
+ const spCount = await this.ctx.service.pos.count({ tid: tid });
|
|
|
+ const ledgerHis = await this.ctx.service.ledgerHistory.getLatestHistory(tid);
|
|
|
+ if (sbCount === ledgerHis.bills_count && spCount === ledgerHis.pos_count) return ledgerHis.id;
|
|
|
+ }
|
|
|
|
|
|
const now = new Date();
|
|
|
const timestamp = (now).getTime();
|