Requirements
Download the installation packages from the EPO NextCloud:
Installation
Import the latest version of the ZIP file - see importing EPO transport packages.
Transaction /EPO1/EXC
Create a new outgoing service:
Create an entry for each SAP - system (development, test, productive):
Create a new operation:
Create one line for each SAP system-ID:
The desired ZUGFeRD profile can be customized, depending on the invoice type:
Create texts in each used language:
Transaction SO10
The first '&' - character in the subject will be replaced by the invoice number.
If the SO10-text is not available, a standard text will be used.
This chapter describes the data flow in simple steps (not in detail). The XML is stored with 'is invoice' - sign 'Y', the PDF ist stored with the sign 'X'.
Select an invoice in the outgoing invoice ledger (transaction /EPO1/OIL) and press the 'SEND'-button.
Derive from the base classes, redefine required methods
Example:
classes ZCL_SD_EPO_ZUGF_CN_OUT, ZCL_SD_EPO_ZUGF_INVOICE_OUT
Base classes:
/EPO1/CL_ZUGF_CN_OUT_SD, /EPO1/CL_ZUGF_INVOICE_OUT_SD
Maintain the subclasses-table in order to use the new classes (only as example - use the real names of the newly created classes!).
Class/Interface | Mode | Class/Interface |
---|---|---|
/EPO1/CL_ZUGF_CN_OUT_SD | ZUGF | ZCL_SD_EPO_ZUGF_CN_OUT |
/EPO1/CL_ZUGF_INVOICE_OUT_SD | ZUGF | ZCL_SD_EPO_ZUGF_INVOICE_OUT |
Selecting KNVV-EIKTO and writing into the table 'additional_documentreference'; to be read by the transformations /EPO1/INVOICE_ZUGFERD_CII_1, /EPO1/INVOICE_ZUGFERD_UBL_CII.
Default: the contact data of sales bureau 'ZXRE' is used to fill the name, telephone number and e-mail address.
If this sales bureau is not maintained, or when a logic is required to get the sales contact information, these methods has to be redefined.
Data to be supplied:
The CII version 1.0 requires the piece prices with 4 decimals. In order to get a valid XML, the product of piece price * number of pieces has to match the position price exactly.
In UBL, the piece-price is only calculated with 2 digits, which is sometimes not fine enough. Additionally, there are value combinations, which cannot represent exact values as required.
Example:
0,0225 * 300 = 6,75 (too less)
0,0226 * 300 = 6,78 (too much)
-> it is not possible to calculate a piece price, where 'piece price * number of pieces' matches the position price.
Correction steps for price calculation (only performing required steps!):
Please note, that the last correction will produce an XML, which does not exactly represent the PDF representation (which is a requirement for ZUGFeRD), but there is no other possiblity to get a valid XML wich passes a validator.
added data declaration:
DATA lv_curvalue_4 TYPE p LENGTH 15 DECIMALS 4.
DATA lv_netwr_check TYPE netwr.
inserted code (after the assignment of piece-prices and base unit):
" check/correct piece price
IF is_it_gen-fkimg > 0.
l_curvalue = ls_price-priceamount-element_value.
l_curvalue = l_curvalue * is_it_gen-fkimg.
IF l_curvalue <> ls_it_price-netwr.
" calculate the precise price (with 4 decimals instead of only 2)
lv_curvalue_4 = ls_it_price-netwr / is_it_gen-fkimg.
" check result, try to correct the last digit
lv_netwr_check = lv_curvalue_4 * is_it_gen-fkimg.
IF lv_netwr_check > ls_it_price-netwr.
lv_curvalue_4 = lv_curvalue_4 - '0.0001'.
ELSEIF lv_netwr_check < ls_it_price-netwr.
lv_curvalue_4 = lv_curvalue_4 + '0.0001'.
ENDIF.
ls_price-priceamount-element_value = /epo1/cl_ubl_helpers=>move_and_condense( lv_curvalue_4 ).
ENDIF.
" final check/correction for piece price
lv_curvalue_4 = ls_price-priceamount-element_value.
lv_netwr_check = lv_curvalue_4 * is_it_gen-fkimg.
IF lv_netwr_check <> ls_it_price-netwr.
" set piece - price to position price, set base quantity to position quantity
" (just to satisfy the validator)
ls_price-priceamount-element_value = /epo1/cl_ubl_helpers=>move_and_condense( ls_it_price-netwr ).
ls_it_price-kpein = is_it_gen-fkimg.
ls_price-basequantity-element_value = /epo1/cl_ubl_helpers=>move_and_condense( ls_it_price-kpein ).
ENDIF.
ENDIF.
..just in case, the CII XML does not look like You have expected.
Transaction SE80, class /EPO1/CL_INVOICE_ZUGFERD_PDF, method CII_CONVERT_FROM_UBL: make a breakpoint at CALL TRANSFORMATION, then You can inspect the incoming UBL - XML and the created CII - XML (version 1.0 or 2.1.1, depending on the settings).
Invoke transaction VF03, enter the number of the invoice or credit note, then from the menu select
Billing document | Issue Output To
Select the message type for ZUGFeRD format (e.g. ZUGF) and press the button for the print preview.
Your breakpoint should invoke the debugger.
Connection: outgoing invoice ledger / ZUGFeRD
Product: 'LEDGEROI_ZUGFERD' (for Z_TRANSPORT_TOOL)
NextCloud: Kundenprojekte / EPO / SoftwareDownload / EPO eInvoice ZUGFeRD
EPO_LedgerOI_ZUGFeRD_v<version>_<ta>.zip
Transport order WK1K90???? ??.11.2023
Aktivities before or after import:
Transport order WK1K902860 29.06.2022
Aktivities before import:
Transport order WK1K902860 29.06.2022
Aktivities before import:
Transport order WK1K902691 14.03.2022
Aktivities before import:
Transport order WK1K902478 16.12.2021
Aktivities before import:
Version 1.2.3
Transport order WK1K902359 23.11.2021
Aktivities before import:
Version 1.2.2
Transport order WK1K902340 18.11.2021
Aktivities before import:
Version 1.2.1
Transport order WK1K902107 16.06.2021
Aktivities before import:
Version 1.2.0
Transport order WK1K901989 25.06.2021
Aktivities before import:
Version 1.1.2
Transport order WK1K901893 10.05.2021
Aktivities during import:
Version 1.1.1
Transport order WK1K901887 10.05.2021
Aktivities during import:
Version 1.1.0
!! do not use !!
Transport order WK1K901876 06.05.2021
Aktivities during import:
Version 1.0.1
Transport order WK1K901653 22.02.2021
Aktivities after import:
Version 1.0.0
Transport order WK1K901531 12.01.2021
Aktivities after import: