@widergy/utilitygo-smart-bill-mobile 3.2.0 → 3.4.0
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/CHANGELOG.md +19 -0
- package/README.md +0 -1
- package/package.json +1 -1
- package/src/lib/components/BillCalculation/index.js +8 -3
- package/src/lib/components/BillSummary/components/Header/index.js +5 -2
- package/src/lib/components/BillSummary/index.js +6 -5
- package/src/lib/components/ConsumptionComparison/components/ComparisonTable/utils.js +7 -3
- package/src/lib/components/ConsumptionComparison/index.js +1 -1
- package/src/lib/components/MainBillData/components/ConsumptionData/index.js +7 -4
- package/src/lib/components/MainBillData/components/InitialData/index.js +5 -2
- package/src/lib/components/MainBillData/components/ParticularConditions/index.js +1 -1
- package/src/lib/components/MainBillData/index.js +1 -1
- package/src/lib/components/PeriodCard/index.js +20 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [3.4.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.3.0...v3.4.0) (2025-11-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* changes ([2669d6f](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/2669d6f84abba0ccbf5aadc27114f8847ed44a7a))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* [EVEP-229] last prod changes ([#53](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/53)) ([6327d47](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/6327d4720afaade013546cde458f4094fec2d9b6))
|
|
12
|
+
|
|
13
|
+
# [3.3.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.2.0...v3.3.0) (2025-11-05)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* new temporally changes ([#52](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/52)) ([46618ec](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/46618ecee2a5e10e104a235bcca91eed5a8b0c35))
|
|
19
|
+
|
|
1
20
|
# [3.2.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.1.4...v3.2.0) (2025-10-28)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, FlatList } from 'react-native';
|
|
3
3
|
import { Modal, SeparatorBar } from '@widergy/mobile-ui';
|
|
4
|
+
import { bool } from 'prop-types';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
4
6
|
|
|
5
7
|
import { billDataTypes } from '../../types/billDataTypes';
|
|
6
8
|
import { titleMapper } from '../../utils/billCalculation';
|
|
@@ -13,7 +15,7 @@ import ConceptCard from './components/ConceptCard';
|
|
|
13
15
|
import getStyles from './styles';
|
|
14
16
|
import DetailModalContent from './components/DetailModalContent';
|
|
15
17
|
|
|
16
|
-
const BillCalculation = ({ bill, context }) => {
|
|
18
|
+
const BillCalculation = ({ bill, context, temporalyDisabled }) => {
|
|
17
19
|
const [detailModalMopen, setDetailModalOpen] = useState(false);
|
|
18
20
|
const { config } = useSmartBill();
|
|
19
21
|
const {
|
|
@@ -63,7 +65,9 @@ const BillCalculation = ({ bill, context }) => {
|
|
|
63
65
|
</View>
|
|
64
66
|
) : (
|
|
65
67
|
<Label semibold h4 primary style={styles.headerTitle}>
|
|
66
|
-
{
|
|
68
|
+
{temporalyDisabled
|
|
69
|
+
? `${periodicity} ${dayjs(currentPeriod.settlements?.end_date).tz().format('MM/YYYY')}`
|
|
70
|
+
: `${texts.mainBillData.settlement} ${currentSettlement} ${texts.mainBillData.ofPreposition} ${totalSettlements} - ${periodicity} ${periodNumber} `}
|
|
67
71
|
</Label>
|
|
68
72
|
)}
|
|
69
73
|
</View>
|
|
@@ -108,6 +112,7 @@ const BillCalculation = ({ bill, context }) => {
|
|
|
108
112
|
);
|
|
109
113
|
};
|
|
110
114
|
BillCalculation.propTypes = {
|
|
111
|
-
bill: billDataTypes
|
|
115
|
+
bill: billDataTypes,
|
|
116
|
+
temporalyDisabled: bool
|
|
112
117
|
};
|
|
113
118
|
export default withContext()(BillCalculation);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
+
import { bool } from 'prop-types';
|
|
4
5
|
|
|
5
6
|
import { contextApiInfoTypes } from '../../../../types/smartBillTypes';
|
|
6
7
|
import { billDataTypes } from '../../../../types/billDataTypes';
|
|
@@ -10,7 +11,7 @@ import DebtStatusBadge from '../../../DebtStatusBadge';
|
|
|
10
11
|
|
|
11
12
|
import styles from './styles';
|
|
12
13
|
|
|
13
|
-
const Header = ({ context, bill }) => {
|
|
14
|
+
const Header = ({ context, bill, temporalyDisabled }) => {
|
|
14
15
|
const {
|
|
15
16
|
config: {
|
|
16
17
|
texts: {
|
|
@@ -35,6 +36,7 @@ const Header = ({ context, bill }) => {
|
|
|
35
36
|
style={{ container: styles.periodCardContainer }}
|
|
36
37
|
bill={bill}
|
|
37
38
|
billSummaryStep
|
|
39
|
+
temporalyDisabled={temporalyDisabled}
|
|
38
40
|
/>
|
|
39
41
|
<View style={[statusLabel && styles.issuedOnDate]}>
|
|
40
42
|
<Label h6 midGray center={!showPeriodWithMonth(bill)}>
|
|
@@ -51,7 +53,8 @@ const Header = ({ context, bill }) => {
|
|
|
51
53
|
|
|
52
54
|
Header.propTypes = {
|
|
53
55
|
context: contextApiInfoTypes,
|
|
54
|
-
bill: billDataTypes
|
|
56
|
+
bill: billDataTypes,
|
|
57
|
+
temporalyDisabled: bool
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
export default withContext()(Header);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { bool } from 'prop-types';
|
|
3
4
|
|
|
4
5
|
import { billDataTypes } from '../../types/billDataTypes';
|
|
5
6
|
import AmountData from '../MainBillData/components/AmountData';
|
|
@@ -14,7 +15,7 @@ import styles from './styles';
|
|
|
14
15
|
import BillRate from './components/BillRate';
|
|
15
16
|
import PercentageComparison from './components/PercentageComparison';
|
|
16
17
|
|
|
17
|
-
const BillSummary = ({ bill }) => {
|
|
18
|
+
const BillSummary = ({ bill, temporalyDisabled }) => {
|
|
18
19
|
const {
|
|
19
20
|
config,
|
|
20
21
|
assets: { ConsumptionDetailBanner }
|
|
@@ -24,20 +25,20 @@ const BillSummary = ({ bill }) => {
|
|
|
24
25
|
const billToUse = { ...(bill || {}) };
|
|
25
26
|
return (
|
|
26
27
|
<View style={styles.container}>
|
|
27
|
-
<Header bill={billToUse} />
|
|
28
|
+
<Header bill={billToUse} temporalyDisabled={temporalyDisabled} />
|
|
28
29
|
<AmountData bill={billToUse} />
|
|
29
30
|
<ConceptSummary bill={billToUse} />
|
|
30
31
|
<ConsumptionCard bill={billToUse} />
|
|
31
|
-
<PercentageComparison bill={billToUse} />
|
|
32
|
+
{!temporalyDisabled && <PercentageComparison bill={billToUse} />}
|
|
32
33
|
{showPowerConsumptionGraphic(billToUse) && <PowerConsumptionGraphic bill={billToUse} />}
|
|
33
34
|
<BillRate bill={billToUse} />
|
|
34
|
-
{showBillSummaryBanner(billToUse) && (
|
|
35
|
+
{showBillSummaryBanner(billToUse) && !temporalyDisabled && (
|
|
35
36
|
<Banner image={ConsumptionDetailBanner} url={consumptionDetailLink} style={styles.banner} />
|
|
36
37
|
)}
|
|
37
38
|
</View>
|
|
38
39
|
);
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
BillSummary.propTypes = { bill: billDataTypes };
|
|
42
|
+
BillSummary.propTypes = { bill: billDataTypes, temporalyDisabled: bool };
|
|
42
43
|
|
|
43
44
|
export default BillSummary;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getIn } from 'seamless-immutable';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
4
5
|
|
|
5
6
|
import Magnitude from '../../../Magnitude';
|
|
6
7
|
import { ENERGY_TYPES, POWER_TYPES } from '../../../../constants/consumptions';
|
|
@@ -77,12 +78,15 @@ export const getHeaderField = (context, id, totalSettlementsIsOne) => {
|
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
export const getPeriodField = (context, period, averageTemperature, options = {}, id) => {
|
|
81
|
+
export const getPeriodField = (context, period, averageTemperature, options = {}, id, temporalyDisabled) => {
|
|
81
82
|
const { config, Label } = context;
|
|
82
83
|
const { daysUnity, temperatureUnity } = config.texts.consumptionComparison;
|
|
83
84
|
const { primary, semibold, current } = options;
|
|
84
85
|
const { noData } = config.texts.commons;
|
|
85
|
-
const formattedPeriod =
|
|
86
|
+
const formattedPeriod =
|
|
87
|
+
period?.number && period.year && temporalyDisabled
|
|
88
|
+
? dayjs(period.settlements?.end_date).tz().format('MM/YYYY')
|
|
89
|
+
: `${period.number}/${period.year}`;
|
|
86
90
|
|
|
87
91
|
switch (id) {
|
|
88
92
|
case COMPARISON_ROWS_IDS.period:
|
|
@@ -251,7 +255,7 @@ export const getComparisonRow = (
|
|
|
251
255
|
semibold: true
|
|
252
256
|
},
|
|
253
257
|
periodId,
|
|
254
|
-
|
|
258
|
+
temporalyDisabled
|
|
255
259
|
),
|
|
256
260
|
show: true
|
|
257
261
|
}
|
|
@@ -50,7 +50,7 @@ const ConsumptionComparison = ({ bill, context, temporalyDisabled }) => {
|
|
|
50
50
|
</ExternalLink>
|
|
51
51
|
</View>
|
|
52
52
|
)}
|
|
53
|
-
{!!(savingsPercentage === 0 || savingsPercentage) && (
|
|
53
|
+
{!!(savingsPercentage === 0 || savingsPercentage) && !temporalyDisabled && (
|
|
54
54
|
<PercentageComparison
|
|
55
55
|
savingsPercentage={savingsPercentage}
|
|
56
56
|
totalSettlementsIsOne={totalSettlementsIsOne}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import { bool } from 'prop-types';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
5
6
|
|
|
6
7
|
import { billDataTypes } from '../../../../types/billDataTypes';
|
|
7
8
|
import { ENERGY_TYPES } from '../../../../constants/consumptions';
|
|
@@ -46,10 +47,12 @@ const ConsumptionData = ({ bill, temporalyDisabled }) => {
|
|
|
46
47
|
{!powerConsumptionData && (
|
|
47
48
|
<View style={styles.detailsContainer}>
|
|
48
49
|
<Label small semibold style={styles.totalConsumptionAndDays} useMarkdown={false}>
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
'
|
|
52
|
-
|
|
50
|
+
{temporalyDisabled
|
|
51
|
+
? `${periodicity === PERIODICITY.BIMONTHLY ? bimester : '-'} ${dayjs(currentPeriod.settlements?.end_date).tz().format('MM/YY')}:`
|
|
52
|
+
: `${periodicity === PERIODICITY.BIMONTHLY ? bimester : '-'} ${number}/${moment(
|
|
53
|
+
year,
|
|
54
|
+
'YYYY'
|
|
55
|
+
).format('YY')}:`}
|
|
53
56
|
</Label>
|
|
54
57
|
|
|
55
58
|
<Label h4 semibold useMarkdown={false}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
+
import { bool } from 'prop-types';
|
|
4
5
|
|
|
5
6
|
import { billDataTypes } from '../../../../types/billDataTypes';
|
|
6
7
|
import PeriodCard from '../../../PeriodCard';
|
|
@@ -10,7 +11,7 @@ import { Label } from '../../../Base';
|
|
|
10
11
|
|
|
11
12
|
import styles from './styles';
|
|
12
13
|
|
|
13
|
-
const InitialData = ({ bill }) => {
|
|
14
|
+
const InitialData = ({ bill, temporalyDisabled }) => {
|
|
14
15
|
const {
|
|
15
16
|
assets: { UtilityLogo },
|
|
16
17
|
config: {
|
|
@@ -62,13 +63,15 @@ const InitialData = ({ bill }) => {
|
|
|
62
63
|
includeQuestionIcon
|
|
63
64
|
style={{ container: [styles.periodCard, showPeriodWithMonth(bill) && styles.periodWithMonth] }}
|
|
64
65
|
bill={bill}
|
|
66
|
+
temporalyDisabled={temporalyDisabled}
|
|
65
67
|
/>
|
|
66
68
|
</View>
|
|
67
69
|
);
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
InitialData.propTypes = {
|
|
71
|
-
bill: billDataTypes
|
|
73
|
+
bill: billDataTypes,
|
|
74
|
+
temporalyDisabled: bool
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
export default InitialData;
|
|
@@ -42,7 +42,7 @@ const ParticularConditions = ({ bill, context }) => {
|
|
|
42
42
|
<Label primary style={styles.listTitle}>
|
|
43
43
|
{particularConditionsListTitle}
|
|
44
44
|
</Label>
|
|
45
|
-
{particularConditions.map(condition => (
|
|
45
|
+
{[...(particularConditions || [])].map(condition => (
|
|
46
46
|
<View key={condition} style={styles.condition}>
|
|
47
47
|
<View style={styles.dot} />
|
|
48
48
|
<Label gray small>
|
|
@@ -24,7 +24,7 @@ const MainBillData = ({ bill, temporalyDisabled }) => {
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<View style={styles.root}>
|
|
27
|
-
<InitialData bill={bill} />
|
|
27
|
+
<InitialData bill={bill} temporalyDisabled={temporalyDisabled} />
|
|
28
28
|
<AmountData bill={bill} />
|
|
29
29
|
{!isEmpty(bill.particular_conditions) && <ParticularConditions bill={bill} />}
|
|
30
30
|
<ConsumptionData bill={bill} temporalyDisabled={temporalyDisabled} />
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { any, bool } from 'prop-types';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { UTTooltip } from '@widergy/mobile-ui';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
5
6
|
|
|
6
7
|
import { PERIODICITY } from '../../constants/periodicities';
|
|
7
8
|
import { Label } from '../Base';
|
|
@@ -10,7 +11,15 @@ import { useSmartBill, useThemedStyle } from '../../Context';
|
|
|
10
11
|
|
|
11
12
|
import ownStyles, { retrieveStyles, ICON_SIZE } from './styles';
|
|
12
13
|
|
|
13
|
-
const Period = ({
|
|
14
|
+
const Period = ({
|
|
15
|
+
period,
|
|
16
|
+
includeQuestionIcon,
|
|
17
|
+
style,
|
|
18
|
+
bill,
|
|
19
|
+
showPeriod,
|
|
20
|
+
billSummaryStep,
|
|
21
|
+
temporalyDisabled
|
|
22
|
+
}) => {
|
|
14
23
|
const {
|
|
15
24
|
config,
|
|
16
25
|
assets: { QuestionsIcon }
|
|
@@ -54,11 +63,15 @@ const Period = ({ period, includeQuestionIcon, style, bill, showPeriod, billSumm
|
|
|
54
63
|
<View style={includeQuestionIcon && ownStyles.textWithIcon}>
|
|
55
64
|
<View>
|
|
56
65
|
<Label h4 primary bold={!billSummaryStep} semibold={billSummaryStep} center>
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{`${settlement} ${currentSettlement} ${ofPreposition} ${totalSettlements}`}
|
|
66
|
+
{temporalyDisabled
|
|
67
|
+
? dayjs(period.settlements?.end_date).tz().format('MM/YYYY')
|
|
68
|
+
: `${year} - ${periodicity === PERIODICITY.BIMONTHLY ? bimester : '-'} ${number}`}
|
|
61
69
|
</Label>
|
|
70
|
+
{!temporalyDisabled && (
|
|
71
|
+
<Label h4 primary bold={!billSummaryStep} semibold={billSummaryStep} center>
|
|
72
|
+
{`${settlement} ${currentSettlement} ${ofPreposition} ${totalSettlements}`}
|
|
73
|
+
</Label>
|
|
74
|
+
)}
|
|
62
75
|
</View>
|
|
63
76
|
{includeQuestionIcon && (
|
|
64
77
|
<View style={ownStyles.icon}>
|
|
@@ -87,7 +100,8 @@ Period.propTypes = {
|
|
|
87
100
|
period: any,
|
|
88
101
|
includeQuestionIcon: bool,
|
|
89
102
|
showPeriod: bool,
|
|
90
|
-
billSummaryStep: bool
|
|
103
|
+
billSummaryStep: bool,
|
|
104
|
+
temporalyDisabled: bool
|
|
91
105
|
};
|
|
92
106
|
|
|
93
107
|
export default Period;
|