Class ConvertQuotationIntoOrder
- java.lang.Object
-
- org.openbravo.service.db.DalBaseProcess
-
- org.openbravo.erpCommon.ad_process.ConvertQuotationIntoOrder
-
- All Implemented Interfaces:
Process
public class ConvertQuotationIntoOrder extends DalBaseProcess
-
-
Field Summary
-
Fields inherited from interface org.openbravo.scheduling.Process
COMPLETE, ERROR, EXECUTION_ID, KILLED, MISFIRED, PREVENT_CONCURRENT_EXECUTIONS, PROCESS_ID, PROCESS_NAME, PROCESSING, SCHEDULED, SUCCESS, SYSTEM_RESTART, UNSCHEDULED
-
-
Constructor Summary
Constructors Constructor Description ConvertQuotationIntoOrder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Order
convertQuotationIntoSalesOrder(boolean recalculatePrices, String quotationId)
Converts a Quotation Into a Sales Order based on the given ID 1.void
doExecute(ProcessBundle bundle)
-
Methods inherited from class org.openbravo.service.db.DalBaseProcess
execute, isDoCommit, setDoCommit
-
-
-
-
Method Detail
-
doExecute
public void doExecute(ProcessBundle bundle) throws Exception
- Specified by:
doExecute
in classDalBaseProcess
- Throws:
Exception
-
convertQuotationIntoSalesOrder
public Order convertQuotationIntoSalesOrder(boolean recalculatePrices, String quotationId)
Converts a Quotation Into a Sales Order based on the given ID- 1. Creates a Sales Order in Draft Status based on a clone of the Quotation
- 2. Sets the proper Document Type to the new Sales Order
- 3. Sets the proper values to the Sales Order header
- 4. For each line that is not a discount it creates a clone into the Sales Order Document
- 5. If the parameter recalculatePrices is true, it recalculates the prices
- 6. Recalculates the discounts for each line
- 7. Calls C_Order_Post and updates the status of the Quotation to Already Converted to Order
- Parameters:
recalculatePrices
- If true, the prices of the new Sales Order line will be recalculated. If false, it will be the same prices as the QuotationquotationId
- The Id of the Quotation- Returns:
- An OBError message with the result message
-
-