ERP 2.50:Developers Guide/Database Model/org.openbravo.model.common.invoice/C Invoice
C_Invoice
Contains all the invoices
- Name:Invoice
- Classname:Invoice
This table contains the following columns:
Name | Nullable | Data Type | Description |
C_Invoice_ID | N | VARCHAR2(32) | A document listing products, quantities and prices, payment terms, etc. |
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 |
IsSOTrx | N | CHAR(1) | An indication that a transfer of goods and money between business partners is occurring. |
DocumentNo | N | NVARCHAR2(30) | An often automatically generated identifier for all documents. |
DocStatus | N | VARCHAR2(60) | The Document Status indicates the status of a document at this time. |
DocAction | N | VARCHAR2(60) | A means of changing the transaction status of the document. |
Processing | Y | CHAR(1) | A request to process the respective document or task. |
Processed | N | CHAR(1) | A confirmation that the associated documents or requests are processed. |
Posted | N | VARCHAR2(60) | An accounting status button that indicates if the transaction has already been posted to the general ledger or not. |
C_DocType_ID | N | VARCHAR2(32) | A value defining what sequence and process setup are used to handle this document. |
C_DocTypeTarget_ID | N | VARCHAR2(32) | The specific document type which should be used for the document. |
C_Order_ID | Y | VARCHAR2(32) | A unique and often automatically generated identifier for a sales order. |
Description | Y | NVARCHAR2(255) | A space to write additional related information. |
IsPrinted | N | CHAR(1) | A reference stating whether or not the document has been printed at any time in the past. |
SalesRep_ID | Y | VARCHAR2(32) | The person in charge of a document. |
DateInvoiced | N | DATE | The time listed on the invoice. |
DatePrinted | Y | DATE | Date the document was printed. |
DateAcct | N | DATE | The date this transaction is recorded for in the general ledger. |
C_BPartner_ID | N | VARCHAR2(32) | Anyone who takes part in daily business operations by acting as a customer, employee, etc. |
C_BPartner_Location_ID | N | VARCHAR2(32) | The location of the selected business partner. |
POReference | Y | NVARCHAR2(20) | A reference or document order number as listed in business partner application. |
IsDiscountPrinted | N | CHAR(1) | An option to have any discount printed on the invoice. |
DateOrdered | Y | DATE | The time listed on the order. |
C_Currency_ID | N | VARCHAR2(32) | An accepted medium of monetary exchange that may vary across countries. |
PaymentRule | N | VARCHAR2(60) | The method used for payment of this transaction. |
C_PaymentTerm_ID | N | VARCHAR2(32) | The setup and timing defined to complete a specified payment. |
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. |
TotalLines | N | NUMBER | The final sum of all line totals made to a specified document or transaction (not including taxes). |
GrandTotal | N | NUMBER | The final monetary amount (including taxes) charge listed in a document. |
M_PriceList_ID | N | VARCHAR2(32) | A catalog of selected items with prices defined generally or for a specific partner. |
IsTaxIncluded | Y | CHAR(1) | Tax is included in the price |
C_Campaign_ID | Y | VARCHAR2(32) | An advertising effort aimed at increasing sales. |
C_Project_ID | Y | VARCHAR2(32) | Identifier of a project defined within the Project & Service Management module. |
C_Activity_ID | Y | VARCHAR2(32) | A distinct activity defined and used in activity based management. |
CreateFrom | Y | CHAR(1) | An addition of statements from pre-existing documents. |
GenerateTo | Y | CHAR(1) | Generate To |
AD_User_ID | Y | VARCHAR2(32) | An acquaintance to reach for information related to the business partner. |
CopyFrom | Y | CHAR(1) | An addition of statements from pre-existing documents. |
IsSelfService | N | CHAR(1) | x not implemented |
AD_OrgTrx_ID | Y | VARCHAR2(32) | The organization which performs or initiates the transaction. |
User1_ID | Y | VARCHAR2(32) | A display of optional elements that are previously defined for this account combination. |
User2_ID | Y | VARCHAR2(32) | A display of optional elements that are previously defined for this account combination. |
Withholdingamount | Y | NUMBER | Withholding amount |
Taxdate | Y | DATE | Tax Date |
C_Withholding_ID | Y | VARCHAR2(32) | Withholding |
Ispaid | N | CHAR(1) | A confirmation stating whether the request has been closed through a monetary transaction. |
Totalpaid | N | NUMBER | Total amount paid. |
OutstandingAmt | N | NUMBER | Outstanding Amount |
DaysTillDue | N | NUMBER | Days till due date |
DueAmt | N | NUMBER | Due Amount |
LastCalculatedOnDate | Y | DATE | Last Calculated On Date for payment monitor |
UpdatePaymentMonitor | N | CHAR(1) | Update payment monitor information |
FIN_Paymentmethod_ID | Y | VARCHAR2(32) | It is the method by which payment is expected to be made or received. |
FIN_Payment_Priority_ID | Y | VARCHAR2(32) | Sets the priority of the payment plans generated when processing the invoice or order. |
Other Info
Check constraints
These are the check constraints for this table:
- C_INVOICE_CREATEFROM_CHECK: CREATEFROM IN ('Y', 'N')
- C_INVOICE_GENERATETO_CHECK: GENERATETO IN ('Y', 'N')
- C_INVOICE_ISACTIVE_CHECK: ISACTIVE IN ('Y', 'N')
- C_INVOICE_ISDISCOUNTPRINTE_CHK: ISDISCOUNTPRINTED IN ('Y', 'N')
- C_INVOICE_ISPRINTED_CHECK: ISPRINTED IN ('Y', 'N')
- C_INVOICE_ISSOTRX_CHECK: ISSOTRX IN ('Y', 'N')
- C_INVOICE_ISTAXINCLUDED_CHECK: ISTAXINCLUDED IN ('Y', 'N')
- C_INVOICE_PROCESSED_CHECK: PROCESSED 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_INVOICE_BPARTNER
- C_INVOICE_CLIENT_ORG_DATE_DOC
- C_INVOICE_DOCNO
- C_INVOICE_UPDATED
Unique
- C_INVOICE_KEY
Columns
Invoice
The Invoice ID uniquely identifies an Invoice Document.
- Physical column name: C_Invoice_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 (without *): Organization selection without *. With the following code:
AD_ORG_ID <> '0'
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 Transaction
The Sales Transaction checkbox indicates if this item is a Sales Transaction.
- Physical column name: IsSOTrx
- Property Name: salesTransaction
- Reference: YesNo
- Default value: @IsSOTrx@
Document No.
The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field will be empty when creating a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Document Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table inside the database (e.g. C_Order).
- Physical column name: DocumentNo
- Property Name: documentNo
- Reference: String
- This column is part of the table's identifier
Document Status
The Document Status indicates the status of a document at this time. To change the status of a document, use one of the buttons usually located at the bottom of the document window.
- Physical column name: DocStatus
- Property Name: documentStatus
- Reference: List
- Default value: DR
List values: All_Document Status
The allowed values for this list are:
- DR (Draft)
- CO (Completed)
- AP (Accepted)
- CH (Modified)
- NA (Not Accepted)
- TE (Transfer Error)
- PR (Printed)
- TR (Transferred)
- VO (Voided)
- IN (Inactive)
- PE (Accounting Error)
- PO (Posted)
- RE (Re-Opened)
- CL (Closed)
- ?? (Unknown)
- XX (Procesando)
- IP (Under Way)
- WP (Not Paid)
Document Action
You find the current status in the Document Status field. The options are listed in a popup
- Physical column name: DocAction
- Property Name: documentAction
- Reference: Button
- Default value: CO
Process Now
When this field is set as 'Y' a process is being performed on this record.
- Physical column name: Processing
- Property Name: processNow
- Reference: Button
Processed
The Processed checkbox indicates that a document has been processed.
- Physical column name: Processed
- Property Name: processed
- Reference: YesNo
Posted
An accounting status button that indicates if the transaction has already been posted to the general ledger or not. When doing the accounting manually this button can be used to post or unpost the transaction from the general ledger by hand.
- Physical column name: Posted
- Property Name: posted
- Reference: Button
- Default value: N
Document Type
- Physical column name: C_DocType_ID
- Property Name: documentType
- Reference: TableDir
- Default value: 0
Foreign key column to C_DocType table, (column: C_DocType_ID)
Transaction Document
- Physical column name: C_DocTypeTarget_ID
- Property Name: transactionDocument
- Reference: Table
Foreign key column to C_DocType table, (column: C_DocType_ID)
Reference Table C_DocType_Trx With the following where clause:
C_DocType.AD_Client_ID=@#AD_Client_ID@ AND (@AD_Org_ID@ <> '0' OR COALESCE(@AD_Org_ID@,'-1')='-1')
Validation Rule C_DocType AR/AP Invoices and Credit Memos: Document Type AR/AP Invoice and Credit Memos. With the following code:
C_DocType.DocBaseType IN ('ARI', 'API','ARC','APC') AND C_DocType.IsSOTrx='@IsSOTrx@' AND (AD_ISORGINCLUDED(@AD_Org_ID@,C_DocType.AD_Org_ID, @#AD_Client_ID@) <> '-1' OR COALESCE(@AD_Org_ID@,'-1')='-1')
Callout: SL_Invoice_DocType
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Invoice_DocType Java class.
Sales Order
- Physical column name: C_Order_ID
- Property Name: salesOrder
- Reference: Search
Foreign key column to C_Order table, (column: C_Order_ID)
Description
A description is limited to 255 characters.
- Physical column name: Description
- Property Name: description
- Reference: Text
The Printed checkbox indicates if this document or line will included when printing.
- Physical column name: IsPrinted
- Property Name: print
- Reference: YesNo
Sales Representative
- Physical column name: SalesRep_ID
- Property Name: salesRepresentative
- Reference: Table
Foreign key column to AD_User table, (column: AD_User_ID)
Reference Table AD_User SalesRep With the following where clause:
EXISTS (SELECT * FROM C_BPartner bp WHERE AD_User.C_BPartner_ID=bp.C_BPartner_ID AND bp.IsSalesRep='Y')
Invoice Date
The Date Invoice indicates the date printed on the invoice.
- Physical column name: DateInvoiced
- Property Name: invoiceDate
- Reference: Date
- Default value: @#Date@
- This column is part of the table's identifier
Date printed
Indicates the Date that a document was printed.
- Physical column name: DatePrinted
- Property Name: datePrinted
- Reference: Date
Accounting Date
The date this transaction is recorded on in the general ledger. This date also indicates which accounting period within the fiscal year this transaction will be part of.
- Physical column name: DateAcct
- Property Name: accountingDate
- Reference: Date
- Default value: @#Date@
Business Partner
- Physical column name: C_BPartner_ID
- Property Name: businessPartner
- Reference: Search
- This column is a child for a buisiness object (is Parent)
Foreign key column to C_BPartner table, (column: C_BPartner_ID)
Callout: SE_Invoice_BPartner
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SE_Invoice_BPartner Java class.
Partner Address
- Physical column name: C_BPartner_Location_ID
- Property Name: partnerAddress
- Reference: TableDir
Foreign key column to C_BPartner_Location table, (column: C_BPartner_Location_ID)
Validation Rule C_BPartner Location - Bill To: null. With the following code:
C_BPartner_Location.C_BPartner_ID=@C_BPartner_ID@ AND C_BPartner_Location.IsBillTo='Y' AND C_BPartner_Location.IsActive='Y'
Order Reference
This can be used to input a reference for this specific transaction. For example, a Purchase Order number can be input on a Sales Order for easier reference.
- Physical column name: POReference
- Property Name: orderReference
- Reference: String
Print Discount
The Discount Printed Checkbox indicates if the discount will be printed on the document.
- Physical column name: IsDiscountPrinted
- Property Name: printDiscount
- Reference: YesNo
Order Date
Indicates the Date an item was ordered.
- Physical column name: DateOrdered
- Property Name: orderDate
- Reference: Date
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)
Form of Payment
Form of Payment indicates the method of payment used for this transaction (eg. cash, wire transfer, etc.)
- Physical column name: PaymentRule
- Property Name: formOfPayment
- Reference: List
- Default value: P
List values: All_Payment Rule
The allowed values for this list are:
- 1 (Wire Transfer): Wire Transfer
- 2 (Check): Check
- 3 (Promissory Note): Promissory Note
- 4 (Money Order)
- 5 (Bank Deposit)
- B (Cash): Cash payments that generate an automatic accounting line.
- C (Cash on Delivery): Cash on Delivery
- K (Credit Card)
- P (On Credit): Cash payments that do not generate an automatic accounting line. Its is not an automatic cash entry.
- R (Bank Remittance)
- T (Transfer (ACH))
- W (Withholding)
Payment Terms
- Physical column name: C_PaymentTerm_ID
- Property Name: paymentTerms
- Reference: TableDir
Foreign key column to C_PaymentTerm table, (column: C_PaymentTerm_ID)
Charge
- Physical column name: C_Charge_ID
- Property Name: charge
- Reference: Table
Foreign key column to C_Charge table, (column: C_Charge_ID)
Reference Table C_Charge With the following where clause:
C_Charge.AD_Client_ID IN (@#User_Client@)
Charge Amount
The Charge Amount indicates the amount for an additional charge.
- Physical column name: ChargeAmt
- Property Name: chargeAmount
- Reference: Amount
Summed Line Amount
The Total amount displays the total of all lines in document currency
- Physical column name: TotalLines
- Property Name: summedLineAmount
- Reference: Amount
Grand Total Amount
The Grand Total displays the total amount including Tax and Freight in document currency
- Physical column name: GrandTotal
- Property Name: grandTotalAmount
- Reference: Amount
- This column is part of the table's identifier
Price List
- Physical column name: M_PriceList_ID
- Property Name: priceList
- Reference: TableDir
Foreign key column to M_PriceList table, (column: M_PriceList_ID)
Callout: SL_Invoice_PriceList
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SL_Invoice_PriceList Java class.
Price includes Tax
The Tax Included checkbox indicates if the prices include tax. This is also known as the gross price.
- Physical column name: IsTaxIncluded
- Property Name: priceIncludesTax
- Reference: YesNo
Sales Campaign
- Physical column name: C_Campaign_ID
- Property Name: salesCampaign
- Reference: TableDir
Foreign key column to C_Campaign table, (column: C_Campaign_ID)
Project
- Physical column name: C_Project_ID
- Property Name: project
- Reference: Search
Foreign key column to C_Project table, (column: C_Project_ID)
Validation Rule C_Project based on status and bpartner: null. With the following code:
C_Project.projectstatus IN ('OP', 'OR') AND (C_Project.c_bpartner_id=@C_BPartner_ID@ OR '@IsSOTrx@'='N') OR C_Project.c_project_id = @c_project_id@
Callout: SE_Invoice_Project
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SE_Invoice_Project Java class.
Activity
- Physical column name: C_Activity_ID
- Property Name: activity
- Reference: TableDir
Foreign key column to C_Activity table, (column: C_Activity_ID)
Create Lines From
A process that allows the user to copy lines (products) from an existing document different from the one being copied into. For example, in case of entering a new Goods Shipment, the user can copy lines (products) from an existing Sales Order or Sales Invoice.
- Physical column name: CreateFrom
- Property Name: createLinesFrom
- Reference: Button
Generate To
A button that creates documents
- Physical column name: GenerateTo
- Property Name: generateTo
- Reference: Button
User/Contact
- Physical column name: AD_User_ID
- Property Name: userContact
- Reference: TableDir
Foreign key column to AD_User table, (column: AD_User_ID)
Validation Rule AD_User C_BPartner User/Contacts: null. With the following code:
AD_User.C_BPartner_ID=@C_BPartner_ID@
Copy from
Copy lines (products) from another document of the same type.
- Physical column name: CopyFrom
- Property Name: copyFrom
- Reference: Button
Self-Service
Self-Service allows users to enter data or update their data. The flag indicates, that this record was entered or created via Self-Service or that the user can change it via the Self-Service functionality.
- Physical column name: IsSelfService
- Property Name: selfService
- Reference: YesNo
Trx Organization
- Physical column name: AD_OrgTrx_ID
- Property Name: trxOrganization
- Reference: Table
Foreign key column to AD_Org table, (column: AD_Org_ID)
Reference Table AD_Org (Trx) With the following where clause:
AD_Org.IsSummary='N' AND AD_Org_ID <> '0'
1st Dimension
The user defined element displays the optional elements that have been defined for this account combination.
- Physical column name: User1_ID
- Property Name: stDimension
- Reference: String
2nd Dimension
The user defined element displays the optional elements that have been defined for this account combination.
- Physical column name: User2_ID
- Property Name: ndDimension
- Reference: String
Withholdingamount
- Physical column name: Withholdingamount
- Property Name: withholdingamount
- Reference: Amount
Tax Date
Tax Date
- Physical column name: Taxdate
- Property Name: taxDate
- Reference: Date
- Default value: @#Date@
Withholding
- Physical column name: C_Withholding_ID
- Property Name: withholding
- Reference: TableDir
Foreign key column to C_Withholding table, (column: C_Withholding_ID)
Validation Rule Business Partner Withholding: Show the Withholdings which belong to the Business Partner. With the following code:
EXISTS (SELECT 1 FROM C_BP_Withholding w , C_BPartner b WHERE w.C_BPartner_ID=b.C_BPartner_ID AND w.C_Withholding_ID=C_Withholding.C_Withholding_ID AND W.C_BPartner_ID=@C_BPartner_ID@ AND w.isactive='Y')
Payment Complete
The document is paid for.
- Physical column name: Ispaid
- Property Name: paymentComplete
- Reference: YesNo
- Default value: N
Total paid
Total amount paid.
- Physical column name: Totalpaid
- Property Name: totalPaid
- Reference: Amount
- Default value: 0
Outstanding Amount
Outstanding Amount. Amount pending to be paid
- Physical column name: OutstandingAmt
- Property Name: outstandingAmount
- Reference: Amount
- Default value: 0
Days till due
Number of days left for the next due date
- Physical column name: DaysTillDue
- Property Name: daysTillDue
- Reference: Integer
- Default value: 0
Due amount
Total amount due
- Physical column name: DueAmt
- Property Name: dueAmount
- Reference: Amount
- Default value: 0
Last Calculated On Date
Last Calculated On Date for payment monitor
- Physical column name: LastCalculatedOnDate
- Property Name: lastCalculatedOnDate
- Reference: Date
Update Payment Monitor
Update payment monitor information
- Physical column name: UpdatePaymentMonitor
- Property Name: updatePaymentMonitor
- Reference: Button
- Default value: N
Payment Method
- Physical column name: FIN_Paymentmethod_ID
- Property Name: paymentMethod
- Reference: TableDir
Foreign key column to FIN_Paymentmethod table, (column: Fin_Paymentmethod_ID)
Validation Rule FIN_PaymentMethodsWithAccount: Filters only the payment methods that belong to a financial account. With the following code:
EXISTS (SELECT 1 FROM FIN_FinAcc_PaymentMethod fapm WHERE FIN_PaymentMethod.FIN_PaymentMethod_ID=fapm.FIN_PaymentMethod_ID)
Callout: SE_Invoice_BPartner
This element is linked to a callout.
It is implemented by org.openbravo.erpCommon.ad_callouts.SE_Invoice_BPartner Java class.
FIN_Payment_Priority_ID
- Physical column name: FIN_Payment_Priority_ID
- Property Name: fINPaymentPriority
- Reference: TableDir
- Default value: @SQL=SELECT FIN_Payment_Priority_ID FROM FIN_Payment_Priority WHERE AD_ISORGINCLUDED( (CASE WHEN @#AD_Org_ID@='0' THEN (SELECT ad_org_id FROM ad_org WHERE name = ( SELECT min(o.name) FROM ad_org o join ad_orgtype ot on (o.ad_orgtype_id=ot.ad_orgtype_id) join ad_role_orgaccess ra on (o.ad_org_id=ra.ad_org_id) join ad_role r on (ra.ad_role_id = r.ad_role_id) WHERE ot.istransactionsallowed = 'Y' and r.ad_role_id=@AD_Role_ID@)) ELSE @#AD_Org_ID@ END), AD_Org_ID, @#AD_Client_ID@) <> -1 AND Isdefault = 'Y' ORDER BY Priority
Foreign key column to FIN_Payment_Priority table, (column: FIN_Payment_Priority_ID)
Related tables
Tables that link this table:
- DataImportBankStatement.Invoice
- DataImportInvoice.Invoice
- FIN_Payment_Schedule.Invoice
- FinancialMgmtDebtPayment.Invoice
- FinancialMgmtDebtPaymentCancelV.Invoice
- FinancialMgmtDebtPaymentGenerateV.Invoice
- InvoiceHeaderV.Invoice
- InvoiceLine.Invoice
- InvoiceLineTax.Invoice
- InvoiceLineTaxV.Invoice
- InvoiceLineV2.Invoice
- InvoiceTax.Invoice
- InvoiceV2.Invoice
- MaterialMgmtShipmentInOut.Invoice
- PricingVolumeDiscountInvoice.Invoice
- Request.Invoice
- RequestionAction.Invoice
- ReversedInvoices.Invoice
- ReversedInvoices.Reversed Invoice
- SalesCommissionRun.Invoice