21
21
import java .math .BigDecimal ;
22
22
import java .time .LocalDate ;
23
23
import java .util .List ;
24
+ import lombok .Getter ;
24
25
import org .apache .fineract .accounting .glaccount .data .GLAccountData ;
25
26
import org .apache .fineract .infrastructure .core .data .EnumOptionData ;
26
27
import org .apache .fineract .organisation .monetary .data .CurrencyData ;
30
31
*
31
32
* Note: no getter/setters required as google will produce json from fields of object.
32
33
*/
34
+ @ Getter
33
35
public class JournalEntryData {
34
36
35
37
private final Long id ;
@@ -76,6 +78,8 @@ public class JournalEntryData {
76
78
77
79
@ SuppressWarnings ("unused" )
78
80
private final TransactionDetailData transactionDetails ;
81
+ @ SuppressWarnings ("unused" )
82
+ private final LocalDate submittedOnDate ;
79
83
80
84
// import fields
81
85
private transient Integer rowIndex ;
@@ -132,6 +136,7 @@ public JournalEntryData(Long officeId, LocalDate transactionDate, String currenc
132
136
this .organizationRunningBalance = null ;
133
137
this .runningBalanceComputed = null ;
134
138
this .transactionDetails = null ;
139
+ this .submittedOnDate = null ;
135
140
}
136
141
137
142
public static JournalEntryData importInstance (Long officeId , LocalDate transactionDate , String currencyCode , Long paymentTypeId ,
@@ -179,6 +184,7 @@ private JournalEntryData(Long officeId, LocalDate transactionDate, String curren
179
184
this .entityType = null ;
180
185
this .entityId = null ;
181
186
this .createdByUserId = null ;
187
+ this .submittedOnDate = null ;
182
188
this .createdDate = null ;
183
189
this .createdByUserName = null ;
184
190
this .reversed = null ;
@@ -209,7 +215,7 @@ public void addCredits(CreditDebit credit) {
209
215
public JournalEntryData (final Long id , final Long officeId , final String officeName , final String glAccountName , final Long glAccountId ,
210
216
final String glAccountCode , final EnumOptionData glAccountClassification , final LocalDate transactionDate ,
211
217
final EnumOptionData entryType , final BigDecimal amount , final String transactionId , final Boolean manualEntry ,
212
- final EnumOptionData entityType , final Long entityId , final Long createdByUserId , final LocalDate createdDate ,
218
+ final EnumOptionData entityType , final Long entityId , final Long createdByUserId , final LocalDate submittedOnDate ,
213
219
final String createdByUserName , final String comments , final Boolean reversed , final String referenceNumber ,
214
220
final BigDecimal officeRunningBalance , final BigDecimal organizationRunningBalance , final Boolean runningBalanceComputed ,
215
221
final TransactionDetailData transactionDetailData , final CurrencyData currency ) {
@@ -228,7 +234,8 @@ public JournalEntryData(final Long id, final Long officeId, final String officeN
228
234
this .entityType = entityType ;
229
235
this .entityId = entityId ;
230
236
this .createdByUserId = createdByUserId ;
231
- this .createdDate = createdDate ;
237
+ this .createdDate = submittedOnDate ;
238
+ this .submittedOnDate = submittedOnDate ;
232
239
this .createdByUserName = createdByUserName ;
233
240
this .comments = comments ;
234
241
this .reversed = reversed ;
@@ -240,40 +247,6 @@ public JournalEntryData(final Long id, final Long officeId, final String officeN
240
247
this .currency = currency ;
241
248
}
242
249
243
- public JournalEntryData (final Long id , final Long officeId , final String glAccountName , final Long glAccountId ,
244
- final String glAccountCode , final EnumOptionData glAccountClassification , final LocalDate transactionDate ,
245
- final EnumOptionData entryType , final BigDecimal amount , final String transactionId , final Boolean manualEntry ,
246
- final EnumOptionData entityType , final Long entityId , final LocalDate createdDate , final String currencyCode ,
247
- final Long savingTransactionId ) {
248
- this .id = id ;
249
- this .officeId = officeId ;
250
- this .officeName = null ;
251
- this .glAccountName = glAccountName ;
252
- this .glAccountId = glAccountId ;
253
- this .glAccountCode = glAccountCode ;
254
- this .glAccountType = glAccountClassification ;
255
- this .transactionDate = transactionDate ;
256
- this .entryType = entryType ;
257
- this .amount = amount ;
258
- this .transactionId = transactionId ;
259
- this .savingTransactionId = savingTransactionId ;
260
- this .manualEntry = manualEntry ;
261
- this .entityType = entityType ;
262
- this .entityId = entityId ;
263
- this .createdByUserId = null ;
264
- this .createdDate = createdDate ;
265
- this .createdByUserName = null ;
266
- this .comments = null ;
267
- this .reversed = false ;
268
- this .referenceNumber = null ;
269
- this .officeRunningBalance = null ;
270
- this .organizationRunningBalance = null ;
271
- this .runningBalanceComputed = null ;
272
- this .transactionDetails = null ;
273
- this .currency = null ;
274
- this .currencyCode = currencyCode ;
275
- }
276
-
277
250
public static JournalEntryData fromGLAccountData (final GLAccountData glAccountData ) {
278
251
279
252
final Long id = null ;
@@ -291,7 +264,7 @@ public static JournalEntryData fromGLAccountData(final GLAccountData glAccountDa
291
264
final EnumOptionData entityType = null ;
292
265
final Long entityId = null ;
293
266
final Long createdByUserId = null ;
294
- final LocalDate createdDate = null ;
267
+ final LocalDate submittedOnDate = null ;
295
268
final String createdByUserName = null ;
296
269
final String comments = null ;
297
270
final Boolean reversed = null ;
@@ -302,65 +275,8 @@ public static JournalEntryData fromGLAccountData(final GLAccountData glAccountDa
302
275
final TransactionDetailData transactionDetailData = null ;
303
276
final CurrencyData currency = null ;
304
277
return new JournalEntryData (id , officeId , officeName , glAccountName , glAccountId , glAccountCode , glAccountClassification ,
305
- transactionDate , entryType , amount , transactionId , manualEntry , entityType , entityId , createdByUserId , createdDate ,
278
+ transactionDate , entryType , amount , transactionId , manualEntry , entityType , entityId , createdByUserId , submittedOnDate ,
306
279
createdByUserName , comments , reversed , referenceNumber , officeRunningBalance , organizationRunningBalance ,
307
280
runningBalanceComputed , transactionDetailData , currency );
308
281
}
309
-
310
- public Long getId () {
311
- return this .id ;
312
- }
313
-
314
- public Long getGlAccountId () {
315
- return this .glAccountId ;
316
- }
317
-
318
- public EnumOptionData getGlAccountType () {
319
- return this .glAccountType ;
320
- }
321
-
322
- public BigDecimal getAmount () {
323
- return this .amount ;
324
- }
325
-
326
- public EnumOptionData getEntryType () {
327
- return this .entryType ;
328
- }
329
-
330
- public Long getOfficeId () {
331
- return this .officeId ;
332
- }
333
-
334
- public String getTransactionId () {
335
- return transactionId ;
336
- }
337
-
338
- public Long getSavingTransactionId () {
339
- return this .savingTransactionId ;
340
- }
341
-
342
- public String getCurrencyCode () {
343
- return this .currencyCode ;
344
- }
345
-
346
- public boolean isManualEntry () {
347
- return this .manualEntry ;
348
- }
349
-
350
- public EnumOptionData getEntityType () {
351
- return this .entityType ;
352
- }
353
-
354
- public Long getEntityId () {
355
- return this .entityId ;
356
- }
357
-
358
- public LocalDate getCreatedDate () {
359
- return this .createdDate ;
360
- }
361
-
362
- public Long getPaymentTypeId () {
363
- return this .paymentTypeId ;
364
- }
365
-
366
282
}
0 commit comments