yeawood_consts 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +29 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -144,6 +144,35 @@ exports.TENDER_CEE_PROJECT_STATE_CALCULATOR = (
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
exports.TENDER_CEE_PACKAGE_LEADER_PRICE_CALCULATOR = (
|
|
148
|
+
price,
|
|
149
|
+
places,
|
|
150
|
+
delayCount,
|
|
151
|
+
decreaseType,
|
|
152
|
+
decreaseDelay,
|
|
153
|
+
decreaseBasic
|
|
154
|
+
) => {
|
|
155
|
+
let step = new big(0)
|
|
156
|
+
|
|
157
|
+
const delayDecreases = new big(decreaseDelay).times(delayCount).times(0.01)
|
|
158
|
+
const totalDecreases = new big(decreaseBasic).times(0.01).add(delayDecreases)
|
|
159
|
+
|
|
160
|
+
switch (decreaseType) {
|
|
161
|
+
case 'fixed':
|
|
162
|
+
step = new big(price).times(delayDecreases).add(decreaseBasic)
|
|
163
|
+
break
|
|
164
|
+
case 'ratio':
|
|
165
|
+
step = new big(price).times(totalDecreases)
|
|
166
|
+
break
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
step: step.toFixed(places, 3),
|
|
171
|
+
ratio: step.div(price).times(100).toFixed(places),
|
|
172
|
+
price: price.minus(step.toFixed(places, 3)).toFixed(places, 0)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
147
176
|
exports.TENDER_COMPANY_FILTER = (company, company_curr) => {
|
|
148
177
|
switch (company) {
|
|
149
178
|
case company_curr:
|