zugferd_code_lists/zugferd_2_3_3/
enum5305.rs

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