zugferd_code_lists/zugferd_2_3_2/
enum5305.rs

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