跟发票相关的表

本文详细介绍了企业财务中各类发票的定义与用途,包括标准发票、贷项通知单、借项通知单等,并阐述了自动产生的发票类型及其系统处理流程。此外还概述了主要发票信息表的结构和字段。

Invoice Types:
-- Standard: A trade invoice you receive from a supplier.
-- Credit Memo(贷项通知单): A negative amount invoice(负数发票) you receive from a supplier representing credit
for goods or services purchased.由供应商创建并发送给您以通知有关贷项信息的负金额发票。贷项通知单就是退货了供应商开了红字发票来
-- Debit Memo(借项通知单): A negative amount invoice (负数发票)you sent to notify a supplier of a credit you
recorded for goods or services purchased.由您创建并发送给供应商以通知供应商有关贷项信息的负金额发票。借项通知单就是退货了自己做的红字发票
注意有两个地方:
AR
Credit Memo
贷项通知单,减应收,冲原始发票
Debit Memo
借项通知单,独立的发票,加应收
AP
Credit Memo
贷项通知单,指供应商开给我们的表示应付减少的通知,负数,冲原始发票,可用0支付结清
Debit Memo
借项通知单,指我们自己开出的表示应付减少的通知,同样是负数,冲原始发票,可用0支付结清
-- Interest(利息): An invoice to pay interest for overdue(延迟) invoices if you use automatic interest
calculation and pay an overdue invoice in payment batch or with Quick payment.
-- PO Default: A trade invoice you automatically match to a specified purchase order (PO)
and then manually match to the individual shipments on the purchase order. After
completing the match, this invoice becomes a Standard invoice type.
-- QuickMatch: A trade invoice automatically matched to all specified PO shipments.
-- Mixed: A standard or credit/debit memo invoice for which you can enter both positive
and negative amounts and perform both positive and negative matching.
-- Prepayment: An advance payment you make to a supplier or employee.
-- Withholding Tax(扣缴税款): An invoice automatically system-generated by the system to pay a tax
authority amounts withheld from supplier invoices.
-- Expense Report: An invoice you enter to record business-related employee expenses.

Automatically Generated Invoices:
-- Payment on Receipt: Through this Oracle Purchasing feature, the system creates an
invoice based on receipts entered in Oracle Purchasing.
-- Interest: Payables automatically creates invoices to pay interest for overdue invoices if
you enable automatic interest calculation for a supplier, and when you pay an overdue
invoice for the supplier in a payment batch or with a Quick payment.
-- Withholding Tax: Payables automatically generates this invoice type to pay a tax
authority for the amounts withheld from a reportable supplier.
Invoice Tables
The major tables used for supplier invoice information are as follows:
-- AP_INVOICES_ALL
-- AP_INVOICE_DISTRIBUTIONS_ALL
-- AP_PAYMENT_SCHEDULES_ALL
-- AP_HOLDS_ALL
-- AP_CHRG_ALLOCATIONS_ALL
---------------------------------------------------------------------------------
ap_invoices_all
--this table contains records for supplier invoices and has one row for each invoice.
--to pass invoice validation,the invoice_amount in the ap_invoices_all table must
--equal the sum of amount columns in the AP_DISTRIBUTIONS_ALL TABLE.
(N) Invoices > Entry > Invoices
Major Columns
-- INVOICE_ID (PK)
-- VENDOR_ID
-- VENDOR_SITE_ID
-- INVOICE_NUM
-- INVOICE_DATE
-- INVOICE_AMOUNT
-- AMOUNT_PAID
-- SET_OF_BOOKS_ID
-- INVOICE_CURRENCY_CODE
-- PAYMENT_CURRENCY_CODE
-- INVOICE_TYPE_LOOKUP_CODE
-- PAYMENT_STATUS_FLAG [Y/P/N]
-- PO_HEADER_ID
-- ORG_ID:

Foreign Keys
Primary Key Table                             Primary Key Column                   Foreign Key Column
AP_AWT_GROUPS                                    GROUP_ID                             AWT_GROUP_ID
AP_BATCHES_ALL                                   BATCH_ID                               BATCH_ID
AP_DOC_SEQUENCE                              DOC_SEQUENCE_VALUE                     DOC_SEQUENCE_VALUE
AUDIT                                         DOC_SEQUENCE_ID                        DOC_SEQUENCE_ID
AP_RECURRING_PAYMNETS_ALL                   RECURRING_PAYMENT_ID                  RECURRING_PAYMENT_ID
AP_TERMS_TL                                     TERMS_ID                                TERMS_ID
FND_CURRENCIES                               CURRENCY_CODE                        INVOICE_CURRENCY_CODE
FND_CURRENCIES                               CURRENCY_CODE                         PAYMENT_CURRENCY_CODE
FND_DOCUMENT_SEQUENCES                     DOCUMENT_SEQUENCE_ID                      DOCUMENT_SEQUENCE_ID
FND_DOC_SEQUENCE_CATEGORIES                      CODE                                DOC_CATEGORY_CODE
GL_CODE_COMBINATIONS                       CODE_COMBINATION_ID                     ACCTS_AY_CODE_COMBINATION_ID
GL_CODE_COMBINATIONS                       CODE_COMBINATION_ID                       PA_DEFAULT_DIST_CCID
GL_DAILY_CONVERSION_TYPES                    CONVERSION_TYPE                         EXCHANGE_RATE_TYPE
GL_DAILY_CONVERSION_TYPES                  CONVERSION_TYPE                         PAYMENT_CROSS_RATE_TYPE
GL_SET_OF_BOOKS                            SET_OF_BOOKS_ID                            SET_OF_BOOKS_ID
GL_USSGL_TRANSACTION_CODES                 USSGL_TRANSACTION_CODE                 USSGL_TRANSACTION_CODE
PA_EXPENDITURE_TYPES                        EXPENDITURE_TYPE                          EXPENDITURE_TYPE
PA_EXP_ORGS_IT                               ORGANIZATION_ID                    EXPENDITURE_ORGANIZATION_ID
PA_PROJECTS_ALL                               PROJECTS_ID                               PROJECTS_ID
PA_TASKS                                      TASK_ID                                   TASK_ID
PO_HEADERS_ALL                                PO_HEADER_ID                            PO_HEADER_ID
PO_VENDORS                                       VENDOR_ID                              VENDOR_ID
PO_VENDORS_SITES_ALL                          VENDOR_SITE_ID                            VENDOR_SITE_ID
-----------------------------------------------------------------------------------------------------------------------
ap_invoice_distributions_all:
--this table holds the distribution line information.
--each invoice distribution has a row,distribution data is copied from po_distributions_all
during match.
--relationships between records are stored in AP_CHRG_ALLOCATIONS_ALL(I.E. the relationship
determining to which item a tax line is allocated.)
(N) Invoices > Entry > Invoices (B) Distributions
Major Columns
-- INVOICE_ID (PK)
-- DISTRIBUTION_LINE_NUMBER (PK)
-- DIST_CODE_COMBINATION_ID (Expense account)
-- ACCOUNTING_DATE
-- ASSETS_ADDITION_FLAG *
-- ASSETS_TRACKING_FLAG *
-- ORG_ID
-- AMOUNT (Transaction currency)
-- BASE_AMOUNT (Functional currency)
-- PO_DISTRIBUTION_ID
If these flags are set to Y, the invoice information can be processed by the Mass Additions
Create process to create records in Oracle Assets.
Foreign Keys
Primary Key Table                   Primary Key Column              Foreign Key Column
AP_ACCOUNTING_EVENT_ALL              ACCOUNTING_EVENT_ID            ACCOUNTING_EVENT_ID
AP_AWT_GROUPS                            GROUP_ID                      AWT_GROUP_ID
AP_AWT_GROUPS                            GROUP_ID                   AWT_ORIGIN_GROUP_ID
AP_AWT_TAX_RATES_ALL                    TAX_RATE_ID                   AWT_TAX_RATE_ID
AP_BATCHES_ALL                            BATCH_ID                       BATCH_ID
AP_INCOME_TAX_REGION                  REGION_SHORT_NAME               INCOME_TAX_REGION
AP_INVOICES_ALL                          INVOICES_ID                    INVOICES_ID
AP_INVOICES_ALL                          INVOICES_ID                PARENT_INVOICES_ID
AP_INVOICES_ALL                          INVOICES_ID                  AWT_INVOICES_ID
AP_INVOICES_DISTRIBUTIONS_ALL        INVOICE_DISTRIBUTIONS_ID       PREPAY_DISTRIBUTIONS_ID
AP_INVOICE_PAYMENTS_ALL                 INVOICE_PAYMENT_ID          AWT_INVOICE_PAYMENT_ID
AP_TAX_CODES_ALL                           TAX_ID                        TAX_CODE_ID
FND_CURRENCIES                          CURRENCY_CODE               RECEIPT_CURRENCY_CODE
GL_BC_PACKETS                            PACKET_ID                         PACKET_ID
GL_CODE_COMBINATIONS                  CODE_COMBINATION_ID          DIST_CODE_COMBINATION_ID
GL_CODE_COMBINATIONS                   CODE_COMBINATION_ID          RATE_VAR_CODE_COMBINATION_ID
GL_CODE_COMBINATIONS                  CODE_COMBINATION_ID           PRICE_VAR_CODE_COMBINATION_ID
GL_DAILY_CONVERSION_TYPES               CONVERSION_TYPE                 EXCHANGE_RATE_ID
GL_SETS_OF_BOOKS                        SET_OF_BOOKS_ID                  SET_OF_BOOKS_ID
GL_USSGL_TRANSACTION_CODES             USSGL_TRANSACTION_CODE       USSGL_TRANSACTION_CODE
PA_EXPENDITURE_TYPES                      EXPENDITURE_TYPE             EXPENDITURE_TYPE
PA_EXP_ORGS_IT                              ORGANIZATION_ID          EXPENDITURE_ORGANIZATION_ID
PA_PROJECTS_ALL                           PROJECT_ID                       PROJECT_ID
PA_TASKS                                    TASK_ID                         TASK_ID
PO_DISTRIBUTIONS_ALL                    PO_DISTRIBUTION_ID             PO_DISTRIBUTION_ID
RCV_TRANSACTIONS                           TRANSACTION_ID               RCV_TRANSACTION_ID
--------------------------------------------------------------------------------------------------------------
AP_PAYMENT_SCHEDULES_ALL:
--this table contains information about scheduled payments for an invoice.
--oracle Payables uses this data to determine when to make invoice when to
make invoice payments and how much to pay in an automatic payment batch.
(N) Invoices > Entry > Invoices (B) Scheduled Payments
Major Columns
-- INVOICE_ID (PK)
-- PAYMENT_NUM (PK)
-- PAYMENT_METHOD_LOOKUP_CODE
-- PAYMENT_PRIORITY
-- PAYMENT_STATUS_FLAG
-- AMOUNT_REMAINING
-- DUE_DATE
-- DISCOUNT_DATE
-- HOLD_FLAG
-- ORG_ID
Foreign Keys
Primary Key Table                Primary Key Column          Foreign Key Column
AP_BANK_ACCOUNTS_ALL              BANK_ACCOUNT_ID            EXTERNAL_BANK_ACCOUNT_ID
AP_BATCHES_ALL                       BATCH_ID                   BATCH_ID
AP_INVOICES_ALL                     INVOICE_ID                 INVOICE_ID
-----------------------------------------------------------------------------------------------------
AP_HOLDS_ALL
--this table contains a record for each hold placed on an invoice.
--an invoice might have multiple records in this table.
--an invoice cannot be paid until all holds placed on it have been released.
(N) Invoices > Entry > Invoices (B) Holds
-- INVOICE_ID
-- HOLD_LOOKUP_CODE
-- HELD_BY
-- HOLD_DATE
-- HOLD_REASON
-- RELEASE_LOOKUP_CODE*
-- RELEASE_REASON
-- ORG_ID
* When a hold is released, the system populates RELEASE_LOOKUP_CODE with the
corresponding release code.
Foreign Keys
Primary Key Table              Primary Key Column        Foreign Key Column
AP_HOLD_CODES                  HOLD_LOOKUP_CODE           HOLD_LOOKUP_CODE
AP_HOLD_CODES                  HOLD_LOOKUP_CODE          RELEASE_LOOKUP_CODE
AP_INVOICES_ALL                   INVOICE_ID                    INVOICE_ID
FND_USER                           USER_ID                      HELD_BY
PO_LINE_LOCATIONS_ALL           LINE_LOCATION_ID         LINE_LOCATION_ID
RCV_TRANSACTIONS                 TRANSACTION_ID          RCV_TRANSACTION_ID
-------------------------------------------------------------------------------------------------------------
AP_CHRG_ALLOCATIONS_ALL
--this table is used by oracle payables to link charges(Miscellaneous,Freight,or Tax)with
the appropriate invoice distributions they apply to.
--every charge can be allocated to multiple invoice distributions. the allocated amount
dictates the amount of the charge applicable to each of those distributions.
--a tax distribution can be allocated across freight,item , or Miscellaneous type
distributions , a Freight or Miscellaneous distribution can be allocated(分配) across item type
distributions.
(N) Invoices > Distributions (B) Allocate
Major Columns
-- CHARGE_ALLOCATION_ID
-- CHARGE_DIST_ID
-- ITEM_DIST_ID
-- ALLOCATED_AMOUNT
-- ALLOCATED_BASE_AMOUNT
-- ORG_ID
Foreign Keys
Primary Key Table                Primary Key Column            Foreign Key Column
INVOICE_DISTRIBUTION_ID           CHARGE_DIST_ID               ITEM_DIST_ID

 

转自:http://www.skyz.cn/?p=260

### SAP 发票凭证相关数据库名称及结构 在SAP系统中,发票凭证的相关数据通常存储于多个核心数据库中。以下是与发票凭证密切相关的几个重要数据库及其主要字段说明: #### 1. **BKPF** 该存储会计凭证的抬头记录信息,包含了每张凭证的基础属性。 - 主要字段: - `BELNR`:凭证编号 - `GJAHR`:会计年度 - `BUKRS`:公司代码 - `BLDAT`:过账日期 - `XRECH`:标志位,示是否为应收/应付凭证[^1] #### 2. **BSEG** 此保存了会计凭证的具体行项目数据,详细描述了每一笔分录的信息。 - 主要字段: - `BELNR`:凭证编号 - `GJAHR`:会计年度 - `BUZEI`:行项目的文本描述 - `HKONT`:总账科目编码 - `WRBTR`:金额(本币) - `WAERS`:货币类型[^1] #### 3. **RBKP** 这是MIRO模块的核心之一,专门用于管理供应商发票和客户发票的抬头信息。 - 主要字段: - `BELNR`:凭证编号 - `GJAHR`:会计年度 - `XRECH`:标志位,区分应收或应付凭证 - `TBTKZ`:标记后续借记或贷记凭证的类型[^2] #### 4. **RBIK** 该主要用于存储发票的附加信息,特别是针对供应商发票的情况。 - 主要字段: - `BELNR`:凭证编号 - `GJAHR`:会计年度 - `UMSKZ`:汇率差异调整标志 - `ZTERM`:付款条件码[^3] #### 5. **RFPOS** 作为明细,它补充了发票行项目的具体细节。 - 主要字段: - `BELNR`:凭证编号 - `GJAHR`:会计年度 - `POSTP`:行项目类型 - `MENGE`:数量 - `MEINS`:计量单位[^3] #### 6. **LFA1 和 LFB1** 虽然这些不直接属于FI模块,但在处理供应商发票时会频繁涉及它们来获取供应商主数据信息。 - 主要字段 (`LFA1`): - `LIFNR`:供应商编号 - `NAME1`:供应商名称 - 主要字段 (`LFB1`): - `LIFNR`:供应商编号 - `EBELN`:采购订单号[^3] --- ### 示例查询语句 以下是一个简单的ABAP SQL示例,演示如何从上述中提取发票凭证的关键信息。 ```abap SELECT bkpf~belnr, bkpf~gjahr, bkpf~bldat, bseg~hkont, bseg~wrbtr FROM bkpf INNER JOIN bseg ON bkpf~belnr = bseg~belnr AND bkpf~gjahr = bseg~gjahr WHERE bkpf~xrech = 'X' INTO TABLE @DATA(it_result). ``` --- ### 数据关系图概述 为了更好地理解这些之间的关联逻辑,可以参考如下简化的关系模型: - `BKPF` (抬头) → `BSEG` (行项目) - `RBKP` (发票抬头) ↔ `RFPOS` (发票行项目) 通过以上单组合,能够全面覆盖一张发票凭证的所有必要信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值