zugferd_code_lists/zugferd_2_3_2/
timecii.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 TimeCII {
6    /// Date of invoice
7    DateInvoice,
8    /// Date of delivery of goods to establishments/domicile/site
9    DateDeliveryGoodsToEstablishmentsDomicileSite,
10    /// Payment date
11    PaymentDate,
12}
13
14impl crate::Code for TimeCII {
15    fn code(self) -> &'static str {
16        match self {
17            TimeCII::DateInvoice => "5",
18            TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite => "29",
19            TimeCII::PaymentDate => "72",
20        }
21    }
22}
23
24impl crate::Description for TimeCII {
25    fn description(self) -> &'static str {
26        match self {
27            TimeCII::DateInvoice => "Date of invoice",
28            TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite => {
29                "Date of delivery of goods to establishments/domicile/site"
30            }
31            TimeCII::PaymentDate => "Payment date",
32        }
33    }
34}
35
36impl crate::FromCode for TimeCII {
37    fn from_code(code: &str) -> Option<Self>
38    where
39        Self: Sized,
40    {
41        match code {
42            "5" => Some(TimeCII::DateInvoice),
43            "29" => Some(TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite),
44            "72" => Some(TimeCII::PaymentDate),
45            _ => None,
46        }
47    }
48}