Skip to content

Commit c0dd92c

Browse files
committed
Merge branch 'develop'
2 parents 9a69693 + b9e8327 commit c0dd92c

9 files changed

+37
-36
lines changed

.github/workflows/build.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
commit_email: ${{secrets.commit_email}}
1212
commit_name: ${{secrets.commit_name}}
1313
app_sentry: ${{secrets.app_sentry}}
14+
api_secret: ${{secrets.api_secret}}
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v1
@@ -23,7 +24,7 @@ jobs:
2324
- run: |
2425
cp lib/.env.dart.example lib/.env.dart
2526
cp android/app/build.gradle.prod android/app/build.gradle
26-
sed -i 's/secret/password/g' lib/.env.dart
27+
sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart
2728
sed -i 's/dns/${{secrets.app_sentry}}/g' lib/.env.dart
2829
sed -i -e '/OTHER_LANGUAGES/{r lib/utils/i18n' -e 'd}' lib/utils/i18n.dart
2930
- run: flutter upgrade

lib/constants.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Constants {
88
}
99

1010
// TODO remove version once #46609 is fixed
11-
const String kClientVersion = '5.0.23';
11+
const String kClientVersion = '5.0.24';
1212
const String kMinServerVersion = '5.0.4';
1313

1414
const String kAppName = 'Invoice Ninja';

lib/ui/reports/document_report.dart

-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ ReportResult documentReport(
153153
return skip ? null : row;
154154
}
155155

156-
/* TODO enable this code
157156
clientMap.forEach((clientId, client) {
158157
client.documents.forEach((document) {
159158
final row = _getRow(client, document);
@@ -163,8 +162,6 @@ ReportResult documentReport(
163162
});
164163
});
165164

166-
*/
167-
168165
productMap.forEach((productId, product) {
169166
product.documents.forEach((document) {
170167
final row = _getRow(product, document);

lib/ui/reports/expense_report.dart

+9-9
Original file line numberDiff line numberDiff line change
@@ -124,31 +124,31 @@ ReportResult expenseReport(
124124
value = expense.taxRate3;
125125
break;
126126
case ExpenseReportFields.client:
127-
value = client.displayName;
127+
value = client?.displayName;
128128
break;
129129
case ExpenseReportFields.client_balance:
130-
value = client.balance;
130+
value = client?.balance;
131131
break;
132132
case ExpenseReportFields.client_address1:
133-
value = client.address1;
133+
value = client?.address1;
134134
break;
135135
case ExpenseReportFields.client_address2:
136-
value = client.address2;
136+
value = client?.address2;
137137
break;
138138
case ExpenseReportFields.client_shipping_address1:
139-
value = client.shippingAddress1;
139+
value = client?.shippingAddress1;
140140
break;
141141
case ExpenseReportFields.client_shipping_address2:
142-
value = client.shippingAddress2;
142+
value = client?.shippingAddress2;
143143
break;
144144
case ExpenseReportFields.invoice:
145-
value = invoice.listDisplayName;
145+
value = invoice?.listDisplayName;
146146
break;
147147
case ExpenseReportFields.invoice_amount:
148-
value = invoice.amount;
148+
value = invoice?.amount;
149149
break;
150150
case ExpenseReportFields.vendor:
151-
value = vendor.listDisplayName;
151+
value = vendor?.listDisplayName;
152152
break;
153153
case ExpenseReportFields.custom_value1:
154154
value = expense.customValue1;

lib/ui/reports/profit_loss_report.dart

+13-13
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ ReportResult profitAndLossReport(
8282

8383
switch (column) {
8484
case ProfitAndLossReportFields.client:
85-
value = client.displayName;
85+
value = client?.displayName;
8686
break;
8787
case ProfitAndLossReportFields.client_address1:
88-
value = client.address1;
88+
value = client?.address1;
8989
break;
9090
case ProfitAndLossReportFields.client_address2:
91-
value = client.address2;
91+
value = client?.address2;
9292
break;
9393
case ProfitAndLossReportFields.client_shipping_address1:
94-
value = client.shippingAddress1;
94+
value = client?.shippingAddress1;
9595
break;
9696
case ProfitAndLossReportFields.client_shipping_address2:
97-
value = client.shippingAddress2;
97+
value = client?.shippingAddress2;
9898
break;
9999
case ProfitAndLossReportFields.vendor:
100100
value = vendor?.listDisplayName;
@@ -109,10 +109,10 @@ ReportResult profitAndLossReport(
109109
value = staticState.countryMap[vendor?.countryId];
110110
break;
111111
case ProfitAndLossReportFields.amount:
112-
value = payment.amount;
112+
value = payment?.amount;
113113
break;
114114
case ProfitAndLossReportFields.date:
115-
value = payment.date;
115+
value = payment?.date;
116116
break;
117117
}
118118

@@ -153,22 +153,22 @@ ReportResult profitAndLossReport(
153153

154154
switch (column) {
155155
case ProfitAndLossReportFields.client:
156-
value = client.displayName;
156+
value = client?.displayName;
157157
break;
158158
case ProfitAndLossReportFields.client_address1:
159-
value = client.address1;
159+
value = client?.address1;
160160
break;
161161
case ProfitAndLossReportFields.client_address2:
162-
value = client.address2;
162+
value = client?.address2;
163163
break;
164164
case ProfitAndLossReportFields.client_shipping_address1:
165-
value = client.shippingAddress1;
165+
value = client?.shippingAddress1;
166166
break;
167167
case ProfitAndLossReportFields.client_shipping_address2:
168-
value = client.shippingAddress2;
168+
value = client?.shippingAddress2;
169169
break;
170170
case ProfitAndLossReportFields.vendor:
171-
value = vendor.listDisplayName;
171+
value = vendor?.listDisplayName;
172172
break;
173173
case ProfitAndLossReportFields.vendor_city:
174174
value = vendor?.city;

lib/ui/reports/reports_screen.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class ReportsScreen extends StatelessWidget {
7575
if (state.company.hasTaxes)
7676
kReportTaxRate,
7777
kReportDocument,
78-
//kReportExpense,
79-
//kReportProduct,
80-
//kReportProfitAndLoss,
81-
//kReportTask,
78+
kReportExpense,
79+
kReportProduct,
80+
kReportProfitAndLoss,
81+
kReportTask,
8282
]
8383
.map((report) =>
8484
DropdownMenuItem(

lib/ui/reports/task_report.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:invoiceninja_flutter/redux/reports/reports_state.dart';
99
import 'package:invoiceninja_flutter/redux/static/static_state.dart';
1010
import 'package:invoiceninja_flutter/ui/reports/reports_screen.dart';
1111
import 'package:memoize/memoize.dart';
12+
import 'package:invoiceninja_flutter/utils/extensions.dart';
1213

1314
enum TaskReportFields {
1415
rate,
@@ -117,12 +118,10 @@ ReportResult taskReport(
117118
);
118119
break;
119120
case TaskReportFields.start_date:
120-
// TODO: Check
121-
value = task.taskTimes[0]?.startDate;
121+
value = task.taskTimes.firstOrNull?.startDate;
122122
break;
123123
case TaskReportFields.end_date:
124-
// TODO: Check
125-
value = task.taskTimes[0]?.endDate;
124+
value = task.taskTimes.firstOrNull?.endDate;
126125
break;
127126
case TaskReportFields.description:
128127
value = task.description;

lib/utils/extensions.dart

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ extension ContextHelper on BuildContext {
1717
return store.state;
1818
}
1919
}
20+
21+
extension ListHelper<T> on List<T> {
22+
T get firstOrNull => isEmpty ? null : first;
23+
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: invoiceninja_flutter
22
description: Client for Invoice Ninja
3-
version: 5.0.23+23
3+
version: 5.0.24+24
44
author: Hillel Coren
55
homepage: https://invoiceninja.com
66
documentation: http://docs.invoiceninja.com

0 commit comments

Comments
 (0)