zugferd_code_lists/zugferd_2_3_3/
incoterms.rs1#![allow(non_camel_case_types)]
2
3#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
4pub enum INCOTERMS {
5 DeliveryArrangedBySupplier,
7 DeliveryArrangedByLogisticServiceProvider,
9 CostAndFreight,
11 CostInsuranceAndFreight,
13 CarriageAndInsurancePaidToInsertNamedPlaceDestination,
15 CarriagePaidToInsertNamedPlaceDestination,
17 DeliveredAtPlaceInsertNamedPlaceDestination,
19 DeliveredDutyPaidInsertNamedPlaceDestination,
21 DeliveredAtPlaceUnloadedInsertNamedPlaceUnloading,
23 ExWorksInsertNamedPlaceDelivery,
25 FreeAlongsideShipInsertNamedPortShipment,
27 FreeCarrierInsertNamedPlaceDelivery,
29 FreeOnBoardInsertNamedPortShipment,
31}
32
33impl crate::Code for INCOTERMS {
34 fn code(self) -> &'static str {
35 match self {
36 INCOTERMS::DeliveryArrangedBySupplier => "1",
37 INCOTERMS::DeliveryArrangedByLogisticServiceProvider => "2",
38 INCOTERMS::CostAndFreight => "CFR",
39 INCOTERMS::CostInsuranceAndFreight => "CIF",
40 INCOTERMS::CarriageAndInsurancePaidToInsertNamedPlaceDestination => "CIP",
41 INCOTERMS::CarriagePaidToInsertNamedPlaceDestination => "CPT",
42 INCOTERMS::DeliveredAtPlaceInsertNamedPlaceDestination => "DAP",
43 INCOTERMS::DeliveredDutyPaidInsertNamedPlaceDestination => "DDP",
44 INCOTERMS::DeliveredAtPlaceUnloadedInsertNamedPlaceUnloading => "DPU",
45 INCOTERMS::ExWorksInsertNamedPlaceDelivery => "EXW",
46 INCOTERMS::FreeAlongsideShipInsertNamedPortShipment => "FAS",
47 INCOTERMS::FreeCarrierInsertNamedPlaceDelivery => "FCA",
48 INCOTERMS::FreeOnBoardInsertNamedPortShipment => "FOB",
49 }
50 }
51}
52
53impl crate::Description for INCOTERMS {
54 fn description(self) -> &'static str {
55 match self {
56 INCOTERMS::DeliveryArrangedBySupplier => "Delivery arranged by supplier",
57 INCOTERMS::DeliveryArrangedByLogisticServiceProvider => {
58 "Delivery arranged by logistic service provider"
59 }
60 INCOTERMS::CostAndFreight => "Cost and Freight",
61 INCOTERMS::CostInsuranceAndFreight => "Cost, Insurance and Freight",
62 INCOTERMS::CarriageAndInsurancePaidToInsertNamedPlaceDestination => {
63 "Carriage and Insurance Paid to (insert named place of destination)"
64 }
65 INCOTERMS::CarriagePaidToInsertNamedPlaceDestination => {
66 "Carriage Paid To (insert named place of destination)"
67 }
68 INCOTERMS::DeliveredAtPlaceInsertNamedPlaceDestination => {
69 "Delivered At Place (insert named place of destination)"
70 }
71 INCOTERMS::DeliveredDutyPaidInsertNamedPlaceDestination => {
72 "Delivered Duty Paid (insert named place of destination)"
73 }
74 INCOTERMS::DeliveredAtPlaceUnloadedInsertNamedPlaceUnloading => {
75 "Delivered At Place Unloaded (insert named place of unloading)"
76 }
77 INCOTERMS::ExWorksInsertNamedPlaceDelivery => {
78 "Ex Works (insert named place of delivery)"
79 }
80 INCOTERMS::FreeAlongsideShipInsertNamedPortShipment => {
81 "Free Alongside Ship (insert named port of shipment)"
82 }
83 INCOTERMS::FreeCarrierInsertNamedPlaceDelivery => {
84 "Free Carrier (insert named place of delivery)"
85 }
86 INCOTERMS::FreeOnBoardInsertNamedPortShipment => {
87 " Free On Board (insert named port of shipment)"
88 }
89 }
90 }
91}
92
93impl crate::FromCode for INCOTERMS {
94 fn from_code(code: &str) -> Option<Self>
95 where
96 Self: Sized,
97 {
98 match code {
99 "1" => Some(INCOTERMS::DeliveryArrangedBySupplier),
100 "2" => Some(INCOTERMS::DeliveryArrangedByLogisticServiceProvider),
101 "CFR" => Some(INCOTERMS::CostAndFreight),
102 "CIF" => Some(INCOTERMS::CostInsuranceAndFreight),
103 "CIP" => Some(INCOTERMS::CarriageAndInsurancePaidToInsertNamedPlaceDestination),
104 "CPT" => Some(INCOTERMS::CarriagePaidToInsertNamedPlaceDestination),
105 "DAP" => Some(INCOTERMS::DeliveredAtPlaceInsertNamedPlaceDestination),
106 "DDP" => Some(INCOTERMS::DeliveredDutyPaidInsertNamedPlaceDestination),
107 "DPU" => Some(INCOTERMS::DeliveredAtPlaceUnloadedInsertNamedPlaceUnloading),
108 "EXW" => Some(INCOTERMS::ExWorksInsertNamedPlaceDelivery),
109 "FAS" => Some(INCOTERMS::FreeAlongsideShipInsertNamedPortShipment),
110 "FCA" => Some(INCOTERMS::FreeCarrierInsertNamedPlaceDelivery),
111 "FOB" => Some(INCOTERMS::FreeOnBoardInsertNamedPortShipment),
112 _ => None,
113 }
114 }
115}