=begin
#Fatture in Cloud API v2 - API Reference
#Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.
The version of the OpenAPI document: 2.0.7
Contact: info@fattureincloud.it
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.3.0
=end
require 'spec_helper'
require 'json'
# Unit tests for FattureInCloud_Ruby_Sdk::IssuedDocumentsApi
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe 'IssuedDocumentsApi' do
before do
# run before each test
@api_instance = FattureInCloud_Ruby_Sdk::IssuedDocumentsApi.new
@create_issued_document_response_obj = { "data": { "id": 12345, "type": "receipt", "year": 2021, "numeration": "rec123", "subject": "", "visible_subject": "", "rc_center": "", "ei_cassa_type": nil, "ei_withholding_tax_causal": nil, "ei_other_withholding_tax_type": nil, "ei_other_withholding_tax_causal": nil, "stamp_duty": 0, "use_gross_prices": false, "e_invoice": false, "agyo_company_id": nil, "agyo_id": nil, "agyo_sent_at": nil, "delivery_note": false, "accompanying_invoice": false, "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 0, "amount_rivalsa": 0, "amount_cassa": 0, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "permanent_token": "6pzguy12h45rn9yqwertp43t7ec90vr", "h_margins": 15, "v_margins": 16, "show_payment_method": false, "show_payments": true, "show_totals": "all", "show_paypal_button": true, "show_notification_button": false, "is_marked": false, "created_at": "2021-08-13 09:30:20", "updated_at": "2021-08-23 05:34:20", "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "date": "2021-08-20", "number": 1, "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "language": { "code": "it", "name": "Italiano" }, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "payment_method": { "id": 4, "name": "Credit card" }, "use_split_payment": false, "merged_in": nil, "original_document": nil, "items_list": [{ "product_id": 5432, "code": "SG3", "name": "Soggiorno", "measure": "", "net_price": 68.18182, "category": "", "id": 277876033, "gross_price": 75, "apply_withholding_taxes": true, "discount": 0, "discount_highlight": false, "in_dn": false, "qty": 1, "vat": { "id": 3, "value": 10, "description": "" }, "stock": false, "description": "", "not_taxable": false }], "payments_list": [{ "amount": 75, "due_date": "2020-08-23", "paid_date": nil, "id": 69078013, "payment_terms": { "days": 0, "type": "standard" }, "status": "not_paid", "payment_account": nil }], "attachment_url": "kdijrnf893hnwkfk45f50f.pdf", "seen_date": nil, "next_due_date": "2020-08-23", "template": { "id": 2821, "name": "Light Smoke" }, "extra_data": nil, "url": "y12h45rn9yf2mse0p43t7ec90vr.pdf", "locked": false, "has_ts_pay_pending_payment": false, "show_tspay_button": false, "pay_with_tspay_url": nil } }
allow(@api_instance).to receive(:create_issued_document) { @create_issued_document_response_obj }
@get_email_data_response_obj = { "data": { "recipient_email": "mary.red@example.com", "default_sender_email": { "id": 0, "email": "no-reply@fattureincloud.it" }, "sender_emails_list": [{ "id": 0, "email": "no-reply@fattureincloud.it" }, { "id": 888, "email": "mariorossi@fattureincloud.it" }], "cc_email": "m.rossi@exxample.com", "subject": "Nostra pro forma nr. 1", "body": "Gentile Mario Rossi,
per vedere la nostra pro forma di o per scaricarne una copia in versione PDF prema sul bottone sottoastante.
{{allegati}}
Cordiali saluti,
Mario Rossi<\/b>", "document_exists": true, "delivery_note_exists": false, "attachment_exists": false, "accompanying_invoice_exists": false } }
allow(@api_instance).to receive(:get_email_data) { @get_email_data_response_obj }
@get_existing_issued_document_totals_response_obj = { "data": { "amount_net": 68.18, "amount_rivalsa": 13.64, "amount_net_with_rivalsa": 81.82000000000001, "taxable_amount": 81.82, "vat_list": { "10": { "amount_net": 81.82, "amount_vat": 8.18 } }, "amount_vat": 8.18, "amount_gross": 90, "amount_due": 90, "amount_due_discount": 0, "payments_sum": 75 } }
allow(@api_instance).to receive(:get_existing_issued_document_totals) { @get_existing_issued_document_totals_response_obj }
@get_issued_document_response_obj = { "data": { "id": 12345, "type": "receipt", "year": 2021, "numeration": "rec123", "subject": "", "visible_subject": "", "rc_center": "", "ei_cassa_type": nil, "ei_withholding_tax_causal": nil, "ei_other_withholding_tax_type": nil, "ei_other_withholding_tax_causal": nil, "stamp_duty": 0, "use_gross_prices": false, "e_invoice": false, "agyo_company_id": nil, "agyo_id": nil, "agyo_sent_at": nil, "delivery_note": false, "accompanying_invoice": false, "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 0, "amount_rivalsa": 0, "amount_cassa": 0, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "permanent_token": "6pzguy12h45rn9yqwertp43t7ec90vr", "h_margins": 15, "v_margins": 16, "show_payment_method": false, "show_payments": true, "show_totals": "all", "show_paypal_button": true, "show_notification_button": false, "is_marked": false, "created_at": "2021-08-13 09:30:20", "updated_at": "2021-08-23 05:34:20", "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "date": "2021-08-20", "number": 1, "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "language": { "code": "it", "name": "Italiano" }, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "payment_method": { "id": 4, "name": "Credit card" }, "use_split_payment": false, "merged_in": nil, "original_document": nil, "items_list": [{ "product_id": 5432, "code": "SG3", "name": "Soggiorno", "measure": "", "net_price": 68.18182, "category": "", "id": 277876033, "gross_price": 75, "apply_withholding_taxes": true, "discount": 0, "discount_highlight": false, "in_dn": false, "qty": 1, "vat": { "id": 3, "value": 10, "description": "" }, "stock": false, "description": "", "not_taxable": false }], "payments_list": [{ "amount": 75, "due_date": "2020-08-23", "paid_date": nil, "id": 69078013, "payment_terms": { "days": 0, "type": "standard" }, "status": "not_paid", "payment_account": nil }], "attachment_url": "kdijrnf893hnwkfk45f50f.pdf", "seen_date": nil, "next_due_date": "2020-08-23", "template": { "id": 2821, "name": "Light Smoke" }, "extra_data": nil, "url": "y12h45rn9yf2mse0p43t7ec90vr.pdf", "locked": false, "has_ts_pay_pending_payment": false, "show_tspay_button": false, "pay_with_tspay_url": nil } }
allow(@api_instance).to receive(:get_issued_document) { @get_issued_document_response_obj }
@get_issued_document_pre_create_info_response_obj = { "data": { "numerations": { "2018": { "AB123": 2 }, "2019": { "123": nil }, "2020": { "ABC": 2 }, "2021": { "rec123": 2 } }, "dn_numerations": { "2017": { "": 1000 }, "2018": { "": 112 }, "2019": { "": 526 }, "2020": { "": 11 }, "2021": { "": 110 } }, "default_values": { "template": { "id": 111, "type": "standard", "name": "Light Smoke" }, "dn_template": { "id": 222, "type": "delivery_note", "name": "DDT 1" }, "ai_template": { "id": 333, "type": "accompanying_invoice", "name": "FT Accompagnatoria 1" }, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "use_gross_prices": false, "payment_method": { "id": 123321, "name": "Bonifico bancario", "is_default": true, "details": [{ "title": "Banca", "description": "Indesa" }, { "title": "IBAN", "description": "IT17QA12345600000003498936" }, { "title": "Intestatario", "description": "Mario Rossi" }], "bank_iban": "IT17QA12345600000003498936", "bank_name": "Indesa", "bank_beneficiary": "Mario Rossi", "ei_payment_method": "MP05" }, "show_payment_method": true, "ei_cassa_type": nil, "ei_withholding_tax_causal": "B", "ei_other_withholding_tax_type": nil, "ei_other_withholding_tax_causal": nil, "ei_default_document_type": "TD01" }, "extra_data_default_values": { "ts_communication": false, "ts_tipo_spesa": "SR", "ts_flag_tipo_spesa": 0, "ts_pagamento_tracciato": false }, "items_default_values": { "vat": { "id": 0, "value": 22, "description": "", "notes": "", "e_invoice": true, "ei_type": "0", "ei_description": "", "is_disabled": false, "editable": false, "default": true } }, "countries_list": ["Italia", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Anguilla", "Antartide", "Antigua e Barbuda", "Antille Olandesi", "Arabia Saudita", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaigian", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belgio", "Belize", "Benin", "Bermuda", "Bhutan", "Bielorussia", "Bolivia", "Bosnia ed Erzegovina", "Botswana", "Brasile", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambogia", "Camerun", "Canada", "Capo Verde", "Ciad", "Cile", "Cina", "Cipro", "Citt\u00e0 del Vaticano", "Colombia", "Comore", "Corea del Nord", "Corea del Sud", "Costa Rica", "Costa d\'Avorio", "Croazia", "Cuba", "Danimarca", "Dominica", "Ecuador", "Egitto", "El Salvador", "Emirati Arabi Uniti", "Eritrea", "Estonia", "Etiopia", "Fiji", "Filippine", "Finlandia", "Francia", "Gabon", "Gambia", "Georgia", "Georgia del Sud e isole Sandwich", "Germania", "Ghana", "Giamaica", "Giappone", "Gibilterra", "Gibuti", "Giordania", "Grecia", "Grenada", "Groenlandia", "Guadalupa", "Guam", "Guatemala", "Guernsey - Channel Islands", "Guinea", "Guinea Equatoriale", "Guinea-Bissau", "Guyana", "Guyana Francese", "Haiti", "Heard Island e McDonald Islands", "Honduras", "Hong Kong", "India", "Indonesia", "Iran", "Iraq", "Irlanda", "Islanda", "Isola Bouvet", "Isola Christmas", "Isola di Man", "Isola Norfolk", "Isole Canarie (Spagna)", "Isole Cayman", "Isole Cocos e Keeling", "Isole Cook", "Isole Falkland", "Isole F\u00e6r \u00d8er", "Isole Marianne Settentrionali", "Isole Marshall", "Isole Minori Esterne degli USA", "Isole Pitcairn", "Isole Salomone", "Isole Vergini Americane", "Isole Vergini Britanniche", "Isole \u00c5land", "Israele", "Jersey - Channel Islands", "Kazakistan", "Kenia", "Kirghizistan", "Kiribati", "Kosovo", "Kuwait", "Laos", "Lesotho", "Lettonia", "Libano", "Liberia", "Libia", "Liechtenstein", "Lituania", "Lussemburgo", "Macao", "Macedonia", "Macedonia del Nord", "Madagascar", "Malawi", "Malaysia", "Maldive", "Mali", "Malta", "Marocco", "Martinica", "Mauritania", "Mauritius", "Mayotte", "Messico", "Micronesia", "Moldavia", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Mozambico", "Myanmar", "Namibia", "Nauru", "Nepal", "Nicaragua", "Niger", "Nigeria", "Niue", "Norvegia", "Nuova Caledonia", "Nuova Zelanda", "Oman", "Paesi Bassi", "Pakistan", "Palau", "Panama", "Papua Nuova Guinea", "Paraguay", "Per\u00f9", "Polinesia Francese", "Polonia", "Porto Rico", "Portogallo", "Qatar", "Regno Unito", "Repubblica Ceca", "Repubblica Centrafricana", "Repubblica Democratica del Congo", "Repubblica Dominicana", "Repubblica del Congo", "Riunione", "Romania", "Ruanda", "Russia", "Sahara Occidentale", "Saint Barthelemy", "Saint Kitts e Nevis", "Saint Pierre e Miquelon", "Saint Vincent e Grenadine", "Samoa", "Samoa Americane", "San Marino", "Sant\'Elena", "Santa Lucia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Siria", "Slovacchia", "Slovenia", "Somalia", "Spagna", "Sri Lanka", "Stato di Palestina", "Stati Uniti", "Sudafrica", "Sud Sudan", "Sudan", "Suriname", "Svalbard e Jan Mayen", "Svezia", "Svizzera", "Swaziland", "S\u00e3o Tom\u00e9 e Pr\u00edncipe", "Tagikistan", "Taiwan", "Tanzania", "Terre australi e ant. francesi", "Terr. Britannico dell\'Oc. Ind.", "Thailandia", "Timor Est", "Togo", "Tokelau", "Tonga", "Trinidad e Tobago", "Tunisia", "Turchia", "Turkmenistan", "Turks e Caicos", "Tuvalu", "Ucraina", "Uganda", "Ungheria", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Wallis e Futuna", "Yemen", "Zambia", "Zimbabwe"], "currencies_list": [{ "id": "AED", "symbol": "AED", "html_symbol": "AED", "exchange_rate": "4.09500" }, { "id": "ALL", "symbol": "ALL", "html_symbol": "ALL", "exchange_rate": "121.50000" }, { "id": "AUD", "symbol": "AUD", "html_symbol": "AUD", "exchange_rate": "1.62094" }, { "id": "AZN", "symbol": "AZN", "html_symbol": "AZN", "exchange_rate": "2.00130" }, { "id": "BGN", "symbol": "\u043b\u0432", "html_symbol": "BGN", "exchange_rate": "1.95583" }, { "id": "BRL", "symbol": "R$", "html_symbol": "R$", "exchange_rate": "4.50410" }, { "id": "BYN", "symbol": "BYN", "html_symbol": "BYN", "exchange_rate": "2.41000" }, { "id": "CAD", "symbol": "CAD", "html_symbol": "CAD", "exchange_rate": "1.49841" }, { "id": "CFA", "symbol": "CFA", "html_symbol": "CFA", "exchange_rate": "656.68000" }, { "id": "CHF", "symbol": "Fr.", "html_symbol": "Fr.", "exchange_rate": "1.12559" }, { "id": "CNY", "symbol": "CNY", "html_symbol": "CNY", "exchange_rate": "7.70160" }, { "id": "CRC", "symbol": "\u20a1", "html_symbol": "₡", "exchange_rate": "659.17000" }, { "id": "CZK", "symbol": "K\u010d", "html_symbol": "CZK", "exchange_rate": "25.80600" }, { "id": "DKK", "symbol": "kr.", "html_symbol": "kr.", "exchange_rate": "7.46750" }, { "id": "DOP", "symbol": "DOP", "html_symbol": "DOP", "exchange_rate": "56.50000" }, { "id": "DZD", "symbol": "DZD", "html_symbol": "DZD", "exchange_rate": "134.28300" }, { "id": "EGP", "symbol": "EGP", "html_symbol": "EGP", "exchange_rate": "18.98030" }, { "id": "EUR", "symbol": "\u20ac", "html_symbol": "€", "exchange_rate": "1.00000" }, { "id": "GBP", "symbol": "\u00a3", "html_symbol": "£", "exchange_rate": "0.88096" }, { "id": "GHS", "symbol": "GHS", "html_symbol": "GHS", "exchange_rate": "5.45834" }, { "id": "HKD", "symbol": "HK$", "html_symbol": "HK$", "exchange_rate": "8.75450" }, { "id": "HRK", "symbol": "HRK", "html_symbol": "HRK", "exchange_rate": "7.42640" }, { "id": "HUF", "symbol": "HUF", "html_symbol": "HUF", "exchange_rate": "326.24000" }, { "id": "ILS", "symbol": "\u20aa", "html_symbol": "₪", "exchange_rate": "4.02680" }, { "id": "INR", "symbol": "INR", "html_symbol": "INR", "exchange_rate": "77.76050" }, { "id": "ISK", "symbol": "ISK", "html_symbol": "ISK", "exchange_rate": "135.94600" }, { "id": "JPY", "symbol": "\u00a5", "html_symbol": "¥", "exchange_rate": "123.05800" }, { "id": "KRW", "symbol": "KRW", "html_symbol": "KRW", "exchange_rate": "1329.20000" }, { "id": "MAD", "symbol": "MAD", "html_symbol": "MAD", "exchange_rate": "10.78900" }, { "id": "MKD", "symbol": "MKD", "html_symbol": "MKD", "exchange_rate": "61.36700" }, { "id": "MXN", "symbol": "Mex$", "html_symbol": "Mex$", "exchange_rate": "21.17900" }, { "id": "MYR", "symbol": "MYR", "html_symbol": "MYR", "exchange_rate": "4.67310" }, { "id": "NGN", "symbol": "NGN", "html_symbol": "NGN", "exchange_rate": "405.17000" }, { "id": "NIS", "symbol": "NIS", "html_symbol": "NIS", "exchange_rate": "4020.00000" }, { "id": "NOK", "symbol": "kr", "html_symbol": "kr", "exchange_rate": "9.76270" }, { "id": "NZD", "symbol": "NZD", "html_symbol": "NZD", "exchange_rate": "1.71687" }, { "id": "OMR", "symbol": "OMR", "html_symbol": "OMR", "exchange_rate": "0.42950" }, { "id": "PEN", "symbol": "PEN", "html_symbol": "PEN", "exchange_rate": "3.73400" }, { "id": "PLN", "symbol": "z\u0142", "html_symbol": "PLN", "exchange_rate": "4.30330" }, { "id": "QAR", "symbol": "QAR", "html_symbol": "QAR", "exchange_rate": "4.06270" }, { "id": "RON", "symbol": "RON", "html_symbol": "RON", "exchange_rate": "4.66891" }, { "id": "RSD", "symbol": "RSD", "html_symbol": "RSD", "exchange_rate": "117.39414" }, { "id": "RUB", "symbol": "\u20bd", "html_symbol": "₽", "exchange_rate": "71.70370" }, { "id": "SAR", "symbol": "SAR", "html_symbol": "SAR", "exchange_rate": "4.18520" }, { "id": "SEK", "symbol": "SEK", "html_symbol": "SEK", "exchange_rate": "10.73374" }, { "id": "SGD", "symbol": "SGD", "html_symbol": "SGD", "exchange_rate": "1.53800" }, { "id": "THB", "symbol": "THB", "html_symbol": "THB", "exchange_rate": "35.56400" }, { "id": "TND", "symbol": "TND", "html_symbol": "TND", "exchange_rate": "3.34010" }, { "id": "TRY", "symbol": "TRY", "html_symbol": "TRY", "exchange_rate": "6.81590" }, { "id": "TWD", "symbol": "TWD", "html_symbol": "TWD", "exchange_rate": "35.14200" }, { "id": "UAH", "symbol": "UAH", "html_symbol": "UAH", "exchange_rate": "29.31490" }, { "id": "USD", "symbol": "$", "html_symbol": "$", "exchange_rate": "1.11570" }, { "id": "VND", "symbol": "\u20ab", "html_symbol": "₫", "exchange_rate": "26100.00000" }, { "id": "ZAR", "symbol": "R", "html_symbol": "R", "exchange_rate": "16.03080" }], "templates_list": [{ "id": 10, "name": "New Standard S1" }, { "id": 11, "name": "New Standard S2" }, { "id": 12, "name": "New Professionisti P1" }, { "id": 13, "name": "New Buste" }, { "id": 14, "name": "New Professionisti P2" }, { "id": 101, "name": "Clear lines" }, { "id": 106, "name": "Minimalist" }, { "id": 107, "name": "Squared" }, { "id": 108, "name": "Modern" }, { "id": 150, "name": "Bright Colors" }, { "id": 681, "name": "Modern Spese di trasporto" }, { "id": 682, "name": "Modern ciao" }, { "id": 2821, "name": "Light Smoke" }, { "id": 2823, "name": "IDEAVERDE" }, { "id": 2824, "name": "LS problem" }, { "id": 2825, "name": "Light Smoke 2nd CASSA" }, { "id": 2826, "name": "LIGHT NUOVO" }, { "id": 2827, "name": "STAND" }], "dn_templates_list": [{ "id": 660, "name": "DDT 1" }, { "id": 680, "name": "DDT Prova" }], "ai_templates_list": [{ "id": 663, "name": "FT Accompagnatoria 1" }], "payment_methods_list": [{ "id": 555, "name": "Rimessa diretta", "is_default": false, "details": [], "bank_iban": nil, "bank_name": nil, "bank_beneficiary": nil, "ei_payment_method": nil }, { "id": 123321, "name": "Bonifico bancario", "is_default": true, "details": [{ "title": "Banca", "description": "Indesa" }, { "title": "IBAN", "description": "IT17QA12345600000003498936" }, { "title": "Intestatario", "description": "Mario Rossi" }], "bank_iban": "IT17QA12345600000003498936", "bank_name": "Indesa", "bank_beneficiary": "Mario Rossi", "ei_payment_method": "MP05" }], "payment_accounts_list": [{ "id": 21, "name": "Indesa - Carta conto" }, { "id": 287, "name": "Bonifico_Bancario" }], "vat_types_list": [{ "id": 1409, "value": 15, "description": "ALIQUOTA #1234#", "ei_type": "0", "is_disabled": false }, { "id": 1332, "value": 0, "description": "Non imp. art. 17 c. 6 lett. A TER DPR 633\/72", "ei_type": "0", "is_disabled": false }], "measures_list": ["pezzi", "kg", "litri", "ore", "giorni", "km", "mesi"], "languages_list": [{ "code": "it", "name": "Italiano" }, { "code": "en", "name": "Inglese" }, { "code": "de", "name": "Tedesco" }, { "code": "fr", "name": "Francese" }, { "code": "es", "name": "Spagnolo" }, { "code": "pt", "name": "Portoghese" }, { "code": "el", "name": "Greco" }, { "code": "pl", "name": "Polacco" }, { "code": "sl", "name": "Sloveno" }], "ei_structure": { "FatturaElettronicaHeader": { "idx": 1, "children": { "DatiTrasmissione": { "idx": 1, "children": { "ContattiTrasmittente": { "idx": 5, "children": { "Telefono": { "idx": 1, "type": "text", "length": [5, 12] }, "Email": { "idx": 2, "type": "text", "length": [7, 256] } } } } }, "CedentePrestatore": { "idx": 2, "children": { "DatiAnagrafici": { "idx": 1, "children": { "Anagrafica": { "idx": 3, "children": { "CodEORI": { "idx": 5, "type": "text", "length": [13, 17] } } }, "AlboProfessionale": { "idx": 4, "type": "text", "length": [1, 60] }, "ProvinciaAlbo": { "idx": 5, "type": "text", "length": 2 }, "NumeroIscrizioneAlbo": { "idx": 6, "type": "text", "length": [1, 60] }, "DataIscrizioneAlbo": { "idx": 7, "type": "date", "length": 10 } } }, "Sede": { "idx": 2, "children": { "NumeroCivico": { "idx": 2, "type": "text", "length": [1, 8] } } }, "StabileOrganizzazione": { "idx": 3, "children": { "Indirizzo": { "idx": 1, "type": "text", "length": [1, 60] }, "NumeroCivico": { "idx": 2, "type": "text", "length": [1, 8] }, "CAP": { "idx": 3, "type": "text", "length": 5 }, "Comune": { "idx": 4, "type": "text", "length": [1, 60] }, "Provincia": { "idx": 5, "type": "text", "length": 2 }, "Nazione": { "idx": 6, "type": "text", "length": 2 } } }, "Contatti": { "idx": 5, "children": { "Telefono": { "idx": 1, "type": "text", "length": [5, 12] }, "Fax": { "idx": 2, "type": "text", "length": [5, 12] }, "Email": { "idx": 3, "type": "text", "length": [7, 256] } } }, "RiferimentoAmministrazione": { "idx": 6, "type": "text", "length": [1, 20] } } }, "CessionarioCommittente": { "idx": 4, "children": { "DatiAnagrafici": { "idx": 1, "children": { "Anagrafica": { "idx": 3, "children": { "Nome": { "idx": 2, "type": "text", "length": [2, 50] }, "Cognome": { "idx": 3, "type": "text", "length": [2, 50] }, "Titolo": { "idx": 4, "type": "text", "length": [2, 10] }, "CodEORI": { "idx": 5, "type": "text", "length": [13, 17] } } } } }, "StabileOrganizzazione": { "idx": 3, "children": { "Indirizzo": { "idx": 1, "type": "text", "length": [1, 60] }, "NumeroCivico": { "idx": 2, "type": "text", "length": [1, 8] }, "CAP": { "idx": 3, "type": "text", "length": 5 }, "Comune": { "idx": 4, "type": "text", "length": [1, 60] }, "Provincia": { "idx": 5, "type": "text", "length": 2 }, "Nazione": { "idx": 6, "type": "text", "length": 2 } } }, "RappresentanteFiscale": { "idx": 4, "children": { "IdFiscaleIVA": { "idx": 1, "children": { "IdPaese": { "idx": 1, "type": "text", "length": 2 }, "IdCodice": { "idx": 2, "type": "text", "length": [1, 28] } } }, "Denominazione": { "idx": 2, "type": "text", "length": [1, 80] }, "Nome": { "idx": 3, "type": "text", "length": [1, 60] }, "Cognome": { "idx": 4, "type": "text", "length": [1, 60] } } } } } } }, "FatturaElettronicaBody": { "idx": 2, "children": { "DatiGenerali": { "idx": 1, "children": { "DatiGeneraliDocumento": { "idx": 1, "children": { "TipoDocumento": { "idx": 1, "type": "select", "options": { "TD01": "TD01 - fattura", "TD02": "TD02 - acconto\/anticipo su fattura", "TD03": "TD03 - acconto\/anticipo su parcella", "TD04": "TD04 - nota di credito", "TD05": "TD05 - nota di debito", "TD06": "TD06 - parcella", "TD16": "TD16 - integrazione fattura reverse charge interno", "TD17": "TD17 - integrazione\/autofattura per acquisto servizi dall\'estero", "TD18": "TD18 - integrazione per acquisto di beni intracomunitari", "TD19": "TD19 - integrazione\/autofattura per acquisto di beni ex art.17 c.2 DPR 633\/72", "TD20": "TD20 - autofattura per regolarizzazione e integrazione delle fatture (art.6 c.8 d.lgs. 471\/97 o art.46 c.5 D.L. 331\/93)", "TD21": "TD21 - autofattura per splafonamento", "TD22": "TD22 - estrazione beni da Deposito IVA", "TD23": "TD23 - estrazione beni da Deposito IVA con versamento dell\'IVA", "TD24": "TD24 - fattura differita di cui all\'art. 21, comma 4, lett. a)", "TD25": "TD25 - fattura differita di cui all\'art. 21, comma 4, terzo periodo, lett. b)", "TD26": "TD26 - cessione di beni ammortizzabili e per passaggi interni (ex art.36 DPR 633\/72)", "TD27": "TD27 - fattura per autoconsumo o per cessioni gratuite senza rivalsa" } }, "Arrotondamento": { "idx": 10, "type": "text", "format": "decimal", "length": [4, 15] }, "Causale": { "idx": 11, "array": true, "type": "text", "length": [1, 200] }, "Art73": { "idx": 12, "type": "select", "options": { "SI": "Si" } } } }, "DatiOrdineAcquisto": { "idx": 2, "array": true, "children": { "RiferimentoNumeroLinea": { "idx": 1, "type": "text", "array": true, "length": [1, 4] }, "IdDocumento": { "idx": 2, "type": "text", "length": [1, 20] }, "Data": { "idx": 3, "type": "date", "length": 10 }, "NumItem": { "idx": 4, "type": "text", "length": [1, 20] }, "CodiceCommessaConvenzione": { "idx": 5, "type": "text", "length": [1, 100] }, "CodiceCUP": { "idx": 6, "type": "text", "length": [1, 15] }, "CodiceCIG": { "idx": 7, "type": "text", "length": [1, 15] } } }, "DatiContratto": { "idx": 3, "array": true, "children": { "RiferimentoNumeroLinea": { "idx": 1, "type": "text", "array": true, "length": [1, 4] }, "IdDocumento": { "idx": 2, "type": "text", "length": [1, 20] }, "Data": { "idx": 3, "type": "date", "length": 10 }, "NumItem": { "idx": 4, "type": "text", "length": [1, 20] }, "CodiceCommessaConvenzione": { "idx": 5, "type": "text", "length": [1, 100] }, "CodiceCUP": { "idx": 6, "type": "text", "length": [1, 15] }, "CodiceCIG": { "idx": 7, "type": "text", "length": [1, 15] } } }, "DatiConvenzione": { "idx": 4, "array": true, "children": { "RiferimentoNumeroLinea": { "idx": 1, "type": "text", "array": true, "length": [1, 4] }, "IdDocumento": { "idx": 2, "type": "text", "length": [1, 20] }, "Data": { "idx": 3, "type": "date", "length": 10 }, "NumItem": { "idx": 4, "type": "text", "length": [1, 20] }, "CodiceCommessaConvenzione": { "idx": 5, "type": "text", "length": [1, 100] }, "CodiceCUP": { "idx": 6, "type": "text", "length": [1, 15] }, "CodiceCIG": { "idx": 7, "type": "text", "length": [1, 15] } } }, "DatiRicezione": { "idx": 5, "array": true, "children": { "RiferimentoNumeroLinea": { "idx": 1, "type": "text", "array": true, "length": [1, 4] }, "IdDocumento": { "idx": 2, "type": "text", "length": [1, 20] }, "Data": { "idx": 3, "type": "date", "length": 10 }, "NumItem": { "idx": 4, "type": "text", "length": [1, 20] }, "CodiceCommessaConvenzione": { "idx": 5, "type": "text", "length": [1, 100] }, "CodiceCUP": { "idx": 6, "type": "text", "length": [1, 15] }, "CodiceCIG": { "idx": 7, "type": "text", "length": [1, 15] } } }, "DatiFattureCollegate": { "idx": 6, "array": true, "children": { "RiferimentoNumeroLinea": { "idx": 1, "type": "text", "array": true, "length": [1, 4] }, "IdDocumento": { "idx": 2, "type": "text", "length": [1, 20] }, "Data": { "idx": 3, "type": "date", "length": 10 }, "NumItem": { "idx": 4, "type": "text", "length": [1, 20] }, "CodiceCommessaConvenzione": { "idx": 5, "type": "text", "length": [1, 100] }, "CodiceCUP": { "idx": 6, "type": "text", "length": [1, 15] }, "CodiceCIG": { "idx": 7, "type": "text", "length": [1, 15] } } }, "DatiSAL": { "idx": 7, "array": true, "children": { "RiferimentoFase": { "idx": 1, "type": "text", "length": [1, 3] } } }, "DatiDDT": { "idx": 8, "array": true, "children": { "NumeroDDT": { "idx": 1, "type": "text", "length": [1, 20] }, "DataDDT": { "idx": 2, "type": "date", "length": 10 }, "RiferimentoNumeroLinea": { "idx": 3, "type": "text", "array": true, "length": [1, 4] } } }, "DatiTrasporto": { "idx": 9, "children": { "DatiAnagraficiVettore": { "idx": 1, "children": { "IdFiscaleIVA": { "idx": 1, "children": { "IdPaese": { "idx": 1, "type": "text", "length": 2 }, "IdCodice": { "idx": 2, "type": "text", "length": [1, 28] } } }, "CodiceFiscale": { "idx": 2, "type": "text", "length": [11, 16] }, "Anagrafica": { "idx": 3, "children": { "Denominazione": { "idx": 1, "type": "text", "length": [1, 80] }, "Nome": { "idx": 2, "type": "text", "length": [1, 60] }, "Cognome": { "idx": 3, "type": "text", "length": [1, 60] }, "Titolo": { "idx": 4, "type": "text", "length": [2, 10] }, "CodEORI": { "idx": 5, "type": "text", "length": [13, 17] } } }, "NumeroLicenzaGuida": { "idx": 4, "type": "text", "length": [1, 20] } } }, "MezzoTrasporto": { "idx": 2, "type": "text", "length": [1, 80] }, "CausaleTrasporto": { "idx": 3, "type": "text", "length": [1, 100] }, "NumeroColli": { "idx": 4, "type": "text", "length": [1, 4] }, "DataInizioTrasporto": { "idx": 10, "type": "date", "length": 10 }, "TipoResa": { "idx": 11, "type": "text", "length": 3 }, "IndirizzoResa": { "idx": 12, "children": { "Indirizzo": { "idx": 1, "type": "text", "length": [1, 60] }, "NumeroCivico": { "idx": 2, "type": "text", "length": [1, 8] }, "CAP": { "idx": 3, "type": "text", "length": 5 }, "Comune": { "idx": 4, "type": "text", "length": [1, 60] }, "Provincia": { "idx": 5, "type": "text", "length": 2 }, "Nazione": { "idx": 6, "type": "text", "length": 2 } } } } } } }, "DatiPagamento": { "idx": "4", "children": { "CondizioniPagamento": { "idx": 1, "type": "select", "options": { "TP01": "Pagamento a rate", "TP02": "Pagamento completo", "TP03": "Anticipo" } } } } } } }, "ei_item_structure": { "DettaglioLinee": { "idx": "2.2.1", "children": { "NumeroLinea": { "idx": 1, "type": "text", "length": [1, 4] }, "TipoCessionePrestazione": { "idx": 2, "type": "select", "options": { "SC": "sconto", "PR": "premio", "AB": "abbuono", "AC": "spesa accessoria" } }, "CodiceArticolo": { "idx": 3, "array": true, "children": { "CodiceTipo": { "idx": 1, "type": "text", "length": [1, 35] }, "CodiceValore": { "idx": 2, "type": "text", "length": [1, 35] } } }, "DataInizioPeriodo": { "idx": 7, "type": "date", "length": 10 }, "DataFinePeriodo": { "idx": 8, "type": "date", "length": 10 }, "RiferimentoAmministrazione": { "idx": 15, "type": "text", "length": [1, 20] }, "AltriDatiGestionali": { "idx": 16, "array": true, "children": { "TipoDato": { "idx": 1, "type": "text", "length": [1, 10] }, "RiferimentoTesto": { "idx": 2, "type": "text", "length": [1, 60] }, "RiferimentoNumero": { "idx": 3, "type": "text", "format": "decimal", "length": [4, 21] }, "RiferimentoData": { "idx": 4, "type": "date", "length": 10 } } } } } }, "ei_payment_structure": { "DettaglioPagamento": { "idx": "2.4.2", "children": { "DataRiferimentoTerminiPagamento": { "idx": 3, "type": "date", "length": 10 }, "GiorniTerminiPagamento": { "idx": 4, "type": "text", "length": [1, 3] }, "DataScadenzaPagamento": { "idx": 5, "type": "date", "length": 10 }, "ABI": { "idx": 14, "type": "text", "length": 5 }, "CAB": { "idx": 15, "type": "text", "length": 5 }, "BIC": { "idx": 16, "type": "text", "length": [8, 11] }, "DataDecorrenzaPenale": { "idx": 20, "type": "date", "length": 10 } } } }, "documents_type_info": { "TD01": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD01 - fattura", "description_self_invoice": "TD01 - fattura in nome e per conto" }, "TD02": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD02 - acconto\/anticipo su fattura" }, "TD03": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD03 - acconto\/anticipo su parcella" }, "TD04": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD04 - nota di credito" }, "TD05": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD05 - nota di debito" }, "TD06": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD06 - parcella" }, "TD16": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD16 - integrazione fattura reverse charge interno" }, "TD17": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD17 - integrazione\/autofattura per acquisto servizi dall\'estero" }, "TD18": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD18 - integrazione per acquisto di beni intracomunitari" }, "TD19": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD19 - integrazione\/autofattura per acquisto di beni ex art.17 c.2 DPR 633\/72" }, "TD20": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD20 - autofattura per regolarizzazione e integrazione delle fatture (art.6 c.8 d.lgs. 471\/97 o art.46 c.5 D.L. 331\/93)" }, "TD21": { "self_own_invoice": true, "self_supplier_invoice": false, "description": "TD21 - autofattura per splafonamento" }, "TD22": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD22 - estrazione beni da Deposito IVA" }, "TD23": { "self_own_invoice": false, "self_supplier_invoice": true, "description": "TD23 - estrazione beni da Deposito IVA con versamento dell\'IVA" }, "TD24": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD24 - fattura differita di cui all\'art. 21, comma 4, lett. a)" }, "TD25": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD25 - fattura differita di cui all\'art. 21, comma 4, terzo periodo, lett. b)" }, "TD26": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD26 - cessione di beni ammortizzabili e per passaggi interni (ex art.36 DPR 633\/72)" }, "TD27": { "self_own_invoice": true, "self_supplier_invoice": true, "description": "TD27 - fattura per autoconsumo o per cessioni gratuite senza rivalsa" } }, "ei_regime_info": { "RF01": "Ordinario", "RF02": "Contribuenti minimi (art.1, c.96-117, L. 244\/07)", "RF04": "Agricoltura e attivit\u00e0 connesse e pesca (artt.34 e 34-bis, DPR 633\/72)", "RF05": "Vendita sali e tabacchi (art.74, c.1, DPR. 633\/72)", "RF06": "Commercio fiammiferi (art.74, c.1, DPR 633\/72)", "RF07": "Editoria (art.74, c.1, DPR 633\/72)", "RF08": "Gestione servizi telefonia pubblica (art.74, c.1, DPR 633\/72)", "RF09": "Rivendita documenti di trasporto pubblico e di sosta (art.74, c.1, DPR 633\/72)", "RF10": "Intrattenimenti, giochi e altre attivit\u00e0 di cui alla tariffa allegata al DPR 640\/72 (art.74, c.6, DPR 633\/72)", "RF11": "Agenzie viaggi e turismo (art.74-ter, DPR 633\/72)", "RF12": "Agriturismo (art.5, c.2, L. 413\/91)", "RF13": "Vendite a domicilio (art.25-bis, c.6, DPR 600\/73)", "RF14": "Rivendita beni usati, oggetti d\u2019arte, d\u2019antiquariato o da collezione (art.36, DL 41\/95)", "RF15": "Agenzie di vendite all\u2019asta di oggetti d\'arte, antiquariato o da collezione (art.40-bis, DL 41\/95)", "RF16": "IVA per cassa P.A. (art.6, c.5, DPR 633\/72)", "RF17": "IVA per cassa (art. 32-bis, DL 83\/2012)", "RF18": "Altro", "RF19": "Regime forfettario (art.1, c.54-89, L. 190\/2014)" }, "ei_cassa_type_info": { "": "Nessuna cassa previdenziale", "TC01": "Cassa nazionale previdenza e assistenza avvocati e procuratori legali", "TC02": "Cassa previdenza dottori commercialisti", "TC03": "Cassa previdenza e assistenza geometri", "TC04": "Cassa nazionale previdenza e assistenza ingegneri e architetti liberi professionisti", "TC05": "Cassa nazionale del notariato", "TC06": "Cassa nazionale previdenza e assistenza ragionieri e periti commerciali", "TC07": "Ente nazionale assistenza agenti e rappresentanti di commercio (ENASARCO)", "TC08": "Ente nazionale previdenza e assistenza consulenti del lavoro (ENPACL)", "TC09": "Ente nazionale previdenza e assistenza medici (ENPAM)", "TC10": "Ente nazionale previdenza e assistenza farmacisti (ENPAF)", "TC11": "Ente nazionale previdenza e assistenza veterinari (ENPAV)", "TC12": "Ente nazionale previdenza e assistenza impiegati dell\'agricoltura (ENPAIA)", "TC13": "Fondo previdenza impiegati imprese di spedizione e agenzie marittime", "TC14": "Istituto nazionale previdenza giornalisti italiani (INPGI)", "TC15": "Opera nazionale assistenza orfani sanitari italiani (ONAOSI)", "TC16": "Cassa autonoma assistenza integrativa giornalisti italiani (CASAGIT)", "TC17": "Ente previdenza periti industriali e periti industriali laureati (EPPI)", "TC18": "Ente previdenza e assistenza pluricategoriale (EPAP)", "TC19": "Ente nazionale previdenza e assistenza biologi (ENPAB)", "TC20": "Ente nazionale previdenza e assistenza professione infermieristica (ENPAPI)", "TC21": "Ente nazionale previdenza e assistenza psicologi (ENPAP)", "TC22": "INPS" }, "ei_causal_payment_info": { "": "Nessuna ritenuta", "A": "Prestazioni di lavoro autonomo rientranti nell\'esercizio di arte o professione abituale", "B": "Utilizzazione economica, da parte dell\'autore o dell\'inventore, di opere dell\'ingegno, di brevetti industriali e di processi, formule o informazioni relativi ad esperienze acquisite in campo industriale, commerciale o scientifico", "C": "Utili derivanti da contratti di associazione in partecipazione e da contratti di cointeressenza, quando l\'apporto \u00e8 costituito esclusivamente dalla prestazione di lavoro", "D": "Utili spettanti ai soci promotori ed ai soci fondatori delle societ\u00e0 di capitali", "E": "Levata di protesti cambiari da parte dei segretari comunali", "G": "Indennit\u00e0 corrisposte per la cessazione di attivit\u00e0 sportiva professionale", "H": "Indennit\u00e0 corrisposte per la cessazione dei rapporti di agenzia delle persone fisiche e delle societ\u00e0 di persone con esclusione delle somme maturate entro il 31 dicembre 2003, gi\u00e0 imputate per competenza e tassate come reddito d\'impresa", "I": "Indennit\u00e0 corrisposte per la cessazione da funzioni notarili", "L": "Redditi derivanti dall\'utilizzazione economica di opere dell\'ingegno, di brevetti industriali e di processi, formule e informazioni relativi a esperienze acquisite in campo industriale, commerciale o scientifico, che sono percepiti dagli aventi causa a titolo gratuito (ad es. eredi e legatari dell\'autore e inventore)", "L1": "Redditi derivanti dall\'utilizzazione economica di opere dell\'ingegno, di brevetti industriali e di processi, formule e informazioni relativi a esperienze acquisite in campo industriale, commerciale o scientifico, che sono percepiti da soggetti che abbiano acquistato a titolo oneroso i diritti alla loro utilizzazione", "M": "Prestazioni di lavoro autonomo non esercitate abitualmente", "M1": "Redditi derivanti dall\'assunzione di obblighi di fare, di non fare o permettere", "M2": "Prestazioni di lavoro autonomo non esercitate abitualmente per le quali sussiste l\'obbligo di iscrizione alla Gestione Separata ENPAPI", "N": "Indennit\u00e0 di trasferta, rimborso forfettario di spese, premi e compensi erogati: \u0096 nell\'esercizio diretto di attivit\u00e0 sportive dilettantistiche; in relazione a rapporti di collaborazione coordinata e continuativa di carattere amministrativo-gestionale di natura non professionale resi a favore di societ\u00e0 e associazioni sportive dilettantistiche e di cori, bande e filodrammatiche da parte del direttore e dei collaboratori tecnici;", "O": "Prestazioni di lavoro autonomo non esercitate abitualmente, obblighi di fare, di non fare o permettere, per le quali non sussiste l\'obbligo di iscrizione alla gestione separata (Circ. INPS n. 104\/2001)", "O1": "Redditi derivanti dall\u2019assunzione di obblighi di fare, di non fare o permettere, per le quali non sussiste l\'obbligo di iscrizione alla gestione separata (Circ. INPS n. 104\/2001)", "P": "compensi corrisposti a soggetti non residenti privi di stabile organizzazione per l\'uso o la concessione in uso di attrezzature industriali, commerciali o scientifiche che si trovano nel territorio dello Stato ovvero a societ\u00e0 svizzere o stabili organizzazioni di societ\u00e0 svizzere che possiedono i requisiti di cui all\'art. 15, comma 2 dell\'Accordo tra la Comunit\u00e0 europea e la Confederazione svizzera del 26 ottobre 2004 (pubblicato in G.U.C.E. del 29 dicembre 2004 n. L385\/30)", "Q": "Provvigioni corrisposte ad agente o rappresentante di commercio monomandatario", "R": "Provvigioni corrisposte ad agente o rappresentante di commercio plurimandatario", "S": "Provvigioni corrisposte a commissionario", "T": "Provvigioni corrisposte a mediatore", "U": "Provvigioni corrisposte a procacciatore di affari", "V": "Provvigioni corrisposte a incaricato per le vendite a domicilio; provvigioni corrisposte a incaricato per la vendita porta a porta e per la vendita ambulante di giornali quotidiani e periodici (L. 25 febbraio 1987, n. 67)", "V1": "Redditi derivanti da attivit\u00e0 commerciali non esercitate abitualmente (ad esempio, provvigioni corrisposte per prestazioni occasionali ad agente o rappresentante di commercio, mediatore, procacciatore d\'affari)", "W": "Corrispettivi erogati nell\'anno corrente per prestazioni relative a contratti d\'appalto cui si sono resi applicabili le disposizioni contenute nell\'art. 25-ter del D.P.R. n. 600 del 29 settembre 1973", "X": "Canoni corrisposti nel 2004 da societ\u00e0 o enti residenti ovvero da stabili organizzazioni di societ\u00e0 estere di cui all\'art. 26-quater, comma 1, lett. a) e b) del D.P.R. 600 del 29 settembre 1973, a societ\u00e0 o stabili organizzazioni di societ\u00e0, situate in altro stato membro dell\'Unione Europea in presenza dei requisiti di cui al citato art. 26-quater, del D.P.R. 600 del 29 settembre 1973, per i quali \u00e8 stato effettuato, nell\'anno 2006, il rimborso della ritenuta ai sensi dell\'art. 4 del D.Lgs. 30 maggio 2005 n. 143", "Y": "Canoni corrisposti dal 1\u00b0 gennaio 2005 al 26 luglio 2005 da societ\u00e0 o enti residenti ovvero da stabili organizzazioni di societ\u00e0 estere di cui all\'art. 26-quater, comma 1, lett. a) e b) del D.P.R. n. 600 del 29 settembre 1973, asociet\u00e0 o stabili organizzazioni di societ\u00e0, situate in altro stato membro dell\'Unione Europea in presenza dei requisiti di cui al citato art. 26-quater, del D.P.R. n. 600 del 29 settembre 1973, per i quali \u00e8 stato effettuato, nell\'anno 2006, il rimborso della ritenuta ai sensi dell\'art. 4 del D.Lgs. 30 maggio 2005 n. 143", "ZO": "Titolo diverso dai precedenti" }, "ei_withholding_type_info": { "": "Nessuna ritenuta", "RT01": "Ritenuta di acconto persone fisiche", "RT02": "Ritenuta di acconto persone giuridiche", "RT03": "Contributo INPS", "RT04": "Contributo ENASARCO", "RT05": "Contributo ENPAM", "RT06": "Altro contributo previdenziale" }, "use_e_invoice": true } }
allow(@api_instance).to receive(:get_issued_document_pre_create_info) { @get_issued_document_pre_create_info_response_obj }
@get_new_issued_document_totals_response_obj = { "data": { "amount_net": 68.18, "taxable_amount": 68.18, "vat_list": { "10": { "amount_net": 68.18, "amount_vat": 6.82 } }, "amount_vat": 6.82, "amount_gross": 75, "amount_due": 75, "amount_due_discount": 0, "payments_sum": 75 } }
allow(@api_instance).to receive(:get_new_issued_document_totals) { @get_new_issued_document_totals_response_obj }
@list_issued_documents_response_obj = { "current_page": 1, "data": [{ "id": 12345, "type": "receipt", "numeration": "rec123", "subject": "", "visible_subject": "", "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 0, "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "date": "2021-08-20", "number": 1, "next_due_date": "2021-12-31", "url": "ypbqqe4u8w8bdabcd5fd5b1a4gtqhlof.pdf", "items_list": nil, "payments_list": nil }, { "id": 12346, "type": "receipt", "numeration": "rec124", "subject": "", "visible_subject": "", "amount_net": 168.18, "amount_vat": 16.82, "amount_gross": 175, "amount_due_discount": 0, "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "date": "2021-08-28", "number": 1, "next_due_date": "2021-12-31", "url": "qwertye4u8w8bdaqrt5fd5b1a4gtqhlof.pdf", "items_list": nil, "payments_list": nil }], "first_page_url": "page=1", "from": 1, "last_page": 1, "last_page_url": "page=1", "next_page_url": nil, "path": "issued_documents", "per_page": 50, "prev_page_url": nil, "to": 2, "total": 2 }
allow(@api_instance).to receive(:list_issued_documents) { @list_issued_documents_response_obj }
@modify_issued_document_response_obj = { "data": { "id": 12345, "type": "receipt", "year": 2021, "numeration": "rec123", "subject": "", "visible_subject": "", "rc_center": "", "ei_cassa_type": nil, "ei_withholding_tax_causal": nil, "ei_other_withholding_tax_type": nil, "ei_other_withholding_tax_causal": nil, "stamp_duty": 0, "use_gross_prices": false, "e_invoice": false, "agyo_company_id": nil, "agyo_id": nil, "agyo_sent_at": nil, "delivery_note": false, "accompanying_invoice": false, "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 0, "amount_rivalsa": 0, "amount_cassa": 0, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "permanent_token": "6pzguy12h45rn9yqwertp43t7ec90vr", "h_margins": 15, "v_margins": 16, "show_payment_method": false, "show_payments": true, "show_totals": "all", "show_paypal_button": true, "show_notification_button": false, "is_marked": false, "created_at": "2021-08-13 09:30:20", "updated_at": "2021-08-23 05:34:20", "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "date": "2021-08-20", "number": 1, "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "language": { "code": "it", "name": "Italiano" }, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "payment_method": { "id": 4, "name": "Credit card" }, "use_split_payment": false, "merged_in": nil, "original_document": nil, "items_list": [{ "product_id": 5432, "code": "SG3", "name": "Soggiorno", "measure": "", "net_price": 68.18182, "category": "", "id": 277876033, "gross_price": 75, "apply_withholding_taxes": true, "discount": 0, "discount_highlight": false, "in_dn": false, "qty": 1, "vat": { "id": 3, "value": 10, "description": "" }, "stock": false, "description": "", "not_taxable": false }], "payments_list": [{ "amount": 75, "due_date": "2020-08-23", "paid_date": nil, "id": 69078013, "payment_terms": { "days": 0, "type": "standard" }, "status": "not_paid", "payment_account": nil }], "attachment_url": "kdijrnf893hnwkfk45f50f.pdf", "seen_date": nil, "next_due_date": "2020-08-23", "template": { "id": 2821, "name": "Light Smoke" }, "extra_data": nil, "url": "y12h45rn9yf2mse0p43t7ec90vr.pdf", "locked": false, "has_ts_pay_pending_payment": false, "show_tspay_button": false, "pay_with_tspay_url": nil } }
allow(@api_instance).to receive(:modify_issued_document) { @modify_issued_document_response_obj }
@upload_issued_document_attachment_response_obj = { "data": { "attachment_token": "YmMyNWYxYzIwMTU3N2Y4ZGE3ZjZiMzg5OWY0ODNkZDQveXl5LmRvYw" } }
allow(@api_instance).to receive(:upload_issued_document_attachment) { @upload_issued_document_attachment_response_obj }
@transform_issued_document_response_obj = { "data": { "id": 12345, "type": "receipt", "year": 2021, "numeration": "rec123", "subject": "", "visible_subject": "", "rc_center": "", "ei_cassa_type": "", "ei_withholding_tax_causal": "a", "ei_other_withholding_tax_type": "a", "ei_other_withholding_tax_causal": "c", "stamp_duty": 0, "use_gross_prices": false, "e_invoice": false, "delivery_note": false, "accompanying_invoice": false, "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 1, "amount_rivalsa": 0, "amount_cassa": 0, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "h_margins": 15, "v_margins": 16, "show_payment_method": false, "show_payments": true, "show_totals": "all", "show_paypal_button": true, "show_notification_button": false, "is_marked": false, "date": "2021-08-20", "number": 1, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "use_split_payment": false, "attachment_url": "kdijrnf893hnwkfk45f50f.pdf", "seen_date": "2020-08-23", "next_due_date": "2020-08-23", "url": "y12h45rn9yf2mse0p43t7ec90vr.pdf", "show_tspay_button": false, "dn_number": 3, "dn_date": "2020-10-21", "dn_ai_packages_number": 4, "dn_ai_weight": 3, "dn_ai_causal": "causal", "dn_ai_destination": "dest", "dn_ai_transporter": "trasp", "dn_ai_notes": "notes", "amount_rivalsa_taxable": 3, "amount_global_cassa_taxable": 3, "amount_cassa_taxable": 3, "amount_cassa2": 3, "amount_cassa2_taxable": 3, "amount_withholding_tax_taxable": 3, "amount_enasarco_taxable": 3, "amount_other_withholding_tax_taxable": 3, "ei_cassa2_type": 3, "attachment_token": "asdaosdjaoisndoa", "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "language": { "code": "it", "name": "Italiano" }, "payment_method": { "id": 4, "name": "Credit card" }, "items_list": [{ "product_id": 5432, "code": "SG3", "name": "Soggiorno", "measure": "", "net_price": 68.18182, "category": "", "id": 277876033, "gross_price": 75, "apply_withholding_taxes": true, "discount": 0, "discount_highlight": false, "in_dn": false, "qty": 1, "vat": { "id": 3, "value": 10, "description": "" }, "stock": false, "description": "", "not_taxable": false }], "payments_list": [{ "amount": 75, "due_date": "2020-08-23", "paid_date": nil, "id": 69078013, "payment_terms": { "days": 0, "type": "standard" }, "status": "not_paid", "payment_account": nil }], "template": { "id": 2821, "name": "Light Smoke" }, "extra_data": { "ts_status": 1 }, "acc_inv_template": { "id": 4 }, "delivery_note_template": { "id": 54321 }, "ei_raw": { "prop": true }, "ei_data": { "bank_name": "Sao Paulo" } }, "options": { "create_from": ["82112399"], "transform": true, "keep_copy": true } }
allow(@api_instance).to receive(:transform_issued_document) { @transform_issued_document_response_obj }
@join_issued_documents_response_obj = { "data": { "id": 12345, "type": "receipt", "year": 2021, "numeration": "rec123", "subject": "", "visible_subject": "", "rc_center": "", "ei_cassa_type": "", "ei_withholding_tax_causal": "a", "ei_other_withholding_tax_type": "a", "ei_other_withholding_tax_causal": "c", "stamp_duty": 0, "use_gross_prices": false, "e_invoice": false, "delivery_note": false, "accompanying_invoice": false, "amount_net": 68.18, "amount_vat": 6.82, "amount_gross": 75, "amount_due_discount": 1, "amount_rivalsa": 0, "amount_cassa": 0, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "h_margins": 15, "v_margins": 16, "show_payment_method": false, "show_payments": true, "show_totals": "all", "show_paypal_button": true, "show_notification_button": false, "is_marked": false, "date": "2021-08-20", "number": 1, "notes": "", "rivalsa": 0, "cassa": 0, "withholding_tax": 0, "withholding_tax_taxable": 100, "other_withholding_tax": 0, "use_split_payment": false, "attachment_url": "kdijrnf893hnwkfk45f50f.pdf", "seen_date": "2020-08-23", "next_due_date": "2020-08-23", "url": "y12h45rn9yf2mse0p43t7ec90vr.pdf", "show_tspay_button": false, "dn_number": 3, "dn_date": "2020-10-21", "dn_ai_packages_number": 4, "dn_ai_weight": 3, "dn_ai_causal": "causal", "dn_ai_destination": "dest", "dn_ai_transporter": "trasp", "dn_ai_notes": "notes", "amount_rivalsa_taxable": 3, "amount_global_cassa_taxable": 3, "amount_cassa_taxable": 3, "amount_cassa2": 3, "amount_cassa2_taxable": 3, "amount_withholding_tax_taxable": 3, "amount_enasarco_taxable": 3, "amount_other_withholding_tax_taxable": 3, "ei_cassa2_type": 3, "attachment_token": "asdaosdjaoisndoa", "entity": { "id": 54321, "name": "Mary Red S.r.L.", "vat_number": "IT05432181211", "tax_code": "IT05432181211", "address_street": "Corso impero, 66", "address_postal_code": "20900", "address_city": "Milano", "address_province": "MI", "address_extra": "", "country": "Italia", "certified_email": "mary@pec.red.com", "ei_code": "ABCXCR1" }, "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "language": { "code": "it", "name": "Italiano" }, "payment_method": { "id": 4, "name": "Credit card" }, "items_list": [{ "product_id": 5432, "code": "SG3", "name": "Soggiorno", "measure": "", "net_price": 68.18182, "category": "", "id": 277876033, "gross_price": 75, "apply_withholding_taxes": true, "discount": 0, "discount_highlight": false, "in_dn": false, "qty": 1, "vat": { "id": 3, "value": 10, "description": "" }, "stock": false, "description": "", "not_taxable": false }], "payments_list": [{ "amount": 75, "due_date": "2020-08-23", "paid_date": nil, "id": 69078013, "payment_terms": { "days": 0, "type": "standard" }, "status": "not_paid", "payment_account": nil }], "template": { "id": 2821, "name": "Light Smoke" }, "extra_data": { "ts_status": 1 }, "acc_inv_template": { "id": 4 }, "delivery_note_template": { "id": 54321 }, "ei_raw": { "prop": true }, "ei_data": { "bank_name": "Sao Paulo" } }, "options": { "create_from": ["82112399", "82112400"] } }
allow(@api_instance).to receive(:join_issued_documents) { @join_issued_documents_response_obj }
end
after do
# run after each test
end
describe 'test an instance of IssuedDocumentsApi' do
it 'should create an instance of IssuedDocumentsApi' do
expect(@api_instance).to be_instance_of(FattureInCloud_Ruby_Sdk::IssuedDocumentsApi)
end
end
# unit tests for create_issued_document
# Create Issued Document
# Creates a new document.
# @param company_id The ID of the company.
# @param [Hash] opts the optional parameters
# @option opts [CreateIssuedDocumentRequest] :create_issued_document_request The Issued Document
# @return [CreateIssuedDocumentResponse]
describe 'create_issued_document test' do
it 'should work' do
opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } }
response = @api_instance.create_issued_document(2, opts)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @create_issued_document_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for delete_issued_document
# Delete Issued Document
# Deletes the specified document.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @return [nil]
describe 'delete_issued_document test' do
it 'should work' do
expect(true).to eq(true)
end
end
# unit tests for delete_issued_document_attachment
# Delete Issued Document Attachment
# Removes the attachment of the specified document.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @return [nil]
describe 'delete_issued_document_attachment test' do
it 'should work' do
expect(true).to eq(true)
end
end
# unit tests for get_email_data
# Get Email Data
# Gets the pre-compiled email details.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @return [GetEmailDataResponse]
describe 'get_email_data test' do
it 'should work' do
response = @api_instance.get_email_data(2, 22)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_email_data_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for get_existing_issued_document_totals
# Get Existing Issued Document Totals
# Returns the totals for a specified document.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @option opts [GetExistingIssuedDocumentTotalsRequest] :get_existing_issued_document_totals_request
# @return [GetExistingIssuedDocumentTotalsResponse]
describe 'get_existing_issued_document_totals test' do
it 'should work' do
response = @api_instance.get_existing_issued_document_totals(2, 22)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_existing_issued_document_totals_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for get_issued_document
# Get Issued Document
# Gets the specified document.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @option opts [String] :fields List of comma-separated fields.
# @option opts [String] :fieldset Name of the fieldset.
# @return [GetIssuedDocumentResponse]
describe 'get_issued_document test' do
it 'should work' do
response = @api_instance.get_issued_document(2, 22)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_issued_document_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for get_issued_document_pre_create_info
# Get Issued Document Pre-create info
# Retrieves the information useful while creating a new document.
# @param company_id The ID of the company.
# @param type The type of the issued document.
# @param [Hash] opts the optional parameters
# @return [GetIssuedDocumentPreCreateInfoResponse]
describe 'get_issued_document_pre_create_info test' do
it 'should work' do
response = @api_instance.get_issued_document_pre_create_info(2, 22)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_issued_document_pre_create_info_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for get_new_issued_document_totals
# Get New Issued Document Totals
# Returns the totals for a new document.
# @param company_id The ID of the company.
# @param [Hash] opts the optional parameters
# @option opts [GetNewIssuedDocumentTotalsRequest] :get_new_issued_document_totals_request
# @return [GetNewIssuedDocumentTotalsResponse]
describe 'get_new_issued_document_totals test' do
it 'should work' do
opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } }
response = @api_instance.get_new_issued_document_totals(2, opts)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_new_issued_document_totals_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for list_issued_documents
# List Issued Documents
# Lists the issued documents.
# @param company_id The ID of the company.
# @param type The type of the issued document.
# @param [Hash] opts the optional parameters
# @option opts [String] :fields List of comma-separated fields.
# @option opts [String] :fieldset Name of the fieldset.
# @option opts [String] :sort List of comma-separated fields for result sorting (minus for desc sorting).
# @option opts [Integer] :page The page to retrieve.
# @option opts [Integer] :per_page The size of the page.
# @option opts [String] :query Query for filtering the results.
# @return [ListIssuedDocumentsResponse]
describe 'list_issued_documents test' do
it 'should work' do
response = @api_instance.list_issued_documents(2, "invoices")
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @list_issued_documents_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for modify_issued_document
# Modify Issued Document
# Modifies the specified document.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @option opts [ModifyIssuedDocumentRequest] :modify_issued_document_request The modified document
# @return [ModifyIssuedDocumentResponse]
describe 'modify_issued_document test' do
it 'should work' do
opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } }
response = @api_instance.modify_issued_document(2, opts)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @modify_issued_document_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for schedule_email
# Schedule Email
# Schedules the sending of a document by email.
# @param company_id The ID of the company.
# @param document_id The ID of the document.
# @param [Hash] opts the optional parameters
# @option opts [ScheduleEmailRequest] :schedule_email_request Email Schedule
# @return [nil]
describe 'schedule_email test' do
it 'should work' do
expect(true).to eq(true)
end
end
# unit tests for upload_issued_document_attachment
# Upload Issued Document Attachment
# Uploads an attachment destined to an issued document. The actual association between the document and the attachment must be implemented separately, using the returned token.
# @param company_id The ID of the company.
# @param [Hash] opts the optional parameters
# @option opts [String] :filename Name of the file.
# @option opts [File] :attachment Valid format: .png, .jpg, .gif, .pdf, .zip, .xls, .xlsx, .doc, .docx
# @return [UploadIssuedDocumentAttachmentResponse]
describe 'upload_issued_document_attachment test' do
it 'should work' do
response = @api_instance.upload_issued_document_attachment(2, {})
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @upload_issued_document_attachment_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for transform_issued_document
# Transform Issued Document
describe 'transform_issued_document test' do
it 'should work' do
response = @api_instance.transform_issued_document(2, 54321, "proforma")
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @transform_issued_document_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
# unit tests for join_issued_documents
# Join Issued Documents
describe 'join_issued_documents test' do
it 'should work' do
response = @api_instance.join_issued_documents(2, {})
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @join_issued_documents_response_obj.to_json
actual_json = response.to_json
expect(actual_json).to eq(expected_json)
end
end
end