@Transactional public class ElectronicInvoiceHelperServiceImpl extends InitiateDirectoryBase implements ElectronicInvoiceHelperService
Modifier and Type | Field and Description |
---|---|
protected BatchInputFileService |
batchInputFileService |
protected org.kuali.rice.core.api.datetime.DateTimeService |
dateTimeService |
protected ElectronicInvoiceInputFileType |
electronicInvoiceInputFileType |
protected ElectronicInvoicingDao |
electronicInvoicingDao |
protected String |
INVOICE_FILE_MIME_TYPE |
protected org.kuali.rice.core.api.config.property.ConfigurationService |
kualiConfigurationService |
protected org.kuali.rice.krad.service.MailService |
mailService |
protected ElectronicInvoiceMatchingService |
matchingService |
protected org.kuali.rice.coreservice.framework.parameter.ParameterService |
parameterService |
protected PaymentRequestService |
paymentRequestService |
protected PurchaseOrderService |
purchaseOrderService |
protected String |
UNKNOWN_DUNS_IDENTIFIER |
protected VendorService |
vendorService |
Constructor and Description |
---|
ElectronicInvoiceHelperServiceImpl() |
Modifier and Type | Method and Description |
---|---|
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) |
String |
getAcceptDirName() |
protected String |
getBaseDirName() |
protected String |
getErrorMessages(Map<String,ArrayList> 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() |
ElectronicInvoiceLoadSummary |
getOrCreateLoadSummary(ElectronicInvoiceLoad eInvoiceLoad,
String fileDunsNumber) |
String |
getRejectDirName() |
protected ElectronicInvoiceRejectReasonType |
getRejectReasonType(String rejectReasonTypeCode) |
List<String> |
getRequiredDirectoryNames()
Get the required list of directories name (full path)
|
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.core.api.util.type.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 |
setConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService) |
void |
setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService) |
void |
setElectronicInvoiceInputFileType(ElectronicInvoiceInputFileType electronicInvoiceInputFileType) |
void |
setElectronicInvoiceMatchingService(ElectronicInvoiceMatchingService matchingService) |
void |
setElectronicInvoicingDao(ElectronicInvoicingDao electronicInvoicingDao) |
protected void |
setItemDefaultDescription(PaymentRequestItem preqItem) |
void |
setMailService(org.kuali.rice.krad.service.MailService mailService) |
protected org.kuali.rice.core.api.mail.MailMessage |
setMessageToAddressesAndSubject(org.kuali.rice.core.api.mail.MailMessage message,
List<String> toAddressList) |
void |
setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService) |
void |
setPaymentRequestService(PaymentRequestService paymentRequestService) |
protected void |
setProcessingCampus(PaymentRequestDocument preqDoc,
String initiatorCampusCode)
This method check OVERRIDE_PROCESSING_CAMPUS parameter to set processing campus code.
|
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) |
prepareDirectories
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prepareDirectories
protected final String UNKNOWN_DUNS_IDENTIFIER
protected final String INVOICE_FILE_MIME_TYPE
protected ElectronicInvoiceInputFileType electronicInvoiceInputFileType
protected org.kuali.rice.krad.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.core.api.config.property.ConfigurationService kualiConfigurationService
protected org.kuali.rice.core.api.datetime.DateTimeService dateTimeService
protected org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService
public ElectronicInvoiceHelperServiceImpl()
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 modifiedprotected 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)
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.core.api.mail.MailMessage setMessageToAddressesAndSubject(org.kuali.rice.core.api.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 setProcessingCampus(PaymentRequestDocument preqDoc, String initiatorCampusCode)
preqDoc
- initiatorCampusCode
- 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.core.api.util.type.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 void deleteDoneFile(File invoiceFile)
protected String getErrorMessages(Map<String,ArrayList> errorMap)
errorMap
- protected String getBaseDirName()
public String getRejectDirName()
public String getAcceptDirName()
protected File getInvoiceFile(String fileName)
protected ElectronicInvoiceLoadSummary saveElectronicInvoiceLoadSummary(ElectronicInvoiceLoadSummary eils)
public void setElectronicInvoiceInputFileType(ElectronicInvoiceInputFileType electronicInvoiceInputFileType)
public void setMailService(org.kuali.rice.krad.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 setConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService)
public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
public void setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService)
public List<String> getRequiredDirectoryNames()
InitiateDirectory
getRequiredDirectoryNames
in interface InitiateDirectory
getRequiredDirectoryNames
in class InitiateDirectoryBase
org.kuali.ole.sys.batch.service.impl.InitiateDirectoryImpl#getRequiredDirectoryNames()
Copyright © 2004-2014 The Kuali Foundation. All Rights Reserved.