zugferd_code_lists/zugferd_2_3_2/
enum5305.rs1#![allow(non_camel_case_types)]
2
3#[cfg_attr(feature = "specta", derive(specta::Type))]
4#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
6pub enum Enum5305 {
7 StandardRate,
9 ZeroRatedGoods,
11 ExemptFromTax,
13 VatReverseCharge,
17 VatExemptForEeaIntraCommunitySupplyGoodsAndServices,
21 FreeExportItemTaxNotCharged,
23 ServiceOutsideScopeTax,
27 CanaryIslandsGeneralIndirectTax,
31 TaxForProductionServicesAndImportationInCeutaAndMelilla,
35}
36
37impl crate::Code for Enum5305 {
38 fn code(self) -> &'static str {
39 match self {
40 Enum5305::StandardRate => "S",
41 Enum5305::ZeroRatedGoods => "Z",
42 Enum5305::ExemptFromTax => "E",
43 Enum5305::VatReverseCharge => "AE",
44 Enum5305::VatExemptForEeaIntraCommunitySupplyGoodsAndServices => "K",
45 Enum5305::FreeExportItemTaxNotCharged => "G",
46 Enum5305::ServiceOutsideScopeTax => "O",
47 Enum5305::CanaryIslandsGeneralIndirectTax => "L",
48 Enum5305::TaxForProductionServicesAndImportationInCeutaAndMelilla => "M",
49 }
50 }
51}
52
53impl crate::Description for Enum5305 {
54 fn description(self) -> &'static str {
55 match self {
56 Enum5305::StandardRate => "Standard rate",
57 Enum5305::ZeroRatedGoods => "Zero rated goods",
58 Enum5305::ExemptFromTax => "Exempt from tax",
59 Enum5305::VatReverseCharge => "VAT Reverse charge",
60 Enum5305::VatExemptForEeaIntraCommunitySupplyGoodsAndServices => {
61 "VAT exempt for EEA intra-community supply of goods and services"
62 }
63 Enum5305::FreeExportItemTaxNotCharged => "Free export item, tax not charged",
64 Enum5305::ServiceOutsideScopeTax => "Service outside scope of tax",
65 Enum5305::CanaryIslandsGeneralIndirectTax => "Canary Islands general indirect tax",
66 Enum5305::TaxForProductionServicesAndImportationInCeutaAndMelilla => {
67 "Tax for production, services and importation in Ceuta and Melilla"
68 }
69 }
70 }
71}
72
73impl crate::FromCode for Enum5305 {
74 fn from_code(code: &str) -> Option<Self>
75 where
76 Self: Sized,
77 {
78 match code {
79 "S" => Some(Enum5305::StandardRate),
80 "Z" => Some(Enum5305::ZeroRatedGoods),
81 "E" => Some(Enum5305::ExemptFromTax),
82 "AE" => Some(Enum5305::VatReverseCharge),
83 "K" => Some(Enum5305::VatExemptForEeaIntraCommunitySupplyGoodsAndServices),
84 "G" => Some(Enum5305::FreeExportItemTaxNotCharged),
85 "O" => Some(Enum5305::ServiceOutsideScopeTax),
86 "L" => Some(Enum5305::CanaryIslandsGeneralIndirectTax),
87 "M" => Some(Enum5305::TaxForProductionServicesAndImportationInCeutaAndMelilla),
88 _ => None,
89 }
90 }
91}