ERP 2.50:Developers Guide/Database Model/org.openbravo.model.common.order/C OrderLine
C_OrderLine
The table defines the individual line items that comprise an Order
- Name:OrderLine
- Classname:OrderLine
This table contains the following columns:
Name | Nullable | Data Type | Description |
C_OrderLine_ID | N | VARCHAR2(32) | A unique and often automatically generated identifier for a sales order line. |
AD_Client_ID | N | VARCHAR2(32) | Client for this installation. |
AD_Org_ID | N | VARCHAR2(32) | Organizational entity within client |
IsActive | N | CHAR(1) | A flag indicating whether this record is available for use or de-activated. |
Created | N | DATE | The date that this record is completed. |
CreatedBy | N | VARCHAR2(32) | User who created this records |
Updated | N | DATE | x not implemented |
UpdatedBy | N | VARCHAR2(32) | User who updated this records |
C_Order_ID | N | VARCHAR2(32) | A unique and often automatically generated identifier for a sales order. |
Line | N | NUMBER(10, 0) | A line stating the position of this request in the document. |
C_BPartner_ID | Y | VARCHAR2(32) | Anyone who takes part in daily business operations by acting as a customer, employee, etc. |
C_BPartner_Location_ID | Y | VARCHAR2(32) | The location of the selected business partner. |
DateOrdered | N | DATE | The time listed on the order. |
DatePromised | Y | DATE | The date that a task, process, or action is to be completed or delivered by. |
DateDelivered | Y | DATE | Date when the product was delivered |
DateInvoiced | Y | DATE | The time listed on the invoice. |
Description | Y | NVARCHAR2(2000) | A space to write additional related information. |
M_Product_ID | Y | VARCHAR2(32) | An item produced by a process. |
M_Warehouse_ID | N | VARCHAR2(32) | The location where products arrive to or are sent from. |
DirectShip | N | CHAR(1) | Ship direct from Vendor to Customer |
C_UOM_ID | N | VARCHAR2(32) | A non monetary unit of measure. |
QtyOrdered | N | NUMBER | The number of an item involved in a transaction, given in standard units. It is used to determine price per unit. |
QtyReserved | N | NUMBER | Reserved Quantity |
QtyDelivered | N | NUMBER | Delivered Quantity |
QtyInvoiced | N | NUMBER | The total number of a product included in an invoice to a business partner. |
M_Shipper_ID | Y | VARCHAR2(32) | The name of the company making the shipment. |
C_Currency_ID | N | VARCHAR2(32) | An accepted medium of monetary exchange that may vary across countries. |
PriceList | N | NUMBER | The official price of a product in a specified currency. |
PriceActual | N | NUMBER | The price that will be paid for a specified item. |
PriceLimit | N | NUMBER | The lowest price a specified item may be sold for. |
LineNetAmt | N | NUMBER | The final amount of a specified line, based only on quantities and prices. |
Discount | Y | NUMBER | Discount in percent |
FreightAmt | N | NUMBER | The charge amount for a specified shipment. |
C_Charge_ID | Y | VARCHAR2(32) | A cost or expense incurred during business activity. |
ChargeAmt | Y | NUMBER | The amount of a cost or expense incurred during business activity. |
C_Tax_ID | N | VARCHAR2(32) | The percentage of money requested by the government for this specified product or transaction. |
S_ResourceAssignment_ID | Y | VARCHAR2(32) | x not implemented |
Ref_OrderLine_ID | Y | VARCHAR2(32) | Reference to corresponding Sales/Purchase Order |
M_AttributeSetInstance_ID | Y | VARCHAR2(32) | An attribute associated with a product as part of an attribute set. |
IsDescription | N | CHAR(1) | if true, the line is just description and no transaction |
QuantityOrder | Y | NUMBER | The number of a certain item involved in the transaction, shown in units which differ from the standard UOM. |
M_Product_Uom_Id | Y | VARCHAR2(32) | The unit of measure being used for the request. |
M_Offer_ID | Y | VARCHAR2(32) | The ability to raise or lower prices. |
PriceStd | N | NUMBER | The regular or normal price of a product in the respective price list. |
CANCELPRICEAD | Y | CHAR(1) | Used to activate or deactive the price adjustment for each line |
C_Order_Discount_ID | Y | VARCHAR2(32) | null |
Iseditlinenetamt | Y | CHAR(1) | A flag used to allow the end-user to edit Line Net Amount field. |
Taxbaseamt | Y | NUMBER | The total sum on which taxes are added. |
Other Info
Check constraints
These are the check constraints for this table:
- C_ORDERLINE_CHECK1: ((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))
- C_ORDERLINE_CHECK2: (LINENETAMT = 0) OR (C_TAX_ID IS NOT NULL)
- C_ORDERLINE_DIRECTSHIP_CHECK: DIRECTSHIP IN ('Y', 'N')
- C_ORDERLINE_ISACTIVE_CHECK: ISACTIVE IN ('Y', 'N')
Indexes
These are the indexes for this table (for each index there is a list of all the columns included within it):
Non Unique
- C_ORDERLINE_ORDER
- C_ORDERLINE_PRODUCT
Unique
- C_ORDERLINE_KEY
Columns
Sales Order Line
A unique identifier and a reference to a sales order line (product).
- Physical column name: C_OrderLine_ID
- Property Name: id
- Reference: ID
Client
- Physical column name: AD_Client_ID
- Property Name: client
- Reference: TableDir
- Default value: @AD_Client_ID@
Foreign key column to AD_Client table, (column: AD_Client_ID)
Organization
- Physical column name: AD_Org_ID
- Property Name: organization
- Reference: TableDir
- Default value: @AD_Org_ID@
Foreign key column to AD_Org table, (column: AD_Org_ID)
Validation Rule AD_Org show child organizations: It only shows the child organizations of the organization's header. With the following code:
AD_ISORGINCLUDED(ad_org.ad_org_id, @AD_ORG_ID@, ad_org.ad_client_id)<>-1 AND IsReady='Y'
Active
There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records:
(1) The system requires the record for auditing purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.
- Physical column name: IsActive
- Property Name: active
- Reference: YesNo
Creation Date
The Created field indicates the date that this record was created.
- Physical column name: Created
- Property Name: creationDate
- Reference: DateTime
Created By
- Physical column name: CreatedBy
- Property Name: createdBy
- Reference: Search
Foreign key column to AD_User table, (column: AD_User_ID)
Updated
The Updated field indicates the date that this record was updated.
- Physical column name: Updated
- Property Name: updated
- Reference: DateTime
Updated By
- Physical column name: UpdatedBy
- Property Name: updatedBy
- Reference: Search
Foreign key column to AD_User table, (column: AD_User_ID)
Sales Order
- Physical column name: C_Order_ID
- Property Name: salesOrder
- Reference: Search
- This column is part of the table's identifier
- This column is a child for a buisiness object (is Parent)
Foreign key column to C_Order table, (column: C_Order_ID)
Line No.
Indicates the unique line for a document. It will also control the display order of the lines within a document.
- Physical column name: Line
- Property Name: lineNo
- Reference: Integer
- Default value: @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_OrderLine WHERE C_Order_ID=@C_Order_ID@
- This column is part of the table's identifier
Business Partner
- Physical column name: C_BPartner_ID
- Property Name: businessPartner
- Reference: Search
- Default value: @SQL=SELECT C_BPartner_ID AS DefaultValue FROM C_Order WHERE C_Order_ID=@C_Order_ID@
Foreign key column to C_BPartner table, (column: C_BPartner_ID)
Partner Address
- Physical column name: C_BPartner_Location_ID
- Property Name: partnerAddress
- Reference: TableDir
- Default value: @C_BPartner_Location_ID@
Foreign key column to C_BPartner_Location table, (column: C_BPartner_Location_ID)
Validation Rule C_BPartner Location - Ship To: null. With the following code:
C_BPartner_Location.C_BPartner_ID=@C_BPartner_ID@ AND C_BPartner_Location.IsShipTo='Y' AND C_BPartner_Location.IsActive='Y'
Callout: SL_Order_Tax
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Tax Java class.
Order Date
Indicates the Date an item was ordered.
- Physical column name: DateOrdered
- Property Name: orderDate
- Reference: Date
- Default value: @DateOrdered@
Scheduled Delivery Date
Scheduled Delivery Date indicates the date, if any, that an order was promised by.
- Physical column name: DatePromised
- Property Name: scheduledDeliveryDate
- Reference: Date
- Default value: @DatePromised@
Date Delivered
Date when the product was delivered
- Physical column name: DateDelivered
- Property Name: dateDelivered
- Reference: Date
Invoice Date
The Date Invoice indicates the date printed on the invoice.
- Physical column name: DateInvoiced
- Property Name: invoiceDate
- Reference: Date
Description
A description is limited to 255 characters.
- Physical column name: Description
- Property Name: description
- Reference: Text
Product
- Physical column name: M_Product_ID
- Property Name: product
- Reference: Search
Foreign key column to M_Product table, (column: M_Product_ID)
Callout: SL_Order_Product
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Product Java class.
Warehouse
- Physical column name: M_Warehouse_ID
- Property Name: warehouse
- Reference: Table
- Default value: @M_Warehouse_ID@
Foreign key column to M_Warehouse table, (column: M_Warehouse_ID)
Reference Table M_Warehouse of Client With the following where clause:
M_Warehouse.AD_Client_ID=@#AD_Client_ID@ AND (select ad.isactive from ad_org ad where ad.ad_org_id = M_Warehouse.AD_Org_ID) = 'Y'
Direct shipment
Direct Shipment indicates if this line will ship directly from the vendor to the customer
- Physical column name: DirectShip
- Property Name: directShipment
- Reference: YesNo
UOM
- Physical column name: C_UOM_ID
- Property Name: uOM
- Reference: TableDir
Foreign key column to C_UOM table, (column: C_UOM_ID)
Ordered Quantity
The Ordered Quantity indicates the quantity of a product that was ordered.
- Physical column name: QtyOrdered
- Property Name: orderedQuantity
- Reference: Quantity
- Default value: 1
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Reserved Quantity
The Reserved Quantity indicates the quantity of a product that is currently reserved for this order.
- Physical column name: QtyReserved
- Property Name: reservedQuantity
- Reference: Quantity
Delivered Quantity
The Delivered Quantity indicates the quantity of a product that has already been delivered.
- Physical column name: QtyDelivered
- Property Name: deliveredQuantity
- Reference: Quantity
Invoiced Quantity
The Invoiced Quantity indicates the quantity of a product that have been invoiced.
- Physical column name: QtyInvoiced
- Property Name: invoicedQuantity
- Reference: Quantity
Shipping Company
- Physical column name: M_Shipper_ID
- Property Name: shippingCompany
- Reference: TableDir
- Default value: @M_Shipper_ID@
Foreign key column to M_Shipper table, (column: M_Shipper_ID)
Currency
- Physical column name: C_Currency_ID
- Property Name: currency
- Reference: TableDir
- Default value: @C_Currency_ID@
Foreign key column to C_Currency table, (column: C_Currency_ID)
List Price
The List Price is the official price stated by the selected pricelist and the currency of the document.
- Physical column name: PriceList
- Property Name: listPrice
- Reference: Price
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Unit Price
The actual price indicates the price for a product in source currency.
- Physical column name: PriceActual
- Property Name: unitPrice
- Reference: Price
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Price Limit
The Price Limit indicates the lowest price for a product stated in the Price List Currency.
- Physical column name: PriceLimit
- Property Name: priceLimit
- Reference: Price
Line Net Amount
Indicates the line net amount based on the quantity and the actual price. Any additional charges or freight are not included.
- Physical column name: LineNetAmt
- Property Name: lineNetAmount
- Reference: Amount
- This column is part of the table's identifier
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Discount
The Discount indicates the discount applied as a percentage of the List Price.
- Physical column name: Discount
- Property Name: discount
- Reference: Number
- Default value: 0
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Freight Amount
The Freight Amount indicates the amount charged for Freight in the document currency.
- Physical column name: FreightAmt
- Property Name: freightAmount
- Reference: Amount
Charge
- Physical column name: C_Charge_ID
- Property Name: charge
- Reference: TableDir
Foreign key column to C_Charge table, (column: C_Charge_ID)
Callout: SL_Order_Charge_Tax
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Charge_Tax Java class.
Charge Amount
The Charge Amount indicates the amount for an additional charge.
- Physical column name: ChargeAmt
- Property Name: chargeAmount
- Reference: Amount
- Default value: 0
Tax
- Physical column name: C_Tax_ID
- Property Name: tax
- Reference: Table
Foreign key column to C_Tax table, (column: C_Tax_ID)
Reference Table C_Tax Parent is NULL With the following where clause:
C_Tax.Parent_Tax_ID IS NULL
Validation Rule C_Tax IsSOTrx: Validate tax depending on is Sales or Purchase transaction. With the following code:
(C_TAX.SOPOTYPE =(CASE WHEN @IsSOTrx@ = 'Y' THEN 'S' ELSE 'P' END) OR C_TAX.SOPOTYPE = 'B') AND C_TAX.AD_CLIENT_ID=@AD_CLIENT_ID@ AND C_TAX.C_TAX_ID=(CASE WHEN @IsSOTrx@ = 'Y' AND EXISTS(SELECT 1 FROM AD_ORGINFO WHERE ISTAXUNDEDUCTABLE='Y' AND AD_ORG_ID=@AD_ORG_ID@) THEN (SELECT C_TAX_ID FROM AD_ORGINFO WHERE ISTAXUNDEDUCTABLE='Y' AND AD_ORG_ID=@AD_ORG_ID@) ELSE C_TAX.C_TAX_ID END)
Resource Assignment
The ID identifies a unique record
- Physical column name: S_ResourceAssignment_ID
- Property Name: resourceAssignment
- Reference: Assignment
SO/PO Reference
- Physical column name: Ref_OrderLine_ID
- Property Name: sOPOReference
- Reference: Search
Foreign key column to Ref_OrderLine table, (column: null)
Attribute Set Value
- Physical column name: M_AttributeSetInstance_ID
- Property Name: attributeSetValue
- Reference: PAttribute
Foreign key column to M_AttributeSetInstance table, (column: M_AttributeSetInstance_ID)
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
Description Only
If a line is Description Only, e.g. Product Inventory is not corrected. No accounting transactions are created and the amount or totals are not included in the document. This for including descriptional detail lines, e.g. for an Work Order.
- Physical column name: IsDescription
- Property Name: descriptionOnly
- Reference: YesNo
- Default value: N
Order Quantity
Product quantity in the order uom.
- Physical column name: QuantityOrder
- Property Name: orderQuantity
- Reference: Quantity
Callout: SL_Order_Conversion
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Conversion Java class.
Order UOM
- Physical column name: M_Product_Uom_Id
- Property Name: orderUOM
- Reference: Table
Foreign key column to M_Product_UOM table, (column: M_Product_Uom_Id)
Reference Table M_Product_UOM With the following where clause:
M_Product_UOM.M_Product_ID = @M_Product_ID@
Callout: SL_Order_Conversion
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Conversion Java class.
Price Adjustment
- Physical column name: M_Offer_ID
- Property Name: priceAdjustment
- Reference: TableDir
Foreign key column to M_Offer table, (column: M_Offer_ID)
Standard Price
The Standard Price indicates the standard or normal price for a product on this price list
- Physical column name: PriceStd
- Property Name: standardPrice
- Reference: Price
- Default value: 0
Cancel Price Adjustment
If the user wants not to apply price adjustment to a specific line should use this check to achieve it
- Physical column name: CANCELPRICEAD
- Property Name: cancelPriceAdjustment
- Reference: YesNo
- Default value: N
Callout: SL_Order_Amt
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Order_Amt Java class.
C_Order_Discount_ID
- Physical column name: C_Order_Discount_ID
- Property Name: orderDiscount
- Reference: TableDir
Foreign key column to C_Order_Discount table, (column: C_Order_Discount_ID)
Edit Line Amount
A flag used to allow the end-user to edit Line Net Amount field.
- Physical column name: Iseditlinenetamt
- Property Name: editLineAmount
- Reference: YesNo
- Default value: N
Alternate Taxable Amount
- Physical column name: Taxbaseamt
- Property Name: taxableAmount
- Reference: Amount
Related tables
Tables that link this table:
- DataImportOrder.Sales Order Line
- InvoiceLine.Sales Order Line
- MRPProductionRunLine.Sales Order Line
- MRPPurchasingRunLine.Sales Order Line
- MaterialMgmtShipmentInOutLine.Sales Order Line
- OrderOpen.Sales Order Line
- ProcurementPOInvoiceMatch.Sales Order Line
- ProcurementRequisitionPOMatch.Sales Order Line
- SalesCommissionDetail.Sales Order Line
- TimeAndExpenseSheetLine.Sales Order Line
- TimeAndExpenseSheetLineV.Sales Order Line