|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.module.purap.service.impl.ElectronicInvoiceHelperServiceImpl
@Transactional public class ElectronicInvoiceHelperServiceImpl
This is a helper service to parse electronic invoice file, match it with a PO and create PREQs based on the eInvoice. Also, it provides helper methods to the reject document to match it with a PO and create PREQ.
Field Summary | |
---|---|
protected BatchInputFileService |
batchInputFileService
|
protected org.kuali.rice.kns.service.DateTimeService |
dateTimeService
|
protected ElectronicInvoiceInputFileType |
electronicInvoiceInputFileType
|
protected ElectronicInvoicingDao |
electronicInvoicingDao
|
protected String |
INVOICE_FILE_MIME_TYPE
|
protected org.kuali.rice.kns.service.KualiConfigurationService |
kualiConfigurationService
|
protected org.kuali.rice.kns.service.MailService |
mailService
|
protected ElectronicInvoiceMatchingService |
matchingService
|
protected org.kuali.rice.kns.service.ParameterService |
parameterService
|
protected PaymentRequestService |
paymentRequestService
|
protected PurchaseOrderService |
purchaseOrderService
|
protected String |
UNKNOWN_DUNS_IDENTIFIER
|
protected VendorService |
vendorService
|
Constructor Summary | |
---|---|
ElectronicInvoiceHelperServiceImpl()
|
Method Summary | |
---|---|
protected void |
addMissingMappedItems(List<PurApItem> preqItems,
ElectronicInvoiceOrderHolder orderHolder)
Ensures that the mapped items, item type code, exist as a payment request item so they're process correctly within populateItemDetails |
protected byte[] |
addNamespaceDefinition(ElectronicInvoiceLoad eInvoiceLoad,
File invoiceFile)
|
protected void |
addRejectReasonsToNote(String rejectReasons,
ElectronicInvoiceRejectDocument eInvoiceRejectDocument)
|
protected void |
addShipToNotes(PaymentRequestDocument preqDoc,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
addToListIfExists(List itemTypeCodeList,
String invoiceItemTypeCode,
ElectronicInvoiceOrderHolder orderHolder)
Utility method to add a kuali item type code to a list from a invoice item type code |
protected void |
attachInvoiceXMLWithRejectDoc(ElectronicInvoiceRejectDocument eInvoiceRejectDocument,
File attachmentFile,
String noteText)
|
protected String |
checkDescriptionLengthAndStripIfNeeded(String description)
|
protected boolean |
checkForCompleteFailure(ElectronicInvoiceLoad electronicInvoiceLoad,
ElectronicInvoice electronicInvoice,
File invoiceFile)
|
protected List |
createInvoiceRequiresItemTypeCodeList(ElectronicInvoiceOrderHolder orderHolder)
Creates a list of item types the eInvoice requirs on the payment request due to valid amounts. |
protected PaymentRequestDocument |
createPaymentRequest(ElectronicInvoiceOrderHolder orderHolder)
|
boolean |
createPaymentRequest(ElectronicInvoiceRejectDocument rejectDocument)
|
ElectronicInvoiceRejectDocument |
createRejectDocument(ElectronicInvoice eInvoice,
ElectronicInvoiceOrder electronicInvoiceOrder,
ElectronicInvoiceLoad eInvoiceLoad)
|
protected void |
deleteDoneFile(File invoiceFile)
|
boolean |
doMatchingProcess(ElectronicInvoiceRejectDocument rejectDocument)
This method is responsible for the matching process for a reject document |
protected String |
generatePREQDocumentDescription(PurchaseOrderDocument poDocument)
|
protected String |
generateRejectDocumentDescription(ElectronicInvoice eInvoice,
ElectronicInvoiceOrder electronicInvoiceOrder)
|
protected String |
generateRejectDocumentDescription(ElectronicInvoiceRejectDocument rejectDoc)
|
protected String |
getAcceptDirName()
|
protected String |
getBaseDirName()
|
protected String |
getErrorMessages(Map<String,org.kuali.rice.kns.util.TypedArrayList> errorMap)
returns a list of all error messages as a string |
protected File |
getInvoiceFile(String fileName)
|
protected Map |
getItemTypeMappings(Integer vendorHeaderId,
Integer vendorDetailId)
|
protected Map<String,ItemType> |
getKualiItemTypes()
|
protected org.kuali.rice.kns.bo.PersistableBusinessObject |
getNoteParent(ElectronicInvoiceRejectDocument document,
org.kuali.rice.kns.bo.Note newNote)
|
ElectronicInvoiceLoadSummary |
getOrCreateLoadSummary(ElectronicInvoiceLoad eInvoiceLoad,
String fileDunsNumber)
|
protected String |
getRejectDirName()
|
protected ElectronicInvoiceRejectReasonType |
getRejectReasonType(String rejectReasonTypeCode)
|
protected String |
getVendorNumber(Integer vendorHeaderId,
Integer vendorDetailId)
|
protected boolean |
isItemValidForUpdation(String itemTypeCode,
String invoiceItemTypeCode,
ElectronicInvoiceOrderHolder orderHolder)
|
protected boolean |
isNullOrZero(BigDecimal value)
|
protected boolean |
isNullOrZero(org.kuali.rice.kns.util.KualiDecimal value)
|
ElectronicInvoice |
loadElectronicInvoice(byte[] xmlAsBytes)
|
ElectronicInvoiceLoad |
loadElectronicInvoices()
|
protected void |
logProcessElectronicInvoiceError(String msg)
|
protected boolean |
moveFile(File fileForMove,
String location)
|
protected void |
moveFileList(Map filesToMove)
|
protected void |
populateItemDetails(PaymentRequestDocument preqDocument,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processAboveTheLineItem(PaymentRequestItem purapItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processDepositItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processDiscountItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processDueItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected boolean |
processElectronicInvoice(ElectronicInvoiceLoad eInvoiceLoad,
File invoiceFile,
byte[] xmlAsBytes)
This method processes a single electronic invoice file |
protected void |
processInvoiceItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
Finds the mapped item type code to invoice item type code and applies the appropriate values to the correct payment request item. |
protected void |
processItemsForDiscount(PaymentRequestDocument preqDocument,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processShippingItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processSpecialHandlingItem(PaymentRequestItem purapItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
processTaxItem(PaymentRequestItem preqItem,
ElectronicInvoiceOrderHolder orderHolder)
|
protected void |
rejectElectronicInvoiceFile(ElectronicInvoiceLoad eInvoiceLoad,
String fileDunsNumber,
File filename,
String rejectReasonTypeCode)
|
protected void |
rejectElectronicInvoiceFile(ElectronicInvoiceLoad eInvoiceLoad,
String fileDunsNumber,
File invoiceFile,
String extraDescription,
String rejectReasonTypeCode)
|
protected void |
removeEmptyItems(List<PurApItem> preqItems)
Removes preq items from the list that have null or zero unit and extended price |
protected void |
routeRejectDocument(ElectronicInvoiceRejectDocument rejectDoc,
Map savedLoadSummariesMap)
|
protected ElectronicInvoiceLoadSummary |
saveElectronicInvoiceLoadSummary(ElectronicInvoiceLoadSummary eils)
|
protected StringBuffer |
saveLoadSummary(ElectronicInvoiceLoad eInvoiceLoad)
|
protected void |
sendSummary(StringBuffer message)
|
void |
setBatchInputFileService(BatchInputFileService batchInputFileService)
|
void |
setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
|
void |
setElectronicInvoiceInputFileType(ElectronicInvoiceInputFileType electronicInvoiceInputFileType)
|
void |
setElectronicInvoiceMatchingService(ElectronicInvoiceMatchingService matchingService)
|
void |
setElectronicInvoicingDao(ElectronicInvoicingDao electronicInvoicingDao)
|
protected void |
setItemDefaultDescription(PaymentRequestItem preqItem)
|
void |
setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
|
void |
setMailService(org.kuali.rice.kns.service.MailService mailService)
|
protected org.kuali.rice.kns.mail.MailMessage |
setMessageToAddressesAndSubject(org.kuali.rice.kns.mail.MailMessage message,
List<String> toAddressList)
|
void |
setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
|
void |
setPaymentRequestService(PaymentRequestService paymentRequestService)
|
void |
setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
|
protected void |
setVendorDetails(ElectronicInvoice eInvoice)
|
protected void |
setVendorDUNSNumber(ElectronicInvoice eInvoice)
|
void |
setVendorService(VendorService vendorService)
|
void |
validateInvoiceOrderValidForPREQCreation(ElectronicInvoiceOrderHolder orderHolder)
This validates an electronic invoice and makes sure it can be turned into a Payment Request |
protected void |
validateVendorDetails(ElectronicInvoiceRejectDocument rejectDocument)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String UNKNOWN_DUNS_IDENTIFIER
protected final String INVOICE_FILE_MIME_TYPE
protected ElectronicInvoiceInputFileType electronicInvoiceInputFileType
protected org.kuali.rice.kns.service.MailService mailService
protected ElectronicInvoiceMatchingService matchingService
protected ElectronicInvoicingDao electronicInvoicingDao
protected BatchInputFileService batchInputFileService
protected VendorService vendorService
protected PurchaseOrderService purchaseOrderService
protected PaymentRequestService paymentRequestService
protected org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService
protected org.kuali.rice.kns.service.DateTimeService dateTimeService
protected org.kuali.rice.kns.service.ParameterService parameterService
Constructor Detail |
---|
public ElectronicInvoiceHelperServiceImpl()
Method Detail |
---|
public ElectronicInvoiceLoad loadElectronicInvoices()
loadElectronicInvoices
in interface ElectronicInvoiceHelperService
protected void logProcessElectronicInvoiceError(String msg)
protected byte[] addNamespaceDefinition(ElectronicInvoiceLoad eInvoiceLoad, File invoiceFile)
protected boolean processElectronicInvoice(ElectronicInvoiceLoad eInvoiceLoad, File invoiceFile, byte[] xmlAsBytes)
eInvoiceLoad
- the load summary to be modified
protected void setVendorDUNSNumber(ElectronicInvoice eInvoice)
protected void setVendorDetails(ElectronicInvoice eInvoice)
protected void validateVendorDetails(ElectronicInvoiceRejectDocument rejectDocument)
protected Map getItemTypeMappings(Integer vendorHeaderId, Integer vendorDetailId)
protected String getVendorNumber(Integer vendorHeaderId, Integer vendorDetailId)
protected Map<String,ItemType> getKualiItemTypes()
protected boolean checkForCompleteFailure(ElectronicInvoiceLoad electronicInvoiceLoad, ElectronicInvoice electronicInvoice, File invoiceFile)
protected ElectronicInvoiceRejectReasonType getRejectReasonType(String rejectReasonTypeCode)
protected void rejectElectronicInvoiceFile(ElectronicInvoiceLoad eInvoiceLoad, String fileDunsNumber, File filename, String rejectReasonTypeCode)
protected void rejectElectronicInvoiceFile(ElectronicInvoiceLoad eInvoiceLoad, String fileDunsNumber, File invoiceFile, String extraDescription, String rejectReasonTypeCode)
protected void attachInvoiceXMLWithRejectDoc(ElectronicInvoiceRejectDocument eInvoiceRejectDocument, File attachmentFile, String noteText)
protected org.kuali.rice.kns.bo.PersistableBusinessObject getNoteParent(ElectronicInvoiceRejectDocument document, org.kuali.rice.kns.bo.Note newNote)
public ElectronicInvoiceRejectDocument createRejectDocument(ElectronicInvoice eInvoice, ElectronicInvoiceOrder electronicInvoiceOrder, ElectronicInvoiceLoad eInvoiceLoad)
protected void addRejectReasonsToNote(String rejectReasons, ElectronicInvoiceRejectDocument eInvoiceRejectDocument)
protected String generateRejectDocumentDescription(ElectronicInvoice eInvoice, ElectronicInvoiceOrder electronicInvoiceOrder)
protected String generateRejectDocumentDescription(ElectronicInvoiceRejectDocument rejectDoc)
protected String checkDescriptionLengthAndStripIfNeeded(String description)
public ElectronicInvoiceLoadSummary getOrCreateLoadSummary(ElectronicInvoiceLoad eInvoiceLoad, String fileDunsNumber)
public ElectronicInvoice loadElectronicInvoice(byte[] xmlAsBytes) throws CxmlParseException
CxmlParseException
protected StringBuffer saveLoadSummary(ElectronicInvoiceLoad eInvoiceLoad)
protected void routeRejectDocument(ElectronicInvoiceRejectDocument rejectDoc, Map savedLoadSummariesMap)
protected void sendSummary(StringBuffer message)
protected org.kuali.rice.kns.mail.MailMessage setMessageToAddressesAndSubject(org.kuali.rice.kns.mail.MailMessage message, List<String> toAddressList)
public boolean doMatchingProcess(ElectronicInvoiceRejectDocument rejectDocument)
doMatchingProcess
in interface ElectronicInvoiceHelperService
public boolean createPaymentRequest(ElectronicInvoiceRejectDocument rejectDocument)
createPaymentRequest
in interface ElectronicInvoiceHelperService
protected PaymentRequestDocument createPaymentRequest(ElectronicInvoiceOrderHolder orderHolder)
protected void addShipToNotes(PaymentRequestDocument preqDoc, ElectronicInvoiceOrderHolder orderHolder)
protected void processItemsForDiscount(PaymentRequestDocument preqDocument, ElectronicInvoiceOrderHolder orderHolder)
protected void populateItemDetails(PaymentRequestDocument preqDocument, ElectronicInvoiceOrderHolder orderHolder)
protected void removeEmptyItems(List<PurApItem> preqItems)
preqItems
- protected void addMissingMappedItems(List<PurApItem> preqItems, ElectronicInvoiceOrderHolder orderHolder)
preqItems
- orderHolder
- protected List createInvoiceRequiresItemTypeCodeList(ElectronicInvoiceOrderHolder orderHolder)
protected void addToListIfExists(List itemTypeCodeList, String invoiceItemTypeCode, ElectronicInvoiceOrderHolder orderHolder)
itemTypeCodeList
- invoiceItemTypeCode
- orderHolder
- protected void processInvoiceItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
preqItem
- orderHolder
- protected void processAboveTheLineItem(PaymentRequestItem purapItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processSpecialHandlingItem(PaymentRequestItem purapItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processTaxItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processShippingItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processDiscountItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processDepositItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
protected void processDueItem(PaymentRequestItem preqItem, ElectronicInvoiceOrderHolder orderHolder)
protected boolean isNullOrZero(BigDecimal value)
protected boolean isNullOrZero(org.kuali.rice.kns.util.KualiDecimal value)
protected void setItemDefaultDescription(PaymentRequestItem preqItem)
protected boolean isItemValidForUpdation(String itemTypeCode, String invoiceItemTypeCode, ElectronicInvoiceOrderHolder orderHolder)
protected String generatePREQDocumentDescription(PurchaseOrderDocument poDocument)
public void validateInvoiceOrderValidForPREQCreation(ElectronicInvoiceOrderHolder orderHolder)
protected void moveFileList(Map filesToMove)
protected boolean moveFile(File fileForMove, String location)
protected void deleteDoneFile(File invoiceFile)
protected String getErrorMessages(Map<String,org.kuali.rice.kns.util.TypedArrayList> errorMap)
errorMap
-
protected String getBaseDirName()
protected String getRejectDirName()
protected String getAcceptDirName()
protected File getInvoiceFile(String fileName)
protected ElectronicInvoiceLoadSummary saveElectronicInvoiceLoadSummary(ElectronicInvoiceLoadSummary eils)
public void setElectronicInvoiceInputFileType(ElectronicInvoiceInputFileType electronicInvoiceInputFileType)
public void setMailService(org.kuali.rice.kns.service.MailService mailService)
public void setElectronicInvoicingDao(ElectronicInvoicingDao electronicInvoicingDao)
public void setBatchInputFileService(BatchInputFileService batchInputFileService)
public void setElectronicInvoiceMatchingService(ElectronicInvoiceMatchingService matchingService)
public void setVendorService(VendorService vendorService)
public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
public void setPaymentRequestService(PaymentRequestService paymentRequestService)
public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |