1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.service.impl;
17
18 import java.util.ArrayList;
19 import java.util.HashMap;
20 import java.util.Iterator;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.apache.commons.lang.StringUtils;
25 import org.kuali.ole.fp.businessobject.CashDrawer;
26 import org.kuali.ole.fp.businessobject.CashieringItemInProcess;
27 import org.kuali.ole.fp.businessobject.CashieringTransaction;
28 import org.kuali.ole.fp.businessobject.Check;
29 import org.kuali.ole.fp.businessobject.CoinDetail;
30 import org.kuali.ole.fp.businessobject.CurrencyDetail;
31 import org.kuali.ole.fp.businessobject.Deposit;
32 import org.kuali.ole.fp.businessobject.DepositCashReceiptControl;
33 import org.kuali.ole.fp.businessobject.format.CashDrawerStatusCodeFormatter;
34 import org.kuali.ole.fp.document.CashManagementDocument;
35 import org.kuali.ole.fp.document.CashReceiptDocument;
36 import org.kuali.ole.fp.document.dataaccess.CashManagementDao;
37 import org.kuali.ole.fp.document.service.CashManagementService;
38 import org.kuali.ole.fp.document.service.CashReceiptService;
39 import org.kuali.ole.fp.exception.CashDrawerStateException;
40 import org.kuali.ole.fp.exception.InvalidCashReceiptState;
41 import org.kuali.ole.fp.service.CashDrawerService;
42 import org.kuali.ole.sys.OLEConstants;
43 import org.kuali.ole.sys.OLEConstants.CashDrawerConstants;
44 import org.kuali.ole.sys.OLEConstants.CurrencyCoinSources;
45 import org.kuali.ole.sys.OLEConstants.DepositConstants;
46 import org.kuali.ole.sys.OLEConstants.DocumentStatusCodes;
47 import org.kuali.ole.sys.OLEConstants.DocumentStatusCodes.CashReceipt;
48 import org.kuali.ole.sys.OLEPropertyConstants;
49 import org.kuali.ole.sys.businessobject.Bank;
50 import org.kuali.ole.sys.businessobject.FinancialSystemDocumentHeader;
51 import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry;
52 import org.kuali.ole.sys.context.SpringContext;
53 import org.kuali.rice.core.api.datetime.DateTimeService;
54 import org.kuali.rice.core.api.util.type.KualiDecimal;
55 import org.kuali.rice.kew.api.WorkflowDocument;
56 import org.kuali.rice.kew.api.exception.WorkflowException;
57 import org.kuali.rice.kim.api.identity.Person;
58 import org.kuali.rice.kns.document.authorization.DocumentAuthorizer;
59 import org.kuali.rice.kns.service.DataDictionaryService;
60 import org.kuali.rice.kns.service.DocumentHelperService;
61 import org.kuali.rice.krad.service.BusinessObjectService;
62 import org.kuali.rice.krad.service.DocumentService;
63 import org.kuali.rice.krad.util.GlobalVariables;
64 import org.kuali.rice.krad.util.ObjectUtils;
65 import org.springframework.transaction.annotation.Transactional;
66
67
68
69
70 @Transactional
71 public class CashManagementServiceImpl implements CashManagementService {
72 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CashManagementServiceImpl.class);
73
74 private BusinessObjectService businessObjectService;
75 private CashDrawerService cashDrawerService;
76 private DateTimeService dateTimeService;
77 private DocumentService documentService;
78 private CashManagementDao cashManagementDao;
79 private DataDictionaryService dataDictionaryService;
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96 @Override
97 public CashManagementDocument getCashManagementDocumentForCashReceiptId(String documentId) {
98 CashManagementDocument cmdoc = null;
99
100
101 HashMap primaryKeys = new HashMap();
102 primaryKeys.put(OLEPropertyConstants.DOCUMENT_NUMBER, documentId);
103 CashReceiptDocument crDoc = (CashReceiptDocument) businessObjectService.findByPrimaryKey(getDataDictionaryService().getDocumentClassByTypeName(OLEConstants.FinancialDocumentTypeCodes.CASH_RECEIPT), primaryKeys);
104
105
106 if (crDoc != null) {
107 List crcList = crDoc.getDepositCashReceiptControl();
108 if (!crcList.isEmpty()) {
109 DepositCashReceiptControl dpcrc = (DepositCashReceiptControl) crcList.get(0);
110
111
112 Deposit d = dpcrc.getDeposit();
113 cmdoc = d.getCashManagementDocument();
114 }
115 }
116
117 return cmdoc;
118 }
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142 @Override
143 public CashManagementDocument createCashManagementDocument(String campusCode, String docDescription, String annotation) {
144 if (StringUtils.isBlank(campusCode)) {
145 throw new IllegalArgumentException("invalid (blank) campus code");
146 }
147 if (StringUtils.isBlank(docDescription)) {
148 throw new IllegalArgumentException("invalid (blank) docDescription");
149 }
150
151
152 Person user = GlobalVariables.getUserSession().getPerson();
153 DocumentAuthorizer documentAuthorizer = SpringContext.getBean(DocumentHelperService.class).getDocumentAuthorizer(OLEConstants.FinancialDocumentTypeCodes.CASH_MANAGEMENT);
154 documentAuthorizer.canInitiate(OLEConstants.FinancialDocumentTypeCodes.CASH_MANAGEMENT, user);
155
156
157 CashDrawer cd = cashDrawerService.getByCampusCode(campusCode);
158 if (cd == null) {
159 throw new RuntimeException("No cash drawer exists for campus code "+campusCode+"; please create on via the Cash Drawer Maintenance Document before attemping to create a CashManagementDocument for campus "+campusCode);
160 }
161 String controllingDocId = cd.getReferenceFinancialDocumentNumber();
162
163
164
165
166 if (!cd.isClosed() || cd.getStatusCode() == null) {
167 boolean forceDrawerClosed = false;
168
169 if (cd.getStatusCode() == null) {
170 forceDrawerClosed = true;
171 }
172
173 if (StringUtils.isBlank(controllingDocId)) {
174 forceDrawerClosed = true;
175 }
176 else if (!documentService.documentExists(controllingDocId)) {
177 forceDrawerClosed = true;
178 }
179
180 if (forceDrawerClosed) {
181 cashDrawerService.closeCashDrawer(cd);
182 cd = cashDrawerService.getByCampusCode(campusCode);
183 if (cd == null) {
184 throw new RuntimeException("No cash drawer exists for campus code "+campusCode+"; please create on via the Cash Drawer Maintenance Document before attemping to create a CashManagementDocument for campus "+campusCode);
185 }
186 }
187 }
188
189
190 CashManagementDocument cmDoc = null;
191 if (cd.isClosed()) {
192
193 try {
194 cmDoc = (CashManagementDocument) documentService.getNewDocument(CashManagementDocument.class);
195 cmDoc.getDocumentHeader().setDocumentDescription(docDescription);
196 cmDoc.setCampusCode(campusCode);
197 cmDoc.setCashDrawer(cd);
198 cmDoc.getCurrentTransaction().setCampusCode(cmDoc.getCampusCode());
199 cmDoc.getCurrentTransaction().setReferenceFinancialDocumentNumber(cmDoc.getDocumentNumber());
200 cmDoc.getCurrentTransaction().setOpenItemsInProcess(getOpenItemsInProcess(cmDoc));
201 }
202 catch (WorkflowException e) {
203 throw new IllegalArgumentException("unable to create CashManagementDocument", e);
204 }
205 }
206 else {
207 CashDrawerStatusCodeFormatter f = new CashDrawerStatusCodeFormatter();
208
209 throw new CashDrawerStateException(campusCode, controllingDocId, (String) f.format(CashDrawerConstants.STATUS_CLOSED), (String) f.format(cd.getStatusCode()));
210 }
211
212 return cmDoc;
213 }
214
215
216
217
218
219
220
221 @Override
222 public void createNewCashDetails(CashManagementDocument cmDoc, String cashieringStatus) {
223 CoinDetail coinDetail = new CoinDetail();
224 coinDetail.setDocumentNumber(cmDoc.getDocumentNumber());
225 coinDetail.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
226 coinDetail.setCashieringStatus(cashieringStatus);
227 businessObjectService.save(coinDetail);
228
229 CurrencyDetail currencyDetail = new CurrencyDetail();
230 currencyDetail.setDocumentNumber(cmDoc.getDocumentNumber());
231 currencyDetail.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
232 currencyDetail.setCashieringStatus(cashieringStatus);
233 businessObjectService.save(currencyDetail);
234 }
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261 @Override
262 @SuppressWarnings("deprecation")
263 public void addDeposit(CashManagementDocument cashManagementDoc, String depositTicketNumber, Bank bank, List selectedCashReceipts, List selectedCashieringChecks, boolean isFinalDeposit) {
264 validateDepositParams(cashManagementDoc, bank, selectedCashReceipts);
265
266 String depositTypeCode = DepositConstants.DEPOSIT_TYPE_INTERIM;
267 if (isFinalDeposit) {
268 depositTypeCode = DepositConstants.DEPOSIT_TYPE_FINAL;
269 }
270
271
272 cashDrawerService.lockCashDrawer(cashManagementDoc.getCashDrawer(), cashManagementDoc.getDocumentNumber());
273
274
275 Map<Integer, Check> checks = getUndepositedChecksAsMap(cashManagementDoc);
276 List<Check> checksToSave = new ArrayList<Check>();
277 if (selectedCashieringChecks != null) {
278 for (Object o: selectedCashieringChecks) {
279 Integer sequenceId = (Integer)o;
280 Check check = checks.get(sequenceId);
281 checksToSave.add(check);
282 }
283 }
284
285
286 Deposit deposit = buildDeposit(cashManagementDoc, depositTypeCode, depositTicketNumber, bank, selectedCashReceipts, checksToSave);
287
288
289 List deposits = cashManagementDoc.getDeposits();
290 deposits.add(deposit);
291 documentService.updateDocument(cashManagementDoc);
292
293
294 List dccList = new ArrayList();
295 for (Iterator i = selectedCashReceipts.iterator(); i.hasNext();) {
296 CashReceiptDocument crDoc = (CashReceiptDocument) i.next();
297 FinancialSystemDocumentHeader dh = crDoc.getFinancialSystemDocumentHeader();
298
299
300 String statusCode = isFinalDeposit ? DocumentStatusCodes.CashReceipt.FINAL : DocumentStatusCodes.CashReceipt.INTERIM;
301 if (!dh.getFinancialDocumentStatusCode().equalsIgnoreCase(DocumentStatusCodes.CashReceipt.INTERIM)) {
302 dh.setFinancialDocumentStatusCode(statusCode);
303 documentService.updateDocument(crDoc);
304 }
305
306 DepositCashReceiptControl dcc = new DepositCashReceiptControl();
307 dcc.setFinancialDocumentCashReceiptNumber(crDoc.getDocumentNumber());
308 dcc.setFinancialDocumentDepositNumber(deposit.getDocumentNumber());
309 dcc.setFinancialDocumentDepositLineNumber(deposit.getFinancialDocumentDepositLineNumber());
310
311 dcc.setCashReceiptDocument(crDoc);
312 dcc.setDeposit(deposit);
313
314 dccList.add(dcc);
315 }
316
317 businessObjectService.save(dccList);
318
319
320 for (Check check: checksToSave) {
321 check.setFinancialDocumentDepositLineNumber(deposit.getFinancialDocumentDepositLineNumber());
322 }
323 businessObjectService.save(checksToSave);
324
325
326 if (!isFinalDeposit) {
327 cashDrawerService.unlockCashDrawer(cashManagementDoc.getCashDrawer(), cashManagementDoc.getDocumentNumber());
328 }
329 }
330
331
332
333
334
335
336
337
338 protected void validateDepositParams(CashManagementDocument cashManagementDoc, Bank bank, List<CashReceiptDocument> selectedCashReceipts) {
339 if (cashManagementDoc == null) {
340 throw new IllegalArgumentException("invalid (null) cashManagementDoc");
341 }
342 else if (!cashManagementDoc.getDocumentHeader().getWorkflowDocument().isSaved()) {
343 throw new IllegalStateException("cashManagementDoc '" + cashManagementDoc.getDocumentNumber() + "' is not in 'saved' state");
344 }
345 else if (cashManagementDoc.hasFinalDeposit()) {
346 throw new IllegalStateException("cashManagementDoc '" + cashManagementDoc.getDocumentNumber() + "' hasFinalDeposit");
347 }
348 if (bank == null) {
349 throw new IllegalArgumentException("invalid (null) bank");
350 }
351
352 if (selectedCashReceipts == null) {
353 throw new IllegalArgumentException("invalid (null) cashReceipts list");
354 }
355 else {
356 for (CashReceiptDocument cashReceipt : selectedCashReceipts) {
357 String statusCode = cashReceipt.getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode();
358
359 if (!StringUtils.equals(statusCode, DocumentStatusCodes.CashReceipt.VERIFIED) && !StringUtils.equals(statusCode, DocumentStatusCodes.CashReceipt.INTERIM)) {
360 throw new InvalidCashReceiptState("cash receipt document " + cashReceipt.getDocumentNumber() + " has a status other than 'verified' or 'interim' ");
361 }
362 }
363 }
364 }
365
366
367
368
369
370
371
372
373
374
375
376
377
378 protected Deposit buildDeposit(CashManagementDocument cashManagementDoc, String depositTypeCode, String depositTicketNumber, Bank bank, List<CashReceiptDocument> selectedCashReceipts, List selectedCashieringChecks) {
379 Deposit deposit = new Deposit();
380 deposit.setDocumentNumber(cashManagementDoc.getDocumentNumber());
381 deposit.setCashManagementDocument(cashManagementDoc);
382
383 deposit.setDepositTypeCode(depositTypeCode);
384
385 deposit.setDepositDate(dateTimeService.getCurrentSqlDate());
386
387 deposit.setBank(bank);
388 deposit.setDepositBankCode(bank.getBankCode());
389
390
391 int lineNumber = cashManagementDoc.getNextDepositLineNumber();
392 deposit.setFinancialDocumentDepositLineNumber(new Integer(lineNumber));
393
394
395 deposit.setDepositTicketNumber(StringUtils.trimToEmpty(depositTicketNumber));
396
397
398 KualiDecimal total = KualiDecimal.ZERO;
399 for (Iterator i = selectedCashReceipts.iterator(); i.hasNext();) {
400 CashReceiptDocument crDoc = (CashReceiptDocument) i.next();
401 if (crDoc.getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode().equalsIgnoreCase(CashReceipt.VERIFIED)) {
402 total = total.add(crDoc.getTotalConfirmedCheckAmount());
403 }
404 }
405 Check currCheck;
406 for (Object checkObj: selectedCashieringChecks) {
407 currCheck = (Check)checkObj;
408 total = total.add(currCheck.getAmount());
409 }
410 deposit.setDepositAmount(total);
411
412 return deposit;
413 }
414
415
416
417
418
419
420
421
422 protected Map<Integer, Check> getUndepositedChecksAsMap(CashManagementDocument cmDoc) {
423 Map<Integer, Check> checks = new HashMap<Integer, Check>();
424 List<Check> checkList = cashManagementDao.selectUndepositedCashieringChecks(cmDoc.getDocumentNumber());
425 if (checkList != null && checkList.size() > 0) {
426 for (Check check: checkList) {
427 checks.put(check.getSequenceId(), check);
428 }
429 }
430 return checks;
431 }
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448 @Override
449 public void cancelCashManagementDocument(CashManagementDocument cmDoc) {
450 if (cmDoc == null) {
451 throw new IllegalArgumentException("invalid (null) CashManagementDocument");
452 }
453
454
455 List deposits = cmDoc.getDeposits();
456 for (Iterator i = deposits.iterator(); i.hasNext();) {
457 Deposit deposit = (Deposit) i.next();
458
459 cancelDeposit(deposit);
460 }
461
462
463 String unitName = cmDoc.getCampusCode();
464 cashDrawerService.closeCashDrawer(cmDoc.getCashDrawer());
465
466
467 cmDoc.setDeposits(new ArrayList());
468 cmDoc.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(DocumentStatusCodes.CANCELLED);
469
470
471 String[] cashieringSourcesToDelete = { OLEConstants.CurrencyCoinSources.CASH_RECEIPTS, CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_IN, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_OUT };
472 for (String cashieringSourceToDelete : cashieringSourcesToDelete) {
473 CurrencyDetail currencyDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, cashieringSourceToDelete);
474 if (currencyDetail != null) {
475 businessObjectService.delete(currencyDetail);
476 }
477 CoinDetail coinDetail = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, cashieringSourceToDelete);
478 if (coinDetail != null) {
479 businessObjectService.delete(coinDetail);
480 }
481 }
482 }
483
484
485
486
487
488
489
490
491
492
493
494
495
496 @Override
497 public void cancelDeposit(Deposit deposit) {
498 if (deposit == null) {
499 throw new IllegalArgumentException("invalid (null) deposit");
500 }
501
502
503 deposit.refresh();
504
505
506 String depositCampus = deposit.getCashManagementDocument().getCampusCode();
507
508
509 List depositCashReceiptControls = deposit.getDepositCashReceiptControl();
510 for (Iterator j = depositCashReceiptControls.iterator(); j.hasNext();) {
511 DepositCashReceiptControl dcc = (DepositCashReceiptControl) j.next();
512 if (!ObjectUtils.isNull(dcc)) {
513 dcc.refreshReferenceObject("cashReceiptDocument");
514 CashReceiptDocument crDoc = dcc.getCashReceiptDocument();
515 if (!ObjectUtils.isNull(crDoc)) {
516 crDoc.refreshReferenceObject("documentHeader");
517 FinancialSystemDocumentHeader crdh = crDoc.getFinancialSystemDocumentHeader();
518 if (!ObjectUtils.isNull(crdh)) {
519 if (!(deposit.getDepositTypeCode().equalsIgnoreCase(DocumentStatusCodes.CashReceipt.FINAL)
520 && crdh.getFinancialDocumentStatusCode().equalsIgnoreCase(DocumentStatusCodes.CashReceipt.INTERIM))) {
521 crdh.setFinancialDocumentStatusCode(DocumentStatusCodes.CashReceipt.VERIFIED);
522 }
523 documentService.updateDocument(crDoc);
524 }
525 }
526 }
527 }
528
529
530 List<Check> depositedChecks = selectCashieringChecksForDeposit(deposit.getDocumentNumber(), deposit.getFinancialDocumentDepositLineNumber());
531 for (Check check: depositedChecks) {
532 check.setFinancialDocumentDepositLineNumber(null);
533 }
534 businessObjectService.save(depositedChecks);
535
536
537 if (LOG.isDebugEnabled()) {
538 LOG.debug("deposit deposit type = "+deposit.getDepositTypeCode()+"; constant = "+OLEConstants.DepositConstants.DEPOSIT_TYPE_FINAL+"; are they equal? "+deposit.getDepositTypeCode().equals(OLEConstants.DepositConstants.DEPOSIT_TYPE_FINAL));
539 }
540 if (deposit.getDepositTypeCode().equals(OLEConstants.DepositConstants.DEPOSIT_TYPE_FINAL)) {
541 CashDrawer drawer = cashDrawerService.getByCampusCode(deposit.getCashManagementDocument().getCampusCode());
542 CurrencyDetail currencyDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(deposit.getCashManagementDocument().getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
543 if (currencyDetail != null) {
544 drawer.addCurrency(currencyDetail);
545 businessObjectService.delete(currencyDetail);
546 }
547 CoinDetail coinDetail = cashManagementDao.findCoinDetailByCashieringStatus(deposit.getCashManagementDocument().getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
548 if (coinDetail != null) {
549 drawer.addCoin(coinDetail);
550 businessObjectService.delete(coinDetail);
551 }
552 businessObjectService.save(drawer);
553 cashDrawerService.unlockCashDrawer(drawer, deposit.getDocumentNumber());
554 }
555
556
557 businessObjectService.delete(deposit);
558 }
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575 @Override
576 public void finalizeCashManagementDocument(CashManagementDocument cmDoc) {
577 if (cmDoc == null) {
578 throw new IllegalArgumentException("invalid (null) CashManagementDocument");
579 }
580 if (!cmDoc.hasFinalDeposit()) {
581 throw new IllegalStateException("cmDoc " + cmDoc.getDocumentNumber() + " is missing a FinalDeposit");
582 }
583
584 String campusCode = cmDoc.getCampusCode();
585 cashDrawerService.closeCashDrawer(campusCode);
586 CashDrawer cd = cashDrawerService.getByCampusCode(campusCode);
587
588
589
590 List<Deposit> deposits = cmDoc.getDeposits();
591 for (Deposit deposit : deposits) {
592 List<CashReceiptDocument> receipts = retrieveCashReceipts(deposit);
593 for (CashReceiptDocument receipt : receipts) {
594
595 for (GeneralLedgerPendingEntry glpe : receipt.getGeneralLedgerPendingEntries()) {
596 glpe.setFinancialDocumentApprovedCode(DocumentStatusCodes.APPROVED);
597 }
598
599
600 receipt.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(DocumentStatusCodes.APPROVED);
601
602
603 documentService.updateDocument(receipt);
604 }
605 }
606
607
608 CurrencyDetail masterCurrencyDetail = this.generateMasterCurrencyDetail(cmDoc);
609
610 CoinDetail masterCoinDetail = this.generateMasterCoinDetail(cmDoc);
611
612 generateMasterRecord(cmDoc, masterCurrencyDetail, masterCoinDetail);
613
614 cmDoc.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(DocumentStatusCodes.APPROVED);
615 }
616
617
618
619
620
621
622
623 @Override
624 public boolean allVerifiedCashReceiptsAreDeposited(CashManagementDocument cmDoc) {
625 boolean result = true;
626 List verifiedReceipts = SpringContext.getBean(CashReceiptService.class).getCashReceipts(cmDoc.getCampusCode(), OLEConstants.DocumentStatusCodes.CashReceipt.VERIFIED);
627 for (Object o: verifiedReceipts) {
628 if (!verifyCashReceiptIsDeposited(cmDoc, (CashReceiptDocument)o)) {
629 result = false;
630 break;
631 }
632 }
633 return result;
634 }
635
636
637
638
639
640
641
642
643
644 @Override
645 public List<CashReceiptDocument> retrieveCashReceipts(Deposit deposit) {
646 List<CashReceiptDocument> cashReceiptDocuments = new ArrayList<CashReceiptDocument>();
647
648 if (ObjectUtils.isNull(deposit.getDepositCashReceiptControl()) || deposit.getDepositCashReceiptControl().isEmpty() ) {
649 deposit.refreshReferenceObject("depositCashReceiptControl");
650 }
651
652 Map pkMap = new HashMap();
653 for (Object dcrcAsObject : deposit.getDepositCashReceiptControl()) {
654 final DepositCashReceiptControl dcrc = (DepositCashReceiptControl)dcrcAsObject;
655 try {
656 CashReceiptDocument crDoc = (CashReceiptDocument)documentService.getByDocumentHeaderId(dcrc.getFinancialDocumentCashReceiptNumber());
657 final WorkflowDocument headerWorkflowDoc = crDoc.getDocumentHeader().getWorkflowDocument();
658 crDoc.refreshReferenceObject("documentHeader");
659 crDoc.getDocumentHeader().setWorkflowDocument(headerWorkflowDoc);
660 cashReceiptDocuments.add(crDoc);
661 }
662 catch (WorkflowException we) {
663 throw new RuntimeException("Could not retrieve related Cash Receipts", we);
664 }
665 }
666
667 return cashReceiptDocuments;
668 }
669
670
671
672
673
674
675
676
677 @Override
678 public boolean verifyCashReceiptIsDeposited(CashManagementDocument cmDoc, CashReceiptDocument crDoc) {
679 boolean thisCRDeposited = false;
680 for (Deposit deposit: cmDoc.getDeposits()) {
681 if (deposit.containsCashReceipt(crDoc)) {
682 thisCRDeposited = true;
683 break;
684 }
685 }
686 return thisCRDeposited;
687 }
688
689
690
691
692
693
694
695
696
697
698 @Override
699 public void finalizeLastInterimDeposit(CashManagementDocument cmDoc) {
700
701 if (cmDoc.hasFinalDeposit()) {
702 throw new IllegalStateException("CashManagementDocument #"+cmDoc.getDocumentNumber()+" already has a final deposit");
703 }
704
705 List verifiedReceipts = SpringContext.getBean(CashReceiptService.class).getCashReceipts(cmDoc.getCampusCode(), OLEConstants.DocumentStatusCodes.CashReceipt.VERIFIED);
706 for (Object o: verifiedReceipts) {
707 CashReceiptDocument crDoc = (CashReceiptDocument)o;
708 if (!verifyCashReceiptIsDeposited(cmDoc, crDoc)) {
709 throw new IllegalStateException("Verified Cash Receipt Document #"+crDoc.getDocumentNumber()+" must be deposited for this to be a final deposit");
710 }
711 }
712
713 cashDrawerService.lockCashDrawer(cmDoc.getCashDrawer(), cmDoc.getDocumentNumber());
714
715
716 List<Deposit> allDeposits = cmDoc.getDeposits();
717 Deposit lastInterim = allDeposits.get(allDeposits.size() - 1);
718 lastInterim.setDepositTypeCode(DepositConstants.DEPOSIT_TYPE_FINAL);
719 finalizeCashReceiptsForDeposit(lastInterim);
720 documentService.updateDocument(cmDoc);
721 }
722
723
724
725
726
727
728 protected void finalizeCashReceiptsForDeposit(Deposit deposit) {
729 List cashReceipts = this.retrieveCashReceipts(deposit);
730 for (Object o: cashReceipts) {
731 CashReceiptDocument crDoc = (CashReceiptDocument)o;
732 crDoc.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(OLEConstants.DocumentStatusCodes.CashReceipt.FINAL);
733 documentService.updateDocument(crDoc);
734 }
735 }
736
737
738
739
740
741
742
743
744
745 @Override
746 public void applyCashieringTransaction(CashManagementDocument cmDoc) {
747 if (cmDoc.getCashDrawer() == null) {
748 cmDoc.setCashDrawer(cashDrawerService.getByCampusCode(cmDoc.getCampusCode()));
749 }
750
751 this.transferChecksToCashManagementDocument(cmDoc, cmDoc.getCurrentTransaction());
752 this.saveChecks(cmDoc);
753 this.completeNewItemInProcess(cmDoc.getCurrentTransaction());
754 if (cmDoc.getCurrentTransaction().getNewItemInProcess() != null) {
755 this.saveNewItemInProcess(cmDoc, cmDoc.getCurrentTransaction());
756 }
757 this.saveExisingItemsInProcess(cmDoc, cmDoc.getCurrentTransaction());
758 this.saveMoneyInCash(cmDoc, cmDoc.getCurrentTransaction());
759 this.saveMoneyOutCash(cmDoc, cmDoc.getCurrentTransaction());
760 this.updateCashDrawer(cmDoc.getCashDrawer(), cmDoc.getCurrentTransaction());
761 cmDoc.resetCurrentTransaction();
762 }
763
764
765
766
767
768
769
770
771 protected void updateCashDrawer(CashDrawer drawer, CashieringTransaction trans) {
772
773 if (!trans.getMoneyInCurrency().isEmpty()) {
774 drawer.addCurrency(trans.getMoneyInCurrency());
775 }
776 if (!trans.getMoneyInCoin().isEmpty()) {
777 drawer.addCoin(trans.getMoneyInCoin());
778 }
779
780
781 if (!trans.getMoneyOutCurrency().isEmpty()) {
782 drawer.removeCurrency(trans.getMoneyOutCurrency());
783 }
784 if (!trans.getMoneyOutCoin().isEmpty()) {
785 drawer.removeCoin(trans.getMoneyOutCoin());
786 }
787
788 businessObjectService.save(drawer);
789 }
790
791
792
793
794
795
796
797 protected void completeNewItemInProcess(CashieringTransaction trans) {
798 if (trans.getNewItemInProcess().isPopulated()) {
799 trans.getNewItemInProcess().setItemRemainingAmount(trans.getNewItemInProcess().getItemAmount());
800 }
801 else {
802 trans.setNewItemInProcess(null);
803 }
804 }
805
806
807
808
809
810
811
812 protected void saveChecks(CashManagementDocument cmDoc) {
813 if (cmDoc.getChecks() != null) {
814 for (Check check: cmDoc.getChecks()) {
815 check.setDocumentNumber(cmDoc.getDocumentNumber());
816 check.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
817 check.setCashieringStatus(OLEConstants.CheckSources.CASH_MANAGEMENT);
818 businessObjectService.save(check);
819 }
820 }
821 }
822
823
824
825
826
827
828
829
830 protected void transferChecksToCashManagementDocument(CashManagementDocument cmDoc, CashieringTransaction trans) {
831 for (Check check: trans.getMoneyInChecks()) {
832 check.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
833 check.setCashieringStatus(OLEConstants.CheckSources.CASH_MANAGEMENT);
834 check.setDocumentNumber(cmDoc.getDocumentNumber());
835 cmDoc.addCheck(check);
836 }
837 }
838
839
840
841
842
843
844
845 protected void saveNewItemInProcess(CashManagementDocument cmDoc, CashieringTransaction trans) {
846 if (trans.getNewItemInProcess().isPopulated()) {
847 trans.getNewItemInProcess().setItemRemainingAmount(trans.getNewItemInProcess().getItemAmount());
848 trans.getNewItemInProcess().setItemReducedAmount(KualiDecimal.ZERO);
849 trans.getNewItemInProcess().setCampusCode(cmDoc.getCampusCode());
850 businessObjectService.save(trans.getNewItemInProcess());
851
852
853 trans.getOpenItemsInProcess().add(trans.getNewItemInProcess());
854
855 CashDrawer drawer = cmDoc.getCashDrawer();
856 if (drawer.getFinancialDocumentMiscellaneousAdvanceAmount() == null) {
857 drawer.setFinancialDocumentMiscellaneousAdvanceAmount(trans.getNewItemInProcess().getItemAmount());
858 }
859 else {
860 drawer.setFinancialDocumentMiscellaneousAdvanceAmount(drawer.getFinancialDocumentMiscellaneousAdvanceAmount().add(trans.getNewItemInProcess().getItemAmount()));
861 }
862 }
863 }
864
865
866
867
868
869
870
871
872 protected void saveExisingItemsInProcess(CashManagementDocument cmDoc, CashieringTransaction trans) {
873 if (trans.getOpenItemsInProcess() != null) {
874 CashDrawer drawer = cmDoc.getCashDrawer();
875
876 for (CashieringItemInProcess itemInProc: trans.getOpenItemsInProcess()) {
877 if (itemInProc.getCurrentPayment() != null && !itemInProc.getCurrentPayment().equals(KualiDecimal.ZERO)) {
878 itemInProc.setItemRemainingAmount(itemInProc.getItemRemainingAmount().subtract(itemInProc.getCurrentPayment()));
879 itemInProc.setItemReducedAmount(itemInProc.getItemReducedAmount().add(itemInProc.getCurrentPayment()));
880 if (drawer.getFinancialDocumentMiscellaneousAdvanceAmount() != null) {
881 drawer.setFinancialDocumentMiscellaneousAdvanceAmount(drawer.getFinancialDocumentMiscellaneousAdvanceAmount().subtract(itemInProc.getCurrentPayment()));
882 }
883 itemInProc.setCurrentPayment(KualiDecimal.ZERO);
884 if (itemInProc.getItemRemainingAmount().equals(KualiDecimal.ZERO)) {
885 itemInProc.setItemClosedDate(new java.sql.Date(SpringContext.getBean(DateTimeService.class).getCurrentDate().getTime()));
886 }
887 businessObjectService.save(itemInProc);
888 }
889 }
890 }
891 }
892
893
894
895
896
897
898
899
900
901 protected void saveMoneyInCash(CashManagementDocument cmDoc, CashieringTransaction trans) {
902
903 CoinDetail cumulativeMoneyInCoin = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_IN);
904
905 cumulativeMoneyInCoin.add(trans.getMoneyInCoin());
906
907 businessObjectService.save(cumulativeMoneyInCoin);
908
909 CurrencyDetail cumulativeMoneyInCurrency = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_IN);
910 cumulativeMoneyInCurrency.add(trans.getMoneyInCurrency());
911 businessObjectService.save(cumulativeMoneyInCurrency);
912 }
913
914
915
916
917
918
919
920
921
922 protected void saveMoneyOutCash(CashManagementDocument cmDoc, CashieringTransaction trans) {
923 CoinDetail cumulativeMoneyOutCoin = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_OUT);
924 cumulativeMoneyOutCoin.add(trans.getMoneyOutCoin());
925 businessObjectService.save(cumulativeMoneyOutCoin);
926
927 CurrencyDetail cumulativeMoneyOutCurrency = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_OUT);
928 cumulativeMoneyOutCurrency.add(trans.getMoneyOutCurrency());
929 businessObjectService.save(cumulativeMoneyOutCurrency);
930 }
931
932
933
934
935
936
937
938
939
940
941 @Override
942 public List<CashieringItemInProcess> getOpenItemsInProcess(CashManagementDocument cmDoc) {
943 List<CashieringItemInProcess> itemsInProcess = cashManagementDao.findOpenItemsInProcessByCampusCode(cmDoc.getCampusCode());
944 return (itemsInProcess == null) ? new ArrayList<CashieringItemInProcess>() : itemsInProcess;
945 }
946
947
948
949
950
951
952
953
954
955
956 @Override
957 public List<CashieringItemInProcess> getRecentlyClosedItemsInProcess(CashManagementDocument cmDoc) {
958 return cashManagementDao.findRecentlyClosedItemsInProcess(cmDoc.getCampusCode());
959 }
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976 @Override
977 public CoinDetail generateMasterCoinDetail(CashManagementDocument cmDoc) {
978 CoinDetail masterDetail = new CoinDetail();
979 masterDetail.setDocumentNumber(cmDoc.getDocumentNumber());
980 masterDetail.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
981 masterDetail.setCashieringStatus(OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_MASTER);
982
983 masterDetail.zeroOutAmounts();
984
985 CoinDetail cashReceiptDetail = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_RECEIPTS);
986 if (cashReceiptDetail != null) {
987 masterDetail.add(cashReceiptDetail);
988 }
989
990 CoinDetail depositDetail = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
991 if (depositDetail != null) {
992 masterDetail.subtract(depositDetail);
993 }
994
995 CoinDetail moneyInDetail = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_IN);
996 if (moneyInDetail != null) {
997 masterDetail.add(moneyInDetail);
998 }
999
1000 CoinDetail moneyOutDetail = cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_OUT);
1001 if (moneyOutDetail != null) {
1002 masterDetail.subtract(moneyOutDetail);
1003 }
1004
1005 return masterDetail;
1006 }
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024 @Override
1025 public CurrencyDetail generateMasterCurrencyDetail(CashManagementDocument cmDoc) {
1026 CurrencyDetail masterDetail = new CurrencyDetail();
1027 masterDetail.setDocumentNumber(cmDoc.getDocumentNumber());
1028 masterDetail.setFinancialDocumentTypeCode(CashieringTransaction.DETAIL_DOCUMENT_TYPE);
1029 masterDetail.setCashieringStatus(OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_MASTER);
1030
1031 masterDetail.zeroOutAmounts();
1032
1033 CurrencyDetail cashReceiptDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_RECEIPTS);
1034 if (cashReceiptDetail != null) {
1035 masterDetail.add(cashReceiptDetail);
1036 }
1037
1038 CurrencyDetail depositDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
1039 if (depositDetail != null) {
1040 masterDetail.subtract(depositDetail);
1041 }
1042
1043 CurrencyDetail moneyInDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_IN);
1044 if (moneyInDetail != null) {
1045 masterDetail.add(moneyInDetail);
1046 }
1047
1048 CurrencyDetail moneyOutDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.CASH_MANAGEMENT_OUT);
1049 if (moneyOutDetail != null) {
1050 masterDetail.subtract(moneyOutDetail);
1051 }
1052
1053 return masterDetail;
1054 }
1055
1056
1057
1058
1059
1060
1061
1062 @Override
1063 public void populateCashDetailsForDeposit(CashManagementDocument cmDoc) {
1064
1065
1066 for (Deposit d: cmDoc.getDeposits()) {
1067 if (d.getDepositTypeCode().equals(DepositConstants.DEPOSIT_TYPE_FINAL)) {
1068 if (d.getDepositedCurrency() == null) {
1069 d.setDepositedCurrency(cashManagementDao.findCurrencyDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, CurrencyCoinSources.DEPOSITS));
1070 }
1071 if (d.getDepositedCoin() == null) {
1072 d.setDepositedCoin(cashManagementDao.findCoinDetailByCashieringStatus(cmDoc.getDocumentNumber(), CashieringTransaction.DETAIL_DOCUMENT_TYPE, CurrencyCoinSources.DEPOSITS));
1073 }
1074 }
1075 }
1076 }
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087 @Override
1088 public List<Check> selectCashieringChecksForDeposit(String documentNumber, Integer depositLineNumber) {
1089 return cashManagementDao.selectCashieringChecksForDeposit(documentNumber, depositLineNumber);
1090 }
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100 @Override
1101 public List<Check> selectUndepositedCashieringChecks(String documentNumber) {
1102 return cashManagementDao.selectUndepositedCashieringChecks(documentNumber);
1103 }
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113 @Override
1114 public List<Check> selectDepositedCashieringChecks(String documentNumber) {
1115 return cashManagementDao.selectDepositedCashieringChecks(documentNumber);
1116 }
1117
1118
1119
1120
1121
1122
1123
1124
1125 @Override
1126 public KualiDecimal calculateDepositedCheckTotal(String documentNumber) {
1127 KualiDecimal total = KualiDecimal.ZERO;
1128 for (Check check: cashManagementDao.selectDepositedCashieringChecks(documentNumber)) {
1129 if (check != null && check.getAmount() != null && check.getAmount().isGreaterThan(KualiDecimal.ZERO)) {
1130 total = total.add(check.getAmount());
1131 }
1132 }
1133 return total;
1134 }
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144 @Override
1145 public KualiDecimal calculateUndepositedCheckTotal(String documentNumber) {
1146 KualiDecimal total = KualiDecimal.ZERO;
1147 for (Check check: cashManagementDao.selectUndepositedCashieringChecks(documentNumber)) {
1148 if (check != null && check.getAmount() != null && check.getAmount().isGreaterThan(KualiDecimal.ZERO)) {
1149 total = total.add(check.getAmount());
1150 }
1151 }
1152 return total;
1153 }
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168 @Override
1169 public boolean allowDocumentCancellation(CashManagementDocument cmDoc) {
1170 return !existCashReceipts(cmDoc) && !existCashieringChecks(cmDoc) && !existCashDetails(cmDoc);
1171 }
1172
1173
1174
1175
1176
1177
1178
1179 protected boolean existCashReceipts(CashManagementDocument cmDoc) {
1180 List<CashReceiptDocument> cashReceipts = SpringContext.getBean(CashReceiptService.class).getCashReceipts(cmDoc.getCampusCode(), new String[] {OLEConstants.DocumentStatusCodes.CashReceipt.VERIFIED, OLEConstants.DocumentStatusCodes.CashReceipt.INTERIM, OLEConstants.DocumentStatusCodes.CashReceipt.FINAL} );
1181 return cashReceipts != null && cashReceipts.size() > 0;
1182 }
1183
1184
1185
1186
1187
1188
1189
1190 protected boolean existCashDetails(CashManagementDocument cmDoc) {
1191 boolean result = false;
1192 List<CurrencyDetail> currencyDetails = cashManagementDao.getAllCurrencyDetails(cmDoc.getDocumentNumber());
1193 if (currencyDetails != null && currencyDetails.size() > 0) {
1194 for (CurrencyDetail detail: currencyDetails) {
1195 result |= !detail.isEmpty();
1196 }
1197 }
1198 if (!result) {
1199 List<CoinDetail> coinDetails = cashManagementDao.getAllCoinDetails(cmDoc.getDocumentNumber());
1200 if (coinDetails != null && coinDetails.size() > 0) {
1201 for (CoinDetail detail: coinDetails) {
1202 result |= !detail.isEmpty();
1203 }
1204 }
1205 }
1206 return result;
1207 }
1208
1209
1210
1211
1212
1213
1214
1215 protected boolean existCashieringChecks(CashManagementDocument cmDoc) {
1216 List<Check> undepositedChecks = this.selectUndepositedCashieringChecks(cmDoc.getDocumentNumber());
1217 List<Check> depositedChecks = cashManagementDao.selectDepositedCashieringChecks(cmDoc.getDocumentNumber());
1218 return (undepositedChecks != null && undepositedChecks.size() > 0) || (depositedChecks != null && depositedChecks.size() > 0);
1219 }
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229 @Override
1230 public Integer selectNextAvailableCheckLineNumber(String documentNumber) {
1231 return cashManagementDao.selectNextAvailableCheckLineNumber(documentNumber);
1232 }
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244 @Override
1245 public Map<Class, Object> getCashDetailsForFinalDeposit(String documentNumber) {
1246 CurrencyDetail finalDepositCurrencyDetail = cashManagementDao.findCurrencyDetailByCashieringStatus(documentNumber, CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
1247 CoinDetail finalDepositCoinDetail = cashManagementDao.findCoinDetailByCashieringStatus(documentNumber, CashieringTransaction.DETAIL_DOCUMENT_TYPE, OLEConstants.CurrencyCoinSources.DEPOSITS);
1248 Map<Class, Object> result = new HashMap<Class, Object>();
1249 if (finalDepositCurrencyDetail != null) {
1250 result.put(CurrencyDetail.class, finalDepositCurrencyDetail);
1251 }
1252 if (finalDepositCoinDetail != null) {
1253 result.put(CoinDetail.class, finalDepositCoinDetail);
1254 }
1255 return result;
1256 }
1257
1258
1259
1260
1261
1262
1263
1264 public void generateMasterRecord(CashManagementDocument cmDoc, CurrencyDetail masterCurrencyDetail, CoinDetail masterCoinDetail) {
1265 cmDoc.setFinancialDocumentHundredDollarAmount(masterCurrencyDetail.getFinancialDocumentHundredDollarAmount());
1266 cmDoc.setFinancialDocumentFiftyDollarAmount(masterCurrencyDetail.getFinancialDocumentFiftyDollarAmount());
1267 cmDoc.setFinancialDocumentTwentyDollarAmount(masterCurrencyDetail.getFinancialDocumentTwentyDollarAmount());
1268 cmDoc.setFinancialDocumentTenDollarAmount(masterCurrencyDetail.getFinancialDocumentTenDollarAmount());
1269 cmDoc.setFinancialDocumentFiveDollarAmount(masterCurrencyDetail.getFinancialDocumentFiveDollarAmount());
1270 cmDoc.setFinancialDocumentTwoDollarAmount(masterCurrencyDetail.getFinancialDocumentTwoDollarAmount());
1271 cmDoc.setFinancialDocumentOneDollarAmount(masterCurrencyDetail.getFinancialDocumentOneDollarAmount());
1272 cmDoc.setFinancialDocumentOtherDollarAmount(masterCurrencyDetail.getFinancialDocumentOtherDollarAmount());
1273
1274 cmDoc.setFinancialDocumentHundredCentAmount(masterCoinDetail.getFinancialDocumentHundredCentAmount());
1275 cmDoc.setFinancialDocumentFiftyCentAmount(masterCoinDetail.getFinancialDocumentFiftyCentAmount());
1276 cmDoc.setFinancialDocumentTwentyFiveCentAmount(masterCoinDetail.getFinancialDocumentTwentyFiveCentAmount());
1277 cmDoc.setFinancialDocumentTenCentAmount(masterCoinDetail.getFinancialDocumentTenCentAmount());
1278 cmDoc.setFinancialDocumentFiveCentAmount(masterCoinDetail.getFinancialDocumentFiveCentAmount());
1279 cmDoc.setFinancialDocumentOneCentAmount(masterCoinDetail.getFinancialDocumentOneCentAmount());
1280 cmDoc.setFinancialDocumentOtherCentAmount(masterCoinDetail.getFinancialDocumentOtherCentAmount());
1281 }
1282
1283
1284
1285
1286
1287
1288
1289 public BusinessObjectService getBusinessObjectService() {
1290 return businessObjectService;
1291 }
1292
1293
1294
1295
1296
1297
1298 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
1299 this.businessObjectService = businessObjectService;
1300 }
1301
1302
1303
1304
1305
1306
1307 public CashDrawerService getCashDrawerService() {
1308 return cashDrawerService;
1309 }
1310
1311
1312
1313
1314
1315
1316 public void setCashDrawerService(CashDrawerService cashDrawerService) {
1317 this.cashDrawerService = cashDrawerService;
1318 }
1319
1320
1321
1322
1323
1324
1325 public DocumentService getDocumentService() {
1326 return documentService;
1327 }
1328
1329
1330
1331
1332
1333
1334 public void setDocumentService(DocumentService documentService) {
1335 this.documentService = documentService;
1336 }
1337
1338
1339
1340
1341
1342
1343 public DateTimeService getDateTimeService() {
1344 return dateTimeService;
1345 }
1346
1347
1348
1349
1350
1351
1352 public void setDateTimeService(DateTimeService dateTimeService) {
1353 this.dateTimeService = dateTimeService;
1354 }
1355
1356
1357
1358
1359
1360
1361 public CashManagementDao getCashManagementDao() {
1362 return cashManagementDao;
1363 }
1364
1365
1366
1367
1368
1369
1370 public void setCashManagementDao(CashManagementDao cashManagementDao) {
1371 this.cashManagementDao = cashManagementDao;
1372 }
1373
1374
1375
1376
1377
1378 public DataDictionaryService getDataDictionaryService() {
1379 return dataDictionaryService;
1380 }
1381
1382
1383
1384
1385
1386 public void setDataDictionaryService(DataDictionaryService dataDictionaryService) {
1387 this.dataDictionaryService = dataDictionaryService;
1388 }
1389
1390 }
1391