Projects:Procurement Contract/Technical Specs
Contents |
Technical Specification
In this document are explained all the developments done to develop the Procurement Contracts module.
Dependencies
This module depends on the following modules:
- Contract Management Infrastructure
- Service Contract Management
- Service Contract Management Template
These modules have also been modified in order to properly support Procurement Contracts and to implement new frequencies.
Database objects
The contracts are stored in the C_Project table. It reuses most of the processes introduced by the dependant modules. However some new columns are added to the C_Project table.
- EM_OBPCNTR_PROCPROCESS
- Column needed for the button to process the header contract.
- EM_OBPCNTR_ISCHILD
- Flag defined as a list to differentiate header and lines (both are records of C_Project. A list is needed to ensure that the callout associated is launched automatically on new.
- EM_OBPCNTR_PRODUCT_ID
- Column used by contract lines to define the product used in invoicing.
- EM_OBPCNTR_PRICE
- Column used by contract lines to define the price used in invoicing.
- EM_OBPCNTR_QUANTITY
- Column used by contract lines to define the quantity used in invoicing.
Application Dictionary objects
Windows
Procurement Contract
Window where Procurement contracts are created. It is filtered by contract type, showing only purchase contract types.
Header tab
Based on C_Project table. Implements the Process Procurement Contract process that is hidden by default.
Lines tab
Based on C_Project table. Implements the processes included in the Service Contract Management module to process the contract, update the invoice plan and terminate the contract. It has an auxiliary input to set the EM_OBPCNTR_ISCHILD hidden field to Yes.
This tab uses 2 callouts to fill some fields.
- ContractChild (ContractChild.java)
- Fired by EM_OBPCNTR_ISCHILD column on new. It defaults some fields from the Header tab, search key (appending a -10 where 10 is increased on each line), business partner, location, price list,...
- ContractChildProduct (ContractChildProduct.java)
- Fireb by changed in EM_OBPCNTR_PRODUCT_ID column. Sets the price of the selected product in the corresponding field.
Procurement Contract Invoice Proposal
Unique Edit only tab based on C_InvoiceLine table. Shows all the existing invoice lines in Temporal status. User can only edit the Price and the Quantity. Implements the process to generate the invoices.
Event handlers
ProcurementContractHandler
It extends the ContractHandler of Contract Management Infrastructure module.
It overrides 3 methods:
checkMandatoryFields
Checks that Duration and Duration Unit fields are not null in both header and children contracts. Checks that Product, Quantity and PriceList are not null in children contract.
onUpdateEvent and onSaveEvent
Calls the updateInvoicePlanTemplate method when is a child procurement contract. This method creates a record on the InvoicePlanTemplate based on the information provided by the contract. This record is used to generate the Invoice Plan when the contract is processed using the processes provided by the Service Contract Management module.
Processes
ProcessProcurementContract
This process processes the Header contract. It calls the Service Contract Process for each child. It uses the doCommit parameter to avoid this process to commit each child contract process.
This process is hidden. By default only child contracts are processed and have status. This facilitates to add new lines to contracts.
ProcurementContractInvoiceProcess
It extends the StandardContractInvoiceProcess. It is used to generate the invoices in template status and to process them. It overrides 2 methods:
getInvoiceProposalTabId
Used to return the tab id of the Procurement Contract Invoice Proposal window.
generateInvoices
Reimplementation of the method that moves the invoices from temporal status to draft and process them.
Datasets
Invoice Process Configuration
Dataset to configure the Invoice Process with the java class implemented by the module.