@@ -68,6 +68,7 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
68
68
@track hasInvalidBatchFields = false ;
69
69
@track missingBatchHeaderFieldLabels = [ ] ;
70
70
@track missingRequiredFieldsMessage ;
71
+ @track allowFirstInstallment = false ;
71
72
72
73
dataImportBatchFieldInfos ;
73
74
dataImportBatchInfo ;
@@ -90,7 +91,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
90
91
third : 2
91
92
}
92
93
93
- _allowFirstInstallment = false ;
94
94
_allowFirstInstallmentDisabled ;
95
95
_allowRecurringDonations = false ;
96
96
@@ -119,28 +119,16 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
119
119
const isChecked = event . detail . value
120
120
this . _allowRecurringDonations = isChecked ;
121
121
if ( ! isChecked ) {
122
- this . _allowFirstInstallment = false ;
122
+ this . allowFirstInstallment = false ;
123
123
this . _allowFirstInstallmentDisabled = true ;
124
124
} else {
125
125
this . _allowFirstInstallmentDisabled = false ;
126
126
}
127
127
128
128
}
129
129
130
- get allowFirstInstallment ( ) {
131
- if ( this . isEditMode && this . _allowRecurringDonations ) {
132
- let batchLevelDefaults =
133
- JSON . parse ( this . dataImportBatchRecord . fields [ DATA_IMPORT_BATCH_DEFAULTS_INFO . fieldApiName ] . value ) ;
134
- return batchLevelDefaults [ 'AllowFirstInstallment__f' ] ?
135
- batchLevelDefaults [ 'AllowFirstInstallment__f' ] . value :
136
- false ;
137
- }
138
-
139
- return this . _allowFirstInstallment ;
140
- }
141
-
142
130
handleAllowFirstInstallmentOnChange ( event ) {
143
- this . _allowFirstInstallment = event . detail . value ;
131
+ this . allowFirstInstallment = event . detail . value ;
144
132
}
145
133
146
134
get allowFirstInstallmentDisabled ( ) {
@@ -272,9 +260,17 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
272
260
?. fields [ DATA_IMPORT_BATCH_ALLOW_RECURRING_DONATIONS . fieldApiName ]
273
261
?. value ;
274
262
263
+ if ( ! this . _allowRecurringDonations ) {
264
+ this . _allowFirstInstallmentDisabled = true ;
265
+ }
266
+
275
267
let batchLevelDefaults =
276
268
JSON . parse ( this . dataImportBatchRecord . fields [ DATA_IMPORT_BATCH_DEFAULTS_INFO . fieldApiName ] . value ) ;
277
269
270
+ this . allowFirstInstallment = batchLevelDefaults [ 'AllowFirstInstallment__f' ] ?
271
+ batchLevelDefaults [ 'AllowFirstInstallment__f' ] . value :
272
+ false ;
273
+
278
274
this . formSections . forEach ( section => {
279
275
if ( section . elements ) {
280
276
section . elements . forEach ( element => {
0 commit comments