Skip to content

Commit 93c9e8f

Browse files
committed
Complete
1 parent 5cc2a65 commit 93c9e8f

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

feature/collectionSheet/src/commonMain/kotlin/com/mifos/feature/individualCollectionSheet/individualCollectionSheetDetails/IndividualCollectionSheetDetailsScreen.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ private fun IndividualCollectionSheetItem(
210210
modifier: Modifier = Modifier,
211211
onClick: () -> Unit,
212212
) {
213+
val loan = client.loans?.getOrNull(index)
214+
213215
OutlinedCard(
214216
modifier = modifier
215217
.padding(6.dp)
@@ -246,18 +248,16 @@ private fun IndividualCollectionSheetItem(
246248
Text(
247249
text = it,
248250
style = MaterialTheme.typography.bodyLarge,
249-
250251
)
251252
}
252253
Row {
253254
Text(
254255
text = stringResource(Res.string.feature_collection_sheet_total_due),
255256
style = MaterialTheme.typography.bodyMedium,
256-
257257
)
258258
Spacer(modifier = Modifier.width(16.dp))
259259
Text(
260-
text = client.loans?.get(index)?.totalDue.toString(),
260+
text = loan?.totalDue.toString(),
261261
style = MaterialTheme.typography.bodyMedium,
262262
)
263263
}
@@ -268,16 +268,12 @@ private fun IndividualCollectionSheetItem(
268268
)
269269
Spacer(modifier = Modifier.width(16.dp))
270270
Text(
271-
text = client.loans?.get(index)?.chargesDue.toString(),
271+
text = loan?.chargesDue.toString(),
272272
style = MaterialTheme.typography.bodyMedium,
273273
)
274274
}
275275
Text(
276-
text = "${client.loans?.get(index)?.productShortName} (#${
277-
client.loans?.get(
278-
index,
279-
)?.productShortName
280-
})",
276+
text = "${loan?.productShortName} (#${loan?.productShortName})",
281277
style = MaterialTheme.typography.bodyMedium,
282278
)
283279
}

feature/collectionSheet/src/commonMain/kotlin/com/mifos/feature/individualCollectionSheet/paymentDetails/PaymentDetailsScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private fun MifosButtonRow(
383383
}
384384

385385
@Composable
386-
@Preview
386+
@DevicePreview
387387
private fun PreviewPaymentDetails(modifier: Modifier = Modifier) {
388388
PaymentsDetailsScreen(
389389
modifier = modifier,

0 commit comments

Comments
 (0)