Commit 77f0db7a authored by Pavel Mashliakovskiy's avatar Pavel Mashliakovskiy 🤹🏻

cdn_orgaccount: set cache type to None; add unique index on...

cdn_orgaccount: set cache type to None; add unique index on code+currency+bank;fix error on updating while currency is not defined
parent d753d20f
Pipeline #21839 skipped with stage
......@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `cdn_orgaccount`: added complex unique index on `(code, currencyID, bankID)`
### Changed
......@@ -14,6 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### Fixed
- `cdn_orgaccount`: change cache type to "None" since row count can be huge
- `cdn_orgaccount`: fix error during updating of account with currencyID===null
## [5.4.26] - 2020-07-29
### Fixed
......
......@@ -29,9 +29,12 @@ function setDescriptionAttribute (ctx) {
.where('eGroup', '=', 'CDN_ACCOUNTTYPE')
.where('code', '=', execParams.acctype || oldData.acctype)
.selectScalar() || ''
const currencyCode3 = UB.Repository('cdn_currency').attrs('code3')
.where('ID', '=', execParams.currencyID || oldData.currencyID)
.selectScalar() || ''
let currencyCode3 = ''
if (execParams.currencyID || oldData.currencyID) { // multi-currency account - currency can be empty
currencyCode3 = UB.Repository('cdn_currency').attrs('code3')
.where('ID', '=', execParams.currencyID || oldData.currencyID)
.selectScalar() || ''
}
const bankID = execParams.bankID || oldData.bankID
let bankDescription
if (bankID) {
......
......@@ -3,7 +3,7 @@
"description": "Organization's current accounts dictionary",
"connectionName": "",
"sqlAlias": "orgacc",
"cacheType": "Entity",
"cacheType": "None",
"descriptionAttribute": "description",
"attributes": [
{
......@@ -62,5 +62,12 @@
"simpleAudit":true,
"safeDelete":true
}
},
"dbKeys": {
"UIDX_ORGACC_ACCCODE": {
"code": {},
"currencyID": {},
"bankID": {}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment