1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ups\Entity; |
4
|
|
|
|
5
|
|
|
class ShipmentCharge |
6
|
|
|
{ |
7
|
|
|
const SHIPMENT_CHARGE_TYPE_TRANSPORTATION = '01'; |
8
|
|
|
const SHIPMENT_CHARGE_TYPE_DUTIES = '02'; |
9
|
|
|
|
10
|
|
|
const TYPE_BILL_SHIPPER = 'billShipper'; |
11
|
|
|
const TYPE_BILL_RECEIVER = 'billReceiver'; |
12
|
|
|
const TYPE_BILL_THIRD_PARTY = 'billThirdParty'; |
13
|
|
|
const TYPE_CONSIGNEE_BILLED = 'consigneeBilled'; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @var string |
17
|
|
|
*/ |
18
|
|
|
private $type; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var BillShipper |
22
|
|
|
*/ |
23
|
|
|
private $billShipper; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var BillReceiver |
27
|
|
|
* TODO not implemented yet |
28
|
|
|
*/ |
29
|
|
|
private $billReceiver; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var BillThirdParty |
33
|
|
|
*/ |
34
|
|
|
private $billThirdParty; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var bool |
38
|
|
|
*/ |
39
|
|
|
private $consigneeBilled; |
40
|
|
|
|
41
|
|
|
public function __construct($attributes = null) |
42
|
|
|
{ |
43
|
|
|
if (isset($attributes->Type)) { |
44
|
|
|
$this->setType($attributes->Type); |
45
|
|
|
} |
46
|
|
|
if (isset($attributes->billShipper)) { |
47
|
|
|
$this->setBillShipper($attributes->billShipper); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return BillShipper |
53
|
|
|
*/ |
54
|
|
|
public function getBillShipper() |
55
|
|
|
{ |
56
|
|
|
return $this->billShipper; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @param BillShipper $billShipper |
61
|
|
|
* @return ShipmentCharge |
62
|
|
|
*/ |
63
|
|
|
public function setBillShipper(BillShipper $billShipper) |
64
|
|
|
{ |
65
|
|
|
$this->billShipper = $billShipper; |
66
|
|
|
|
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return BillReceiver |
72
|
|
|
*/ |
73
|
|
|
public function getBillReceiver() |
74
|
|
|
{ |
75
|
|
|
return $this->billReceiver; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param BillReceiver $billReceiver |
80
|
|
|
* @return ShipmentCharge |
81
|
|
|
*/ |
82
|
|
|
public function setBillReceiver(BillReceiver $billReceiver= null) |
83
|
|
|
{ |
84
|
|
|
$this->billReceiver = $billReceiver; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return BillThirdParty |
91
|
|
|
*/ |
92
|
|
|
public function getBillThirdParty() |
93
|
|
|
{ |
94
|
|
|
return $this->billThirdParty; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param BillThirdParty $billThirdParty |
99
|
|
|
* @return ShipmentCharge |
100
|
|
|
*/ |
101
|
|
|
public function setBillThirdParty(BillThirdParty $billThirdParty = null) |
102
|
|
|
{ |
103
|
|
|
$this->billThirdParty = $billThirdParty; |
104
|
|
|
|
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return bool |
110
|
|
|
*/ |
111
|
|
|
public function getConsigneeBilled() |
112
|
|
|
{ |
113
|
|
|
return $this->consigneeBilled; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param bool $consigneeBilled |
118
|
|
|
* @return ShipmentCharge |
119
|
|
|
*/ |
120
|
|
|
public function setConsigneeBilled($consigneeBilled) |
121
|
|
|
{ |
122
|
|
|
$this->consigneeBilled = $consigneeBilled; |
123
|
|
|
|
124
|
|
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return string |
129
|
|
|
*/ |
130
|
|
|
public function getType() |
131
|
|
|
{ |
132
|
|
|
return $this->type; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param string $type |
137
|
|
|
* @return ShipmentCharge |
138
|
|
|
*/ |
139
|
|
|
public function setType($type) |
140
|
|
|
{ |
141
|
|
|
$this->type = $type; |
142
|
|
|
|
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
} |
146
|
|
|
|