1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PaymentTerms {
#[serde(default, rename = "type", skip_serializing_if = "Option::is_none")]
pub _type: Option<Type>,
#[serde(default, rename = "discountPercent", skip_serializing_if = "Option::is_none")]
pub discount_percent: Option<String>,
#[serde(default, rename = "discountDueDays", skip_serializing_if = "Option::is_none")]
pub discount_due_days: Option<f32>,
#[serde(default, rename = "netDueDays", skip_serializing_if = "Option::is_none")]
pub net_due_days: Option<f32>,
}
impl PaymentTerms {
pub fn new() -> PaymentTerms {
PaymentTerms {
_type: None,
discount_percent: None,
discount_due_days: None,
net_due_days: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "Basic")]
Basic,
#[serde(rename = "EndOfMonth")]
EndOfMonth,
#[serde(rename = "FixedDate")]
FixedDate,
#[serde(rename = "Proximo")]
Proximo,
#[serde(rename = "PaymentDueUponReceiptOfInvoice")]
PaymentDueUponReceiptOfInvoice,
#[serde(rename = "LetterofCredit")]
LetterofCredit,
}
impl Default for Type {
fn default() -> Type {
Self::Basic
}
}