zugferd_code_lists/zugferd_2_3_3/
timecii.rs

1#![allow(non_camel_case_types)]
2
3#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
4pub enum TimeCII {
5    /// Date of invoice
6    DateInvoice,
7    /// Date of delivery of goods to establishments/domicile/site
8    DateDeliveryGoodsToEstablishmentsDomicileSite,
9    /// Payment date
10    PaymentDate,
11}
12
13impl crate::Code for TimeCII {
14    fn code(&self) -> &str {
15        match self {
16            TimeCII::DateInvoice => "5",
17            TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite => "29",
18            TimeCII::PaymentDate => "72",
19        }
20    }
21}
22
23impl crate::Description for TimeCII {
24    fn description(&self) -> &str {
25        match self {
26            TimeCII::DateInvoice => "Date of invoice",
27            TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite => {
28                "Date of delivery of goods to establishments/domicile/site"
29            }
30            TimeCII::PaymentDate => "Payment date",
31        }
32    }
33}
34
35impl crate::FromCode for TimeCII {
36    fn from_code(code: &str) -> Option<Self>
37    where
38        Self: Sized,
39    {
40        match code {
41            "5" => Some(TimeCII::DateInvoice),
42            "29" => Some(TimeCII::DateDeliveryGoodsToEstablishmentsDomicileSite),
43            "72" => Some(TimeCII::PaymentDate),
44            _ => None,
45        }
46    }
47}