zugferd_code_lists/zugferd_2_3_3/
enum5305.rs

1#![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    /// Standard rate
8    StandardRate,
9    /// Zero rated goods
10    ZeroRatedGoods,
11    /// Exempt from tax
12    ExemptFromTax,
13    /// VAT Reverse charge
14    ///
15    /// VAT reverse charge
16    VatReverseCharge,
17    /// VAT exempt for EEA intra-community supply of goods and services
18    ///
19    /// VAT exempt for intra community supply of goods
20    VatExemptForEeaIntraCommunitySupplyGoodsAndServices,
21    /// Free export item, tax not charged
22    FreeExportItemTaxNotCharged,
23    /// Service outside scope of tax
24    ///
25    /// Services outside scope of tax
26    ServiceOutsideScopeTax,
27    /// Canary Islands general indirect tax
28    ///
29    /// Canary Islands General Indirect Tax
30    CanaryIslandsGeneralIndirectTax,
31    /// Tax for production, services and importation in Ceuta and Melilla
32    ///
33    /// Liable for IPSI
34    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}