zugferd_code_lists/zugferd_2_3_2/
enum1001.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 Enum1001 {
7    /// Request for payment
8    ///
9    /// Invoice
10    RequestForPayment,
11    /// Debit note related to goods or services
12    ///
13    /// Invoice
14    DebitNoteRelatedToGoodsOrServices,
15    /// Credit note related to goods or services
16    ///
17    /// Credit Note
18    CreditNoteRelatedToGoodsOrServices,
19    /// Metered services invoice
20    ///
21    /// Invoice
22    MeteredServicesInvoice,
23    /// Credit note related to financial adjustments
24    ///
25    /// Credit Note
26    CreditNoteRelatedToFinancialAdjustments,
27    /// Debit note related to financial adjustments
28    ///
29    /// Invoice
30    DebitNoteRelatedToFinancialAdjustments,
31    /// Tax notification
32    ///
33    /// Invoice
34    TaxNotification,
35    /// Invoicing data sheet
36    ///
37    /// Invoice
38    InvoicingDataSheet,
39    /// Direct payment valuation
40    ///
41    /// Invoice
42    DirectPaymentValuation,
43    /// Provisional payment valuation
44    ///
45    /// Invoice
46    ProvisionalPaymentValuation,
47    /// Payment valuation
48    ///
49    /// Invoice
50    PaymentValuation,
51    /// Interim application for payment
52    ///
53    /// Invoice
54    InterimApplicationForPayment,
55    /// Final payment request based on completion of work
56    ///
57    /// Invoice
58    FinalPaymentRequestBasedOnCompletionWork,
59    /// Payment request for completed units
60    ///
61    /// Invoice
62    PaymentRequestForCompletedUnits,
63    /// Self billed credit note
64    ///
65    /// Credit Note
66    SelfBilledCreditNote,
67    /// Consolidated credit note - goods and services
68    ///
69    /// Credit Note
70    ConsolidatedCreditNoteGoodsAndServices,
71    /// Price variation invoice
72    ///
73    /// Invoice
74    PriceVariationInvoice,
75    /// Credit note for price variation
76    ///
77    /// Credit Note
78    CreditNoteForPriceVariation,
79    /// Delcredere credit note
80    ///
81    /// Credit Note
82    DelcredereCreditNote,
83    /// Proforma invoice
84    ///
85    /// Invoice
86    ProformaInvoice,
87    /// Partial invoice
88    ///
89    /// Invoice
90    PartialInvoice,
91    /// Commercial invoice which includes a packing list
92    ///
93    /// Invoice
94    CommercialInvoiceWhichIncludesAPackingList,
95    /// Commercial invoice
96    ///
97    /// Invoice
98    CommercialInvoice,
99    /// Credit note
100    ///
101    /// Credit Note
102    CreditNote,
103    /// Commission note
104    ///
105    /// Invoice
106    CommissionNote,
107    /// Debit note
108    ///
109    /// Invoice
110    DebitNote,
111    /// Corrected invoice
112    ///
113    /// Invoice
114    CorrectedInvoice,
115    /// Consolidated invoice
116    ///
117    /// Invoice
118    ConsolidatedInvoice,
119    /// Prepayment invoice
120    ///
121    /// Invoice
122    PrepaymentInvoice,
123    /// Hire invoice
124    ///
125    /// Invoice
126    HireInvoice,
127    /// Tax invoice
128    ///
129    /// Invoice
130    TaxInvoice,
131    /// Self-billed invoice
132    ///
133    /// Invoice
134    SelfBilledInvoice,
135    /// Delcredere invoice
136    ///
137    /// Invoice
138    DelcredereInvoice,
139    /// Factored invoice
140    ///
141    /// Invoice
142    FactoredInvoice,
143    /// Lease invoice
144    ///
145    /// Invoice
146    LeaseInvoice,
147    /// Consignment invoice
148    ///
149    /// Invoice
150    ConsignmentInvoice,
151    /// Factored credit note
152    ///
153    /// Credit Note
154    FactoredCreditNote,
155    /// Optical Character Reading (OCR) payment credit note
156    ///
157    /// Credit Note
158    OpticalCharacterReadingOcrPaymentCreditNote,
159    /// Debit advice
160    ///
161    /// Invoice
162    DebitAdvice,
163    /// Reversal of debit
164    ///
165    /// Invoice
166    ReversalDebit,
167    /// Reversal of credit
168    ///
169    /// Credit Note
170    ReversalCredit,
171    /// Self billed debit note
172    ///
173    /// Invoice
174    SelfBilledDebitNote,
175    /// Forwarder's credit note
176    ///
177    /// Credit Note
178    ForwardersCreditNote,
179    /// Forwarder's invoice discrepancy report
180    ///
181    /// Invoice
182    ForwardersInvoiceDiscrepancyReport,
183    /// Insurer's invoice
184    ///
185    /// Invoice
186    InsurersInvoice,
187    /// Forwarder's invoice
188    ///
189    /// Invoice
190    ForwardersInvoice,
191    /// Port charges documents
192    ///
193    /// Invoice
194    PortChargesDocuments,
195    /// Invoice information for accounting purposes
196    ///
197    /// Invoice
198    InvoiceInformationForAccountingPurposes,
199    /// Freight invoice
200    ///
201    /// Invoice
202    FreightInvoice,
203    /// Claim notification
204    ///
205    /// Invoice
206    ClaimNotification,
207    /// Consular invoice
208    ///
209    /// Invoice
210    ConsularInvoice,
211    /// Partial construction invoice
212    ///
213    /// Invoice
214    PartialConstructionInvoice,
215    /// Partial final construction invoice
216    ///
217    /// Invoice
218    PartialFinalConstructionInvoice,
219    /// Final construction invoice
220    ///
221    /// Invoice
222    FinalConstructionInvoice,
223    /// Customs invoice
224    ///
225    /// Invoice
226    CustomsInvoice,
227}
228
229impl std::fmt::Display for Enum1001 {
230    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
231        write!(f, "{}", <Self as crate::Code>::code(*self))
232    }
233}
234
235impl std::str::FromStr for Enum1001 {
236    type Err = crate::ParseError<Self>;
237    fn from_str(s: &str) -> Result<Self, Self::Err> {
238        <Self as crate::FromCode>::from_code(s)
239            .ok_or_else(|| crate::ParseError::<Self>::new(s.to_owned()))
240    }
241}
242
243impl crate::Code for Enum1001 {
244    fn code(self) -> &'static str {
245        match self {
246            Enum1001::RequestForPayment => "71",
247            Enum1001::DebitNoteRelatedToGoodsOrServices => "80",
248            Enum1001::CreditNoteRelatedToGoodsOrServices => "81",
249            Enum1001::MeteredServicesInvoice => "82",
250            Enum1001::CreditNoteRelatedToFinancialAdjustments => "83",
251            Enum1001::DebitNoteRelatedToFinancialAdjustments => "84",
252            Enum1001::TaxNotification => "102",
253            Enum1001::InvoicingDataSheet => "130",
254            Enum1001::DirectPaymentValuation => "202",
255            Enum1001::ProvisionalPaymentValuation => "203",
256            Enum1001::PaymentValuation => "204",
257            Enum1001::InterimApplicationForPayment => "211",
258            Enum1001::FinalPaymentRequestBasedOnCompletionWork => "218",
259            Enum1001::PaymentRequestForCompletedUnits => "219",
260            Enum1001::SelfBilledCreditNote => "261",
261            Enum1001::ConsolidatedCreditNoteGoodsAndServices => "262",
262            Enum1001::PriceVariationInvoice => "295",
263            Enum1001::CreditNoteForPriceVariation => "296",
264            Enum1001::DelcredereCreditNote => "308",
265            Enum1001::ProformaInvoice => "325",
266            Enum1001::PartialInvoice => "326",
267            Enum1001::CommercialInvoiceWhichIncludesAPackingList => "331",
268            Enum1001::CommercialInvoice => "380",
269            Enum1001::CreditNote => "381",
270            Enum1001::CommissionNote => "382",
271            Enum1001::DebitNote => "383",
272            Enum1001::CorrectedInvoice => "384",
273            Enum1001::ConsolidatedInvoice => "385",
274            Enum1001::PrepaymentInvoice => "386",
275            Enum1001::HireInvoice => "387",
276            Enum1001::TaxInvoice => "388",
277            Enum1001::SelfBilledInvoice => "389",
278            Enum1001::DelcredereInvoice => "390",
279            Enum1001::FactoredInvoice => "393",
280            Enum1001::LeaseInvoice => "394",
281            Enum1001::ConsignmentInvoice => "395",
282            Enum1001::FactoredCreditNote => "396",
283            Enum1001::OpticalCharacterReadingOcrPaymentCreditNote => "420",
284            Enum1001::DebitAdvice => "456",
285            Enum1001::ReversalDebit => "457",
286            Enum1001::ReversalCredit => "458",
287            Enum1001::SelfBilledDebitNote => "527",
288            Enum1001::ForwardersCreditNote => "532",
289            Enum1001::ForwardersInvoiceDiscrepancyReport => "553",
290            Enum1001::InsurersInvoice => "575",
291            Enum1001::ForwardersInvoice => "623",
292            Enum1001::PortChargesDocuments => "633",
293            Enum1001::InvoiceInformationForAccountingPurposes => "751",
294            Enum1001::FreightInvoice => "780",
295            Enum1001::ClaimNotification => "817",
296            Enum1001::ConsularInvoice => "870",
297            Enum1001::PartialConstructionInvoice => "875",
298            Enum1001::PartialFinalConstructionInvoice => "876",
299            Enum1001::FinalConstructionInvoice => "877",
300            Enum1001::CustomsInvoice => "935",
301        }
302    }
303}
304
305impl crate::Description for Enum1001 {
306    fn description(self) -> &'static str {
307        match self {
308            Enum1001::RequestForPayment => "Request for payment",
309            Enum1001::DebitNoteRelatedToGoodsOrServices => {
310                "Debit note related to goods or services"
311            }
312            Enum1001::CreditNoteRelatedToGoodsOrServices => {
313                "Credit note related to goods or services"
314            }
315            Enum1001::MeteredServicesInvoice => "Metered services invoice",
316            Enum1001::CreditNoteRelatedToFinancialAdjustments => {
317                "Credit note related to financial adjustments"
318            }
319            Enum1001::DebitNoteRelatedToFinancialAdjustments => {
320                "Debit note related to financial adjustments"
321            }
322            Enum1001::TaxNotification => "Tax notification",
323            Enum1001::InvoicingDataSheet => "Invoicing data sheet",
324            Enum1001::DirectPaymentValuation => "Direct payment valuation",
325            Enum1001::ProvisionalPaymentValuation => "Provisional payment valuation",
326            Enum1001::PaymentValuation => "Payment valuation",
327            Enum1001::InterimApplicationForPayment => "Interim application for payment",
328            Enum1001::FinalPaymentRequestBasedOnCompletionWork => {
329                "Final payment request based on completion of work"
330            }
331            Enum1001::PaymentRequestForCompletedUnits => "Payment request for completed units",
332            Enum1001::SelfBilledCreditNote => "Self billed credit note",
333            Enum1001::ConsolidatedCreditNoteGoodsAndServices => {
334                "Consolidated credit note - goods and services"
335            }
336            Enum1001::PriceVariationInvoice => "Price variation invoice",
337            Enum1001::CreditNoteForPriceVariation => "Credit note for price variation",
338            Enum1001::DelcredereCreditNote => "Delcredere credit note",
339            Enum1001::ProformaInvoice => "Proforma invoice",
340            Enum1001::PartialInvoice => "Partial invoice",
341            Enum1001::CommercialInvoiceWhichIncludesAPackingList => {
342                "Commercial invoice which includes a packing list"
343            }
344            Enum1001::CommercialInvoice => "Commercial invoice",
345            Enum1001::CreditNote => "Credit note",
346            Enum1001::CommissionNote => "Commission note",
347            Enum1001::DebitNote => "Debit note",
348            Enum1001::CorrectedInvoice => "Corrected invoice",
349            Enum1001::ConsolidatedInvoice => "Consolidated invoice",
350            Enum1001::PrepaymentInvoice => "Prepayment invoice",
351            Enum1001::HireInvoice => "Hire invoice",
352            Enum1001::TaxInvoice => "Tax invoice",
353            Enum1001::SelfBilledInvoice => "Self-billed invoice",
354            Enum1001::DelcredereInvoice => "Delcredere invoice",
355            Enum1001::FactoredInvoice => "Factored invoice",
356            Enum1001::LeaseInvoice => "Lease invoice",
357            Enum1001::ConsignmentInvoice => "Consignment invoice",
358            Enum1001::FactoredCreditNote => "Factored credit note",
359            Enum1001::OpticalCharacterReadingOcrPaymentCreditNote => {
360                "Optical Character Reading (OCR) payment credit note"
361            }
362            Enum1001::DebitAdvice => "Debit advice",
363            Enum1001::ReversalDebit => "Reversal of debit",
364            Enum1001::ReversalCredit => "Reversal of credit",
365            Enum1001::SelfBilledDebitNote => "Self billed debit note",
366            Enum1001::ForwardersCreditNote => "Forwarder's credit note",
367            Enum1001::ForwardersInvoiceDiscrepancyReport => {
368                "Forwarder's invoice discrepancy report"
369            }
370            Enum1001::InsurersInvoice => "Insurer's invoice",
371            Enum1001::ForwardersInvoice => "Forwarder's invoice",
372            Enum1001::PortChargesDocuments => "Port charges documents",
373            Enum1001::InvoiceInformationForAccountingPurposes => {
374                "Invoice information for accounting purposes"
375            }
376            Enum1001::FreightInvoice => "Freight invoice",
377            Enum1001::ClaimNotification => "Claim notification",
378            Enum1001::ConsularInvoice => "Consular invoice",
379            Enum1001::PartialConstructionInvoice => "Partial construction invoice",
380            Enum1001::PartialFinalConstructionInvoice => "Partial final construction invoice",
381            Enum1001::FinalConstructionInvoice => "Final construction invoice",
382            Enum1001::CustomsInvoice => "Customs invoice",
383        }
384    }
385}
386
387impl crate::FromCode for Enum1001 {
388    fn from_code(code: &str) -> Option<Self>
389    where
390        Self: Sized,
391    {
392        match code {
393            "71" => Some(Enum1001::RequestForPayment),
394            "80" => Some(Enum1001::DebitNoteRelatedToGoodsOrServices),
395            "81" => Some(Enum1001::CreditNoteRelatedToGoodsOrServices),
396            "82" => Some(Enum1001::MeteredServicesInvoice),
397            "83" => Some(Enum1001::CreditNoteRelatedToFinancialAdjustments),
398            "84" => Some(Enum1001::DebitNoteRelatedToFinancialAdjustments),
399            "102" => Some(Enum1001::TaxNotification),
400            "130" => Some(Enum1001::InvoicingDataSheet),
401            "202" => Some(Enum1001::DirectPaymentValuation),
402            "203" => Some(Enum1001::ProvisionalPaymentValuation),
403            "204" => Some(Enum1001::PaymentValuation),
404            "211" => Some(Enum1001::InterimApplicationForPayment),
405            "218" => Some(Enum1001::FinalPaymentRequestBasedOnCompletionWork),
406            "219" => Some(Enum1001::PaymentRequestForCompletedUnits),
407            "261" => Some(Enum1001::SelfBilledCreditNote),
408            "262" => Some(Enum1001::ConsolidatedCreditNoteGoodsAndServices),
409            "295" => Some(Enum1001::PriceVariationInvoice),
410            "296" => Some(Enum1001::CreditNoteForPriceVariation),
411            "308" => Some(Enum1001::DelcredereCreditNote),
412            "325" => Some(Enum1001::ProformaInvoice),
413            "326" => Some(Enum1001::PartialInvoice),
414            "331" => Some(Enum1001::CommercialInvoiceWhichIncludesAPackingList),
415            "380" => Some(Enum1001::CommercialInvoice),
416            "381" => Some(Enum1001::CreditNote),
417            "382" => Some(Enum1001::CommissionNote),
418            "383" => Some(Enum1001::DebitNote),
419            "384" => Some(Enum1001::CorrectedInvoice),
420            "385" => Some(Enum1001::ConsolidatedInvoice),
421            "386" => Some(Enum1001::PrepaymentInvoice),
422            "387" => Some(Enum1001::HireInvoice),
423            "388" => Some(Enum1001::TaxInvoice),
424            "389" => Some(Enum1001::SelfBilledInvoice),
425            "390" => Some(Enum1001::DelcredereInvoice),
426            "393" => Some(Enum1001::FactoredInvoice),
427            "394" => Some(Enum1001::LeaseInvoice),
428            "395" => Some(Enum1001::ConsignmentInvoice),
429            "396" => Some(Enum1001::FactoredCreditNote),
430            "420" => Some(Enum1001::OpticalCharacterReadingOcrPaymentCreditNote),
431            "456" => Some(Enum1001::DebitAdvice),
432            "457" => Some(Enum1001::ReversalDebit),
433            "458" => Some(Enum1001::ReversalCredit),
434            "527" => Some(Enum1001::SelfBilledDebitNote),
435            "532" => Some(Enum1001::ForwardersCreditNote),
436            "553" => Some(Enum1001::ForwardersInvoiceDiscrepancyReport),
437            "575" => Some(Enum1001::InsurersInvoice),
438            "623" => Some(Enum1001::ForwardersInvoice),
439            "633" => Some(Enum1001::PortChargesDocuments),
440            "751" => Some(Enum1001::InvoiceInformationForAccountingPurposes),
441            "780" => Some(Enum1001::FreightInvoice),
442            "817" => Some(Enum1001::ClaimNotification),
443            "870" => Some(Enum1001::ConsularInvoice),
444            "875" => Some(Enum1001::PartialConstructionInvoice),
445            "876" => Some(Enum1001::PartialFinalConstructionInvoice),
446            "877" => Some(Enum1001::FinalConstructionInvoice),
447            "935" => Some(Enum1001::CustomsInvoice),
448            _ => None,
449        }
450    }
451}