From d9f912378d60c29bfc02b94e43266adca5d1b0c1 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Fri, 30 Oct 2020 15:17:29 +0100 Subject: [PATCH] invoice: add GTU and SP codes These are codes defined in JPK_V7, ie. the control file submitted to Polish tax authorities for all invoices created in a given month. We need to now tag our invoices with the appropriate codes when submitting them to our accountants, which will pass them on over to the tax authoritiex in a JPK_V7M file. This only adds the relevant enums and adds them to proto messages, but does not actually implement any control/model logic. Change-Id: I695d05b55143a248dab9346151da3c572c7665d4 --- bgpwtf/invoice/proto/invoice.proto | 219 ++++++++++++++++++++++++++++- 1 file changed, 217 insertions(+), 2 deletions(-) diff --git a/bgpwtf/invoice/proto/invoice.proto b/bgpwtf/invoice/proto/invoice.proto index 75720b78..ee2b9d8a 100644 --- a/bgpwtf/invoice/proto/invoice.proto +++ b/bgpwtf/invoice/proto/invoice.proto @@ -2,6 +2,210 @@ syntax = "proto3"; package invoice; option go_package = "code.hackerspace.pl/hscloud/bgpwtf/invoice/proto"; +// GTU codes as defined by JPK_V7. In context of polish VAT/tax law. +// Original schema: http://crd.gov.pl/wzor/2020/05/08/9393/schemat.xsd +// These are used to tag invoice Items. These then get coalesced when an +// Invoice gets created, and that set of tags (specific now to an invoice) +// is then submitted to accounting. +// Numerical values of each code correspond to its numeric name (which is +// enshrined in the JPK schema). +// For each value, we provide one of more of following comments: +// - PL: official polish field from schema. +// - EN: non-legally binding english translation for internal documentation +// purposes. +// - COMMENT: extra comments for internal documentation purposes. +enum GTUCode { + GTU_INVALID = 0; + // PL: Dostawa napojów alkoholowych - alkoholu etylowego, piwa, wina, + // napojów fermentowanych i wyrobów pośrednich, w rozumieniu przepisów + // o podatku akcyzowym + // EN: Supply of alcoholic beverages - ethanol, beer, wine, fermented + // beverages and intermediate products, within the meaning of + // provisions on excise duty. + GTU_01 = 1; + // PL: Dostawa towarów, o których mowa w art. 103 ust. 5aa ustawy + // EN: Supply of goods referred to in Art. 103 paragraph 5aa of the VAT law + // COMMENT: liquid fuels. + GTU_02 = 2; + // PL: Dostawa oleju opałowego w rozumieniu przepisów o podatku akcyzowym + // oraz olejów smarowych, pozostałych olejów o kodach CN od 2710 19 71 + // do 2710 19 99, z wyłączeniem wyrobów o kodzie CN 2710 19 85 (oleje + // białe, parafina ciekła) oraz smarów plastycznych zaliczanych do kodu + // CN 2710 19 99, olejów smarowych o kodzie CN 2710 20 90, preparatów + // smarowych objętych pozycją CN 3403, z wyłączeniem smarów + // plastycznych objętych tą pozycją + // EN: Supply of fuel oil under the provisions of provisions on excise + // duty, and lubricating oils, other oils with CN codes from 2710 19 71 + // do 2710 19 99, except products with code CN 2710 19 85 (while + // mineral oils, liquid paraffin) and high viscosity oils classified + // under code CN 2710 19 199, lubricating oils with code CN 2710 20 90, + // lubricating products classified under code CN 3403, except high + // viscosity lubricants classified under this code. + GTU_03 = 3; + // PL: Dostawa wyrobów tytoniowych, suszu tytoniowego, płynu do papierosów + // elektronicznych i wyrobów nowatorskich, w rozumieniu przepisów o + // podatku akcyzowym + // EN: Supply of tobacco products, dried tobacco, electronic cigarette + // liquids and designer products, within the meaning of provisions on + // excise duty. + GTU_04 = 4; + // PL: Dostawa odpadów - wyłącznie określonych w poz. 79-91 załącznika nr + // 15 do ustawy + // EN: Waste supply - only as defined in annex 15 position 79-91 of the VAT + // law. + // COMMENT: non-WEEE waste, except batteries. + GTU_05 = 5; + // PL: Dostawa urządzeń elektronicznych oraz części i materiałów do nich, + // wyłącznie określonych w poz. 7-9, 59-63, 65, 66, 69 i 94-96 załącznika + // nr 15 do ustawy + // EN: Supply of electronic devices and components thereof, only as defined + // in annex 15, positions 7-9, 59-63, 65, 66, 69 and 94-96 of the VAT + // law. + // COMMENT: print cartridges, ink, plastics, processors, computers, HDDs, + // SSDs, mobile phones, video game consoles, photo cameras, + // photocopier parts, software bundles on SSDs, video on SSDs. + // COMMENT: tl;dr computer accessories and stuff, but not CDs/DVDs. + GTU_06 = 6; + // PL: Dostawa pojazdów oraz części samochodowych o kodach wyłącznie CN + // 8701 - 8708 oraz CN 8708 10 + // EN: Supply of vehicles and car parts only with CN codes 8701-8708 and CN + // 8708 10. + GTU_07 = 7; + // PL: Dostawa metali szlachetnych oraz nieszlachetnych - wyłącznie + // określonych w poz. 1-3 załącznika nr 12 do ustawy oraz w poz. 12-25, + // 33-40, 45, 46, 56 i 78 załącznika nr 15 do ustawy + // EN: Supply of precious and common metals - only as defined in annex 12 + // positions 1-3 and annex 15 positions 12-25, 33-40, 45, 46, 56, 78 of + // the VAT law. + // COMMENT: metals but also wax/stearine for sculpting, metal waste, + // antiques (>100Y) containing metal. + GTU_08 = 8; + // PL: Dostawa leków oraz wyrobów medycznych - produktów leczniczych, + // środków spożywczych specjalnego przeznaczenia żywieniowego oraz + // wyrobów medycznych, objętych obowiązkiem zgłoszenia, o którym mowa w + // art. 37av ust. 1 ustawy z dnia 6 września 2001 r. - Prawo + // farmaceutyczne (Dz. U. z 2019 r. poz. 499, z późn. zm.) + // EN: Supply of medicine and medical products - [...] + GTU_09 = 9; + // PL: Dostawa budynków, budowli i gruntów + // EN: Supply of buildings, structures and land. + GTU_10 = 10; + // PL: Świadczenie usług w zakresie przenoszenia uprawnień do emisji gazów + // cieplarnianych, o których mowa w ustawie z dnia 12 czerwca 2015 r. o + // systemie handlu uprawnieniami do emisji gazów cieplarnianych (Dz. U. + // z 2018 r. poz. 1201 i 2538 oraz z 2019 r. poz. 730, 1501 i 1532) + // EN: Supply of services related to transfer of greenhouse gas emission + // allowances, as defined in Dz. U. z 2018r. poz. 1201 i 2538 oraz z + // 2019r. poz. 730, 1501 i 1532. + GTU_11 = 11; + // PL: Świadczenie usług o charakterze niematerialnym - wyłącznie: + // doradczych, księgowych, prawnych, zarządczych, szkoleniowych, + // marketingowych, firm centralnych (head offices), reklamowych, + // badania rynku i opinii publicznej, w zakresie badań naukowych i prac + // rozwojowych + // EN: Supply of non-material services - only: consulting, accounting, + // legal, managerial, training, marketing, head offices, advertisement, + // market and public opinion study, within academic research and R&D. + // COMMENT: IT consulting falls under this. + GTU_12 = 12; + // PL: Świadczenie usług transportowych i gospodarki magazynowej - Sekcja H + // PKWiU 2015 symbol ex 49.4, ex 52.1 + // EN: Supply of transport and logistics services [...]. + GTU_13 = 13; +} + +// SP codes as defined by JPK_V7. In context of polish VAT/tax law. +// Original schema: http://crd.gov.pl/wzor/2020/05/08/9393/schemat.xsd +// These are used to tag invoices, and describe sale procedures regarding this +// invoice. +// Numerical values are arbitrary. +// For each value, we provide one of more of following comments: +// - PL: official polish field from schema. +// - EN: non-legally binding english translation for internal documentation +// purposes. +// - COMMENT: extra comments for internal documentation purposes. +enum SPCode { + SP_INVALID = 0; + // PL: Dostawa w ramach sprzedaży wysyłkowej z terytorium kraju, o której + // mowa w art. 23 ustawy + // EN: Mail Order sales, as per art. 23 of the VAT law. + SP_SW = 1; + // PL: Świadczenie usług telekomunikacyjnych, nadawczych i elektronicznych, + // o których mowa w art. 28k ustawy + // EN: Supply of telecommunication, broadcast and electronic services as + // per artc. 28k of the VAT law. + // COMMENT: MOSS EU VAT sales. + SP_EE = 2; + // PL: Istniejące powiązania między nabywcą a dokonującym dostawy towarów + // lub usługodawcą, o których mowa w art. 32 ust. 2 pkt 1 ustawy + // EN: Existing connection between the buyer and supplier of goods or + // services, as per art. 32, par. 2 point 2 of the VAT law + SP_TP = 3; + // PL: Wewnątrzwspólnotowe nabycie towarów dokonane przez drugiego w + // kolejności podatnika VAT w ramach transakcji trójstronnej w + // procedurze uproszczonej, o której mowa w dziale XII rozdziale 8 + // ustawy + // EN: Intra-EU goods supply by the second VAT taxpayer in a tripartite + // simplified procedures as defined insection XII chapter 8 of the VAT + // law + SP_TT_WNT = 4; + // PL: Dostawa towarów poza terytorium kraju dokonana przez drugiego w + // kolejności podatnika VAT w ramach transakcji trójstronnej w + // procedurze uproszczonej, o której mowa w dziale XII rozdziale 8 + // ustawy + // EN: Foreign goods supply by the second VAT taxpayer in a tripartite + // simplified procedures as defined insection XII chapter 8 of the VAT + // law + SP_TT_D = 5; + // PL: Świadczenie usług turystyki opodatkowane na zasadach marży zgodnie z + // art. 119 ustawy + // EN: Supply of tourism services under magin tax as per art. 119 of the + // VAT law + SP_MR_T = 6; + // PL: Dostawa towarów używanych, dzieł sztuki, przedmiotów + // kolekcjonerskich i antyków, opodatkowana na zasadach marży zgodnie z + // art. 120 ustawy + // EN: Supply of used goods, art, collectibles and antiques under margin + // tax as per art 120 of the VAT law + SP_MR_UZ = 7; + // PL: Wewnątrzwspólnotowa dostawa towarów następująca po imporcie tych + // towarów w ramach procedury celnej 42 (import) + // EN: Intra-EU goods supply after import of these goods as part of the + // customs procedure 42 (import) + SP_I_42 = 8; + // PL: Wewnątrzwspólnotowa dostawa towarów następująca po imporcie tych + // towarów w ramach procedury celnej 63 (import) + // EN: Intra-EU goods supply after import of these goods as part of the + // customs procedure 63 (import) + SP_I_63 = 9; + // PL: Transfer bonu jednego przeznaczenia dokonany przez podatnika + // działającego we własnym imieniu, opodatkowany zgodnie z art. 8a ust. + // 1 ustawy + // EN: Transfer of a single-purpose voucher by a taxpayer acting on their + // own behalf, taxed under art. 8a paragraph 1 of the VAT law + SP_B_SPV = 10; + // PL: Dostawa towarów oraz świadczenie usług, których dotyczy bon jednego + // przeznaczenia na rzecz podatnika, który wyemitował bon zgodnie z + // art. 8a ust. 4 ustawy + // EN: Supply of goods and services affected by single-purpose voucher for + // a taxpayer, which emitted that voucher in accordance with art. 8a + // paragraph 4 of the VAT law + SP_B_SPV_DOSTAWA = 11; + // PL: Świadczenie usług pośrednictwa oraz innych usług dotyczących + // transferu bonu różnego przeznaczenia, opodatkowane zgodnie z art. 8b + // ust. 2 ustawy + // EN: Supply of intermediary services and other services relating to the + // transfer of multi-purpose vouchers, taxed in accordance with art. 8b + // paragraph 2 of the VAT law + SP_B_MPV_PROWIZJA = 12; + // PL: Transakcja objęta obowiązkiem stosowania mechanizmu podzielonej + // płatności + // EN: Transaction required to use the VAT split payment mechanism + SP_MPP = 13; +} + + +// VAT invoice item (ie. entry). message Item { string title = 1; uint64 count = 2; @@ -9,16 +213,24 @@ message Item { // in thousands of percent points // (ie 23% == 23000) uint64 vat = 4; - // Denormalized fields follow. + // GTU codes for this item. + repeated GTUCode gtu_code = 7; + + // Denormalized fields follow. These are only present in Invoice, not + // InvoiceData. uint64 total_net = 5; uint64 total = 6; + // Next tag: 8 } +// Point of contact for an invoice. message ContactPoint { string medium = 1; string contact = 2; } +// Invoice 'intent' - ie. data given by an Invoice creator. These never change +// after creation. message InvoiceData { repeated Item item = 1; repeated string invoicer_billing = 2; @@ -35,7 +247,8 @@ message InvoiceData { string iban = 9; string swift = 10; string unit = 13; - // Next tag: 15 + repeated SPCode sp_code = 15; + // Next tag: 16 } message Invoice { @@ -56,6 +269,8 @@ message Invoice { uint64 total_net = 6; uint64 total = 7; string unit = 8; + repeated GTUCode gtu_codes = 10; + // Next tag: 11; } message CreateInvoiceRequest {