@widergy/utilitygo-smart-bill-mobile 3.1.4 → 3.3.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 +14 -0
- package/package.json +1 -1
- package/src/lib/components/BillCalculation/components/ConceptCard/index.js +2 -1
- package/src/lib/components/BillCalculation/index.js +7 -3
- package/src/lib/components/BillSummary/components/ConceptSummary/index.js +3 -2
- package/src/lib/components/BillSummary/components/Header/index.js +5 -2
- package/src/lib/components/BillSummary/index.js +5 -4
- package/src/lib/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +16 -10
- package/src/lib/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/styles.js +17 -16
- package/src/lib/components/ConsumptionComparison/components/ComparisonTable/index.js +6 -4
- package/src/lib/components/ConsumptionComparison/components/ComparisonTable/utils.js +9 -7
- package/src/lib/components/ConsumptionComparison/index.js +6 -4
- package/src/lib/components/ConsumptionPeriod/components/LectureDetail/index.js +2 -1
- package/src/lib/components/ConsumptionPeriod/index.js +2 -1
- package/src/lib/components/MainBillData/components/ConsumptionData/components/DataBySettlement/index.js +32 -30
- package/src/lib/components/MainBillData/components/ConsumptionData/index.js +5 -3
- 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 +6 -4
- package/src/lib/components/PeriodCard/index.js +16 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.3.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.2.0...v3.3.0) (2025-11-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* 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))
|
|
7
|
+
|
|
8
|
+
# [3.2.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.1.4...v3.2.0) (2025-10-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [EVEP-193] prod settings ([#51](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/51)) ([2a8c116](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/2a8c11605acbc9af5649254016543310447dd4dc))
|
|
14
|
+
|
|
1
15
|
## [3.1.4](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.1.3...v3.1.4) (2025-10-28)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import Collapsible from 'react-native-collapsible';
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { shape, number, string, arrayOf } from 'prop-types';
|
|
5
5
|
import { useTogglableState } from '@widergy/mobile-ui';
|
|
6
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
6
7
|
|
|
7
8
|
import withContext from '../../../../hocs/withContext';
|
|
8
9
|
import NumberWithSuperIndex from '../../../NumberWithSuperIndex';
|
|
@@ -22,7 +23,7 @@ const ConceptCard = ({ context, concept }) => {
|
|
|
22
23
|
const isCollapsable = linesToRender?.length > 0;
|
|
23
24
|
|
|
24
25
|
const renderConcepts = lines =>
|
|
25
|
-
lines
|
|
26
|
+
cloneDeep(lines).map(line => (
|
|
26
27
|
<View style={styles.linesContainer}>
|
|
27
28
|
<View style={styles.linesConcept}>
|
|
28
29
|
<Label small style={styles.lineTitle} useMarkdown={false}>
|
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
|
|
5
6
|
import { billDataTypes } from '../../types/billDataTypes';
|
|
6
7
|
import { titleMapper } from '../../utils/billCalculation';
|
|
@@ -13,7 +14,7 @@ import ConceptCard from './components/ConceptCard';
|
|
|
13
14
|
import getStyles from './styles';
|
|
14
15
|
import DetailModalContent from './components/DetailModalContent';
|
|
15
16
|
|
|
16
|
-
const BillCalculation = ({ bill, context }) => {
|
|
17
|
+
const BillCalculation = ({ bill, context, temporalyDisabled }) => {
|
|
17
18
|
const [detailModalMopen, setDetailModalOpen] = useState(false);
|
|
18
19
|
const { config } = useSmartBill();
|
|
19
20
|
const {
|
|
@@ -63,7 +64,9 @@ const BillCalculation = ({ bill, context }) => {
|
|
|
63
64
|
</View>
|
|
64
65
|
) : (
|
|
65
66
|
<Label semibold h4 primary style={styles.headerTitle}>
|
|
66
|
-
{
|
|
67
|
+
{temporalyDisabled
|
|
68
|
+
? `${periodicity} ${periodNumber} `
|
|
69
|
+
: `${texts.mainBillData.settlement} ${currentSettlement} ${texts.mainBillData.ofPreposition} ${totalSettlements} - ${periodicity} ${periodNumber} `}
|
|
67
70
|
</Label>
|
|
68
71
|
)}
|
|
69
72
|
</View>
|
|
@@ -108,6 +111,7 @@ const BillCalculation = ({ bill, context }) => {
|
|
|
108
111
|
);
|
|
109
112
|
};
|
|
110
113
|
BillCalculation.propTypes = {
|
|
111
|
-
bill: billDataTypes
|
|
114
|
+
bill: billDataTypes,
|
|
115
|
+
temporalyDisabled: bool
|
|
112
116
|
};
|
|
113
117
|
export default withContext()(BillCalculation);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTogglableState, Touchable } from '@widergy/mobile-ui';
|
|
4
4
|
import { shape, string } from 'prop-types';
|
|
5
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
5
6
|
|
|
6
7
|
import { contextApiInfoTypes } from '../../../../types/smartBillTypes';
|
|
7
8
|
import { billDataTypes } from '../../../../types/billDataTypes';
|
|
@@ -70,7 +71,7 @@ const ConceptSummary = ({ bill }) => {
|
|
|
70
71
|
<View style={styles.detailsContainer}>
|
|
71
72
|
{isListView ? (
|
|
72
73
|
<View style={styles.conceptBar}>
|
|
73
|
-
{billDetailsData.map(
|
|
74
|
+
{cloneDeep(billDetailsData).map(
|
|
74
75
|
(concept, index) =>
|
|
75
76
|
(concept.total !== 0 || showZeroConcepts) && (
|
|
76
77
|
<ConceptBar
|
|
@@ -87,7 +88,7 @@ const ConceptSummary = ({ bill }) => {
|
|
|
87
88
|
<View style={styles.pieChartContainer}>
|
|
88
89
|
<PieChart data={billDetailsData} />
|
|
89
90
|
</View>
|
|
90
|
-
{billDetailsData.map(
|
|
91
|
+
{cloneDeep(billDetailsData).map(
|
|
91
92
|
(item, index) =>
|
|
92
93
|
item.total !== 0 && (
|
|
93
94
|
<ConceptLine
|
|
@@ -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,11 +25,11 @@ 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
35
|
{showBillSummaryBanner(billToUse) && (
|
|
@@ -38,6 +39,6 @@ const BillSummary = ({ bill }) => {
|
|
|
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;
|
|
@@ -4,17 +4,23 @@ import { View } from 'react-native';
|
|
|
4
4
|
|
|
5
5
|
import { componentTypes } from '../../../../../../types/componentsTypes';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import getStyles from './styles';
|
|
8
8
|
|
|
9
|
-
const DataLine = ({ fields }) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const DataLine = ({ fields }) => {
|
|
10
|
+
const styles = getStyles(fields.filter(field => field.show).length);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View style={styles.container}>
|
|
14
|
+
{fields
|
|
15
|
+
.filter(field => field.show)
|
|
16
|
+
.map(field => (
|
|
17
|
+
<View key={field.id} style={styles.cell}>
|
|
18
|
+
{field.Component}
|
|
19
|
+
</View>
|
|
20
|
+
))}
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
18
24
|
|
|
19
25
|
DataLine.propTypes = {
|
|
20
26
|
fields: arrayOf(shape({ id: string, Component: componentTypes }))
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
3
|
+
export default fields =>
|
|
4
|
+
StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
flexDirection: 'row',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
flex: 1,
|
|
10
|
+
paddingHorizontal: 5
|
|
11
|
+
},
|
|
12
|
+
cell: {
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
textAlign: 'center',
|
|
15
|
+
marginVertical: 13,
|
|
16
|
+
width: ` ${100 / fields}%`,
|
|
17
|
+
height: '100%'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, FlatList } from 'react-native';
|
|
3
|
-
import { number } from 'prop-types';
|
|
3
|
+
import { number, bool } from 'prop-types';
|
|
4
4
|
import { getIn } from 'seamless-immutable';
|
|
5
5
|
|
|
6
6
|
import withContext from '../../../../hocs/withContext';
|
|
@@ -12,7 +12,7 @@ import styles from './styles';
|
|
|
12
12
|
import { getComparisonRow } from './utils';
|
|
13
13
|
import DataLine from './components/DataLine';
|
|
14
14
|
|
|
15
|
-
const ComparisonTable = ({ context, billData, monthNumber }) => {
|
|
15
|
+
const ComparisonTable = ({ context, billData, monthNumber, temporalyDisabled }) => {
|
|
16
16
|
const currentPeriod = getCurrentPeriod(billData);
|
|
17
17
|
const lastYearPeriod = getLastYearPeriod(billData);
|
|
18
18
|
const { settlements } = currentPeriod;
|
|
@@ -33,7 +33,8 @@ const ComparisonTable = ({ context, billData, monthNumber }) => {
|
|
|
33
33
|
lastYearPeriodAverageTemperature,
|
|
34
34
|
monthNumber,
|
|
35
35
|
COMPARISON_ROWS_IDS[rowId],
|
|
36
|
-
totalSettlementsIsOne
|
|
36
|
+
totalSettlementsIsOne,
|
|
37
|
+
temporalyDisabled
|
|
37
38
|
)
|
|
38
39
|
)
|
|
39
40
|
.filter(row => row.show);
|
|
@@ -50,7 +51,8 @@ const ComparisonTable = ({ context, billData, monthNumber }) => {
|
|
|
50
51
|
};
|
|
51
52
|
ComparisonTable.propTypes = {
|
|
52
53
|
billData: billDataTypes,
|
|
53
|
-
monthNumber: number
|
|
54
|
+
monthNumber: number,
|
|
55
|
+
temporalyDisabled: bool
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
export default withContext()(ComparisonTable);
|
|
@@ -217,7 +217,8 @@ export const getComparisonRow = (
|
|
|
217
217
|
lastYearPeriodAverageTemperature,
|
|
218
218
|
monthNumber,
|
|
219
219
|
periodId,
|
|
220
|
-
totalSettlementsIsOne
|
|
220
|
+
totalSettlementsIsOne,
|
|
221
|
+
temporalyDisabled
|
|
221
222
|
) => ({
|
|
222
223
|
rowID: periodId,
|
|
223
224
|
row: [
|
|
@@ -227,16 +228,16 @@ export const getComparisonRow = (
|
|
|
227
228
|
context,
|
|
228
229
|
lastYearPeriod,
|
|
229
230
|
lastYearPeriodAverageTemperature,
|
|
230
|
-
{
|
|
231
|
-
gray: true
|
|
232
|
-
},
|
|
231
|
+
{ gray: true },
|
|
233
232
|
periodId,
|
|
234
233
|
totalSettlementsIsOne
|
|
235
|
-
)
|
|
234
|
+
),
|
|
235
|
+
show: !temporalyDisabled
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
key: `header_${periodId}`,
|
|
239
|
-
Component: getHeaderField(context, periodId, totalSettlementsIsOne)
|
|
239
|
+
Component: getHeaderField(context, periodId, totalSettlementsIsOne),
|
|
240
|
+
show: true
|
|
240
241
|
},
|
|
241
242
|
{
|
|
242
243
|
key: `current_period_${periodId}`,
|
|
@@ -251,7 +252,8 @@ export const getComparisonRow = (
|
|
|
251
252
|
},
|
|
252
253
|
periodId,
|
|
253
254
|
totalSettlementsIsOne
|
|
254
|
-
)
|
|
255
|
+
),
|
|
256
|
+
show: true
|
|
255
257
|
}
|
|
256
258
|
],
|
|
257
259
|
show: defineRowVisibility(
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { getIn } from 'seamless-immutable';
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
+
import { bool } from 'prop-types';
|
|
5
6
|
|
|
6
7
|
import { billDataTypes } from '../../types/billDataTypes';
|
|
7
8
|
import { getCurrentPeriod } from '../../utils/periods';
|
|
@@ -14,7 +15,7 @@ import PercentageComparison from './components/PercentageComparison';
|
|
|
14
15
|
import styles from './styles';
|
|
15
16
|
import ConsumptionAdvice from './components/ConsumptionAdvice';
|
|
16
17
|
|
|
17
|
-
const ConsumptionComparison = ({ bill, context }) => {
|
|
18
|
+
const ConsumptionComparison = ({ bill, context, temporalyDisabled }) => {
|
|
18
19
|
const {
|
|
19
20
|
config,
|
|
20
21
|
Label,
|
|
@@ -38,7 +39,7 @@ const ConsumptionComparison = ({ bill, context }) => {
|
|
|
38
39
|
|
|
39
40
|
return (
|
|
40
41
|
<View style={styles.container}>
|
|
41
|
-
<ComparisonTable billData={bill} monthNumber={monthNumber} />
|
|
42
|
+
<ComparisonTable billData={bill} monthNumber={monthNumber} temporalyDisabled={temporalyDisabled} />
|
|
42
43
|
{showWeatherInfo && (
|
|
43
44
|
<View style={styles.weatherInfo}>
|
|
44
45
|
<Label small midGray>
|
|
@@ -49,7 +50,7 @@ const ConsumptionComparison = ({ bill, context }) => {
|
|
|
49
50
|
</ExternalLink>
|
|
50
51
|
</View>
|
|
51
52
|
)}
|
|
52
|
-
{!!(savingsPercentage === 0 || savingsPercentage) && (
|
|
53
|
+
{!!(savingsPercentage === 0 || savingsPercentage) && !temporalyDisabled && (
|
|
53
54
|
<PercentageComparison
|
|
54
55
|
savingsPercentage={savingsPercentage}
|
|
55
56
|
totalSettlementsIsOne={totalSettlementsIsOne}
|
|
@@ -69,7 +70,8 @@ const ConsumptionComparison = ({ bill, context }) => {
|
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
ConsumptionComparison.propTypes = {
|
|
72
|
-
bill: billDataTypes
|
|
73
|
+
bill: billDataTypes,
|
|
74
|
+
temporalyDisabled: bool
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
export default withContext()(ConsumptionComparison);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { string, func, arrayOf, shape } from 'prop-types';
|
|
4
4
|
import { UTTooltip } from '@widergy/mobile-ui';
|
|
5
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
5
6
|
|
|
6
7
|
import { Label } from '../../../Base';
|
|
7
8
|
import IconAndDetails from '../../../IconAndDetails';
|
|
@@ -45,7 +46,7 @@ const LectureDetail = ({ title, details, context, theme }) => {
|
|
|
45
46
|
)}
|
|
46
47
|
</View>
|
|
47
48
|
<View style={styles.detailsContainer}>
|
|
48
|
-
{details?.map(detail => (
|
|
49
|
+
{cloneDeep(details)?.map(detail => (
|
|
49
50
|
<IconAndDetails
|
|
50
51
|
key={detail.mainText}
|
|
51
52
|
{...detail}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
4
|
|
|
4
5
|
import withContext from '../../hocs/withContext';
|
|
5
6
|
|
|
@@ -22,7 +23,7 @@ const ConsumptionPeriod = ({ bill, context }) => {
|
|
|
22
23
|
return (
|
|
23
24
|
<View style={styles.container}>
|
|
24
25
|
<View style={styles.readingsDetailsContainer}>
|
|
25
|
-
{readingDetails.map(detail => (
|
|
26
|
+
{cloneDeep(readingDetails).map(detail => (
|
|
26
27
|
<LectureDetail key={detail.title} {...detail} />
|
|
27
28
|
))}
|
|
28
29
|
</View>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { string, shape } from 'prop-types';
|
|
3
|
+
import { string, shape, bool } from 'prop-types';
|
|
4
4
|
|
|
5
5
|
import { billDataTypes } from '../../../../../../types/billDataTypes';
|
|
6
6
|
import withContext from '../../../../../../hocs/withContext';
|
|
@@ -10,7 +10,7 @@ import { consumptionDataMapper } from '../../../../../../utils/consumptions';
|
|
|
10
10
|
|
|
11
11
|
import getStyles from './styles';
|
|
12
12
|
|
|
13
|
-
const DataBySettlement = ({ bill, context, colors }) => {
|
|
13
|
+
const DataBySettlement = ({ bill, context, colors, temporalyDisabled }) => {
|
|
14
14
|
const {
|
|
15
15
|
config: {
|
|
16
16
|
texts: {
|
|
@@ -31,43 +31,45 @@ const DataBySettlement = ({ bill, context, colors }) => {
|
|
|
31
31
|
<Label bold style={styles.title} useMarkdown={false}>
|
|
32
32
|
{consumptionTitle}
|
|
33
33
|
</Label>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
{!temporalyDisabled && (
|
|
35
|
+
<View style={styles.settlementsContainer}>
|
|
36
|
+
{settlementsConsumption.map(data => {
|
|
37
|
+
const isFirstCard = data.order === 1;
|
|
38
|
+
const { isCurrent } = data;
|
|
39
|
+
return (
|
|
40
|
+
<View style={styles.consumptionContainer}>
|
|
41
|
+
<View
|
|
42
|
+
style={[
|
|
43
|
+
isFirstCard ? styles.firstCardContainer : styles.secondCardContainer,
|
|
44
|
+
isCurrent &&
|
|
45
|
+
(isFirstCard ? styles.currentFirstCardContainer : styles.currentSecondCardContainer)
|
|
46
|
+
]}>
|
|
47
|
+
<Label big center primary={isCurrent}>
|
|
48
|
+
{numberFormatter(data.value)}{' '}
|
|
49
|
+
<Label center primary={isCurrent}>
|
|
50
|
+
{data.unit}
|
|
51
|
+
</Label>
|
|
51
52
|
</Label>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
<Label center medium primary={isCurrent}>
|
|
54
|
+
{data.settlementDuration}
|
|
55
|
+
</Label>
|
|
56
|
+
</View>
|
|
57
|
+
<Label small center semibold={isCurrent} primary={isCurrent} style={styles.descriptionText}>
|
|
58
|
+
{data.settlementDescription}
|
|
55
59
|
</Label>
|
|
56
60
|
</View>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
);
|
|
62
|
-
})}
|
|
63
|
-
</View>
|
|
61
|
+
);
|
|
62
|
+
})}
|
|
63
|
+
</View>
|
|
64
|
+
)}
|
|
64
65
|
</View>
|
|
65
66
|
);
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
DataBySettlement.propTypes = {
|
|
69
70
|
bill: billDataTypes,
|
|
70
|
-
colors: shape(string)
|
|
71
|
+
colors: shape(string),
|
|
72
|
+
temporalyDisabled: bool
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
export default withContext()(DataBySettlement);
|
|
@@ -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 { ENERGY_TYPES } from '../../../../constants/consumptions';
|
|
@@ -13,7 +14,7 @@ import ConsumptionCard from '../../../ConsumptionCard';
|
|
|
13
14
|
import DataBySettlement from './components/DataBySettlement';
|
|
14
15
|
import styles, { powerConsumptionStyles } from './styles';
|
|
15
16
|
|
|
16
|
-
const ConsumptionData = ({ bill }) => {
|
|
17
|
+
const ConsumptionData = ({ bill, temporalyDisabled }) => {
|
|
17
18
|
const currentPeriod = bill.periods.find(period => period.current);
|
|
18
19
|
const {
|
|
19
20
|
config: {
|
|
@@ -39,7 +40,7 @@ const ConsumptionData = ({ bill }) => {
|
|
|
39
40
|
{powerConsumptionData ? (
|
|
40
41
|
<ConsumptionCard bill={bill} style={powerConsumptionStyles} />
|
|
41
42
|
) : (
|
|
42
|
-
<DataBySettlement bill={bill} />
|
|
43
|
+
<DataBySettlement bill={bill} temporalyDisabled={temporalyDisabled} />
|
|
43
44
|
)}
|
|
44
45
|
|
|
45
46
|
{!powerConsumptionData && (
|
|
@@ -64,7 +65,8 @@ const ConsumptionData = ({ bill }) => {
|
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
ConsumptionData.propTypes = {
|
|
67
|
-
bill: billDataTypes
|
|
68
|
+
bill: billDataTypes,
|
|
69
|
+
temporalyDisabled: bool
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
export default ConsumptionData;
|
|
@@ -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>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { isEmpty } from '@widergy/web-utils/lib/array';
|
|
4
|
+
import { bool } from 'prop-types';
|
|
4
5
|
|
|
5
6
|
import { billDataTypes } from '../../types/billDataTypes';
|
|
6
7
|
import PowerConsumptionGraphic from '../PowerConsumptionGraphic';
|
|
@@ -14,7 +15,7 @@ import ParticularConditions from './components/ParticularConditions';
|
|
|
14
15
|
import styles from './styles';
|
|
15
16
|
import MeasurementInfo from './components/MeasurementInfo';
|
|
16
17
|
|
|
17
|
-
const MainBillData = ({ bill }) => {
|
|
18
|
+
const MainBillData = ({ bill, temporalyDisabled }) => {
|
|
18
19
|
const {
|
|
19
20
|
config: {
|
|
20
21
|
validators: { showPowerConsumptionGraphic }
|
|
@@ -23,10 +24,10 @@ const MainBillData = ({ bill }) => {
|
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
26
|
<View style={styles.root}>
|
|
26
|
-
<InitialData bill={bill} />
|
|
27
|
+
<InitialData bill={bill} temporalyDisabled={temporalyDisabled} />
|
|
27
28
|
<AmountData bill={bill} />
|
|
28
29
|
{!isEmpty(bill.particular_conditions) && <ParticularConditions bill={bill} />}
|
|
29
|
-
<ConsumptionData bill={bill} />
|
|
30
|
+
<ConsumptionData bill={bill} temporalyDisabled={temporalyDisabled} />
|
|
30
31
|
{showPowerConsumptionGraphic(bill) && <PowerConsumptionGraphic bill={bill} />}
|
|
31
32
|
<MeasurementInfo bill={bill} />
|
|
32
33
|
<OwnerData bill={bill} />
|
|
@@ -35,7 +36,8 @@ const MainBillData = ({ bill }) => {
|
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
MainBillData.propTypes = {
|
|
38
|
-
bill: billDataTypes
|
|
39
|
+
bill: billDataTypes,
|
|
40
|
+
temporalyDisabled: bool
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
export default MainBillData;
|
|
@@ -10,7 +10,15 @@ import { useSmartBill, useThemedStyle } from '../../Context';
|
|
|
10
10
|
|
|
11
11
|
import ownStyles, { retrieveStyles, ICON_SIZE } from './styles';
|
|
12
12
|
|
|
13
|
-
const Period = ({
|
|
13
|
+
const Period = ({
|
|
14
|
+
period,
|
|
15
|
+
includeQuestionIcon,
|
|
16
|
+
style,
|
|
17
|
+
bill,
|
|
18
|
+
showPeriod,
|
|
19
|
+
billSummaryStep,
|
|
20
|
+
temporalyDisabled
|
|
21
|
+
}) => {
|
|
14
22
|
const {
|
|
15
23
|
config,
|
|
16
24
|
assets: { QuestionsIcon }
|
|
@@ -56,9 +64,11 @@ const Period = ({ period, includeQuestionIcon, style, bill, showPeriod, billSumm
|
|
|
56
64
|
<Label h4 primary bold={!billSummaryStep} semibold={billSummaryStep} center>
|
|
57
65
|
{`${year} - ${periodicity === PERIODICITY.BIMONTHLY ? bimester : '-'} ${number}`}
|
|
58
66
|
</Label>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
{!temporalyDisabled && (
|
|
68
|
+
<Label h4 primary bold={!billSummaryStep} semibold={billSummaryStep} center>
|
|
69
|
+
{`${settlement} ${currentSettlement} ${ofPreposition} ${totalSettlements}`}
|
|
70
|
+
</Label>
|
|
71
|
+
)}
|
|
62
72
|
</View>
|
|
63
73
|
{includeQuestionIcon && (
|
|
64
74
|
<View style={ownStyles.icon}>
|
|
@@ -87,7 +97,8 @@ Period.propTypes = {
|
|
|
87
97
|
period: any,
|
|
88
98
|
includeQuestionIcon: bool,
|
|
89
99
|
showPeriod: bool,
|
|
90
|
-
billSummaryStep: bool
|
|
100
|
+
billSummaryStep: bool,
|
|
101
|
+
temporalyDisabled: bool
|
|
91
102
|
};
|
|
92
103
|
|
|
93
104
|
export default Period;
|