﻿sep=:

// <Key>:<Optional value>:<Operator>:<arg1>:<arg2>
// Operators: '=' use give value (arg1), Escape are repalce e.g.\r\n\t ...
//            '#' extract value from content between two arguments arg1 and arg2
//            'c' value between arg1 and one of the characters in arg2. Escape allowed e.g. \r for line end

/// Force a number format from a country e.g. DE-DE
number_format:                          1:c:[NF]:⁞

//# ----------- Invoice -----------------
// BT-1
invoice_nr:	   	                        0:c:[01]:⁞
// BT-2
invoice_date:                           0:c:[02]:⁞
// BT-3: Invoice = 380, Unknown = 0: Use string or number (default Invoice)
invoice_type:                           1:c:[03]:⁞
// BT-5: EUR, USD, ...
invoice_currency:                       0:c:[05]:⁞
// BT-9: 
invoice_payment_due_date:               0:c:[09]:⁞
// BT-9: 
invoice_payment_description:            1:c:[20]:⁞

// BT-10: Leitweg-Id in germany; sometimes optional sometimes not
invoice_buyer_reference:                1:c:[10]:⁞
// BT-11: project id
invoice_project_reference:              1:c:[11]:⁞
// BT-11a (warning if not provided for ZUGFeRD version Version23)
invoice_project_reference_name:         1:c:[11a]:⁞
// BT-12:
invoice_contract_reference:             1:c:[1 2]:⁞
// BT-13: 
invoice_purchase_order_reference:       1:c:[13]:⁞
// BT-14:
invoice_sales_order_reference:          1:c:[14]:⁞

// BT-22: Note
invoice_note:                           1:c:[22]:⁞
// BT-72: Should be present for PEPPOL
invoice_actual_delivery_date:           1:c:[72]:⁞
// BT-73
invoice_period_start:                   1:c:[73]:⁞
// BT-74
invoice_period_end:                     1:c:[74]:⁞

//# ----------- Invoice -----------------


//# -------------  Seller -----------
// BT-27
seller_name:                            0:c:[27]:⁞
// BT-28
seller_trading_name:                    1:c:[28]:⁞
// BT-29
seller_id:                              1:c:[29]:⁞
// BT-41
seller_contact_name:                    0:c:[41]:⁞
// BT-35  e.g. street or postfach
seller_adr1:                            1:c:[35]:⁞
// BT-36
seller_adr2:                            1:c:[36]:⁞
// BT-162  
seller_adr3:                            1:c:[162]:⁞
// BT-38
seller_postcode:                        0:c:[38]:⁞
//BT-37
seller_city:                            0:c:[37]:⁞
// BT-40
seller_country:                         0:c:[40]:⁞
//BT-31
seller_vat:                             1:c:[31]:⁞
//BT-32
seller_fiscal_nr:                       1:c:[32]:⁞
// BT-42
seller_phone:                           0:c:[42]:⁞
// BT-43
seller_email:                           0:c:[43]:⁞
// BT-33
seller_add_legal_information:           1:c:[33]:⁞
//# -------------  Seller -----------


//# -------------  Buyer -----------
// BT-44
buyer_name:                             0:c:[44]:⁞
// BT-45
buyer_trading_name:                     1:c:[45]:⁞
// BT-46
buyer_id:                               1:c:[46]:⁞
// BT-56
buyer_contact_name:                     1:c:[56]:⁞
// BT-50
buyer_adr1:                             1:c:[50]:⁞
// BT-51
buyer_adr2:                             1:c:[51]:⁞
// BT-163
buyer_adr3:                             1:c:[163]:⁞
// BT-53
buyer_postcode:                         0:c:[53]:⁞
// BT-52
buyer_city:                             0:c:[52]:⁞
// BT-55
buyer_country:                          0:c:[55]:⁞
//BT-48
buyer_vat:                              1:c:[48]:⁞
// BT-57
buyer_phone:                            1:c:[57]:⁞
// BT-58
buyer_email:                            1:c:[58]:⁞
//# -------------  Buyer -----------

//# -------------  Delivery -----------

// BT-70
deliver_to_name:                        1:c:[70]:⁞
// BT-75
deliver_to_adr1:                        1:c:[75]:⁞
// BT-76
deliver_to_adr2:                        1:c:[76]:⁞
// BT-165
deliver_to_adr3:                        1:c:[165]:⁞
// BT-80
deliver_to_country:                     1:c:[80]:⁞
// BT-78
deliver_to_postcode:                    1:c:[78]:⁞
// BT-77
deliver_to_city:                        1:c:[77]:⁞

//# -------------  Delivery -----------


//# -------------  Invoice positions -----------
// BT-126
item_id:                                0:c:[I_#]:⁞
// BT-153
item_name:                              0:c:[N_#]:⁞
// BT-154
item_description:                       1:c:[D_#]:⁞
// BT-155
item_seller_id:                         1:c:[S_#]:⁞
// BT-129
item_quantity:                          0:c:[Q_#]:⁞
// BT-130
item_unit:                              0:c:[U_#]:⁞
// BT-146
item_netto_price:                       0:c:[P_#]:⁞
// BT-131 (will be calculated if not provided)
item_netto_amount:                      1:c:[A_#]:⁞

// BT-151 ('S' Standard, 'Z' Zero Rate, 'AE' Reverse charged, 'G' not EU), default 'S'
item_tax_category_code:                 1:c:[C_#]:⁞
// BT-152
item_tax_rate:                          0:c:[R_#]:⁞

//# -------------  Allowance (Nachlass) and Charge (Zuschläge) -----------
// BT-136
item_allowance_amount:                  1:c:[AA_#]:⁞
// BT-138
item_allowance_percent:                 1:c:[AP_#]:⁞
// BT-139 (Reason codes not working, just use reason)
item_allowance_reason:                  1:c:[AR_#]:⁞

// BT-141
item_charge_amount:                     1:c:[CA_#]:⁞
// BT-143
item_charge_percent:                    1:c:[CP_#]:⁞
// BT-144 (Reason codes not working, just use reason)
item_charge_reason:                     1:c:[CR_#]:⁞

// the following fields can be used instead of the above. 
// For negativ values, allowance is used, for positive charge is used
// BT-136/BT-141
item_allowance_charge_amount:           1:c:[BA_#]:⁞
// BT-138/BT-143 
item_allowance_charge_percent:          1:c:[BP_#]:⁞
// BT-139/BT-144 (Reason codes not working, just use reason)
item_allowance_charge_reason:           1:c:[BR_#]:⁞

//# -------------  Invoice positions -----------


//# -------------  Payment          -----------
// BT-81 (30: Sepa with BIC, 58: Sepa without BIC, 68 Electronic like PayPal)
payment_means_type_code:                0:c:[81]:⁞
// BT-82 
payment_means_text:                     1:c:[82]:⁞
// BT-83 Überweisungstext
payment_remittance_information:         1:c:[83]:⁞
// BT-84 (IBAN)
payment_account_identifier:             1:c:[84]:⁞
// BT-85 (Kontoinhaber)
payment_account_name:                   1:c:[85]:⁞
// BT-86 (BIC)
payment_service_provider_identifier:    1:c:[86]:⁞
// BT-89 (SEPA Lastschrift)
payment_mandate_reference_identifier:   1:c:[89]:⁞
// BT-90 (SEPA Lastschrift)
payment_creditor_identifier:            1:c:[90]:⁞
//# -------------  Payment          -----------

//# -------------  Total (netto) allowance(discount)/charge  -----------

// BT-92
allowance_amount:                       1:c:[92]:⁞
// BT-94
allowance_percent:                      1:c:[94]:⁞
// BT-97
allowance_reason:                       1:c:[97]:⁞
// BT-95
allowance_tax_category_code:            1:c:[95]:⁞
// BT-96
allowance_tax_rate:                     1:c:[96]:⁞

// BT-99
charge_amount:                          1:c:[99]:⁞
// BT-101
charge_percent:                         1:c:[101]:⁞
// BT-104
charge_reason:                          1:c:[104]:⁞
// BT-102
charge_tax_category_code:               1:c:[102]:⁞
// BT-103
charge_tax_rate:                        1:c:[96]:⁞

// Negativ values are allowance, positive are charge
// BT-92/99
allowance_charge_amount:                1:c:[aca]:⁞
// BT-94/101
allowance_charge_percent:               1:c:[acp]:⁞
// BT-97/104
allowance_charge_reason:                1:c:[acr]:⁞
// BT-95/102
allowance_charge_tax_category_code:     1:c:[actcc]:⁞
// BT-96/103
allowance_charge_tax_rate:              1:c:[actr]:⁞


//# -------------  Totals (optional just to check if calculation is correct)     -----------
// BT-109
total_without_vat:                      1:c:[109]:⁞
// BT-112
total_with_vat:                         1:c:[112]:⁞
// BT-113
total_paid_amount:                      1:c:[113]:⁞
// BT-115
total_to_pay:                           1:c:[115]:⁞

// BT-121 (BT-151: G, K and AE are filled with correct codes, for other this value must be provided)
tax_vat_exemption_reason_code:          1:c:[121]:⁞
// BT-120 (BT-151: G, K and AE are filled with english exemption reason text, for other this value must be provided)
tax_vat_exemption_reason_text:          1:c:[120]:⁞
//# -------------  Totals (optional just to check if calculation is correct)     -----------








