|
@@ -103,7 +103,7 @@ module.exports = app => {
|
|
|
async _getBookUpdateData(data, ledger_id, details) {
|
|
async _getBookUpdateData(data, ledger_id, details) {
|
|
|
const detailDatas = details || await this.getAllDataByCondition({ columns: ['id', 'ledger_id', ...costFields.curFields], where: { ledger_id, stage_id: this.ctx.costStage.id } });
|
|
const detailDatas = details || await this.getAllDataByCondition({ columns: ['id', 'ledger_id', ...costFields.curFields], where: { ledger_id, stage_id: this.ctx.costStage.id } });
|
|
|
|
|
|
|
|
- const updateData = { id: ledger_id, update_user_id: this.ctx.session.sessionUser.accountId };
|
|
|
|
|
|
|
+ const updateData = { update_user_id: this.ctx.session.sessionUser.accountId };
|
|
|
for (const prop of costFields.curFields) {
|
|
for (const prop of costFields.curFields) {
|
|
|
updateData[prop] = 0;
|
|
updateData[prop] = 0;
|
|
|
}
|
|
}
|
|
@@ -169,6 +169,8 @@ module.exports = app => {
|
|
|
bookUpdate.ledger_id = orgLedger.id;
|
|
bookUpdate.ledger_id = orgLedger.id;
|
|
|
bookUpdate.cost_id = orgLedger.cost_id;
|
|
bookUpdate.cost_id = orgLedger.cost_id;
|
|
|
bookUpdate.add_user_id = user_id;
|
|
bookUpdate.add_user_id = user_id;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ bookUpdate.id = orgBook.id;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|