Speedy_Shipping - Version 2.0.0

Version Notes

Version 2.0.0

Download this release

Release Info

Developer Speedy JSC
Extension Speedy_Shipping
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.3.4 to 2.0.0

Files changed (55) hide show
  1. app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Billoflading.php +20 -1
  2. app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Sales/Order/Create/Billing/Address.php +26 -3
  3. app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Sales/Order/Create/Shipping/Address.php +20 -10
  4. app/code/community/Speedy/Speedyshipping/Block/Adminhtml/System/Config/Form/Moneytransfer.php +46 -0
  5. app/code/community/Speedy/Speedyshipping/Block/Onepage/Billing/Billing.php +3 -1
  6. app/code/community/Speedy/Speedyshipping/Block/Onepage/Paymentinfo.php +8 -4
  7. app/code/community/Speedy/Speedyshipping/Block/Onepage/Shipping/Shipping.php +3 -1
  8. app/code/community/Speedy/Speedyshipping/Helper/Data.php +1 -3
  9. app/code/community/Speedy/Speedyshipping/Helper/Validate/Validate.php +16 -0
  10. app/code/community/Speedy/Speedyshipping/Model/Autocomplete/Address.php +139 -21
  11. app/code/community/Speedy/Speedyshipping/Model/Carrier/Receiverdata/Receiverdata.php +8 -2
  12. app/code/community/Speedy/Speedyshipping/Model/Carrier/Shippingmethod.php +148 -95
  13. app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Beforepayment.php +37 -0
  14. app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Calculation.php +3 -1
  15. app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Method.php +1 -1
  16. app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Moneytransfer.php +34 -0
  17. app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Tablerate.php +19 -0
  18. app/code/community/Speedy/Speedyshipping/Model/Carrier/Tablerate.php +12 -0
  19. app/code/community/Speedy/Speedyshipping/Model/Observer.php +182 -12
  20. app/code/community/Speedy/Speedyshipping/Model/Resource/Carrier/Tablerate.php +267 -0
  21. app/code/community/Speedy/Speedyshipping/Model/Resource/Carrier/Tablerate/Collection.php +115 -0
  22. app/code/community/Speedy/Speedyshipping/controllers/AddressController.php +14 -1
  23. app/code/community/Speedy/Speedyshipping/controllers/Adminhtml/AddressController.php +43 -0
  24. app/code/community/Speedy/Speedyshipping/controllers/Adminhtml/PrintController.php +141 -37
  25. app/code/community/Speedy/Speedyshipping/etc/config.xml +52 -2
  26. app/code/community/Speedy/Speedyshipping/etc/system.xml +79 -14
  27. app/code/community/Speedy/Speedyshipping/sql/speedyshippingmodule_setup/mysql4-upgrade-1.2.0-1.2.1.php +70 -0
  28. app/design/adminhtml/default/default/template/speedy_speedyshipping/billoflading.phtml +34 -1
  29. app/design/adminhtml/default/default/template/speedy_speedyshipping/pickupform.phtml +16 -4
  30. app/design/adminhtml/default/default/template/speedy_speedyshipping/sales/order/create/form/address.phtml +286 -32
  31. app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/billing.phtml +296 -75
  32. app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/shipping.phtml +299 -87
  33. app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/shipping_method/available.phtml +3 -1
  34. app/locale/bg_BG/speedyTranslate.csv +22 -3
  35. app/locale/en_US/speedyTranslate.csv +22 -3
  36. lib/SpeedyEPS/ver01/EPSFacade.class.php +1014 -984
  37. lib/SpeedyEPS/ver01/EPSInterface.class.php +734 -703
  38. lib/SpeedyEPS/ver01/ParamCalculation.class.php +962 -937
  39. lib/SpeedyEPS/ver01/ParamPicking.class.php +1320 -1232
  40. lib/SpeedyEPS/ver01/ParamReturnVoucher.class.php +64 -0
  41. lib/SpeedyEPS/ver01/ResultAddressInfo.class.php +378 -0
  42. lib/SpeedyEPS/ver01/ResultClientInfo.class.php +118 -0
  43. lib/SpeedyEPS/ver01/ResultCourierService.class.php +16 -0
  44. lib/SpeedyEPS/ver01/ResultCourierServiceExt.class.php +2 -1
  45. lib/SpeedyEPS/ver01/ResultDeliveryInfo.class.php +63 -0
  46. lib/SpeedyEPS/ver01/ResultOptionsBeforePayment.class.php +48 -0
  47. lib/SpeedyEPS/ver01/ResultPackings.class.php +48 -0
  48. lib/SpeedyEPS/ver01/ResultParcelInfoEx.class.php +107 -0
  49. lib/SpeedyEPS/ver01/ResultPickingExtendedInfo.class.php +850 -0
  50. lib/SpeedyEPS/ver01/ResultReturnVoucher.class.php +48 -0
  51. lib/SpeedyEPS/ver01/ResultTrackPicking.class.php +44 -9
  52. lib/SpeedyEPS/ver01/ResultTrackPickingEx.class.php +36 -1
  53. lib/SpeedyEPS/ver01/soap/EPSSOAPInterfaceImpl.class.php +1466 -1413
  54. package.xml +7 -7
  55. skin/adminhtml/default/default/speedy/js/validateAddress.js +41 -2
app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Billoflading.php CHANGED
@@ -51,6 +51,8 @@ class Speedy_Speedyshipping_Block_Adminhtml_Billoflading extends Mage_Adminhtml_
51
  * @var type
52
  */
53
  protected $_isSpeedyCarrier = false;
 
 
54
 
55
  /**
56
  *A boolean flag, indicating whether the currently viewed shipment has an
@@ -72,7 +74,11 @@ class Speedy_Speedyshipping_Block_Adminhtml_Billoflading extends Mage_Adminhtml_
72
 
73
 
74
  protected $_doesUserHasPermission = true;
75
-
 
 
 
 
76
  /**
77
  * The purpose of this constructor is to get various request params and
78
  * assemble of the urls of various actions inside
@@ -128,6 +134,19 @@ class Speedy_Speedyshipping_Block_Adminhtml_Billoflading extends Mage_Adminhtml_
128
  $this->_deferredDays = $this->_speedyData->getDeferredDeliveryWorkdays();
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  $this->setTemplate('speedy_speedyshipping/billoflading.phtml');
132
  }
133
 
51
  * @var type
52
  */
53
  protected $_isSpeedyCarrier = false;
54
+
55
+ protected $_isAbroad = false;
56
 
57
  /**
58
  *A boolean flag, indicating whether the currently viewed shipment has an
74
 
75
 
76
  protected $_doesUserHasPermission = true;
77
+
78
+
79
+ protected $_optionsBeforePayment = null;
80
+
81
+
82
  /**
83
  * The purpose of this constructor is to get various request params and
84
  * assemble of the urls of various actions inside
134
  $this->_deferredDays = $this->_speedyData->getDeferredDeliveryWorkdays();
135
  }
136
 
137
+ if ($this->_speedyData->getOptionsBeforePayment()) {
138
+ $this->_optionsBeforePayment = $this->_speedyData->getOptionsBeforePayment();
139
+ } else {
140
+ $this->_optionsBeforePayment = Mage::getStoreConfig('carriers/speedyshippingmodule/options_before_payment');
141
+ }
142
+
143
+ $order = Mage::getModel('sales/order')->load($orderId);
144
+ $this->_shippingAddress = $order->getShippingAddress();
145
+
146
+ if ($this->_shippingAddress->getCountryId() != 'BG') {
147
+ $this->_isAbroad = true;
148
+ }
149
+
150
  $this->setTemplate('speedy_speedyshipping/billoflading.phtml');
151
  }
152
 
app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Sales/Order/Create/Billing/Address.php CHANGED
@@ -47,7 +47,9 @@ Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address{
47
 
48
  $ids = array();
49
  foreach($customer->getAddresses() as $address){
50
- if($address->getSpeedySiteId()){
 
 
51
  $ids[] = $address->getId();
52
  }
53
  }
@@ -80,20 +82,41 @@ Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address{
80
  $this->_isFullNomenclature = $result[0]->is_full_nomenclature;
81
  }
82
  }
 
 
 
 
83
 
 
 
 
 
 
 
 
 
 
 
84
 
85
 
 
86
 
 
 
 
 
 
 
87
  //Set office enabled
88
  $speedyOfficeEnabled = $this->_form->getElement('speedy_office_chooser');
89
 
90
 
91
  $fieldset->removeField($speedyOfficeEnabled->getId());
92
 
93
- $speedyQuarterField = $fieldset->addField($speedyOfficeEnabled->getId(),
94
  'select',
95
  $speedyOfficeEnabled->getData(),
96
- $this->_form->getElement('city')->getId()
97
  );
98
 
99
 
47
 
48
  $ids = array();
49
  foreach($customer->getAddresses() as $address){
50
+ if($address->getCountryId() == 'BG' && $address->getSpeedySiteId()){
51
+ $ids[] = $address->getId();
52
+ } elseif ($address->getCountryId() != 'BG' && $address->getCity()) {
53
  $ids[] = $address->getId();
54
  }
55
  }
82
  $this->_isFullNomenclature = $result[0]->is_full_nomenclature;
83
  }
84
  }
85
+
86
+ //Set country
87
+ $speedyCountryName = $this->_form->getElement('country_id');
88
+
89
 
90
+ $fieldset->removeField($speedyCountryName->getId());
91
+
92
+ $speedyCountryField = $fieldset->addField($speedyCountryName->getId(),
93
+ 'select',
94
+ $speedyCountryName->getData(),
95
+ $this->_form->getElement('company')->getId()
96
+ );
97
+
98
+ //Set postcode
99
+ $speedyPostcodeName = $this->_form->getElement('postcode');
100
 
101
 
102
+ $fieldset->removeField($speedyPostcodeName->getId());
103
 
104
+ $speedyPostcodeField = $fieldset->addField($speedyPostcodeName->getId(),
105
+ 'text',
106
+ $speedyPostcodeName->getData(),
107
+ $this->_form->getElement('city')->getId()
108
+ );
109
+
110
  //Set office enabled
111
  $speedyOfficeEnabled = $this->_form->getElement('speedy_office_chooser');
112
 
113
 
114
  $fieldset->removeField($speedyOfficeEnabled->getId());
115
 
116
+ $speedyOfficeField = $fieldset->addField($speedyOfficeEnabled->getId(),
117
  'select',
118
  $speedyOfficeEnabled->getData(),
119
+ $this->_form->getElement('region')->getId()
120
  );
121
 
122
 
app/code/community/Speedy/Speedyshipping/Block/Adminhtml/Sales/Order/Create/Shipping/Address.php CHANGED
@@ -37,7 +37,9 @@ class Speedy_Speedyshipping_Block_Adminhtml_Sales_Order_Create_Shipping_Address
37
 
38
  $ids = array();
39
  foreach ($customer->getAddresses() as $address) {
40
- if ($address->getSpeedySiteId()) {
 
 
41
  $ids[] = $address->getId();
42
  }
43
  }
@@ -56,26 +58,34 @@ class Speedy_Speedyshipping_Block_Adminhtml_Sales_Order_Create_Shipping_Address
56
  $origForm = parent::_prepareForm();
57
  $fieldset = $this->_form->getElement('main');
58
 
59
- //Set office enabled
60
- $speedyOfficeEnabled = $this->_form->getElement('speedy_office_chooser');
61
 
 
62
 
 
 
63
 
64
- $fieldset->removeField($speedyOfficeEnabled->getId());
 
 
 
65
 
66
- $speedyQuarterField = $fieldset->addField($speedyOfficeEnabled->getId(), 'select', $speedyOfficeEnabled->getData(), $this->_form->getElement('city')->getId()
67
  );
68
 
 
 
69
 
 
70
 
71
- //Set office name
72
- $speedyOfficeName = $this->_form->getElement('speedy_office_name');
73
- $tempdata = $speedyOfficeName->getData();
74
 
75
 
76
- //$result = $speedyOfficeName->setValue('testtt');
77
 
78
- $data = $tempdata = $speedyOfficeName->getData();
 
79
 
80
  $fieldset->removeField($speedyOfficeName->getId());
81
 
37
 
38
  $ids = array();
39
  foreach ($customer->getAddresses() as $address) {
40
+ if($address->getCountryId() == 'BG' && $address->getSpeedySiteId()){
41
+ $ids[] = $address->getId();
42
+ } elseif ($address->getCountryId() != 'BG' && $address->getCity()) {
43
  $ids[] = $address->getId();
44
  }
45
  }
58
  $origForm = parent::_prepareForm();
59
  $fieldset = $this->_form->getElement('main');
60
 
61
+ //Set country
62
+ $speedyCountryName = $this->_form->getElement('country_id');
63
 
64
+ $fieldset->removeField($speedyCountryName->getId());
65
 
66
+ $speedyCountryNameField = $fieldset->addField($speedyCountryName->getId(), 'select', $speedyCountryName->getData(), $this->_form->getElement('company')->getId()
67
+ );
68
 
69
+ //Set postcode
70
+ $speedyPostcode = $this->_form->getElement('postcode');
71
+
72
+ $fieldset->removeField($speedyPostcode->getId());
73
 
74
+ $speedyPostcodeField = $fieldset->addField($speedyPostcode->getId(), 'text', $speedyPostcode->getData(), $this->_form->getElement('city')->getId()
75
  );
76
 
77
+ //Set office enabled
78
+ $speedyOfficeEnabled = $this->_form->getElement('speedy_office_chooser');
79
 
80
+ $fieldset->removeField($speedyOfficeEnabled->getId());
81
 
82
+ $speedyOfficeField = $fieldset->addField($speedyOfficeEnabled->getId(), 'select', $speedyOfficeEnabled->getData(), $this->_form->getElement('region')->getId()
83
+ );
 
84
 
85
 
 
86
 
87
+ //Set office name
88
+ $speedyOfficeName = $this->_form->getElement('speedy_office_name');
89
 
90
  $fieldset->removeField($speedyOfficeName->getId());
91
 
app/code/community/Speedy/Speedyshipping/Block/Adminhtml/System/Config/Form/Moneytransfer.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this license header, choose License Headers in Project Properties.
5
+ * To change this template file, choose Tools | Templates
6
+ * and open the template in the editor.
7
+ */
8
+
9
+ /**
10
+ * Description of Moneytransfer
11
+ *
12
+ * @author killer
13
+ */
14
+ class Speedy_Speedyshipping_Block_Adminhtml_System_Config_Form_Moneytransfer extends Mage_Adminhtml_Block_System_Config_Form_Field {
15
+
16
+ /**
17
+ * Override method to output our custom HTML with JavaScript
18
+ *
19
+ * @param Varien_Data_Form_Element_Abstract $element
20
+ * @return String
21
+ */
22
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+ $user = Mage::getStoreConfig('carriers/speedyshippingmodule/username');
25
+ $pass = Mage::helper('core')->decrypt(Mage::getStoreConfig('carriers/speedyshippingmodule/password'));
26
+
27
+ if (!$user || !$pass) {
28
+ return false;
29
+ }
30
+
31
+ try {
32
+ $speedyEPSInterfaceImplementaion = new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
33
+ $speedyEPS = new EPSFacade($speedyEPSInterfaceImplementaion, $user, $pass);
34
+
35
+ $additionamUserParams = $speedyEPS->getAdditionalUserParams(time());
36
+ } catch (Exception $e) {
37
+ Mage::log($e->getMessage(), null, 'speedyLog.log');
38
+ }
39
+
40
+ if (!in_array('101', $additionamUserParams)) {
41
+ $element->setDisabled('disabled')->setValue(0);
42
+ }
43
+
44
+ return parent::_getElementHtml($element);
45
+ }
46
+ }
app/code/community/Speedy/Speedyshipping/Block/Onepage/Billing/Billing.php CHANGED
@@ -30,7 +30,9 @@ class Speedy_Speedyshipping_Block_Onepage_Billing_Billing
30
 
31
  $ids = array();
32
  foreach($customer->getAddresses() as $address){
33
- if($address->getSpeedySiteId()){
 
 
34
  $ids[] = $address->getId();
35
  }
36
  }
30
 
31
  $ids = array();
32
  foreach($customer->getAddresses() as $address){
33
+ if($address->getCountryId() == 'BG' && $address->getSpeedySiteId()){
34
+ $ids[] = $address->getId();
35
+ } elseif ($address->getCountryId() != 'BG' && $address->getCity()) {
36
  $ids[] = $address->getId();
37
  }
38
  }
app/code/community/Speedy/Speedyshipping/Block/Onepage/Paymentinfo.php CHANGED
@@ -115,7 +115,7 @@ class Speedy_Speedyshipping_Block_Onepage_Paymentinfo extends Mage_Payment_Block
115
  //Is Speedy the choosen courier
116
  if ($code[0] == 'speedyshippingmodule') {
117
 
118
- $amountWithoutTax = $this->_codAmount = number_format($cod[$code[1]], 2);
119
 
120
 
121
  $taxCalculator = Mage::helper('tax');
@@ -146,21 +146,25 @@ class Speedy_Speedyshipping_Block_Onepage_Paymentinfo extends Mage_Payment_Block
146
  }
147
 
148
  //Is free shipping enabled
149
- if (Mage::getStoreConfig('carriers/speedyshippingmodule/free_shipping_enable')) {
150
 
151
  $freeCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_city');
152
 
153
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
154
 
 
 
155
  if (isset($code)) {
156
  //Is this a free method
157
  if (array_key_exists(1, $code)) {
158
- if (($code[1] == $freeCityMethod) || ($code[1] == $freeInterCityMethod)) {
 
 
159
  $this->_isFreeMethod = TRUE;
160
  }
161
  }
162
  }
163
- }else if($shippingAmount == 0.000){
164
  $this->_isFreeMethod = TRUE;
165
  }
166
 
115
  //Is Speedy the choosen courier
116
  if ($code[0] == 'speedyshippingmodule') {
117
 
118
+ $amountWithoutTax = $this->_codAmount = ($cod[$code[1]] ? number_format($cod[$code[1]], 2) : 0);
119
 
120
 
121
  $taxCalculator = Mage::helper('tax');
146
  }
147
 
148
  //Is free shipping enabled
149
+ /* if (Mage::getStoreConfig('carriers/speedyshippingmodule/free_shipping_enable')) {
150
 
151
  $freeCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_city');
152
 
153
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
154
 
155
+ $freeInternationalMethod = explode(',', Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_international'));
156
+
157
  if (isset($code)) {
158
  //Is this a free method
159
  if (array_key_exists(1, $code)) {
160
+ if (($code[1] == $freeCityMethod) ||
161
+ ($code[1] == $freeInterCityMethod) ||
162
+ in_array($code[1], $freeInternationalMethod)) {
163
  $this->_isFreeMethod = TRUE;
164
  }
165
  }
166
  }
167
+ }else */ if($shippingAmount == 0.000){
168
  $this->_isFreeMethod = TRUE;
169
  }
170
 
app/code/community/Speedy/Speedyshipping/Block/Onepage/Shipping/Shipping.php CHANGED
@@ -31,7 +31,9 @@ class Speedy_Speedyshipping_Block_Onepage_Shipping_Shipping
31
 
32
  $ids = array();
33
  foreach($customer->getAddresses() as $address){
34
- if($address->getSpeedySiteId()){
 
 
35
  $ids[] = $address->getId();
36
  }
37
  }
31
 
32
  $ids = array();
33
  foreach($customer->getAddresses() as $address){
34
+ if($address->getCountryId() == 'BG' && $address->getSpeedySiteId()){
35
+ $ids[] = $address->getId();
36
+ } elseif ($address->getCountryId() != 'BG' && $address->getCity()) {
37
  $ids[] = $address->getId();
38
  }
39
  }
app/code/community/Speedy/Speedyshipping/Helper/Data.php CHANGED
@@ -42,9 +42,7 @@ class Speedy_Speedyshipping_Helper_Data extends Mage_Core_Helper_Abstract {
42
  new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
43
 
44
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
45
- $this->_speedySessionId = $this->_speedyEPS->login();
46
-
47
- $this->_senderData = $this->_speedyEPS->getClientById($this->_speedyEPS->getResultLogin()->getClientId());
48
  } catch (ServerException $se) {
49
  throw new Exception($se->getMessage());
50
  }
42
  new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
43
 
44
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
45
+ $this->_speedySessionId = $this->_speedyEPS->getResultLogin();
 
 
46
  } catch (ServerException $se) {
47
  throw new Exception($se->getMessage());
48
  }
app/code/community/Speedy/Speedyshipping/Helper/Validate/Validate.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Speedy_Speedyshipping_Helper_Validate_Validate extends Mage_Directory_Helper_Data
4
+ {
5
+ public function getCountriesWithOptionalZip($asJson = false)
6
+ {
7
+ if (null === $this->_optionalZipCountries) {
8
+ $this->_optionalZipCountries = preg_split('/\,/',
9
+ Mage::getStoreConfig('general/country/allow'), 0, PREG_SPLIT_NO_EMPTY);
10
+ }
11
+ if ($asJson) {
12
+ return Mage::helper('core')->jsonEncode($this->_optionalZipCountries);
13
+ }
14
+ return $this->_optionalZipCountries;
15
+ }
16
+ }
app/code/community/Speedy/Speedyshipping/Model/Autocomplete/Address.php CHANGED
@@ -35,15 +35,29 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
35
  public function getSite($siteID = null) {
36
  $session = Mage::getSingleton('checkout/session');
37
  $cityName = $this->_request->getParam('term');
 
 
38
  //$cityName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($cityName);
39
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($cityName);
 
 
 
40
  //$city = strtoupper($address->getCity());
41
  try {
42
  //Customer is editing an existing address
43
  if (!is_null($siteID)) {
44
  $sites = $this->_speedyEPS->getSiteById($siteID);
45
  } else {
46
- $sites = $this->_speedyEPS->listSites(null, $cityName, $lang);
 
 
 
 
 
 
 
 
 
47
  }
48
  } catch (ServerException $se) {
49
  Mage::log($se->getMessage(),null,'speedyLog.log');
@@ -52,16 +66,21 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
52
  $tpl = array();
53
 
54
  if (count($sites) == 1 && is_null($siteID)) {
55
- $nomenclature = $sites[0]->getAddrNomen()->getValue();
56
- $tpl[] = array('value' => $sites[0]->getId(),
57
- 'label' => $sites[0]->getType() . ' ' . $sites[0]->getName() . ', ' .
58
- ' общ. ' . $sites[0]->getMunicipality() . ', ' . ' обл. ' . $sites[0]->getRegion(),
59
- 'post_code' => $sites[0]->getPostCode(),
60
- 'region' => $sites[0]->getRegion(),
61
- 'is_full_nomenclature' => $sites[0]->getAddrNomen()->getValue(),
 
 
 
 
 
62
  'is_full_nomenclature' => $nomenclature,
63
- 'post_code' => $sites[0]->getPostCode(),
64
- 'region' => $sites[0]->getRegion());
65
  }else if(count($sites) == 1){
66
  $nomenclature = $sites->getAddrNomen()->getValue();
67
  $tpl[] = array('value' => $sites->getId(),
@@ -69,25 +88,27 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
69
  ' общ. ' . $sites->getMunicipality() . ', ' . ' обл. ' . $sites->getRegion(),
70
  'post_code' => $sites->getPostCode(),
71
  'region' => $sites->getRegion(),
72
- 'is_full_nomenclature' => $sites->getAddrNomen()->getValue(),
73
  'is_full_nomenclature' => $nomenclature,
74
  'post_code' => $sites->getPostCode(),
75
  'region' => $sites->getRegion());
76
  }
77
  else {
78
-
79
  foreach ($sites as $site) {
 
 
 
 
 
 
80
 
81
- $nomenclature = $site->getAddrNomen()->getValue();
82
- $tpl[] = array('value' => $site->getId(),
83
- 'label' => $site->getType() . ' ' . $site->getName() .
84
- ', общ. ' . $site->getMunicipality() . ', обл. ' . $site->getRegion(),
85
- 'post_code' => $site->getPostCode(),
86
- 'region' => $site->getRegion(),
87
- 'is_full_nomenclature' => $site->getAddrNomen()->getValue(),
88
  'is_full_nomenclature' => $nomenclature,
89
- 'post_code' => $site->getPostCode(),
90
- 'region' => $site->getRegion());
91
  }
92
  }
93
  $jsonData = json_encode($tpl);
@@ -216,6 +237,91 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
216
  }
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  /**
220
  * This method loads information about living quarters (if any) in
221
  * particular site. Please note that in order to retriver anything the
@@ -230,6 +336,10 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
230
  //$quarterName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($quarterName);
231
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($quarterName);
232
  $currentSpeedyAddress = $session->getSpeedyAddress();
 
 
 
 
233
  //$city = strtoupper($address->getCity());
234
  try {
235
  $quarters = $this->_speedyEPS->listQuarters($quarterName, $cityId, $lang);
@@ -270,6 +380,10 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
270
  $streetName = $this->_request->getParam('term');
271
  //$streetName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($streetName);
272
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($streetName);
 
 
 
 
273
  //Initialize empty array
274
  $streets = array();
275
  try {
@@ -302,6 +416,10 @@ class Speedy_Speedyshipping_Model_Autocomplete_Address extends Mage_Core_Model_A
302
  $cityId = (int) $this->_request->getParam('cityid');
303
  $blockName = $this->_request->getParam('term');
304
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($blockName);
 
 
 
 
305
  // $streetName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($streetName);
306
  try {
307
  $blocks = $this->_speedyEPS->listBlocks($blockName, $cityId, $lang);
35
  public function getSite($siteID = null) {
36
  $session = Mage::getSingleton('checkout/session');
37
  $cityName = $this->_request->getParam('term');
38
+ $countryId = (int)$this->_request->getParam('countryid');
39
+ $countryIso = $this->_request->getParam('countryiso');
40
  //$cityName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($cityName);
41
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($cityName);
42
+ if ($countryIso != 'BG') {
43
+ $lang = 'EN';
44
+ }
45
  //$city = strtoupper($address->getCity());
46
  try {
47
  //Customer is editing an existing address
48
  if (!is_null($siteID)) {
49
  $sites = $this->_speedyEPS->getSiteById($siteID);
50
  } else {
51
+ require_once Mage::getBaseDir('lib') . DS . 'SpeedyEPS' . DS . 'ver01' . DS . 'ParamFilterSite.class.php';
52
+ $paramFilterSite = new ParamFilterSite();
53
+ $paramFilterSite->setSearchString($cityName);
54
+
55
+ if ($countryId) {
56
+ $paramFilterSite->setCountryId($countryId);
57
+ }
58
+
59
+ $sites = $this->_speedyEPS->listSitesEx($paramFilterSite, $lang);
60
+ // $sites = $this->_speedyEPS->listSites(null, $cityName, $lang);
61
  }
62
  } catch (ServerException $se) {
63
  Mage::log($se->getMessage(),null,'speedyLog.log');
66
  $tpl = array();
67
 
68
  if (count($sites) == 1 && is_null($siteID)) {
69
+ if (empty($countryId) || (!empty($countryIso) && $countryIso == 'BG')) {
70
+ $label = $sites[0]->getSite()->getType() . ' ' . $sites[0]->getSite()->getName() .
71
+ ', общ. ' . $sites[0]->getSite()->getMunicipality() . ', обл. ' . $sites[0]->getSite()->getRegion();
72
+ } else {
73
+ $label = $sites[0]->getSite()->getName();
74
+ }
75
+
76
+ $nomenclature = $sites[0]->getSite()->getAddrNomen()->getValue();
77
+ $tpl[] = array('value' => $sites[0]->getSite()->getId(),
78
+ 'label' => $label,
79
+ 'post_code' => $sites[0]->getSite()->getPostCode(),
80
+ 'region' => $sites[0]->getSite()->getRegion(),
81
  'is_full_nomenclature' => $nomenclature,
82
+ 'post_code' => $sites[0]->getSite()->getPostCode(),
83
+ 'region' => $sites[0]->getSite()->getRegion());
84
  }else if(count($sites) == 1){
85
  $nomenclature = $sites->getAddrNomen()->getValue();
86
  $tpl[] = array('value' => $sites->getId(),
88
  ' общ. ' . $sites->getMunicipality() . ', ' . ' обл. ' . $sites->getRegion(),
89
  'post_code' => $sites->getPostCode(),
90
  'region' => $sites->getRegion(),
 
91
  'is_full_nomenclature' => $nomenclature,
92
  'post_code' => $sites->getPostCode(),
93
  'region' => $sites->getRegion());
94
  }
95
  else {
 
96
  foreach ($sites as $site) {
97
+ if (empty($countryId) || (!empty($countryIso) && $countryIso == 'BG')) {
98
+ $label = $site->getSite()->getType() . ' ' . $site->getSite()->getName() .
99
+ ', общ. ' . $site->getSite()->getMunicipality() . ', обл. ' . $site->getSite()->getRegion();
100
+ } else {
101
+ $label = $site->getSite()->getName();
102
+ }
103
 
104
+ $nomenclature = $site->getSite()->getAddrNomen()->getValue();
105
+ $tpl[] = array('value' => $site->getSite()->getId(),
106
+ 'label' => $label,
107
+ 'post_code' => $site->getSite()->getPostCode(),
108
+ 'region' => $site->getSite()->getRegion(),
 
 
109
  'is_full_nomenclature' => $nomenclature,
110
+ 'post_code' => $site->getSite()->getPostCode(),
111
+ 'region' => $site->getSite()->getRegion());
112
  }
113
  }
114
  $jsonData = json_encode($tpl);
237
  }
238
  }
239
 
240
+ public function getStates() {
241
+ $session = Mage::getSingleton('checkout/session');
242
+ $stateName = $this->_request->getParam('term');
243
+ $countryId = (int)$this->_request->getParam('countryid');
244
+ //$stateName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($stateName);
245
+ $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($stateName);
246
+ $countryIso = $this->_request->getParam('countryiso');
247
+ if ($countryIso != 'BG') {
248
+ $lang = 'EN';
249
+ }
250
+ //$city = strtoupper($address->getCity());
251
+ try {
252
+ if ($countryId) {
253
+ $states = $this->_speedyEPS->listStates($countryId, $stateName);
254
+ }
255
+ } catch (ServerException $se) {
256
+ Mage::log($se->getMessage(),null,'speedyLog.log');
257
+ }
258
+ if (isset($states)) {
259
+ $tpl = array();
260
+
261
+ if ($states) {
262
+ foreach ($states as $state) {
263
+ $tpl[] = array(
264
+ 'value' => $state->getStateId(),
265
+ 'label' => $state->getName(),
266
+ 'code' => $state->getStateAlpha(),
267
+ 'country_id' => $state->getCountryId()
268
+ );
269
+ }
270
+ }
271
+
272
+ $jsonData = json_encode($tpl);
273
+ //header("Content-Type: text/html; charset=UTF-8");
274
+ return $jsonData;
275
+ } else {
276
+ return FALSE;
277
+ }
278
+ }
279
+
280
+ public function getCountries() {
281
+ $countryName = $this->_request->getParam('term');
282
+ $countryIso = $this->_request->getParam('countryiso');
283
+ $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($countryName);
284
+ if ($countryIso != 'BG') {
285
+ $lang = 'EN';
286
+ }
287
+ try {
288
+ require_once Mage::getBaseDir('lib') . DS . 'SpeedyEPS' . DS . 'ver01' . DS . 'ParamFilterCountry.class.php';
289
+ $ParamFilterCountry = new ParamFilterCountry();
290
+ if ($countryIso) {
291
+ $ParamFilterCountry->setIsoAlpha2($countryIso);
292
+ }
293
+
294
+ $countries = $this->_speedyEPS->listCountriesEx($ParamFilterCountry, $lang);
295
+ } catch (ServerException $se) {
296
+ Mage::log($se->getMessage(),null,'speedyLog.log');
297
+ }
298
+
299
+ if (isset($countries)) {
300
+ $tpl = array();
301
+
302
+ foreach ($countries as $country) {
303
+ $tpl[$country->getIsoAlpha2()] = array(
304
+ 'id' => $country->getCountryId(),
305
+ 'name' => $country->getName(),
306
+ 'label' => $country->getName(),
307
+ 'iso_code_2' => $country->getIsoAlpha2(),
308
+ 'iso_code_3' => $country->getIsoAlpha3(),
309
+ 'nomenclature' => ($country->getSiteNomen()) ? 'FULL' : '',
310
+ 'required_state' => (int)$country->isRequireState(),
311
+ 'required_postcode' => (int)$country->isRequirePostCode(),
312
+ 'active_currency_code' => $country->getActiveCurrencyCode(),
313
+ 'is_full_nomenclature' => (int)$country->getSiteNomen(),
314
+ );
315
+ }
316
+
317
+ $jsonData = json_encode($tpl);
318
+ //header("Content-Type: text/html; charset=UTF-8");
319
+ return $jsonData;
320
+ } else {
321
+ return FALSE;
322
+ }
323
+ }
324
+
325
  /**
326
  * This method loads information about living quarters (if any) in
327
  * particular site. Please note that in order to retriver anything the
336
  //$quarterName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($quarterName);
337
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($quarterName);
338
  $currentSpeedyAddress = $session->getSpeedyAddress();
339
+ $countryIso = $this->_request->getParam('countryiso');
340
+ if ($countryIso != 'BG') {
341
+ $lang = 'EN';
342
+ }
343
  //$city = strtoupper($address->getCity());
344
  try {
345
  $quarters = $this->_speedyEPS->listQuarters($quarterName, $cityId, $lang);
380
  $streetName = $this->_request->getParam('term');
381
  //$streetName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($streetName);
382
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($streetName);
383
+ $countryIso = $this->_request->getParam('countryiso');
384
+ if ($countryIso != 'BG') {
385
+ $lang = 'EN';
386
+ }
387
  //Initialize empty array
388
  $streets = array();
389
  try {
416
  $cityId = (int) $this->_request->getParam('cityid');
417
  $blockName = $this->_request->getParam('term');
418
  $lang = Mage::helper('speedyshippingmodule/transliterate')->getLanguage($blockName);
419
+ $countryIso = $this->_request->getParam('countryiso');
420
+ if ($countryIso != 'BG') {
421
+ $lang = 'EN';
422
+ }
423
  // $streetName = Mage::helper('speedyshippingmodule/transliterate')->transliterate($streetName);
424
  try {
425
  $blocks = $this->_speedyEPS->listBlocks($blockName, $cityId, $lang);
app/code/community/Speedy/Speedyshipping/Model/Carrier/Receiverdata/Receiverdata.php CHANGED
@@ -25,7 +25,6 @@ class Speedy_Speedyshipping_Model_Carrier_Receiverdata_ReceiverData {
25
  } else {
26
  $receiverData->address->siteID = $address->getReceiverCityId(); //'БУРГАС';
27
 
28
-
29
  $receiverData->address->quarterName = null;
30
  if(!$address->getQuarterId()){
31
  $receiverData->address->quarterName = $address->getSpeedyQuarterName();
@@ -51,7 +50,14 @@ class Speedy_Speedyshipping_Model_Carrier_Receiverdata_ReceiverData {
51
  $receiverData->address->speedyApartment = $address->getSpeedyApartment();
52
 
53
  $receiverData->address->speedyAddressNote = $address->getSpeedyAddressNote();
54
-
 
 
 
 
 
 
 
55
  $receiverData->partnerName = $name;
56
  //$receiverData->contactName = $this->_request->getRecipientContactPersonName();
57
  $receiverData->contactPhone = $phone;
25
  } else {
26
  $receiverData->address->siteID = $address->getReceiverCityId(); //'БУРГАС';
27
 
 
28
  $receiverData->address->quarterName = null;
29
  if(!$address->getQuarterId()){
30
  $receiverData->address->quarterName = $address->getSpeedyQuarterName();
50
  $receiverData->address->speedyApartment = $address->getSpeedyApartment();
51
 
52
  $receiverData->address->speedyAddressNote = $address->getSpeedyAddressNote();
53
+
54
+ $receiverData->address->speedyCountryId = $address->getSpeedyCountryId();
55
+ $receiverData->address->speedyStateId = $address->getSpeedyStateId();
56
+ $receiverData->address->city = $address->getCity();
57
+ $receiverData->address->postcode = $address->getPostcode();
58
+ $receiverData->address->street1 = $address->getStreet1();
59
+ $receiverData->address->street2 = $address->getStreet2();
60
+
61
  $receiverData->partnerName = $name;
62
  //$receiverData->contactName = $this->_request->getRecipientContactPersonName();
63
  $receiverData->contactPhone = $phone;
app/code/community/Speedy/Speedyshipping/Model/Carrier/Shippingmethod.php CHANGED
@@ -30,14 +30,6 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
30
  */
31
  protected $_pickingData;
32
 
33
- /**
34
- * A property that holds data about the sender (the data about the online
35
- * shop). This is received after a successful authentication. The data is
36
- * assembled in setSenderData() method.
37
- * @var type
38
- */
39
- protected $_senderData;
40
-
41
  /**
42
  * A property that holds data about the receiver (the customer of the online
43
  * shop).
@@ -115,9 +107,8 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
115
 
116
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
117
 
118
- $this->_speedySessionId = $this->_speedyEPS->login();
119
 
120
- $this->_senderData = $this->_speedyEPS->getClientById($this->_speedyEPS->getResultLogin()->getClientId());
121
  //Mage::log('connection established', null, 'speedyLog.log');
122
  return TRUE;
123
  } catch (Exception $e) {
@@ -192,8 +183,6 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
192
 
193
  $this->_pickingData = $this->setPickingData();
194
 
195
- $this->_senderData = $this->setUpSenderData();
196
-
197
  $this->_receiverData = $this->setUpReceiverData();
198
 
199
  $this->_rawRequest = $request;
@@ -240,8 +229,6 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
240
  }
241
 
242
 
243
-
244
-
245
  if ($address->getCustomerAddressId()) {
246
 
247
  $customerAddress = Mage::getModel('customer/address')->load($address->getCustomerAddressId());
@@ -295,6 +282,62 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
295
  $orderData->setBlockId($address->getSpeedyBlockNumber());
296
  }
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
  $speedyAdminExactTime = null;
300
 
@@ -677,9 +720,14 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
677
  $pickingData->payerType = ParamCalculation::PAYER_TYPE_SENDER;
678
  } else {
679
  */
680
- $pickingData->payerType = ParamCalculation::PAYER_TYPE_RECEIVER;
681
  // }
682
 
 
 
 
 
 
683
 
684
  $pickingData->backDocumentReq = Mage::getStoreConfig('carriers/speedyshippingmodule/back_documents'); // Заявка за обратни документи
685
  $pickingData->backReceiptReq = Mage::getStoreConfig('carriers/speedyshippingmodule/back_receipt'); // Заявка за обратна разписка
@@ -690,58 +738,6 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
690
  return $pickingData;
691
  }
692
 
693
- /*
694
- * This method initializes the sender data
695
- *
696
- */
697
-
698
- protected function setUpSenderData() {
699
-
700
- if ($this->_senderData) {
701
- $senderAddress = $this->_senderData->getAddress();
702
-
703
- $senderData = new StdClass();
704
- $senderData->address = new StdClass();
705
- $senderData->address->siteID = $senderAddress->getSiteId();
706
- $senderData->address->siteType = $senderAddress->getSiteType();
707
- $senderData->address->siteName = $senderAddress->getSiteName();
708
-
709
- if ($senderAddress->getQuarterName()) {
710
- $senderData->address->quarter = $senderAddress->getQuarterName();
711
- }
712
-
713
- if ($senderAddress->getStreetName()) {
714
- $senderData->address->street = $senderAddress->getStreetName();
715
- }
716
-
717
- if ($senderAddress->getStreetNo()) {
718
- $senderData->address->streetNo = $senderAddress->getStreetNo();
719
- }
720
-
721
-
722
-
723
-
724
-
725
- $senderData->clientID = $this->_speedySessionId->getClientId();
726
-
727
- $senderData->partnerName = $this->_senderData->getPartnerName();
728
-
729
- $senderData->contactName = $this->_senderData->getPartnerName();
730
-
731
- $phonenumber = Mage::getStoreConfig('carriers/speedyshippingmodule/contact_telephone');
732
-
733
- if ((int) $phonenumber) {
734
-
735
- $senderData->phonenumber = $phonenumber;
736
- }
737
-
738
-
739
- return $senderData;
740
- } else {
741
- return false;
742
- }
743
- }
744
-
745
  /**
746
  * This method initializes the receiver data
747
  * @return \StdClass
@@ -770,6 +766,12 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
770
 
771
  $receiverData->address->streetNo = $this->_orderData->getStreetNo();
772
 
 
 
 
 
 
 
773
  $receiverData->partnerName = $this->_request->getRecipientContactPersonName();
774
  $receiverData->contactName = $this->_request->getRecipientContactPersonName();
775
  $receiverData->contactPhone = $this->_request->getRecipientContactPhoneNumber();
@@ -817,6 +819,20 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
817
  }
818
 
819
  $result = Mage::getModel('shipping/rate_result');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
  $methods = explode(',', $this->getConfigData('allowed_methods'));
821
 
822
  $request = Mage::app()->getRequest();
@@ -884,7 +900,7 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
884
 
885
  $finalMethods = $this->_speedyRates;
886
 
887
- if (isset($finalMethods)) {
888
  foreach ($finalMethods as $method) {
889
  $Rmethod = Mage::getModel('shipping/rate_result_method');
890
 
@@ -927,11 +943,23 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
927
 
928
  $result->append($Rmethod);
929
  }
930
-
931
- return $result;
932
  } else {
933
- $result->setError('gre6ka');
 
 
 
 
 
 
 
 
 
 
 
 
934
  }
 
 
935
  }
936
 
937
  /**
@@ -1183,7 +1211,13 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1183
 
1184
  $paramCalculation->setPayerType($this->_pickingData->payerType);
1185
 
1186
- $paramCalculation->setAmountCodBase($this->_pickingData->amountCODBase);
 
 
 
 
 
 
1187
 
1188
  $paramCalculation->setTakingDate($this->_pickingData->takingDate);
1189
 
@@ -1197,6 +1231,17 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1197
  $paramCalculation->setOfficeToBeCalledId(null);
1198
  }
1199
 
 
 
 
 
 
 
 
 
 
 
 
1200
 
1201
  /*
1202
  if (count($methods) == 1) {
@@ -1371,6 +1416,13 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1371
  } else if ($isFixed == 3) {
1372
  $handlingAmount = Mage::getStoreConfig('carriers/speedyshippingmodule/handlingCharge');
1373
  $total = $total + $taxCalculator->getShippingPrice($handlingAmount, FALSE);
 
 
 
 
 
 
 
1374
  }
1375
 
1376
  //Is fixed hour allowed for this particular service
@@ -1467,6 +1519,7 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1467
 
1468
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
1469
 
 
1470
 
1471
  if ($isFixed == 2) {
1472
 
@@ -1499,7 +1552,7 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1499
 
1500
  $request->setFreeShipping(1);
1501
  }
1502
- $freeRateId = false;
1503
 
1504
  if (is_object($this->_result)) {
1505
 
@@ -1507,19 +1560,18 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1507
 
1508
  if ($item->getMethod() == $freeCityMethod) {
1509
 
1510
- $freeRateId = $i;
1511
-
1512
- break;
1513
  } else if ($item->getMethod() == $freeInterCityMethod) {
1514
 
1515
- $freeRateId = $i;
 
1516
 
1517
- break;
1518
  }
1519
  }
1520
  }
1521
 
1522
- if ($freeRateId === false) {
1523
 
1524
  return;
1525
  }
@@ -1546,23 +1598,17 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1546
  * if we can apply free shipping for all order we should force price
1547
  * to $0.00 for shipping with out sending second request to carrier
1548
  */
1549
- if (isset($this->_pickingData->amountCODBase)) {
1550
- $oldPrice = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingRateByCode($freeRateId);
1551
- $newPrice = $this->_result->getRateById($freeRateId)->getCost();
1552
-
1553
- $price = 0;
1554
- } else {
1555
-
1556
- $price = 0;
1557
- }
1558
  }
1559
 
1560
  /**
1561
  * if we did not get our free shipping method in response we must use its old price
1562
  */
1563
  if (!is_null($price)) {
1564
- $rate = $this->_result->getRateById($freeRateId);
1565
- $this->_result->getRateById($freeRateId)->setIsFree(1);
 
 
1566
 
1567
  $isAdmin = FALSE;
1568
 
@@ -1581,15 +1627,16 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1581
  $currentAction == 'start' && $currentRoute == 'adminhtml') || ($isAdmin && $currentController == 'sales_order_create' &&
1582
  $currentAction == 'reorder' && $currentRoute == 'adminhtml')) {
1583
 
1584
- if (array_key_exists('speedy_service_' . $rate->getMethod(), $this->_speedyRates)) {
1585
- $this->_speedyRates['speedy_service_' . $rate->getMethod()]['is_free'] = 1;
 
 
 
1586
  }
1587
  Mage::getSingleton('adminhtml/session_quote')->unsSpeedyFixedHourPrices();
1588
  Mage::getSingleton('adminhtml/session_quote')->setSpeedyFixedHourPrices($this->_speedyRates);
1589
  }
1590
  }
1591
-
1592
- $this->_result->getRateById($freeRateId)->setPrice($price);
1593
  }
1594
  }
1595
 
@@ -1620,7 +1667,7 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1620
  protected function speedyTracking($bol) {
1621
  if ($bol) {
1622
  try {
1623
- $bolID = (int) $bol[0];
1624
  $result = $this->_speedyEPS->trackPickingEx($bolID, null);
1625
  } catch (ServerException $se) {
1626
  Mage::log($se->getMessage(), null, 'speedyLog.log');
@@ -1747,6 +1794,12 @@ class Speedy_Speedyshipping_Model_Carrier_Shippingmethod extends Mage_Shipping_M
1747
  if ($service->getTypeId() == 26 || $service->getTypeId() == 36) {
1748
  continue;
1749
  }
 
 
 
 
 
 
1750
  $codes['method'][$service->getTypeId()] = $service->getName();
1751
  }
1752
  }
30
  */
31
  protected $_pickingData;
32
 
 
 
 
 
 
 
 
 
33
  /**
34
  * A property that holds data about the receiver (the customer of the online
35
  * shop).
107
 
108
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
109
 
110
+ $this->_speedySessionId = $this->_speedyEPS->getResultLogin();
111
 
 
112
  //Mage::log('connection established', null, 'speedyLog.log');
113
  return TRUE;
114
  } catch (Exception $e) {
183
 
184
  $this->_pickingData = $this->setPickingData();
185
 
 
 
186
  $this->_receiverData = $this->setUpReceiverData();
187
 
188
  $this->_rawRequest = $request;
229
  }
230
 
231
 
 
 
232
  if ($address->getCustomerAddressId()) {
233
 
234
  $customerAddress = Mage::getModel('customer/address')->load($address->getCustomerAddressId());
282
  $orderData->setBlockId($address->getSpeedyBlockNumber());
283
  }
284
 
285
+ if ($address->getSpeedyCountryId()) {
286
+
287
+ $orderData->setSpeedyCountryId($address->getSpeedyCountryId());
288
+ }
289
+
290
+ if ($address->getSpeedyStateId()) {
291
+
292
+ $orderData->setSpeedyStateId($address->getSpeedyStateId());
293
+ }
294
+
295
+ if ($address->getCountryId()) {
296
+
297
+ $orderData->setCountryId($address->getCountryId());
298
+ }
299
+
300
+ if ($address->getPostcode()) {
301
+ $orderData->setPostcode($address->getPostcode());
302
+ }
303
+
304
+ if ($currentAction == 'saveBilling') {
305
+ $addressData = Mage::app()->getRequest()->getParam('billing');
306
+ $addressId = Mage::app()->getRequest()->getParam('billing_address_id');
307
+ } elseif ($currentAction == 'saveShipping') {
308
+ $addressData = Mage::app()->getRequest()->getParam('shipping');
309
+ $addressId = Mage::app()->getRequest()->getParam('shipping_address_id');
310
+ }
311
+
312
+ Mage::getSingleton('checkout/session')->unsSpeedyActiveCurrencyCode();
313
+ if (empty($addressId) && !empty($addressData['active_currency_code'])) {
314
+ $orderData->setSpeedyActiveCurrencyCode($addressData['active_currency_code']);
315
+ Mage::getSingleton('checkout/session')->setSpeedyActiveCurrencyCode($addressData['active_currency_code']);
316
+ } else {
317
+ if (!empty($addressId)) {
318
+ $address = Mage::getModel('customer/address')->load($addressId);
319
+ }
320
+
321
+ if ($address->getSpeedyCountryId() || $address->getCountryId()) {
322
+ try {
323
+ require_once Mage::getBaseDir('lib') . DS . 'SpeedyEPS' . DS . 'ver01' . DS . 'ParamFilterCountry.class.php';
324
+ $ParamFilterCountry = new ParamFilterCountry();
325
+ if ($address->getSpeedyCountryId()) {
326
+ $ParamFilterCountry->setCountryId($address->getSpeedyCountryId());
327
+ } else {
328
+ $ParamFilterCountry->setIsoAlpha2($address->getCountryId());
329
+ }
330
+ $countries = $this->_speedyEPS->listCountriesEx($ParamFilterCountry);
331
+ } catch (ServerException $se) {
332
+ Mage::log($se->getMessage(),null,'speedyLog.log');
333
+ }
334
+
335
+ if (isset($countries) && count($countries) == 1) {
336
+ $orderData->setSpeedyActiveCurrencyCode($countries[0]->getActiveCurrencyCode());
337
+ Mage::getSingleton('checkout/session')->setSpeedyActiveCurrencyCode($countries[0]->getActiveCurrencyCode());
338
+ }
339
+ }
340
+ }
341
 
342
  $speedyAdminExactTime = null;
343
 
720
  $pickingData->payerType = ParamCalculation::PAYER_TYPE_SENDER;
721
  } else {
722
  */
723
+ // $pickingData->payerType = ParamCalculation::PAYER_TYPE_RECEIVER;
724
  // }
725
 
726
+ if ($isFixed == 2 || $isFixed == 4 || !$this->_orderData->getSpeedyActiveCurrencyCode() || $this->_request->getDestCountryId() != 'BG') {
727
+ $pickingData->payerType = ParamCalculation::PAYER_TYPE_SENDER;
728
+ } else {
729
+ $pickingData->payerType = ParamCalculation::PAYER_TYPE_RECEIVER;
730
+ }
731
 
732
  $pickingData->backDocumentReq = Mage::getStoreConfig('carriers/speedyshippingmodule/back_documents'); // Заявка за обратни документи
733
  $pickingData->backReceiptReq = Mage::getStoreConfig('carriers/speedyshippingmodule/back_receipt'); // Заявка за обратна разписка
738
  return $pickingData;
739
  }
740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  /**
742
  * This method initializes the receiver data
743
  * @return \StdClass
766
 
767
  $receiverData->address->streetNo = $this->_orderData->getStreetNo();
768
 
769
+ $receiverData->address->speedyCountryId = $this->_orderData->getSpeedyCountryId();
770
+ $receiverData->address->speedyStateId = $this->_orderData->getSpeedyStateId();
771
+ $receiverData->address->postcode = $this->_orderData->getPostcode();
772
+ $receiverData->address->countryId = $this->_orderData->getCountryId();
773
+ $receiverData->address->activeCurrencyCode = $this->_orderData->getSpeedyActiveCurrencyCode();
774
+
775
  $receiverData->partnerName = $this->_request->getRecipientContactPersonName();
776
  $receiverData->contactName = $this->_request->getRecipientContactPersonName();
777
  $receiverData->contactPhone = $this->_request->getRecipientContactPhoneNumber();
819
  }
820
 
821
  $result = Mage::getModel('shipping/rate_result');
822
+
823
+ if ($isAdmin && $this->_orderData->getSpeedyActiveCurrencyCode()) {
824
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
825
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), array_values($allowedCurrencies));
826
+ if (!isset($rates[$this->_orderData->getSpeedyActiveCurrencyCode()])) {
827
+ $error = Mage::getModel('shipping/rate_result_error');
828
+ $error->setCarrier($this->_code);
829
+ $error->setCarrierTitle($this->getConfigData('title'));
830
+ $error->setErrorMessage(Mage::helper('speedyshippingmodule')->__('The currency %s is missing or invalid.', $this->_orderData->getSpeedyActiveCurrencyCode()));
831
+ $result->append($error);
832
+ }
833
+ }
834
+
835
+
836
  $methods = explode(',', $this->getConfigData('allowed_methods'));
837
 
838
  $request = Mage::app()->getRequest();
900
 
901
  $finalMethods = $this->_speedyRates;
902
 
903
+ if (!empty($finalMethods)) {
904
  foreach ($finalMethods as $method) {
905
  $Rmethod = Mage::getModel('shipping/rate_result_method');
906
 
943
 
944
  $result->append($Rmethod);
945
  }
 
 
946
  } else {
947
+ if ($this->getConfigData('allowed_methods')) {
948
+ if (Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable') == 4) {
949
+ $message = Mage::helper('speedyshippingmodule')->__('For this order can not be calculated price. Please contact the administrators of the store!');
950
+ } else {
951
+ $message = Mage::helper('speedyshippingmodule')->__('Please select another office or change your shipping address.');
952
+ }
953
+
954
+ $error = Mage::getModel('shipping/rate_result_error');
955
+ $error->setCarrier($this->_code);
956
+ $error->setCarrierTitle($this->getConfigData('title'));
957
+ $error->setErrorMessage($message);
958
+ $result->append($error);
959
+ }
960
  }
961
+
962
+ return $result;
963
  }
964
 
965
  /**
1211
 
1212
  $paramCalculation->setPayerType($this->_pickingData->payerType);
1213
 
1214
+ if ($this->_receiverData->address->activeCurrencyCode) {
1215
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
1216
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), array_values($allowedCurrencies));
1217
+ if (isset($rates[$this->_receiverData->address->activeCurrencyCode])) {
1218
+ $paramCalculation->setAmountCodBase(Mage::helper('directory')->currencyConvert($this->_pickingData->amountCODBase, Mage::app()->getStore()->getBaseCurrencyCode(), $this->_receiverData->address->activeCurrencyCode));
1219
+ }
1220
+ }
1221
 
1222
  $paramCalculation->setTakingDate($this->_pickingData->takingDate);
1223
 
1231
  $paramCalculation->setOfficeToBeCalledId(null);
1232
  }
1233
 
1234
+ if (!$this->_pickingData->takeFromOfficeId && !empty($this->_receiverData->address->speedyCountryId)) {
1235
+ $paramCalculation->setReceiverCountryId($this->_receiverData->address->speedyCountryId);
1236
+ if (!empty($this->_receiverData->address->postcode)) {
1237
+ $paramCalculation->setReceiverPostCode($this->_receiverData->address->postcode);
1238
+ }
1239
+ }
1240
+
1241
+ // if abroad a fixed_pricing_enable == calculator || calculator_fixed
1242
+ if (!empty($this->_receiverData->address->countryId) && $this->_receiverData->address->countryId != 'BG' && (Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable') == 1 || Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable') == 3)) {
1243
+ $paramCalculation->setIncludeShippingPriceInCod(true);
1244
+ }
1245
 
1246
  /*
1247
  if (count($methods) == 1) {
1416
  } else if ($isFixed == 3) {
1417
  $handlingAmount = Mage::getStoreConfig('carriers/speedyshippingmodule/handlingCharge');
1418
  $total = $total + $taxCalculator->getShippingPrice($handlingAmount, FALSE);
1419
+ } else if ($isFixed == 4) {
1420
+ $tablerates = Mage::getModel('speedyshippingmodule/carrier_tablerate')->getCollection()->setServiceIdFilter($method->getServiceTypeId())->setTakeFromOfficeFilter($this->_pickingData->takeFromOfficeId ? 1 : 0)->setWeightFilter($this->_pickingData->weightDeclared)->setTotalFilter($total)->setOrderField('weight')->setOrderField('order_total')->getData();
1421
+ if ($tablerates && isset($tablerates[0])) {
1422
+ $total = $tablerates[0]['price_without_vat'];
1423
+ } else {
1424
+ continue;
1425
+ }
1426
  }
1427
 
1428
  //Is fixed hour allowed for this particular service
1519
 
1520
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
1521
 
1522
+ $freeInternationalMethod = explode(',', Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_international'));
1523
 
1524
  if ($isFixed == 2) {
1525
 
1552
 
1553
  $request->setFreeShipping(1);
1554
  }
1555
+ $freeRateIds = array();
1556
 
1557
  if (is_object($this->_result)) {
1558
 
1560
 
1561
  if ($item->getMethod() == $freeCityMethod) {
1562
 
1563
+ $freeRateIds[] = $i;
 
 
1564
  } else if ($item->getMethod() == $freeInterCityMethod) {
1565
 
1566
+ $freeRateIds[] = $i;
1567
+ } else if (in_array($item->getMethod(), $freeInternationalMethod)) {
1568
 
1569
+ $freeRateIds[] = $i;
1570
  }
1571
  }
1572
  }
1573
 
1574
+ if (empty($freeRateIds)) {
1575
 
1576
  return;
1577
  }
1598
  * if we can apply free shipping for all order we should force price
1599
  * to $0.00 for shipping with out sending second request to carrier
1600
  */
1601
+ $price = 0;
 
 
 
 
 
 
 
 
1602
  }
1603
 
1604
  /**
1605
  * if we did not get our free shipping method in response we must use its old price
1606
  */
1607
  if (!is_null($price)) {
1608
+ foreach ($freeRateIds as $freeRateId) {
1609
+ $this->_result->getRateById($freeRateId)->setIsFree(1);
1610
+ $this->_result->getRateById($freeRateId)->setPrice($price);
1611
+ }
1612
 
1613
  $isAdmin = FALSE;
1614
 
1627
  $currentAction == 'start' && $currentRoute == 'adminhtml') || ($isAdmin && $currentController == 'sales_order_create' &&
1628
  $currentAction == 'reorder' && $currentRoute == 'adminhtml')) {
1629
 
1630
+ foreach ($freeRateIds as $freeRateId) {
1631
+ $rate = $this->_result->getRateById($freeRateId);
1632
+ if (array_key_exists('speedy_service_' . $rate->getMethod(), $this->_speedyRates)) {
1633
+ $this->_speedyRates['speedy_service_' . $rate->getMethod()]['is_free'] = 1;
1634
+ }
1635
  }
1636
  Mage::getSingleton('adminhtml/session_quote')->unsSpeedyFixedHourPrices();
1637
  Mage::getSingleton('adminhtml/session_quote')->setSpeedyFixedHourPrices($this->_speedyRates);
1638
  }
1639
  }
 
 
1640
  }
1641
  }
1642
 
1667
  protected function speedyTracking($bol) {
1668
  if ($bol) {
1669
  try {
1670
+ $bolID = (float) $bol[0];
1671
  $result = $this->_speedyEPS->trackPickingEx($bolID, null);
1672
  } catch (ServerException $se) {
1673
  Mage::log($se->getMessage(), null, 'speedyLog.log');
1794
  if ($service->getTypeId() == 26 || $service->getTypeId() == 36) {
1795
  continue;
1796
  }
1797
+
1798
+ // Remove pallet services
1799
+ if ($service->getCargoType() == 2) {
1800
+ continue;
1801
+ }
1802
+
1803
  $codes['method'][$service->getTypeId()] = $service->getName();
1804
  }
1805
  }
app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Beforepayment.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of beforepayment
10
+ *
11
+ * @author killer
12
+ */
13
+ class Speedy_Speedyshipping_Model_Carrier_Source_Beforepayment {
14
+
15
+ //put your code here
16
+
17
+ public function toOptionArray() {
18
+ // $arr = array('no_option'=>'Без опция',
19
+ // 'test'=>'Теставай преди да платиш (ТПП)',
20
+ // 'open'=>'Отвори преди да платиш (ОПП)');
21
+
22
+ $arr = array('no_option'=>Mage::helper('core')->__('No option'),
23
+ 'test'=>Mage::helper('core')->__('Test before payment'),
24
+ 'open'=>Mage::helper('core')->__('Open before payment'));
25
+
26
+ $options = array();
27
+
28
+ foreach ($arr as $key=>$value) {
29
+ $options[] = array('value' => $key, 'label' => $value);
30
+ }
31
+
32
+ return $options;
33
+ }
34
+
35
+ }
36
+
37
+ ?>
app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Calculation.php CHANGED
@@ -18,10 +18,12 @@ class Speedy_Speedyshipping_Model_Carrier_Source_Calculation {
18
  // $arr = array(1=>'Спиди калкулатор',
19
  // 2=>'Фиксирана цена',
20
  // 3=>'Спиди калкулатор + надбавка за обработка');
 
21
 
22
  $arr = array(1=>Mage::helper('core')->__('speedy calculator'),
23
  2=>Mage::helper('core')->__('fixed price'),
24
- 3=>Mage::helper('core')->__('speedy_calc_handling'));
 
25
 
26
  $options = array();
27
 
18
  // $arr = array(1=>'Спиди калкулатор',
19
  // 2=>'Фиксирана цена',
20
  // 3=>'Спиди калкулатор + надбавка за обработка');
21
+ // 4=>'Цена от файл');
22
 
23
  $arr = array(1=>Mage::helper('core')->__('speedy calculator'),
24
  2=>Mage::helper('core')->__('fixed price'),
25
+ 3=>Mage::helper('core')->__('speedy_calc_handling'),
26
+ 4=>Mage::helper('core')->__('table_rate'));
27
 
28
  $options = array();
29
 
app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Method.php CHANGED
@@ -18,7 +18,7 @@ class Speedy_Speedyshipping_Model_Carrier_Source_Method {
18
  $speedy = Mage::getSingleton('speedyshippingmodule/carrier_shippingmethod');
19
  $arr = array();
20
  foreach ($speedy->getCode('method') as $k => $v) {
21
- $arr[] = array('value' => $k, 'label' => $v);
22
  }
23
  return $arr;
24
  }
18
  $speedy = Mage::getSingleton('speedyshippingmodule/carrier_shippingmethod');
19
  $arr = array();
20
  foreach ($speedy->getCode('method') as $k => $v) {
21
+ $arr[] = array('value' => $k, 'label' => $v . ' (' . Mage::helper('speedyshippingmodule')->__('Service ID:') . ' ' . $k . ')');
22
  }
23
  return $arr;
24
  }
app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Moneytransfer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ class Speedy_Speedyshipping_Model_Carrier_Source_Moneytransfer extends Mage_Core_Model_Config_Data
9
+ {
10
+ public function _beforeSave()
11
+ {
12
+ if ($this->getValue()) {
13
+ $groups = Mage::app()->getRequest()->getParam('groups');
14
+ $server = $groups['speedyshippingmodule']['fields']['server']['value'];
15
+ $username = $groups['speedyshippingmodule']['fields']['username']['value'];
16
+ $password = $groups['speedyshippingmodule']['fields']['password']['value'];
17
+
18
+ try {
19
+ $speedyEPSInterfaceImplementaion = new EPSSOAPInterfaceImpl($server);
20
+ $speedyEPS = new EPSFacade($speedyEPSInterfaceImplementaion, $username, $password);
21
+
22
+ $additionamUserParams = $speedyEPS->getAdditionalUserParams(time());
23
+ } catch (Exception $e) {
24
+ Mage::log($e->getMessage(), null, 'speedyLog.log');
25
+ }
26
+
27
+ if (!in_array('101', $additionamUserParams)) {
28
+ $this->setValue(0);
29
+ }
30
+ }
31
+
32
+ return $this;
33
+ }
34
+ }
app/code/community/Speedy/Speedyshipping/Model/Carrier/Source/Tablerate.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of beforepayment
10
+ *
11
+ * @author killer
12
+ */
13
+ class Speedy_Speedyshipping_Model_Carrier_Source_Tablerate extends Mage_Core_Model_Config_Data
14
+ {
15
+ public function _afterSave()
16
+ {
17
+ Mage::getResourceModel('speedyshippingmodule/carrier_tablerate')->uploadAndImport($this);
18
+ }
19
+ }
app/code/community/Speedy/Speedyshipping/Model/Carrier/Tablerate.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Speedy_Speedyshipping_Model_Carrier_Tablerate extends Mage_Core_Model_Abstract
4
+ {
5
+ /**
6
+ * Define resource model
7
+ */
8
+ protected function _construct()
9
+ {
10
+ $this->_init('speedyshippingmodule/carrier_tablerate');
11
+ }
12
+ }
app/code/community/Speedy/Speedyshipping/Model/Observer.php CHANGED
@@ -28,6 +28,7 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
28
  $action = $evt->getEvent()->getControllerAction();
29
  $currentRoute = $controller->getRequest()->getRouteName();
30
 
 
31
 
32
  /**
33
  * Validation of customer address on onepage checkout->saveBilling action
@@ -38,13 +39,52 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
38
 
39
  //the address is new
40
  if (!$customerAddressId) {
41
- $isValidSpeedyAddress = $validateHelper->validateSpeedyAddress();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  if (!$isValidSpeedyAddress) {
45
  $result = array();
46
  $result['error'] = 1;
47
- $result['message'] = $controller->__("Please enter a valid address");
48
  $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
49
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
50
  } else {
@@ -73,13 +113,51 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
73
 
74
  //the address is new
75
  if (!$customerAddressId) {
76
- $isValidSpeedyAddress = $validateHelper->validateSpeedyAddress();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
 
79
  if (!$isValidSpeedyAddress) {
80
  $result = array();
81
  $result['error'] = 1;
82
- $result['message'] = $controller->__("Please enter a valid address");
83
  $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
84
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
85
  } else {
@@ -239,6 +317,22 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
239
 
240
  $controller->getOnepage()->getQuote()->save();
241
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  } else if ($controllerName == 'address' && $actionName == 'formPost') {
243
  $validateHelper = Mage::helper('speedyshippingmodule/validate_address');
244
  $address = Mage::getModel('customer/address');
@@ -322,6 +416,10 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
322
 
323
  $address->setSpeedyOfficeId($billingAddress->getSpeedyOfficeId());
324
 
 
 
 
 
325
  //$quote->save();
326
  }
327
  }
@@ -469,8 +567,11 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
469
 
470
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
471
 
 
 
472
  if (($code[1] == $freeCityMethod) ||
473
- ($code[1] == $freeInterCityMethod) ||
 
474
  ($shippingAmount == 0.000)) {
475
  $isFreeShippingChoosen = TRUE;
476
  }
@@ -482,7 +583,7 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
482
  //Determine who should pay the price for the shipment
483
 
484
  if ( ($isEnabled && ($order->getSubtotal() >= (float) $freeMethodSubtotal) && $isFreeShippingChoosen) ||
485
- $shippingAmount == 0.000) {
486
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER); //SENDER
487
  } else {
488
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER); //RECEIVER
@@ -616,8 +717,11 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
616
 
617
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
618
 
 
 
619
  if (($code[1] == $freeCityMethod) ||
620
- ($code[1] == $freeInterCityMethod) ||
 
621
  ($shippingAmount == 0.000)) {
622
  $isFreeShippingChoosen = TRUE;
623
  }
@@ -627,7 +731,7 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
627
 
628
 
629
  if ( ($isEnabled && ($order->getSubtotal() >= (float) $freeMethodSubtotal) && $isFreeShippingChoosen) ||
630
- $shippingAmount == 0.000) {
631
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER); //SENDER
632
  } else {
633
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER); //RECEIVER
@@ -700,7 +804,7 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
700
 
701
  $this->_initSpeedyService();
702
  try {
703
- $this->_speedyEPS->invalidatePicking($bolID);
704
  $isBolCanceled = TRUE;
705
  } catch (ServerException $se) {
706
  Mage::log($se->getMessage(), null, 'speedyLog.log');
@@ -912,15 +1016,81 @@ class Speedy_Speedyshipping_Model_Observer extends Varien_Object {
912
  new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
913
 
914
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
915
- $this->_speedySessionId = $this->_speedyEPS->login();
916
-
917
- $this->_senderData = $this->_speedyEPS->getClientById($this->_speedyEPS->getResultLogin()->getClientId());
918
  } catch (Exception $e) {
919
  Mage::log($e->getMessage(), null, 'speedyLog.log');
920
  exit();
921
  }
922
  }
923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
924
  }
925
 
926
  ?>
28
  $action = $evt->getEvent()->getControllerAction();
29
  $currentRoute = $controller->getRequest()->getRouteName();
30
 
31
+ $this->_initSpeedyService();
32
 
33
  /**
34
  * Validation of customer address on onepage checkout->saveBilling action
39
 
40
  //the address is new
41
  if (!$customerAddressId) {
42
+ // $request = $this->_getRequest();
43
+ // $actionName = $request->getActionName();
44
+ $billing_post_address = $controller->getRequest()->getPost('billing');
45
+
46
+ if (!empty($billing_post_address['active_currency_code'])) {
47
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
48
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), array_values($allowedCurrencies));
49
+ if (!isset($rates[$billing_post_address['active_currency_code']])) {
50
+ $result = array();
51
+ $result['error'] = 1;
52
+
53
+ $result['message'] = Mage::helper('speedyshippingmodule')->__('The currency %s is missing or invalid. Please contact the administrators of the store!', $billing_post_address['active_currency_code']);
54
+ $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
55
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
56
+ }
57
+ }
58
 
59
+ if ($billing_post_address && !empty($billing_post_address['country_id']) && $billing_post_address['country_id'] != 'BG') {
60
+ $speedy_address = array(
61
+ 'city_id' => (isset($billing_post_address['speedy_site_id']) ? $billing_post_address['speedy_site_id'] : 0),
62
+ 'city' => (isset($billing_post_address['city']) ? $billing_post_address['city'] : ''),
63
+ 'postcode' => (isset($billing_post_address['postcode']) ? $billing_post_address['postcode'] : ''),
64
+ 'address_1' => (isset($billing_post_address['street'][0]) ? $billing_post_address['street'][0] : ''),
65
+ 'address_2' => (isset($billing_post_address['street'][1]) ? $billing_post_address['street'][1] : ''),
66
+ 'country_id' => (isset($billing_post_address['speedy_country_id']) ? $billing_post_address['speedy_country_id'] : 0),
67
+ 'state_id' => (isset($billing_post_address['speedy_state_id']) ? $billing_post_address['speedy_state_id'] : 0),
68
+ );
69
+
70
+ $valid = $this->validateAddress($speedy_address);
71
+ if ($valid !== true) {
72
+ $isValidSpeedyAddress = false;
73
+ $message = $valid;
74
+ } else {
75
+ $isValidSpeedyAddress = true;
76
+ }
77
+ } else {
78
+ $isValidSpeedyAddress = $validateHelper->validateSpeedyAddress();
79
+ if (!$isValidSpeedyAddress) {
80
+ $message = $controller->__("Please enter a valid address");
81
+ }
82
+ }
83
 
84
  if (!$isValidSpeedyAddress) {
85
  $result = array();
86
  $result['error'] = 1;
87
+ $result['message'] = $message;
88
  $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
89
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
90
  } else {
113
 
114
  //the address is new
115
  if (!$customerAddressId) {
116
+ $shipping_post_address = $controller->getRequest()->getPost('shipping');
117
+
118
+ if (!empty($shipping_post_address['active_currency_code'])) {
119
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
120
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), array_values($allowedCurrencies));
121
+ if (!isset($rates[$shipping_post_address['active_currency_code']])) {
122
+ $result = array();
123
+ $result['error'] = 1;
124
+
125
+ $result['message'] = Mage::helper('speedyshippingmodule')->__('The currency %s is missing or invalid. Please contact the administrators of the store!', $billing_post_address['active_currency_code']);
126
+ $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
127
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
128
+ }
129
+ }
130
+
131
+ if ($shipping_post_address && !empty($shipping_post_address['country_id']) && $shipping_post_address['country_id'] != 'BG') {
132
+ $speedy_address = array(
133
+ 'city_id' => (isset($shipping_post_address['speedy_site_id']) ? $shipping_post_address['speedy_site_id'] : 0),
134
+ 'city' => (isset($shipping_post_address['city']) ? $shipping_post_address['city'] : ''),
135
+ 'postcode' => (isset($shipping_post_address['postcode']) ? $shipping_post_address['postcode'] : ''),
136
+ 'address_1' => (isset($shipping_post_address['street'][0]) ? $shipping_post_address['street'][0] : ''),
137
+ 'address_2' => (isset($shipping_post_address['street'][1]) ? $shipping_post_address['street'][1] : ''),
138
+ 'country_id' => (isset($shipping_post_address['speedy_country_id']) ? $shipping_post_address['speedy_country_id'] : 0),
139
+ 'state_id' => (isset($shipping_post_address['speedy_state_id']) ? $shipping_post_address['speedy_state_id'] : 0),
140
+ );
141
+
142
+ $valid = $this->validateAddress($speedy_address);
143
+ if ($valid !== true) {
144
+ $isValidSpeedyAddress = false;
145
+ $message = $valid;
146
+ } else {
147
+ $isValidSpeedyAddress = true;
148
+ }
149
+ } else {
150
+ $isValidSpeedyAddress = $validateHelper->validateSpeedyAddress();
151
+ if (!$isValidSpeedyAddress) {
152
+ $message = $controller->__("Please enter a valid address");
153
+ }
154
+ }
155
 
156
 
157
  if (!$isValidSpeedyAddress) {
158
  $result = array();
159
  $result['error'] = 1;
160
+ $result['message'] = $message;
161
  $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
162
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
163
  } else {
317
 
318
  $controller->getOnepage()->getQuote()->save();
319
  }
320
+ } else if ($controllerName == 'onepage' && $actionName == 'savePayment') {
321
+ $activeCurrencyCode = Mage::getSingleton('checkout/session')->getSpeedyActiveCurrencyCode();
322
+ $paymentMethod = $controller->getRequest()->getPost('payment');
323
+ $shippingMethod = $controller->getOnepage()->getQuote()->getShippingAddress()->getShippingMethod();
324
+ $code = explode('_', $shippingMethod);
325
+
326
+ if ($code[0] == 'speedyshippingmodule' && $paymentMethod['method'] == 'cashondelivery' && $activeCurrencyCode) {
327
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
328
+ if (!in_array($activeCurrencyCode, $allowedCurrencies)) {
329
+ $result = array();
330
+ $result['error'] = 1;
331
+ $result['message'] = Mage::helper('speedyshippingmodule')->__('You can\'t use Cash on Delivery, the currency %s is missing. Please contact the administrators of the store!', $activeCurrencyCode);
332
+ $action->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
333
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
334
+ }
335
+ }
336
  } else if ($controllerName == 'address' && $actionName == 'formPost') {
337
  $validateHelper = Mage::helper('speedyshippingmodule/validate_address');
338
  $address = Mage::getModel('customer/address');
416
 
417
  $address->setSpeedyOfficeId($billingAddress->getSpeedyOfficeId());
418
 
419
+ $address->setSpeedyCountryId($billingAddress->getSpeedyCountryId());
420
+
421
+ $address->setSpeedyStateId($billingAddress->getSpeedyStateId());
422
+
423
  //$quote->save();
424
  }
425
  }
567
 
568
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
569
 
570
+ $freeInternationalMethod = explode(',', Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_international'));
571
+
572
  if (($code[1] == $freeCityMethod) ||
573
+ ($code[1] == $freeInterCityMethod) ||
574
+ in_array($code[1], $freeInternationalMethod) ||
575
  ($shippingAmount == 0.000)) {
576
  $isFreeShippingChoosen = TRUE;
577
  }
583
  //Determine who should pay the price for the shipment
584
 
585
  if ( ($isEnabled && ($order->getSubtotal() >= (float) $freeMethodSubtotal) && $isFreeShippingChoosen) ||
586
+ $shippingAmount == 0.000 || $address->getCountryId() != 'BG') {
587
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER); //SENDER
588
  } else {
589
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER); //RECEIVER
717
 
718
  $freeInterCityMethod = Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_intercity');
719
 
720
+ $freeInternationalMethod = explode(',', Mage::getStoreConfig('carriers/speedyshippingmodule/free_method_international'));
721
+
722
  if (($code[1] == $freeCityMethod) ||
723
+ ($code[1] == $freeInterCityMethod) ||
724
+ in_array($code[1], $freeInternationalMethod) ||
725
  ($shippingAmount == 0.000)) {
726
  $isFreeShippingChoosen = TRUE;
727
  }
731
 
732
 
733
  if ( ($isEnabled && ($order->getSubtotal() >= (float) $freeMethodSubtotal) && $isFreeShippingChoosen) ||
734
+ $shippingAmount == 0.000 || $address->getCountryId() != 'BG') {
735
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER); //SENDER
736
  } else {
737
  $saveSpeedyData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER); //RECEIVER
804
 
805
  $this->_initSpeedyService();
806
  try {
807
+ $this->_speedyEPS->invalidatePicking((float)$bolID);
808
  $isBolCanceled = TRUE;
809
  } catch (ServerException $se) {
810
  Mage::log($se->getMessage(), null, 'speedyLog.log');
1016
  new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
1017
 
1018
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
1019
+ $this->_speedySessionId = $this->_speedyEPS->getResultLogin();
 
 
1020
  } catch (Exception $e) {
1021
  Mage::log($e->getMessage(), null, 'speedyLog.log');
1022
  exit();
1023
  }
1024
  }
1025
 
1026
+ public function validateAddress($address) {
1027
+ $paramAddress = new ParamAddress();
1028
+
1029
+ $paramAddress->setSiteId($address['city_id']);
1030
+ $paramAddress->setSiteName($address['city']);
1031
+ $paramAddress->setPostCode($address['postcode']);
1032
+ $paramAddress->setFrnAddressLine1($address['address_1']);
1033
+ $paramAddress->setFrnAddressLine2($address['address_2']);
1034
+ $paramAddress->setCountryId($address['country_id']);
1035
+ $paramAddress->setStateId($address['state_id']);
1036
+
1037
+ try {
1038
+ $valid = $this->_speedyEPS->validateAddress($paramAddress, 0);
1039
+ } catch (Exception $e) {
1040
+ if (strpos($e->getMessage(), 'Invalid post code for specified country') || strpos($e->getMessage(), 'Invalid post code for site') || strpos($e->getMessage(), 'VALUE_OUT_OF_RANGE_ADDRESS_FIELD')) {
1041
+ $valid = Mage::helper('speedyshippingmodule')->__("Please enter a valid postcode");
1042
+ } else {
1043
+ $valid = Mage::helper('speedyshippingmodule')->__("Please enter a valid address");
1044
+ }
1045
+ }
1046
+
1047
+ return $valid;
1048
+ }
1049
+
1050
+ /**
1051
+ * @param Varien_Event_Observer $observer
1052
+ */
1053
+ public function restrictPaymentsCd($observer)
1054
+ {
1055
+ if ($observer->getEvent()->hasQuote()) {
1056
+ $activeCurrencyCode = Mage::getSingleton('checkout/session')->getSpeedyActiveCurrencyCode();
1057
+ $paymentMethod = $observer->getEvent()->getMethodInstance()->getCode();
1058
+ $shippingMethod = $observer->getEvent()->getQuote()->getShippingAddress()->getShippingMethod();
1059
+ $code = explode('_', $shippingMethod);
1060
+
1061
+ if ($code[0] == 'speedyshippingmodule' && $paymentMethod == 'cashondelivery' && !$activeCurrencyCode) {
1062
+ $observer->getEvent()->getResult()->isAvailable = false;
1063
+ }
1064
+ }
1065
+ }
1066
+
1067
+ /**
1068
+ * @param Varien_Event_Observer $observer
1069
+ */
1070
+ public function collectTotals($observer)
1071
+ {
1072
+ if (Mage::getStoreConfigFlag('carriers/speedyshippingmodule/invoice_courier_sevice_as_text') && $observer->getEvent()->hasQuote()) {
1073
+ $shippingAddress = $observer->getEvent()->getQuote()->getShippingAddress();
1074
+ $code = explode('_', $shippingAddress->getShippingMethod());
1075
+
1076
+ if ($code[0] == 'speedyshippingmodule') {
1077
+ $shipping_amount = $shippingAddress->getShippingAmount();
1078
+ $base_shipping_amount = $shippingAddress->getBaseShippingAmount();
1079
+ $grant_total = $shippingAddress->getGrandTotal();
1080
+ $base_grant_total = $shippingAddress->getBaseGrandTotal();
1081
+ $shipping_description = $shippingAddress->getShippingDescription();
1082
+ $shipping_description = $shippingAddress->getShippingDescription();
1083
+
1084
+ $shippingAddress->setShippingDescription($shipping_description . ' (' . Mage::helper('core')->currency($shipping_amount, true, false) . ')');
1085
+ $shippingAddress->setGrandTotal($grant_total - $shipping_amount);
1086
+ $shippingAddress->setBaseGrandTotal($base_grant_total - $base_shipping_amount);
1087
+ $shippingAddress->setShippingInclTax(0.00);
1088
+ $shippingAddress->setBaseShippingInclTax(0.00);
1089
+ $shippingAddress->setShippingAmount(0.00);
1090
+ $shippingAddress->setBaseShippingAmount(0.00);
1091
+ }
1092
+ }
1093
+ }
1094
  }
1095
 
1096
  ?>
app/code/community/Speedy/Speedyshipping/Model/Resource/Carrier/Tablerate.php ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Shipping
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Shipping table rates
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Shipping
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Speedy_Speedyshipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Resource_Db_Abstract
35
+ {
36
+ /**
37
+ * Import table rates website ID
38
+ *
39
+ * @var int
40
+ */
41
+ protected $_importWebsiteId = 0;
42
+
43
+ /**
44
+ * Errors in import process
45
+ *
46
+ * @var array
47
+ */
48
+ protected $_importErrors = array();
49
+
50
+ /**
51
+ * Count of imported table rates
52
+ *
53
+ * @var int
54
+ */
55
+ protected $_importedRows = 0;
56
+
57
+ /**
58
+ * Array of unique table rate keys to protect from duplicates
59
+ *
60
+ * @var array
61
+ */
62
+ protected $_importUniqueHash = array();
63
+
64
+ /**
65
+ * Define main table and id field name
66
+ *
67
+ * @return void
68
+ */
69
+ protected function _construct()
70
+ {
71
+ $this->_init('speedyshippingmodule/tablerate', 'pk');
72
+ }
73
+
74
+ /**
75
+ * Upload table rate file and import data from it
76
+ *
77
+ * @param Varien_Object $object
78
+ * @throws Mage_Core_Exception
79
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate
80
+ */
81
+ public function uploadAndImport(Varien_Object $object)
82
+ {
83
+ if (empty($_FILES['groups']['tmp_name']['speedyshippingmodule']['fields']['tableRate']['value'])) {
84
+ return $this;
85
+ }
86
+
87
+ $csvFile = $_FILES['groups']['tmp_name']['speedyshippingmodule']['fields']['tableRate']['value'];
88
+ $website = Mage::app()->getWebsite($object->getScopeId());
89
+
90
+ $this->_importWebsiteId = (int)$website->getId();
91
+ $this->_importUniqueHash = array();
92
+ $this->_importErrors = array();
93
+ $this->_importedRows = 0;
94
+
95
+ $io = new Varien_Io_File();
96
+ $info = pathinfo($csvFile);
97
+ $io->open(array('path' => $info['dirname']));
98
+ $io->streamOpen($info['basename'], 'r');
99
+
100
+ // check and skip headers
101
+ $headers = $io->streamReadCsv();
102
+ if ($headers === false || count($headers) < 5) {
103
+ $io->streamClose();
104
+ Mage::throwException(Mage::helper('shipping')->__('Invalid Speedy Tablerates File Format'));
105
+ }
106
+
107
+ $adapter = $this->_getWriteAdapter();
108
+ $adapter->beginTransaction();
109
+
110
+ try {
111
+ $rowNumber = 1;
112
+ $importData = array();
113
+
114
+ // delete old data by website
115
+ $condition = array(
116
+ 'website_id = ?' => $this->_importWebsiteId
117
+ );
118
+ $adapter->delete($this->getMainTable(), $condition);
119
+
120
+ while (false !== ($csvLine = $io->streamReadCsv())) {
121
+ $rowNumber ++;
122
+
123
+ if (empty($csvLine)) {
124
+ continue;
125
+ }
126
+
127
+ $row = $this->_getImportRow($csvLine, $rowNumber);
128
+ if ($row !== false) {
129
+ $importData[] = $row;
130
+ }
131
+
132
+ if (count($importData) == 5000) {
133
+ $this->_saveImportData($importData);
134
+ $importData = array();
135
+ }
136
+ }
137
+ $this->_saveImportData($importData);
138
+ $io->streamClose();
139
+ } catch (Mage_Core_Exception $e) {
140
+ $adapter->rollback();
141
+ $io->streamClose();
142
+ Mage::throwException($e->getMessage());
143
+ } catch (Exception $e) {
144
+ $adapter->rollback();
145
+ $io->streamClose();
146
+ Mage::logException($e);
147
+ Mage::throwException(Mage::helper('shipping')->__('An error occurred while import table rates.'));
148
+ }
149
+
150
+ $adapter->commit();
151
+
152
+ if ($this->_importErrors) {
153
+ $error = Mage::helper('shipping')->__('File has not been imported. See the following list of errors: %s', implode(" \n", $this->_importErrors));
154
+ Mage::throwException($error);
155
+ }
156
+
157
+ return $this;
158
+ }
159
+
160
+ /**
161
+ * Validate row for import and return table rate array or false
162
+ * Error will be add to _importErrors array
163
+ *
164
+ * @param array $row
165
+ * @param int $rowNumber
166
+ * @return array|false
167
+ */
168
+ protected function _getImportRow($row, $rowNumber = 0)
169
+ {
170
+ // validate row
171
+ if (count($row) < 5) {
172
+ $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Speedy Tablerates format in the Row #%s', $rowNumber);
173
+ return false;
174
+ }
175
+
176
+ // strip whitespace from the beginning and end of each row
177
+ foreach ($row as $k => $v) {
178
+ $row[$k] = trim($v);
179
+ }
180
+
181
+ // validate Service ID
182
+ if (!(int)$row[0]) {
183
+ $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Speedy Tablerates format in the Row #%s', $rowNumber);
184
+ return false;
185
+ } else {
186
+ $ServiceID = (int)$row[0];
187
+ }
188
+
189
+ $TakeFromOffice = (int)$row[1];
190
+
191
+ // validate weight
192
+ $Weight = $this->_parseDecimalValue($row[2]);
193
+ if ($Weight === false) {
194
+ $this->_importErrors[] = Mage::helper('shipping')->__('Invalid Weight "%s" in the Row #%s.', $row[2], $rowNumber);
195
+ return false;
196
+ }
197
+
198
+ // validate ordertotal
199
+ $OrderTotal = $this->_parseDecimalValue($row[3]);
200
+ if ($OrderTotal === false) {
201
+ $this->_importErrors[] = Mage::helper('shipping')->__('Invalid OrderTotal "%s" in the Row #%s.', $row[3], $rowNumber);
202
+ return false;
203
+ }
204
+
205
+ // validate price without vat
206
+ $PriceWithoutVAT = $this->_parseDecimalValue($row[4]);
207
+ if ($PriceWithoutVAT === false) {
208
+ $this->_importErrors[] = Mage::helper('shipping')->__('Invalid PriceWithoutVAT "%s" in the Row #%s.', $row[4], $rowNumber);
209
+ return false;
210
+ }
211
+
212
+ // protect from duplicate
213
+ $hash = sprintf("%d-%d-%F-%F-%F", $ServiceID, $TakeFromOffice, $Weight, $OrderTotal, $PriceWithoutVAT);
214
+ if (isset($this->_importUniqueHash[$hash])) {
215
+ $this->_importErrors[] = Mage::helper('shipping')->__('Duplicate Row #%s (ServiceID "%d", TakeFromOffice "%s", Weight "%F", OrderTotal "%F" and PriceWithoutVAT "%F").', $rowNumber, $ServiceID, $TakeFromOffice, $Weight, $OrderTotal, $PriceWithoutVAT);
216
+ return false;
217
+ }
218
+ $this->_importUniqueHash[$hash] = true;
219
+
220
+ return array(
221
+ $ServiceID, // Service ID
222
+ $TakeFromOffice, // Take From Office,
223
+ $Weight, // Weight
224
+ $OrderTotal, // Order Total
225
+ $PriceWithoutVAT, // Price Without VAT
226
+ $this->_importWebsiteId // Website Id
227
+ );
228
+ }
229
+
230
+ /**
231
+ * Save import data batch
232
+ *
233
+ * @param array $data
234
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate
235
+ */
236
+ protected function _saveImportData(array $data)
237
+ {
238
+ if (!empty($data)) {
239
+ $columns = array('service_id', 'take_from_office', 'weight', 'order_total', 'price_without_vat', 'website_id',);
240
+ $this->_getWriteAdapter()->insertArray($this->getMainTable(), $columns, $data);
241
+ $this->_importedRows += count($data);
242
+ }
243
+
244
+ return $this;
245
+ }
246
+
247
+ /**
248
+ * Parse and validate positive decimal value
249
+ * Return false if value is not decimal or is not positive
250
+ *
251
+ * @param string $value
252
+ * @return bool|float
253
+ */
254
+ protected function _parseDecimalValue($value)
255
+ {
256
+ $value = str_replace(',', '.', $value);
257
+
258
+ if (!is_numeric($value)) {
259
+ return false;
260
+ }
261
+ $value = (float)sprintf('%.4F', $value);
262
+ if ($value < 0.0000) {
263
+ return false;
264
+ }
265
+ return $value;
266
+ }
267
+ }
app/code/community/Speedy/Speedyshipping/Model/Resource/Carrier/Tablerate/Collection.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Shipping
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Shipping table rates collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Shipping
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Speedy_Speedyshipping_Model_Resource_Carrier_Tablerate_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
35
+ {
36
+ /**
37
+ * Define resource model and item
38
+ *
39
+ */
40
+ protected function _construct()
41
+ {
42
+ $this->_init('speedyshippingmodule/carrier_tablerate');
43
+ // $this->_shipTable = $this->getMainTable();
44
+ }
45
+
46
+ /**
47
+ * Add website filter to collection
48
+ *
49
+ * @param int $websiteId
50
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
51
+ */
52
+ public function setWebsiteFilter($websiteId)
53
+ {
54
+ return $this->addFieldToFilter('website_id', $websiteId);
55
+ }
56
+
57
+ /**
58
+ * Add service filter to collection
59
+ *
60
+ * @param string $serviceId
61
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
62
+ */
63
+ public function setServiceIdFilter($serviceId)
64
+ {
65
+ return $this->addFieldToFilter('service_id', $serviceId);
66
+ }
67
+
68
+ /**
69
+ * Add service filter to collection
70
+ *
71
+ * @param string $serviceId
72
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
73
+ */
74
+ public function setOrderField($field)
75
+ {
76
+ return $this->addOrder($field, self::SORT_ORDER_ASC);
77
+ }
78
+
79
+ /**
80
+ * Add take from office filter to collection
81
+ *
82
+ * @param string $serviceId
83
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
84
+ */
85
+ public function setTakeFromOfficeFilter($takeFromOffice)
86
+ {
87
+ return $this->addFieldToFilter('take_from_office', $takeFromOffice);
88
+ }
89
+
90
+ /**
91
+ * Add weight filter to collection
92
+ *
93
+ * @param string $serviceId
94
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
95
+ */
96
+ public function setWeightFilter($weight)
97
+ {
98
+ $this->getSelect()->where("weight >= ?", (float)$weight);
99
+
100
+ return $this;
101
+ }
102
+
103
+ /**
104
+ * Add order total filter to collection
105
+ *
106
+ * @param string $serviceId
107
+ * @return Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection
108
+ */
109
+ public function setTotalFilter($total)
110
+ {
111
+ $this->getSelect()->where("order_total >= ?", (float)$total);
112
+
113
+ return $this;
114
+ }
115
+ }
app/code/community/Speedy/Speedyshipping/controllers/AddressController.php CHANGED
@@ -73,8 +73,21 @@ protected $_speedyEPSInterfaceImplementaion;
73
  }
74
  }
75
 
76
-
 
 
 
 
 
 
77
 
 
 
 
 
 
 
 
78
 
79
  public function getBlockAction() {
80
  $result = $this->_addressModel->getBlock();
73
  }
74
  }
75
 
76
+ public function getStatesAction() {
77
+ $result = $this->_addressModel->getStates();
78
+
79
+ if(isset($result)){
80
+ $this->getResponse()->setBody($result);
81
+ }
82
+ }
83
 
84
+ public function getCountriesAction() {
85
+ $result = $this->_addressModel->getCountries();
86
+
87
+ if(isset($result)){
88
+ $this->getResponse()->setBody($result);
89
+ }
90
+ }
91
 
92
  public function getBlockAction() {
93
  $result = $this->_addressModel->getBlock();
app/code/community/Speedy/Speedyshipping/controllers/Adminhtml/AddressController.php CHANGED
@@ -57,6 +57,22 @@ class Speedy_Speedyshipping_Adminhtml_AddressController extends Mage_Adminhtml_C
57
  }
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  public function getBlockAction() {
61
  $result = $this->_addressModel->getBlock();
62
 
@@ -98,6 +114,33 @@ class Speedy_Speedyshipping_Adminhtml_AddressController extends Mage_Adminhtml_C
98
  }
99
  }
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
 
103
  ?>
57
  }
58
  }
59
 
60
+ public function getStatesAction() {
61
+ $result = $this->_addressModel->getStates();
62
+
63
+ if(isset($result)){
64
+ $this->getResponse()->setBody($result);
65
+ }
66
+ }
67
+
68
+ public function getCountriesAction() {
69
+ $result = $this->_addressModel->getCountries();
70
+
71
+ if(isset($result)){
72
+ $this->getResponse()->setBody($result);
73
+ }
74
+ }
75
+
76
  public function getBlockAction() {
77
  $result = $this->_addressModel->getBlock();
78
 
114
  }
115
  }
116
 
117
+
118
+ public function validateAbroudAddressAction() {
119
+ $this->_initSpeedyService();
120
+
121
+ $request = Mage::app()->getRequest();
122
+
123
+ $paramAddress = new ParamAddress();
124
+
125
+ $paramAddress->setSiteId($request->getParam('speedy_site_id'));
126
+ $paramAddress->setSiteName($request->getParam('city'));
127
+ $paramAddress->setPostCode($request->getParam('postcode'));
128
+ $paramAddress->setFrnAddressLine1($request->getParam('address_1'));
129
+ $paramAddress->setFrnAddressLine2($request->getParam('address_2'));
130
+ $paramAddress->setCountryId($request->getParam('speedy_country_id'));
131
+ $paramAddress->setStateId($request->getParam('state_id'));
132
+
133
+ try {
134
+ $valid = $this->_speedyEPS->validateAddress($paramAddress, 0);
135
+ } catch (Exception $e) {
136
+ $valid = $e->getMessage();
137
+ }
138
+
139
+ if(isset($valid)){
140
+ $this->getResponse()->setBody($valid);
141
+ }
142
+ }
143
+
144
  }
145
 
146
  ?>
app/code/community/Speedy/Speedyshipping/controllers/Adminhtml/PrintController.php CHANGED
@@ -24,12 +24,6 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
24
  */
25
  protected $_city_id;
26
 
27
- /**
28
- * A std class, that holds various pieces of sender data( address, phone, etc.)
29
- * @var type
30
- */
31
- protected $_senderData;
32
-
33
  /**
34
  * A std class, that holds various pieces of receiver data( address, phone, etc.)
35
  * @var type
@@ -155,6 +149,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
155
  */
156
  protected $_takingTime = null;
157
  protected $_deferredDays = null;
 
158
 
159
  public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) {
160
 
@@ -205,7 +200,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
205
  */
206
  protected function createOrderRequest(array $bolIDS) {
207
  $paramOrder = new ParamOrder();
208
- $paramOrder->setBillOfLadingsList($bolIDS);
209
  $paramOrder->setBillOfLadingsToIncludeType(ParamOrder::ORDER_BOL_INCLUDE_TYPE_EXPLICIT);
210
 
211
  $phonenumber = Mage::getStoreConfig('carriers/speedyshippingmodule/contact_telephone');
@@ -629,7 +624,6 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
629
  */
630
  public function createLabelAction() {
631
 
632
-
633
  $orderId = $this->getRequest()->getParam('order_id');
634
  $shipmentId = $this->getRequest()->getParam('shipment_id');
635
  //$forceBolCreation = $this->getRequest()->getParam('forceBolCreation', false);
@@ -675,7 +669,6 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
675
  $time = time();
676
  }
677
 
678
-
679
  $takingTime = null;
680
 
681
  $takingTime = $this->_speedyEPS->getAllowedDaysForTaking($serviceId, $senderSiteId, $senderOfficeId, $time);
@@ -736,15 +729,6 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
736
  $receiverName = $this->_shippingAddress->getFirstname() . ' ' . $this->_shippingAddress->getLastname();
737
  $receiverPhone = $this->_shippingAddress->getTelephone();
738
 
739
- /**
740
- * Setup sender data
741
- */
742
- $sender = Mage::getModel('speedyshippingmodule/carrier_senderdata_senderdata');
743
-
744
- $sender->setSenderData($this->_senderData);
745
-
746
- $this->_senderData = $sender->getSenderData();
747
-
748
  /**
749
  * Setup receiver data
750
  */
@@ -756,6 +740,8 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
756
 
757
  $this->_deferredDays = (int) $this->getRequest()->getParam('deferred_days');
758
 
 
 
759
  /**
760
  * Setup picking data
761
  */
@@ -809,6 +795,8 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
809
 
810
  $this->_speedyData->setDeferredDeliveryWorkdays($this->_deferredDays);
811
 
 
 
812
 
813
 
814
 
@@ -911,7 +899,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
911
 
912
  //If customer has configured that she has a printer, print a label
913
  if ($this->_hasPrinter) {
914
- $pickingParcels = $this->_speedyEPS->getPickingParcels($speedyData->getBolId());
915
 
916
  $ids = array();
917
 
@@ -923,7 +911,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
923
  }
924
  //Otherwise print a regular bill of lading
925
  else {
926
- $paramPDF->setIds($speedyData->getBolId());
927
  $paramPDF->setType(ParamPDF::PARAM_PDF_TYPE_BOL);
928
  }
929
  $paramPDF->setIncludeAutoPrintJS(TRUE);
@@ -998,7 +986,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
998
  $speedyData->setBolDatetime(null);
999
  $speedyData->save();
1000
 
1001
- $this->_speedyEPS->invalidatePicking($bolID);
1002
 
1003
  $isBolCanceled = TRUE;
1004
 
@@ -1099,7 +1087,12 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1099
  }
1100
 
1101
  $receiverAddress = new ParamAddress();
1102
- $receiverAddress->setSiteId($this->_receiverData->address->siteID);
 
 
 
 
 
1103
 
1104
  if ($this->_receiverData->address->quarterName) {
1105
  $receiverAddress->setQuarterName($this->_receiverData->address->quarterName);
@@ -1138,7 +1131,18 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1138
  if ($this->_receiverData->address->speedyAddressNote) {
1139
  $receiverAddress->setAddressNote($this->_receiverData->address->speedyAddressNote);
1140
  }
1141
-
 
 
 
 
 
 
 
 
 
 
 
1142
  $receiver = new ParamClientData();
1143
 
1144
  $receiver->setPartnerName($this->_receiverData->partnerName);
@@ -1153,7 +1157,7 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1153
  $picking = new ParamPicking();
1154
 
1155
  //DO NOT CHANGE THIS LINE
1156
- $picking->setClientSystemId(1307306134);
1157
  $picking->setRef1($this->_orderID);
1158
 
1159
  $size = $this->getParcelSizes();
@@ -1240,33 +1244,75 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1240
 
1241
  $picking->setDeferredDeliveryWorkDays($this->_deferredDays);
1242
 
 
 
1243
  if ($this->_orderData->getIsCod()) {
 
 
 
 
 
 
1244
  $isFixed = Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable');
1245
  if ($isFixed == 2) {
1246
 
1247
  $fixedPrice = Mage::getStoreConfig('carriers/speedyshippingmodule/fixedPrice');
1248
  if ($this->_isFreeShipping) {
1249
- $picking->setAmountCodBase($this->_codAmount);
1250
  } else {
1251
  $taxCalculator = Mage::helper('tax');
1252
- $picking->setAmountCodBase($this->_codAmount + $this->_shippingAmount);
1253
  }
1254
  } else if ($isFixed == 3) {
1255
  if ($this->_isFreeShipping) {
1256
- $picking->setAmountCodBase($this->_codAmount);
1257
  } else {
1258
  $taxCalculator = Mage::helper('tax');
1259
  $chargeAmount = Mage::getStoreConfig('carriers/speedyshippingmodule/handlingCharge');
1260
  $chargeWithTaxApplied = $taxCalculator->getShippingPrice($chargeAmount, true);
1261
- $picking->setAmountCodBase($this->_codAmount + $chargeWithTaxApplied);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1262
  }
1263
  } else {
1264
- $picking->setAmountCodBase($this->_codAmount);
1265
  }
1266
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
  $picking->setAmountCodBase(0);
1268
  }
1269
 
 
 
 
 
 
1270
  $resultBOL = null;
1271
  try {
1272
  $resultBOL = $this->_speedyEPS->createBillOfLading($picking);
@@ -1340,6 +1386,41 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1340
  $orderData->setSpeedyAddressNote($this->_shippingAddress->getSpeedyAddressNote());
1341
  }
1342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1343
  if ($speedyData->getFixedTime()) {
1344
  $orderData->setFixedTime($speedyData->getFixedTime());
1345
  }
@@ -1362,13 +1443,30 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1362
  if ($speedyData->getIsCod()) {
1363
  $orderData->setIsCod(1);
1364
  }
1365
-
1366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1367
 
1368
  //Is fixed prices enabled
1369
  $isFixed = Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable');
1370
 
1371
- if ($isFixed == 2) {
1372
 
1373
  $orderData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER);
1374
  } else if ($speedyData->getPayerType() == 0) {
@@ -1379,9 +1477,18 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1379
  $orderData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER);
1380
  }
1381
 
 
 
 
 
1382
 
1383
-
1384
-
 
 
 
 
 
1385
 
1386
  $this->_orderData = $orderData;
1387
  }
@@ -1410,13 +1517,10 @@ class Speedy_Speedyshipping_Adminhtml_PrintController extends Mage_Adminhtml_Con
1410
  }
1411
 
1412
  try {
1413
-
1414
  $this->_speedyEPSInterfaceImplementaion = new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
1415
 
1416
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
1417
- $this->_speedySessionId = $this->_speedyEPS->login();
1418
-
1419
- $this->_senderData = $this->_speedyEPS->getClientById($this->_speedyEPS->getResultLogin()->getClientId());
1420
  } catch (Exception $e) {
1421
  Mage::log($e->getMessage(), null, 'speedyLog.log');
1422
  exit();
24
  */
25
  protected $_city_id;
26
 
 
 
 
 
 
 
27
  /**
28
  * A std class, that holds various pieces of receiver data( address, phone, etc.)
29
  * @var type
149
  */
150
  protected $_takingTime = null;
151
  protected $_deferredDays = null;
152
+ protected $_optionsBeforePayment = null;
153
 
154
  public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) {
155
 
200
  */
201
  protected function createOrderRequest(array $bolIDS) {
202
  $paramOrder = new ParamOrder();
203
+ $paramOrder->setBillOfLadingsList(array_map('floatval', $bolIDS));
204
  $paramOrder->setBillOfLadingsToIncludeType(ParamOrder::ORDER_BOL_INCLUDE_TYPE_EXPLICIT);
205
 
206
  $phonenumber = Mage::getStoreConfig('carriers/speedyshippingmodule/contact_telephone');
624
  */
625
  public function createLabelAction() {
626
 
 
627
  $orderId = $this->getRequest()->getParam('order_id');
628
  $shipmentId = $this->getRequest()->getParam('shipment_id');
629
  //$forceBolCreation = $this->getRequest()->getParam('forceBolCreation', false);
669
  $time = time();
670
  }
671
 
 
672
  $takingTime = null;
673
 
674
  $takingTime = $this->_speedyEPS->getAllowedDaysForTaking($serviceId, $senderSiteId, $senderOfficeId, $time);
729
  $receiverName = $this->_shippingAddress->getFirstname() . ' ' . $this->_shippingAddress->getLastname();
730
  $receiverPhone = $this->_shippingAddress->getTelephone();
731
 
 
 
 
 
 
 
 
 
 
732
  /**
733
  * Setup receiver data
734
  */
740
 
741
  $this->_deferredDays = (int) $this->getRequest()->getParam('deferred_days');
742
 
743
+ $this->_optionsBeforePayment = $this->getRequest()->getParam('options_before_payment');
744
+
745
  /**
746
  * Setup picking data
747
  */
795
 
796
  $this->_speedyData->setDeferredDeliveryWorkdays($this->_deferredDays);
797
 
798
+ $this->_speedyData->setOptionsBeforePayment($this->_optionsBeforePayment);
799
+
800
 
801
 
802
 
899
 
900
  //If customer has configured that she has a printer, print a label
901
  if ($this->_hasPrinter) {
902
+ $pickingParcels = $this->_speedyEPS->getPickingParcels((float)$speedyData->getBolId());
903
 
904
  $ids = array();
905
 
911
  }
912
  //Otherwise print a regular bill of lading
913
  else {
914
+ $paramPDF->setIds((float)$speedyData->getBolId());
915
  $paramPDF->setType(ParamPDF::PARAM_PDF_TYPE_BOL);
916
  }
917
  $paramPDF->setIncludeAutoPrintJS(TRUE);
986
  $speedyData->setBolDatetime(null);
987
  $speedyData->save();
988
 
989
+ $this->_speedyEPS->invalidatePicking((float)$bolID);
990
 
991
  $isBolCanceled = TRUE;
992
 
1087
  }
1088
 
1089
  $receiverAddress = new ParamAddress();
1090
+
1091
+ if (!empty($this->_receiverData->address->siteID)) {
1092
+ $receiverAddress->setSiteId($this->_receiverData->address->siteID);
1093
+ } else {
1094
+ $receiverAddress->setSiteName($this->_receiverData->address->city);
1095
+ }
1096
 
1097
  if ($this->_receiverData->address->quarterName) {
1098
  $receiverAddress->setQuarterName($this->_receiverData->address->quarterName);
1131
  if ($this->_receiverData->address->speedyAddressNote) {
1132
  $receiverAddress->setAddressNote($this->_receiverData->address->speedyAddressNote);
1133
  }
1134
+
1135
+ if ($this->_receiverData->address->speedyStateId) {
1136
+ $receiverAddress->setStateId($this->_receiverData->address->speedyStateId);
1137
+ }
1138
+
1139
+ if (!empty($this->_receiverData->address->speedyCountryId)) {
1140
+ $receiverAddress->setPostCode($this->_receiverData->address->postcode);
1141
+ $receiverAddress->setFrnAddressLine1($this->_receiverData->address->street1);
1142
+ $receiverAddress->setFrnAddressLine2($this->_receiverData->address->street2);
1143
+ $receiverAddress->setCountryId($this->_receiverData->address->speedyCountryId);
1144
+ }
1145
+
1146
  $receiver = new ParamClientData();
1147
 
1148
  $receiver->setPartnerName($this->_receiverData->partnerName);
1157
  $picking = new ParamPicking();
1158
 
1159
  //DO NOT CHANGE THIS LINE
1160
+ $picking->setClientSystemId(1307306200);
1161
  $picking->setRef1($this->_orderID);
1162
 
1163
  $size = $this->getParcelSizes();
1244
 
1245
  $picking->setDeferredDeliveryWorkDays($this->_deferredDays);
1246
 
1247
+ $optionBeforePayment = new ParamOptionsBeforePayment();
1248
+
1249
  if ($this->_orderData->getIsCod()) {
1250
+ if ($this->_optionsBeforePayment == 'open') {
1251
+ $optionBeforePayment->setOpen(true);
1252
+ } elseif ($this->_optionsBeforePayment == 'test') {
1253
+ $optionBeforePayment->setTest(true);
1254
+ }
1255
+
1256
  $isFixed = Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable');
1257
  if ($isFixed == 2) {
1258
 
1259
  $fixedPrice = Mage::getStoreConfig('carriers/speedyshippingmodule/fixedPrice');
1260
  if ($this->_isFreeShipping) {
1261
+ $totalAmount = $this->_codAmount;
1262
  } else {
1263
  $taxCalculator = Mage::helper('tax');
1264
+ $totalAmount = $this->_codAmount + $this->_shippingAmount;
1265
  }
1266
  } else if ($isFixed == 3) {
1267
  if ($this->_isFreeShipping) {
1268
+ $totalAmount = $this->_codAmount;
1269
  } else {
1270
  $taxCalculator = Mage::helper('tax');
1271
  $chargeAmount = Mage::getStoreConfig('carriers/speedyshippingmodule/handlingCharge');
1272
  $chargeWithTaxApplied = $taxCalculator->getShippingPrice($chargeAmount, true);
1273
+ $totalAmount = $this->_codAmount + $chargeWithTaxApplied;
1274
+ }
1275
+ } else if ($isFixed == 4) {
1276
+ if ($this->_isFreeShipping) {
1277
+ $totalAmount = $this->_codAmount;
1278
+ } else {
1279
+ $tablerates = Mage::getModel('speedyshippingmodule/carrier_tablerate')->getCollection()->setServiceIdFilter($this->_orderData->getServiceTypeId())->setTakeFromOfficeFilter($this->_orderData->getPickFromOffice())->setWeightFilter($totalWeight)->setTotalFilter($this->_codAmount)->setOrderField('weight')->setOrderField('order_total')->getData();
1280
+ if ($tablerates && isset($tablerates[0])) {
1281
+ $taxCalculator = Mage::helper('tax');
1282
+ $shippingPrice = $taxCalculator->getShippingPrice((float)$tablerates[0]['price_without_vat'], true);
1283
+ } else {
1284
+ $shippingPrice = $this->_shippingAmount;
1285
+ }
1286
+
1287
+ $totalAmount = $this->_codAmount + $shippingPrice;
1288
  }
1289
  } else {
1290
+ $totalAmount = $this->_codAmount;
1291
  }
1292
  } else {
1293
+ $totalAmount = 0;
1294
+ }
1295
+
1296
+ $picking->setOptionsBeforePayment($optionBeforePayment);
1297
+
1298
+ if ($this->_orderData->getSpeedyActiveCurrencyCode()) {
1299
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
1300
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), array_values($allowedCurrencies));
1301
+ if (isset($rates[$this->_orderData->getSpeedyActiveCurrencyCode()])) {
1302
+ $picking->setAmountCodBase(Mage::helper('directory')->currencyConvert($totalAmount, Mage::app()->getStore()->getBaseCurrencyCode(), $this->_orderData->getSpeedyActiveCurrencyCode()));
1303
+ }
1304
+ }
1305
+
1306
+ if ($this->_orderData->getIsCod() && (Mage::getStoreConfigFlag('carriers/speedyshippingmodule/money_transfer') && $this->_orderData->getCountryId() == 'BG')) {
1307
+ $picking->setRetMoneyTransferReqAmount($totalAmount);
1308
  $picking->setAmountCodBase(0);
1309
  }
1310
 
1311
+ // if abroad a fixed_pricing_enable == calculator || calculator_fixed
1312
+ if ($this->_orderData->getCountryId() && $this->_orderData->getCountryId() != 'BG' && $this->_orderData->getIsCod() && (Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable') == 1 || $this->config->get('speedy_pricing') == 3)) {
1313
+ $picking->setIncludeShippingPriceInCod(true);
1314
+ }
1315
+
1316
  $resultBOL = null;
1317
  try {
1318
  $resultBOL = $this->_speedyEPS->createBillOfLading($picking);
1386
  $orderData->setSpeedyAddressNote($this->_shippingAddress->getSpeedyAddressNote());
1387
  }
1388
 
1389
+ if ($this->_shippingAddress->getSpeedyCountryId()) {
1390
+ $orderData->setSpeedyCountryId($this->_shippingAddress->getSpeedyCountryId());
1391
+ }
1392
+
1393
+ if ($this->_shippingAddress->getSpeedyStateId()) {
1394
+ $orderData->setSpeedyStateId($this->_shippingAddress->getSpeedyStateId());
1395
+ }
1396
+
1397
+ if ($this->_shippingAddress->getCountryId()) {
1398
+ $orderData->setCountryId($this->_shippingAddress->getCountryId());
1399
+ }
1400
+
1401
+ if ($this->_shippingAddress->getCity()) {
1402
+ $orderData->setCity($this->_shippingAddress->getCity());
1403
+ }
1404
+
1405
+ if ($this->_shippingAddress->getPostcode()) {
1406
+ $orderData->setPostcode($this->_shippingAddress->getPostcode());
1407
+ }
1408
+
1409
+ if ($this->_shippingAddress->getStreet()) {
1410
+ $streets = $this->_shippingAddress->getStreet();
1411
+ if ($streets && isset($streets[0])) {
1412
+ $orderData->setStreet1($streets[0]);
1413
+ } else {
1414
+ $orderData->setStreet1('');
1415
+ }
1416
+
1417
+ if ($streets && isset($streets[1])) {
1418
+ $orderData->setStreet2($streets[1]);
1419
+ } else {
1420
+ $orderData->setStreet2('');
1421
+ }
1422
+ }
1423
+
1424
  if ($speedyData->getFixedTime()) {
1425
  $orderData->setFixedTime($speedyData->getFixedTime());
1426
  }
1443
  if ($speedyData->getIsCod()) {
1444
  $orderData->setIsCod(1);
1445
  }
 
1446
 
1447
+ if ($this->_shippingAddress->getSpeedyCountryId() || $this->_shippingAddress->getCountryId()) {
1448
+ try {
1449
+ require_once Mage::getBaseDir('lib') . DS . 'SpeedyEPS' . DS . 'ver01' . DS . 'ParamFilterCountry.class.php';
1450
+ $ParamFilterCountry = new ParamFilterCountry();
1451
+ if ($this->_shippingAddress->getSpeedyCountryId()) {
1452
+ $ParamFilterCountry->setCountryId($this->_shippingAddress->getSpeedyCountryId());
1453
+ } else {
1454
+ $ParamFilterCountry->setIsoAlpha2($this->_shippingAddress->getCountryId());
1455
+ }
1456
+ $countries = $this->_speedyEPS->listCountriesEx($ParamFilterCountry);
1457
+ } catch (ServerException $se) {
1458
+ Mage::log($se->getMessage(),null,'speedyLog.log');
1459
+ }
1460
+
1461
+ if (isset($countries) && count($countries) == 1) {
1462
+ $orderData->setSpeedyActiveCurrencyCode($countries[0]->getActiveCurrencyCode());
1463
+ }
1464
+ }
1465
 
1466
  //Is fixed prices enabled
1467
  $isFixed = Mage::getStoreConfig('carriers/speedyshippingmodule/fixed_pricing_enable');
1468
 
1469
+ if ($isFixed == 2 || $isFixed == 4 || !$orderData->getSpeedyActiveCurrencyCode()) {
1470
 
1471
  $orderData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER);
1472
  } else if ($speedyData->getPayerType() == 0) {
1477
  $orderData->setPayerType(ParamCalculation::PAYER_TYPE_RECEIVER);
1478
  }
1479
 
1480
+ $allowed_pricings = array(
1481
+ 1 => 'calculator',
1482
+ 3 => 'calculator_fixed'
1483
+ );
1484
 
1485
+ if ($this->_shippingAddress->getCountryId() != 'BG' ||
1486
+ (Mage::getStoreConfigFlag('carriers/speedyshippingmodule/invoice_courier_sevice_as_text') &&
1487
+ isset($allowed_pricings[$isFixed]) &&
1488
+ !$orderData->getIsCod())
1489
+ ) {
1490
+ $orderData->setPayerType(ParamCalculation::PAYER_TYPE_SENDER);
1491
+ }
1492
 
1493
  $this->_orderData = $orderData;
1494
  }
1517
  }
1518
 
1519
  try {
 
1520
  $this->_speedyEPSInterfaceImplementaion = new EPSSOAPInterfaceImpl(Mage::getStoreConfig('carriers/speedyshippingmodule/server'));
1521
 
1522
  $this->_speedyEPS = new EPSFacade($this->_speedyEPSInterfaceImplementaion, $user, $pass);
1523
+ $this->_speedySessionId = $this->_speedyEPS->getResultLogin();
 
 
1524
  } catch (Exception $e) {
1525
  Mage::log($e->getMessage(), null, 'speedyLog.log');
1526
  exit();
app/code/community/Speedy/Speedyshipping/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Speedy_Speedyshipping>
5
- <version>1.3.4</version>
6
  <depends>
7
  <Mage_Payment />
8
  <Mage_Shipping />
@@ -16,6 +16,11 @@
16
  <speedyshippingmodule>
17
  <class>Speedy_Speedyshipping_Helper</class>
18
  </speedyshippingmodule>
 
 
 
 
 
19
  </helpers>
20
  <models>
21
  <speedyshippingmodule>
@@ -28,6 +33,9 @@
28
  <saveorder>
29
  <table>speedy_order_shipping</table>
30
  </saveorder>
 
 
 
31
  </entities>
32
  </speedyshippingmodule_resource>
33
  <sales>
@@ -217,6 +225,22 @@
217
  </speedyshippingmodule>
218
  </observers>
219
  </checkout_submit_all_after>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  </events>
221
  <!--<routers>
222
  <adminhtml>
@@ -251,6 +275,14 @@
251
  <to_order_address>*</to_order_address>
252
  <to_customer_address>*</to_customer_address>
253
  </speedy_street_id>
 
 
 
 
 
 
 
 
254
  <speedy_block_number>
255
  <to_order_address>*</to_order_address>
256
  <to_customer_address>*</to_customer_address>
@@ -283,7 +315,7 @@
283
  <to_order_address>*</to_order_address>
284
  <to_customer_address>*</to_customer_address>
285
  </speedy_address_note>
286
- </sales_convert_quote_address> speedy_address_note
287
  <customer_address>
288
  <speedy_site_id>
289
  <to_quote_address>*</to_quote_address>
@@ -300,6 +332,12 @@
300
  <speedy_street_id>
301
  <to_quote_address>*</to_quote_address>
302
  </speedy_street_id>
 
 
 
 
 
 
303
  <speedy_block_number>
304
  <to_quote_address>*</to_quote_address>
305
  </speedy_block_number>
@@ -341,6 +379,12 @@
341
  <speedy_street_id>
342
  <to_order>*</to_order>
343
  </speedy_street_id>
 
 
 
 
 
 
344
  <speedy_block_number>
345
  <to_order>*</to_order>
346
  </speedy_block_number>
@@ -382,6 +426,12 @@
382
  <speedy_street_id>
383
  <to_order>*</to_order>
384
  </speedy_street_id>
 
 
 
 
 
 
385
  <speedy_block_number>
386
  <to_order>*</to_order>
387
  </speedy_block_number>
2
  <config>
3
  <modules>
4
  <Speedy_Speedyshipping>
5
+ <version>2.0.0</version>
6
  <depends>
7
  <Mage_Payment />
8
  <Mage_Shipping />
16
  <speedyshippingmodule>
17
  <class>Speedy_Speedyshipping_Helper</class>
18
  </speedyshippingmodule>
19
+ <directory>
20
+ <rewrite>
21
+ <data>Speedy_Speedyshipping_Helper_Validate_Validate</data>
22
+ </rewrite>
23
+ </directory>
24
  </helpers>
25
  <models>
26
  <speedyshippingmodule>
33
  <saveorder>
34
  <table>speedy_order_shipping</table>
35
  </saveorder>
36
+ <tablerate>
37
+ <table>speedy_tablerate</table>
38
+ </tablerate>
39
  </entities>
40
  </speedyshippingmodule_resource>
41
  <sales>
225
  </speedyshippingmodule>
226
  </observers>
227
  </checkout_submit_all_after>
228
+ <payment_method_is_active>
229
+ <observers>
230
+ <speedyshippingmodule>
231
+ <class>speedyshippingmodule/observer</class>
232
+ <method>restrictPaymentsCd</method>
233
+ </speedyshippingmodule>
234
+ </observers>
235
+ </payment_method_is_active>
236
+ <sales_quote_collect_totals_after>
237
+ <observers>
238
+ <speedyshippingmodule>
239
+ <class>speedyshippingmodule/observer</class>
240
+ <method>collectTotals</method>
241
+ </speedyshippingmodule>
242
+ </observers>
243
+ </sales_quote_collect_totals_after>
244
  </events>
245
  <!--<routers>
246
  <adminhtml>
275
  <to_order_address>*</to_order_address>
276
  <to_customer_address>*</to_customer_address>
277
  </speedy_street_id>
278
+ <speedy_state_id>
279
+ <to_order_address>*</to_order_address>
280
+ <to_customer_address>*</to_customer_address>
281
+ </speedy_state_id>
282
+ <speedy_country_id>
283
+ <to_order_address>*</to_order_address>
284
+ <to_customer_address>*</to_customer_address>
285
+ </speedy_country_id>
286
  <speedy_block_number>
287
  <to_order_address>*</to_order_address>
288
  <to_customer_address>*</to_customer_address>
315
  <to_order_address>*</to_order_address>
316
  <to_customer_address>*</to_customer_address>
317
  </speedy_address_note>
318
+ </sales_convert_quote_address>
319
  <customer_address>
320
  <speedy_site_id>
321
  <to_quote_address>*</to_quote_address>
332
  <speedy_street_id>
333
  <to_quote_address>*</to_quote_address>
334
  </speedy_street_id>
335
+ <speedy_state_id>
336
+ <to_quote_address>*</to_quote_address>
337
+ </speedy_state_id>
338
+ <speedy_country_id>
339
+ <to_quote_address>*</to_quote_address>
340
+ </speedy_country_id>
341
  <speedy_block_number>
342
  <to_quote_address>*</to_quote_address>
343
  </speedy_block_number>
379
  <speedy_street_id>
380
  <to_order>*</to_order>
381
  </speedy_street_id>
382
+ <speedy_state_id>
383
+ <to_order>*</to_order>
384
+ </speedy_state_id>
385
+ <speedy_country_id>
386
+ <to_order>*</to_order>
387
+ </speedy_country_id>
388
  <speedy_block_number>
389
  <to_order>*</to_order>
390
  </speedy_block_number>
426
  <speedy_street_id>
427
  <to_order>*</to_order>
428
  </speedy_street_id>
429
+ <speedy_state_id>
430
+ <to_order>*</to_order>
431
+ </speedy_state_id>
432
+ <speedy_country_id>
433
+ <to_order>*</to_order>
434
+ </speedy_country_id>
435
  <speedy_block_number>
436
  <to_order>*</to_order>
437
  </speedy_block_number>
app/code/community/Speedy/Speedyshipping/etc/system.xml CHANGED
@@ -96,6 +96,16 @@
96
  <show_in_website>1</show_in_website>
97
  <show_in_store>0</show_in_store>
98
  <can_be_empty>1</can_be_empty>
 
 
 
 
 
 
 
 
 
 
99
  </allowed_methods>
100
 
101
  <fixed_pricing_enable translate="label">
@@ -110,7 +120,6 @@
110
  </fixed_pricing_enable>
111
  <fixedPrice translate="label">
112
  <label>fixed_price_for_shipping_exclvat</label>
113
- <sort_order></sort_order>
114
  <depends>
115
  <fixed_pricing_enable>2</fixed_pricing_enable>
116
  </depends>
@@ -122,7 +131,6 @@
122
  </fixedPrice>
123
  <handlingCharge translate="label">
124
  <label>handling_charge_value</label>
125
- <sort_order></sort_order>
126
  <depends>
127
  <fixed_pricing_enable>3</fixed_pricing_enable>
128
  </depends>
@@ -132,6 +140,19 @@
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>0</show_in_store>
134
  </handlingCharge>
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  <!---<deferredDays translate="label">
136
  <label>Брой дни за отместване на датата на доставка</label>
137
  <sort_order></sort_order>
@@ -154,6 +175,16 @@
154
  <show_in_website>1</show_in_website>
155
  <show_in_store>0</show_in_store>
156
  </speedyTakingtimeOffset>
 
 
 
 
 
 
 
 
 
 
157
  <!--<istest translate="label">
158
  <label>Sandbox</label>
159
  <frontend_type>select</frontend_type>
@@ -173,6 +204,27 @@
173
  <show_in_website>1</show_in_website>
174
  <show_in_store>0</show_in_store>
175
  </default_packing>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  <back_documents translate="label">
177
  <label>back_document_request</label>
178
  <frontend_type>select</frontend_type>
@@ -287,7 +339,7 @@
287
  <label>activate_free_shipping</label>
288
  <frontend_type>select</frontend_type>
289
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
290
- <sort_order>22</sort_order>
291
  <show_in_default>1</show_in_default>
292
  <show_in_website>1</show_in_website>
293
  <show_in_store>0</show_in_store>
@@ -299,7 +351,7 @@
299
  <free_shipping_enable>1</free_shipping_enable>
300
  </depends>
301
  <validate>validate-number validate-zero-or-greater</validate>
302
- <sort_order>23</sort_order>
303
  <show_in_default>1</show_in_default>
304
  <show_in_website>1</show_in_website>
305
  <show_in_store>0</show_in_store>
@@ -312,7 +364,7 @@
312
  <free_shipping_enable>1</free_shipping_enable>
313
  </depends>
314
  <source_model>speedyshippingmodule/carrier_source_method</source_model>
315
- <sort_order>24</sort_order>
316
  <show_in_default>1</show_in_default>
317
  <show_in_website>1</show_in_website>
318
  <show_in_store>0</show_in_store>
@@ -325,15 +377,28 @@
325
  <free_shipping_enable>1</free_shipping_enable>
326
  </depends>
327
  <source_model>speedyshippingmodule/carrier_source_method</source_model>
328
- <sort_order>24</sort_order>
329
  <show_in_default>1</show_in_default>
330
  <show_in_website>1</show_in_website>
331
  <show_in_store>0</show_in_store>
332
  </free_method_intercity>
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  <isDocuments translate="label">
334
  <label>does_contain_documents</label>
335
  <frontend_type>select</frontend_type>
336
- <sort_order>25</sort_order>
337
  <frontend_class>shipping-skip-hide</frontend_class>
338
  <source_model>adminhtml/system_config_source_yesno</source_model>
339
  <show_in_default>1</show_in_default>
@@ -343,7 +408,7 @@
343
  <add_jquery translate="label">
344
  <label>add_jquery</label>
345
  <frontend_type>select</frontend_type>
346
- <sort_order>26</sort_order>
347
  <frontend_class>shipping-skip-hide</frontend_class>
348
  <source_model>adminhtml/system_config_source_yesno</source_model>
349
  <show_in_default>1</show_in_default>
@@ -353,7 +418,7 @@
353
  <add_jquery_ui translate="label">
354
  <label>add_jquery_ui</label>
355
  <frontend_type>select</frontend_type>
356
- <sort_order>26</sort_order>
357
  <frontend_class>shipping-skip-hide</frontend_class>
358
  <source_model>adminhtml/system_config_source_yesno</source_model>
359
  <show_in_default>1</show_in_default>
@@ -363,7 +428,7 @@
363
  <sallowspecific translate="label">
364
  <label>Ship to applicable countries</label>
365
  <frontend_type>select</frontend_type>
366
- <sort_order>27</sort_order>
367
  <frontend_class>shipping-applicable-country</frontend_class>
368
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
369
  <show_in_default>1</show_in_default>
@@ -373,7 +438,7 @@
373
  <specificcountry translate="label">
374
  <label>Ship to Specific countries</label>
375
  <frontend_type>multiselect</frontend_type>
376
- <sort_order>28</sort_order>
377
  <source_model>adminhtml/system_config_source_country</source_model>
378
  <show_in_default>1</show_in_default>
379
  <show_in_website>1</show_in_website>
@@ -382,7 +447,7 @@
382
  <specificerrmsg translate="label">
383
  <label>Displayed Error Message</label>
384
  <frontend_type>textarea</frontend_type>
385
- <sort_order>29</sort_order>
386
  <show_in_default>1</show_in_default>
387
  <show_in_website>1</show_in_website>
388
  <show_in_store>1</show_in_store>
@@ -390,7 +455,7 @@
390
  <add_fixed_hour translate="label">
391
  <label>fixed_hour_delivery</label>
392
  <frontend_type>select</frontend_type>
393
- <sort_order>30</sort_order>
394
  <frontend_class>shipping-skip-hide</frontend_class>
395
  <source_model>adminhtml/system_config_source_yesno</source_model>
396
  <comment>fixed_hour_comment_label</comment>
@@ -401,7 +466,7 @@
401
  <sort_order translate="label">
402
  <label>Sort Order</label>
403
  <frontend_type>text</frontend_type>
404
- <sort_order>35</sort_order>
405
  <show_in_default>1</show_in_default>
406
  <show_in_website>1</show_in_website>
407
  <show_in_store>0</show_in_store>
96
  <show_in_website>1</show_in_website>
97
  <show_in_store>0</show_in_store>
98
  <can_be_empty>1</can_be_empty>
99
+ <comment>
100
+ <![CDATA[
101
+ <style>
102
+ #carriers_speedyshippingmodule_allowed_methods,
103
+ #carriers_speedyshippingmodule_free_method_intercity,
104
+ #carriers_speedyshippingmodule_free_method_city,
105
+ #carriers_speedyshippingmodule_free_method_international { width: 320px; }
106
+ </style>
107
+ ]]>
108
+ </comment>
109
  </allowed_methods>
110
 
111
  <fixed_pricing_enable translate="label">
120
  </fixed_pricing_enable>
121
  <fixedPrice translate="label">
122
  <label>fixed_price_for_shipping_exclvat</label>
 
123
  <depends>
124
  <fixed_pricing_enable>2</fixed_pricing_enable>
125
  </depends>
131
  </fixedPrice>
132
  <handlingCharge translate="label">
133
  <label>handling_charge_value</label>
 
134
  <depends>
135
  <fixed_pricing_enable>3</fixed_pricing_enable>
136
  </depends>
140
  <show_in_website>1</show_in_website>
141
  <show_in_store>0</show_in_store>
142
  </handlingCharge>
143
+ <tableRate translate="label">
144
+ <label>table_rate</label>
145
+ <comment>csv_format</comment>
146
+ <frontend_type>import</frontend_type>
147
+ <backend_model>speedyshippingmodule/carrier_source_tablerate</backend_model>
148
+ <depends>
149
+ <fixed_pricing_enable>4</fixed_pricing_enable>
150
+ </depends>
151
+ <sort_order>11</sort_order>
152
+ <show_in_default>1</show_in_default>
153
+ <show_in_website>1</show_in_website>
154
+ <show_in_store>0</show_in_store>
155
+ </tableRate>
156
  <!---<deferredDays translate="label">
157
  <label>Брой дни за отместване на датата на доставка</label>
158
  <sort_order></sort_order>
175
  <show_in_website>1</show_in_website>
176
  <show_in_store>0</show_in_store>
177
  </speedyTakingtimeOffset>
178
+ <invoice_courier_sevice_as_text translate="label">
179
+ <label>invoice_courier_sevice_as_text</label>
180
+ <frontend_type>select</frontend_type>
181
+ <sort_order>15</sort_order>
182
+ <source_model>adminhtml/system_config_source_yesno</source_model>
183
+ <comment>invoice_courier_sevice_as_text_description</comment>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>0</show_in_store>
187
+ </invoice_courier_sevice_as_text>
188
  <!--<istest translate="label">
189
  <label>Sandbox</label>
190
  <frontend_type>select</frontend_type>
204
  <show_in_website>1</show_in_website>
205
  <show_in_store>0</show_in_store>
206
  </default_packing>
207
+ <money_transfer translate="label">
208
+ <label>money_transfer</label>
209
+ <comment>money_transfer_description</comment>
210
+ <frontend_type>select</frontend_type>
211
+ <frontend_model>speedyshippingmodule/adminhtml_system_config_form_moneytransfer</frontend_model>
212
+ <sort_order>16</sort_order>
213
+ <source_model>adminhtml/system_config_source_yesno</source_model>
214
+ <backend_model>speedyshippingmodule/carrier_source_moneytransfer</backend_model>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>1</show_in_website>
217
+ <show_in_store>0</show_in_store>
218
+ </money_transfer>
219
+ <options_before_payment translate="label">
220
+ <label>options_before_payment</label>
221
+ <frontend_type>select</frontend_type>
222
+ <source_model>speedyshippingmodule/carrier_source_beforepayment</source_model>
223
+ <sort_order>16</sort_order>
224
+ <show_in_default>1</show_in_default>
225
+ <show_in_website>1</show_in_website>
226
+ <show_in_store>0</show_in_store>
227
+ </options_before_payment>
228
  <back_documents translate="label">
229
  <label>back_document_request</label>
230
  <frontend_type>select</frontend_type>
339
  <label>activate_free_shipping</label>
340
  <frontend_type>select</frontend_type>
341
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
342
+ <sort_order>30</sort_order>
343
  <show_in_default>1</show_in_default>
344
  <show_in_website>1</show_in_website>
345
  <show_in_store>0</show_in_store>
351
  <free_shipping_enable>1</free_shipping_enable>
352
  </depends>
353
  <validate>validate-number validate-zero-or-greater</validate>
354
+ <sort_order>31</sort_order>
355
  <show_in_default>1</show_in_default>
356
  <show_in_website>1</show_in_website>
357
  <show_in_store>0</show_in_store>
364
  <free_shipping_enable>1</free_shipping_enable>
365
  </depends>
366
  <source_model>speedyshippingmodule/carrier_source_method</source_model>
367
+ <sort_order>32</sort_order>
368
  <show_in_default>1</show_in_default>
369
  <show_in_website>1</show_in_website>
370
  <show_in_store>0</show_in_store>
377
  <free_shipping_enable>1</free_shipping_enable>
378
  </depends>
379
  <source_model>speedyshippingmodule/carrier_source_method</source_model>
380
+ <sort_order>33</sort_order>
381
  <show_in_default>1</show_in_default>
382
  <show_in_website>1</show_in_website>
383
  <show_in_store>0</show_in_store>
384
  </free_method_intercity>
385
+ <free_method_international translate="label">
386
+ <label>free_international_service</label>
387
+ <frontend_type>multiselect</frontend_type>
388
+ <frontend_class>free-method</frontend_class>
389
+ <depends>
390
+ <free_shipping_enable>1</free_shipping_enable>
391
+ </depends>
392
+ <source_model>speedyshippingmodule/carrier_source_method</source_model>
393
+ <sort_order>34</sort_order>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>1</show_in_website>
396
+ <show_in_store>0</show_in_store>
397
+ </free_method_international>
398
  <isDocuments translate="label">
399
  <label>does_contain_documents</label>
400
  <frontend_type>select</frontend_type>
401
+ <sort_order>40</sort_order>
402
  <frontend_class>shipping-skip-hide</frontend_class>
403
  <source_model>adminhtml/system_config_source_yesno</source_model>
404
  <show_in_default>1</show_in_default>
408
  <add_jquery translate="label">
409
  <label>add_jquery</label>
410
  <frontend_type>select</frontend_type>
411
+ <sort_order>50</sort_order>
412
  <frontend_class>shipping-skip-hide</frontend_class>
413
  <source_model>adminhtml/system_config_source_yesno</source_model>
414
  <show_in_default>1</show_in_default>
418
  <add_jquery_ui translate="label">
419
  <label>add_jquery_ui</label>
420
  <frontend_type>select</frontend_type>
421
+ <sort_order>51</sort_order>
422
  <frontend_class>shipping-skip-hide</frontend_class>
423
  <source_model>adminhtml/system_config_source_yesno</source_model>
424
  <show_in_default>1</show_in_default>
428
  <sallowspecific translate="label">
429
  <label>Ship to applicable countries</label>
430
  <frontend_type>select</frontend_type>
431
+ <sort_order>60</sort_order>
432
  <frontend_class>shipping-applicable-country</frontend_class>
433
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
434
  <show_in_default>1</show_in_default>
438
  <specificcountry translate="label">
439
  <label>Ship to Specific countries</label>
440
  <frontend_type>multiselect</frontend_type>
441
+ <sort_order>61</sort_order>
442
  <source_model>adminhtml/system_config_source_country</source_model>
443
  <show_in_default>1</show_in_default>
444
  <show_in_website>1</show_in_website>
447
  <specificerrmsg translate="label">
448
  <label>Displayed Error Message</label>
449
  <frontend_type>textarea</frontend_type>
450
+ <sort_order>62</sort_order>
451
  <show_in_default>1</show_in_default>
452
  <show_in_website>1</show_in_website>
453
  <show_in_store>1</show_in_store>
455
  <add_fixed_hour translate="label">
456
  <label>fixed_hour_delivery</label>
457
  <frontend_type>select</frontend_type>
458
+ <sort_order>70</sort_order>
459
  <frontend_class>shipping-skip-hide</frontend_class>
460
  <source_model>adminhtml/system_config_source_yesno</source_model>
461
  <comment>fixed_hour_comment_label</comment>
466
  <sort_order translate="label">
467
  <label>Sort Order</label>
468
  <frontend_type>text</frontend_type>
469
+ <sort_order>80</sort_order>
470
  <show_in_default>1</show_in_default>
471
  <show_in_website>1</show_in_website>
472
  <show_in_store>0</show_in_store>
app/code/community/Speedy/Speedyshipping/sql/speedyshippingmodule_setup/mysql4-upgrade-1.2.0-1.2.1.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $this->getConnection()->disallowDdlCache();
5
+ $this->getConnection()->resetDdlCache();
6
+ $installer->startSetup();
7
+
8
+ $installer->run("CREATE TABLE IF NOT EXISTS `{$installer->getTable('speedyshippingmodule/tablerate')}` (
9
+ `pk` INT(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
10
+ `service_id` INT(11) NOT NULL,
11
+ `take_from_office` TINYINT(1) NOT NULL,
12
+ `weight` DECIMAL(15,4) NOT NULL,
13
+ `order_total` DECIMAL(15,4) NOT NULL,
14
+ `price_without_vat` DECIMAL(15,4) NOT NULL,
15
+ `website_id` INT(11) NOT NULL COMMENT 'Website Id',
16
+ PRIMARY KEY (`pk`)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
18
+
19
+ $order_address_table = $installer->getTable('sales/order_address');
20
+ $quote_address_table = $installer->getTable('sales/quote_address');
21
+
22
+ $installer->run("
23
+ ALTER TABLE `{$installer->getTable('sales/order_address')}` ADD `speedy_country_id` int(10)
24
+ ");
25
+
26
+ $installer->run("
27
+ ALTER TABLE `{$installer->getTable('sales/quote_address')}` ADD `speedy_country_id` int(10)
28
+ ");
29
+
30
+ $installer->run("
31
+ ALTER TABLE `{$installer->getTable('sales/order_address')}` ADD `speedy_state_id` varchar(50)
32
+ ");
33
+
34
+ $installer->run("
35
+ ALTER TABLE `{$installer->getTable('sales/quote_address')}` ADD `speedy_state_id` varchar(50)
36
+ ");
37
+
38
+ $this->addAttribute('customer_address', 'speedy_country_id', array(
39
+ 'type' => 'varchar',
40
+ 'input' => 'hidden',
41
+ 'label' => 'speedy country id',
42
+ 'global' => 1,
43
+ 'visible' => 1,
44
+ 'required' => 0,
45
+ 'user_defined' => 1,
46
+ 'visible_on_front' => 1
47
+ ));
48
+
49
+ $this->addAttribute('customer_address', 'speedy_state_id', array(
50
+ 'type' => 'varchar',
51
+ 'input' => 'hidden',
52
+ 'label' => 'speedy state id',
53
+ 'global' => 1,
54
+ 'visible' => 1,
55
+ 'required' => 0,
56
+ 'user_defined' => 1,
57
+ 'visible_on_front' => 1
58
+ ));
59
+
60
+ Mage::getSingleton('eav/config')
61
+ ->getAttribute('customer_address', 'speedy_country_id')
62
+ ->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
63
+ ->save();
64
+
65
+ Mage::getSingleton('eav/config')
66
+ ->getAttribute('customer_address', 'speedy_state_id')
67
+ ->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
68
+ ->save();
69
+
70
+ $installer->endSetup();
app/design/adminhtml/default/default/template/speedy_speedyshipping/billoflading.phtml CHANGED
@@ -5,7 +5,13 @@
5
  var deferredDays = "";
6
  <?php endif; ?>
7
 
8
-
 
 
 
 
 
 
9
 
10
  function getAllElementsWithAttributeValue(attribute, value)
11
  {
@@ -98,9 +104,30 @@ document.getElementById('shipment_tracking_info').style.display = 'none';
98
 
99
  </select>
100
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <script>
102
  var baseRef = document.getElementById('packaging_window').getElementsByClassName('entry-edit')[0];
103
  var packButtons = baseRef.getElementsByClassName('a-right')[0];
 
 
 
104
  baseRef.insertBefore(document.getElementById('speedyDeferredDays'), packButtons);
105
  </script>
106
  <script>
@@ -134,11 +161,17 @@ document.getElementById('shipment_tracking_info').style.display = 'none';
134
  var confirmBox = confirm(response.message);
135
  if (confirmBox == true) {
136
  packaging.paramsCreateLabelRequest['deferred_days'] = deferredDays;
 
 
 
137
  magentoCallback();
138
  }
139
  } else if (response.ok) {
140
  //this.labelCreatedCallback(response);
141
  packaging.paramsCreateLabelRequest['deferred_days'] = deferredDays;
 
 
 
142
  magentoCallback();
143
  }
144
  }
5
  var deferredDays = "";
6
  <?php endif; ?>
7
 
8
+ <?php if (!$this->_isAbroad): ?>
9
+ <?php if ($this->_optionsBeforePayment): ?>
10
+ var optionsBeforePayment = "<?php echo $this->_optionsBeforePayment; ?>";
11
+ <?php else: ?>
12
+ var optionsBeforePayment = "";
13
+ <?php endif; ?>
14
+ <?php endif; ?>
15
 
16
  function getAllElementsWithAttributeValue(attribute, value)
17
  {
104
 
105
  </select>
106
  </div>
107
+
108
+ <?php if (!$this->_isAbroad): ?>
109
+ <div id="speedyOptionsBeforePayment" style="margin: 5px 15px; ">
110
+ <span><?php echo $this->__('options_before_payment') ?></span>
111
+ <select onchange="optionsBeforePayment = this.value;" name="speedy_options_before_payment" id="speedy_options_before_payment">
112
+ <?php foreach (Mage::getModel('speedyshippingmodule/carrier_source_beforepayment')->toOptionArray() as $option): ?>
113
+
114
+ <?php if ($option['value'] == $this->_optionsBeforePayment): ?>
115
+ <?php echo '<option value ="' . $option['value'] . '" selected="selected">' . $option['label'] . '</option>'; ?>
116
+ <?php else: ?>
117
+ <?php echo '<option value ="' . $option['value']. '">' . $option['label'] . '</option>'; ?>
118
+ <?php endif; ?>
119
+
120
+ <?php endforeach; ?>
121
+ </select>
122
+ </div>
123
+ <?php endif; ?>
124
+
125
  <script>
126
  var baseRef = document.getElementById('packaging_window').getElementsByClassName('entry-edit')[0];
127
  var packButtons = baseRef.getElementsByClassName('a-right')[0];
128
+ <?php if (!$this->_isAbroad): ?>
129
+ baseRef.insertBefore(document.getElementById('speedyOptionsBeforePayment'), packButtons);
130
+ <?php endif; ?>
131
  baseRef.insertBefore(document.getElementById('speedyDeferredDays'), packButtons);
132
  </script>
133
  <script>
161
  var confirmBox = confirm(response.message);
162
  if (confirmBox == true) {
163
  packaging.paramsCreateLabelRequest['deferred_days'] = deferredDays;
164
+ <?php if (!$this->_isAbroad): ?>
165
+ packaging.paramsCreateLabelRequest['options_before_payment'] = optionsBeforePayment;
166
+ <?php endif; ?>
167
  magentoCallback();
168
  }
169
  } else if (response.ok) {
170
  //this.labelCreatedCallback(response);
171
  packaging.paramsCreateLabelRequest['deferred_days'] = deferredDays;
172
+ <?php if (!$this->_isAbroad): ?>
173
+ packaging.paramsCreateLabelRequest['options_before_payment'] = optionsBeforePayment;
174
+ <?php endif; ?>
175
  magentoCallback();
176
  }
177
  }
app/design/adminhtml/default/default/template/speedy_speedyshipping/pickupform.phtml CHANGED
@@ -72,10 +72,16 @@ var fixedHourLabel = "<?php echo $this->__("extra charge").'\"'.$this->__("fixed
72
  </table>
73
  </div>
74
 
 
 
 
 
 
 
 
 
 
75
  <script type="text/javascript">
76
- </script>
77
- <script type="text/javascript">
78
-
79
  $j('document').ready(function() {
80
 
81
  var currentMethod = $j('#order-shipping-method-choose input:radio:checked');
@@ -197,7 +203,13 @@ var fixedHourLabel = "<?php echo $this->__("extra charge").'\"'.$this->__("fixed
197
  }
198
 
199
 
200
-
 
 
 
 
 
 
201
  })
202
 
203
  </script>
72
  </table>
73
  </div>
74
 
75
+ <?php
76
+ $cod_error = '';
77
+ if (Mage::getSingleton('checkout/session')->getSpeedyActiveCurrencyCode()) {
78
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
79
+ if (!in_array(Mage::getSingleton('checkout/session')->getSpeedyActiveCurrencyCode(), $allowedCurrencies)) {
80
+ $cod_error = Mage::helper('speedyshippingmodule')->__('You can\'t use Cash on Delivery, the currency %s is missing. Please contact the administrators of the store!', $activeCurrencyCode);
81
+ }
82
+ }
83
+ ?>
84
  <script type="text/javascript">
 
 
 
85
  $j('document').ready(function() {
86
 
87
  var currentMethod = $j('#order-shipping-method-choose input:radio:checked');
203
  }
204
 
205
 
206
+ var cod_error = '<?php echo $cod_error; ?>';
207
+ if (cod_error) {
208
+ $j('#p_method_cashondelivery').attr('disabled', 'disabled');
209
+ $j('#order-billing_method_form').before('<ul class="cod_error messages"><li class="error-msg">'+cod_error+'</li></ul>');
210
+ } else {
211
+ $j('.cod_error').remove();
212
+ }
213
  })
214
 
215
  </script>
app/design/adminhtml/default/default/template/speedy_speedyshipping/sales/order/create/form/address.phtml CHANGED
@@ -89,6 +89,9 @@ else:
89
  var quartername_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getQuarter"); ?>";
90
  var street_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getStreets"); ?>";
91
  var blok_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getBlock"); ?>";
 
 
 
92
 
93
  var allowForcedOfficeChoice = 0;
94
 
@@ -182,8 +185,34 @@ else:
182
  var shippingSiteNomenclature = null;
183
  <?php endif; ?>
184
 
185
- $j('#order-' + target + '_address_street0').parentsUntil('tr').parent().hide()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  var isFullNomenclature = 0;
 
187
 
188
  var isShippingSameAsBilling = $j('#order-shipping_same_as_billing').is(':checked');
189
 
@@ -303,9 +332,9 @@ else:
303
  }
304
 
305
  if ($j('#order-' + target + '_address_speedy_office_chooser').val() == false) {
306
- showSpeedyAddressFields();
307
  } else {
308
- hideSpeedyAddressFields();
309
  }
310
 
311
  if (!$j(this).val()) {
@@ -434,6 +463,82 @@ else:
434
  order.changeAddressField(event)
435
  }
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  } else if (evtTarget.attr('id') != baseFieldSelector + 'city' && evtTarget.attr('id') != baseFieldSelector + 'speedy_office_chooser') {
438
 
439
  var skipElements = ['order-shipping_address_firstname',
@@ -551,6 +656,82 @@ else:
551
  order.changeAddressField(event)
552
  }
553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  } else if (evtTarget.attr('id') != baseFieldSelector + 'city' && evtTarget.attr('id') != baseFieldSelector + 'speedy_office_chooser') {
555
  var skipElements = ['order-billing_address_firstname',
556
  'order-billing_address_lastname',
@@ -572,12 +753,19 @@ else:
572
 
573
 
574
  $j('#' + baseFieldSelector + 'city').change(function(evt) {
575
-
576
- if (siteName != $j(this).val()) {
577
-
 
 
 
 
 
 
578
  $j(this).val('')
579
  $j('#' + baseFieldSelector + 'speedy_site_id').val('')
580
- $j('#' + baseFieldSelector + 'zip').val('')
 
581
  updateForm(target);
582
  var event = {type: 'change', target: this, srcElement: evt.target}
583
  order.changeAddressField(event)
@@ -586,7 +774,7 @@ else:
586
  updateForm(target);
587
  ;
588
  $j('#' + baseFieldSelector + 'speedy_site_id').val('')
589
- $j('#' + baseFieldSelector + 'zip').val('')
590
  // clearForm();
591
  var event = {type: 'change', target: this, srcElement: evt.target}
592
  order.changeAddressField(event)
@@ -595,7 +783,7 @@ else:
595
  }
596
  })
597
 
598
- $j('#order-' + target + '_address_street1').hide();
599
  var possibleAddressSources = ['billing', 'shipping'];
600
 
601
  var isValidAddress = $j('#order-' + target + '_address_customer_address_id').val();
@@ -636,22 +824,23 @@ else:
636
  disableAutocomplete();
637
  }
638
 
639
- initOfficeChooser(target);
640
-
641
-
642
- var isCityEmpty = $j('#order-' + target + '_address_city,#order-shipping_address_city').val();
643
-
644
- var showOffice = $j('#order-' + target + '_address_speedy_office_chooser').val();
645
 
 
646
 
647
- if (showOffice != 0) {
648
 
649
- hideSpeedyAddressFields()
650
- } else {
651
-
652
- showSpeedyAddressFields()
 
653
  }
654
 
 
655
 
656
  if (isCityEmpty == "") {
657
 
@@ -668,7 +857,7 @@ else:
668
 
669
  if ($j(this).val() != false) {
670
 
671
- hideSpeedyAddressFields()
672
 
673
  var zipCode = $j('#order-' + target + '_address_postcode').val();
674
  var regionCode = $j('#order-' + target + '_address_region').val();
@@ -693,7 +882,7 @@ else:
693
  $j('#order-' + target + '_address_postcode').val(zipCode)
694
  $j('#order-' + target + '_address_region').val(regionCode);
695
 
696
- showSpeedyAddressFields();
697
  concatenateStreetAddress();
698
 
699
 
@@ -707,13 +896,43 @@ else:
707
  }
708
 
709
  function hideSpeedyAddressFields() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
 
 
711
  var selector = '#order-' + target + '_address_fields input[id*="speedy"]';
712
 
713
  $j(selector).not(':hidden').hide().closest('tr').hide()
714
  $j('#order-' + target + '_address_speedy_office_name').show().closest('tr').show()
715
  }
716
- function showSpeedyAddressFields() {
717
  $j('#order-' + target + '_address input[id*="speedy"]').show().closest('tr').show()
718
  $j('#order-' + target + '_address_speedy_office_name').hide().closest('tr').hide()
719
  }
@@ -742,7 +961,9 @@ else:
742
  url: city_autocomplete_url,
743
  dataType: "json",
744
  data: {
745
- term: request.term
 
 
746
  },
747
  success: function(data) {
748
 
@@ -753,7 +974,6 @@ else:
753
  , minLength: 1
754
  , select: function(event, ui) {
755
 
756
- updateForm(activeTarget)
757
  updateForm(activeTarget, true);
758
  // clearForm();
759
  $j(this).val(ui.item.label);
@@ -761,7 +981,7 @@ else:
761
  $j('#order-' + activeTarget + '_address_speedy_site_id').val(ui.item.value)
762
  $j('#order-' + activeTarget + '_address_postcode').val(ui.item.post_code)
763
 
764
- $j('#order-' + activeTarget + '_address_country_id').val('BG');
765
 
766
  $j('#order-' + activeTarget + '_address_region_id').removeClass('required-entry validate-select validation-failed').hide();
767
 
@@ -858,7 +1078,8 @@ else:
858
  dataType: "json",
859
  data: {
860
  term: request.term,
861
- cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val()
 
862
  },
863
  success: function(data) {
864
  response(data);
@@ -884,7 +1105,8 @@ else:
884
  dataType: "json",
885
  data: {
886
  term: request.term,
887
- cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val()
 
888
  },
889
  success: function(data) {
890
  response(data);
@@ -914,7 +1136,8 @@ else:
914
  dataType: "json",
915
  data: {
916
  term: request.term,
917
- cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val()
 
918
  },
919
  success: function(data) {
920
  response(data);
@@ -931,6 +1154,30 @@ else:
931
  return false;
932
  }});
933
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
934
 
935
  var selector = '#' + baseFieldSelector + 'speedy_street_number,' +
936
  '#' + baseFieldSelector + 'speedy_block_number,' +
@@ -942,7 +1189,6 @@ else:
942
  concatenateStreetAddress();
943
 
944
  })
945
-
946
  }
947
 
948
  function initSiteData(jsonResponse, target) {
@@ -1146,6 +1392,14 @@ else:
1146
  #order-" + target + "_address_speedy_office_name ").autocomplete("option", "disabled", true);
1147
  }
1148
 
 
 
 
 
1149
 
1150
- })
1151
- </script>
 
 
 
 
89
  var quartername_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getQuarter"); ?>";
90
  var street_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getStreets"); ?>";
91
  var blok_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getBlock"); ?>";
92
+ var region_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getStates"); ?>";
93
+ var country_autocomplete_url = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/getCountries"); ?>";
94
+ var validate_abroud_address = "<?php echo Mage::helper("adminhtml")->getUrl("speedyshipping/address/validateAbroudAddress"); ?>";
95
 
96
  var allowForcedOfficeChoice = 0;
97
 
185
  var shippingSiteNomenclature = null;
186
  <?php endif; ?>
187
 
188
+ if ($j('#order-' + target + '_address_country_id').val() == 'BG') {
189
+ $j('#order-' + target + '_address_street0').parentsUntil('tr').parent().hide()
190
+ }
191
+
192
+ $j('#<?php echo $_fieldsContainerId; ?> input').keypress(function(event){
193
+ if ($j('#order-' + target + '_address_country_id').val() != 'BG' && event.key.match(/[а-яА-я]/)) {
194
+ event.preventDefault();
195
+ alert('<?php echo $this->__('Please, use only latin characters!') ?>');
196
+ }
197
+ });
198
+
199
+ $j('#<?php echo $_fieldsContainerId; ?> input:text').focusout(function(event){
200
+ speedy_clear_input($j(this));
201
+ });
202
+
203
+ $j('#<?php echo $_fieldsContainerId; ?> input:text').each(function(index) {
204
+ speedy_clear_input($j(this));
205
+ });
206
+
207
+
208
+ function speedy_clear_input(element) {
209
+ if ($j('#order-' + target + '_address_country_id').val() != 'BG' && element.val().match(/[а-яА-я]/)) {
210
+ element.val('');
211
+ }
212
+ }
213
+
214
  var isFullNomenclature = 0;
215
+ var isFullSiteNomenclature = 0;
216
 
217
  var isShippingSameAsBilling = $j('#order-shipping_same_as_billing').is(':checked');
218
 
332
  }
333
 
334
  if ($j('#order-' + target + '_address_speedy_office_chooser').val() == false) {
335
+ showSpeedyAddressFieldsForOffice();
336
  } else {
337
+ hideSpeedyAddressFieldsForOffice();
338
  }
339
 
340
  if (!$j(this).val()) {
463
  order.changeAddressField(event)
464
  }
465
 
466
+ } else if (evtTarget.attr('id') == baseFieldSelector + 'country_id') {
467
+ if ($j(this).val() != 'BG') {
468
+ hideSpeedyAddressFields();
469
+ } else {
470
+ showSpeedyAddressFields();
471
+ }
472
+
473
+ $j('#order-' + target + '_address_speedy_site_id').val('');
474
+ $j('#order-' + target + '_address_city').val('');
475
+ $j('#order-' + target + '_address_postcode').val('');
476
+ $j('#order-' + target + '_address_region').val('');
477
+ $j('#order-' + target + '_address_speedy_state_id').val('');
478
+
479
+ // get speedy_country_id
480
+ $j.ajax({
481
+ url: country_autocomplete_url,
482
+ dataType: "json",
483
+ async: false,
484
+ data: {
485
+ countryiso: $j('#order-' + target + '_address_country_id').val()
486
+ },
487
+ success: function(data) {
488
+ if (data && data.hasOwnProperty($j('#order-' + target + '_address_country_id').val())) {
489
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('id')) {
490
+ $j('#order-' + target + '_address_speedy_country_id').val(data[$j('#order-' + target + '_address_country_id').val()].id);
491
+ }
492
+
493
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('is_full_nomenclature')) {
494
+ if(!data[$j('#order-' + target + '_address_country_id').val()].is_full_nomenclature) {
495
+ isFullSiteNomenclature = 'NO';
496
+ //disableSiteAutocomplete();
497
+ } else if (data[$j('#order-' + target + '_address_country_id').val()].is_full_nomenclature == 2) {
498
+ isFullSiteNomenclature = 'PARTIAL';
499
+ //enableSiteAutocomplete();
500
+ } else {
501
+ isFullSiteNomenclature = 'FULL';
502
+ //enableSiteAutocomplete();
503
+ }
504
+ }
505
+
506
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('required_state')) {
507
+ state_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>';
508
+ if (data[$j('#order-' + target + '_address_country_id').val()].required_state) {
509
+ $j('label[for=order-' + target + '_address_region]').find('span.required').show();
510
+ if (!$j('#order-' + target + '_address_region').hasClass(state_req)) {
511
+ $j('#order-' + target + '_address_region').addClass(state_req);
512
+ }
513
+ if (!$j('#order-' + target + '_address_speedy_state_id').hasClass('required')) {
514
+ $j('#order-' + target + '_address_speedy_state_id').addClass('required');
515
+ }
516
+ } else {
517
+ $j('label[for=order-' + target + '_address_region]').find('span.required').hide();
518
+ $j('#order-' + target + '_address_region').removeClass(state_req);
519
+ $j('#order-' + target + '_address_speedy_state_id').removeClass('required');
520
+ }
521
+ }
522
+
523
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('required_postcode')) {
524
+ postcode_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>';
525
+ if (data[$j('#order-' + target + '_address_country_id').val()].required_postcode) {
526
+ $j('label[for=order-' + target + '_address_postcode]').find('span.required').show();
527
+ if (!$j('#order-' + target + '_address_postcode').hasClass(postcode_req)) {
528
+ $j('#order-' + target + '_address_postcode').addClass(postcode_req);
529
+ }
530
+ } else {
531
+ $j('label[for=order-' + target + '_address_postcode]').find('span.required').hide();
532
+ $j('#order-' + target + '_address_postcode').removeClass(postcode_req);
533
+ }
534
+ }
535
+ }
536
+ }
537
+ });
538
+
539
+ var event = {type: 'change', target: this, srcElement: evt.target}
540
+ order.changeAddressField(event)
541
+
542
  } else if (evtTarget.attr('id') != baseFieldSelector + 'city' && evtTarget.attr('id') != baseFieldSelector + 'speedy_office_chooser') {
543
 
544
  var skipElements = ['order-shipping_address_firstname',
656
  order.changeAddressField(event)
657
  }
658
 
659
+ } else if (evtTarget.attr('id') == baseFieldSelector + 'country_id') {
660
+ if ($j(this).val() != 'BG') {
661
+ hideSpeedyAddressFields();
662
+ } else {
663
+ showSpeedyAddressFields();
664
+ }
665
+
666
+ $j('#order-' + target + '_address_speedy_site_id').val('');
667
+ $j('#order-' + target + '_address_city').val('');
668
+ $j('#order-' + target + '_address_postcode').val('');
669
+ $j('#order-' + target + '_address_region').val('');
670
+ $j('#order-' + target + '_address_speedy_state_id').val('');
671
+
672
+ // get speedy_country_id
673
+ $j.ajax({
674
+ url: country_autocomplete_url,
675
+ dataType: "json",
676
+ async: false,
677
+ data: {
678
+ countryiso: $j('#order-' + target + '_address_country_id').val()
679
+ },
680
+ success: function(data) {
681
+ if (data && data.hasOwnProperty($j('#order-' + target + '_address_country_id').val())) {
682
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('id')) {
683
+ $j('#order-' + target + '_address_speedy_country_id').val(data[$j('#order-' + target + '_address_country_id').val()].id);
684
+ }
685
+
686
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('is_full_nomenclature')) {
687
+ if(!data[$j('#order-' + target + '_address_country_id').val()].is_full_nomenclature) {
688
+ isFullSiteNomenclature = 'NO';
689
+ //disableSiteAutocomplete();
690
+ } else if (data[$j('#order-' + target + '_address_country_id').val()].is_full_nomenclature == 2) {
691
+ isFullSiteNomenclature = 'PARTIAL';
692
+ //enableSiteAutocomplete();
693
+ } else {
694
+ isFullSiteNomenclature = 'FULL';
695
+ //enableSiteAutocomplete();
696
+ }
697
+ }
698
+
699
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('required_state')) {
700
+ state_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>';
701
+ if (data[$j('#order-' + target + '_address_country_id').val()].required_state) {
702
+ $j('label[for=order-' + target + '_address_region]').find('span.required').show();
703
+ if (!$j('#order-' + target + '_address_region').hasClass(state_req)) {
704
+ $j('#order-' + target + '_address_region').addClass(state_req);
705
+ }
706
+ if (!$j('#order-' + target + '_address_speedy_state_id').hasClass('required')) {
707
+ $j('#order-' + target + '_address_speedy_state_id').addClass('required');
708
+ }
709
+ } else {
710
+ $j('label[for=order-' + target + '_address_region]').find('span.required').hide();
711
+ $j('#order-' + target + '_address_region').removeClass(state_req);
712
+ $j('#order-' + target + '_address_speedy_state_id').removeClass('required');
713
+ }
714
+ }
715
+
716
+ if (data[$j('#order-' + target + '_address_country_id').val()].hasOwnProperty('required_postcode')) {
717
+ postcode_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>';
718
+ if (data[$j('#order-' + target + '_address_country_id').val()].required_postcode) {
719
+ $j('label[for=order-' + target + '_address_postcode]').find('span.required').show();
720
+ if (!$j('#order-' + target + '_address_postcode').hasClass(postcode_req)) {
721
+ $j('#order-' + target + '_address_postcode').addClass(postcode_req);
722
+ }
723
+ } else {
724
+ $j('label[for=order-' + target + '_address_postcode]').find('span.required').hide();
725
+ $j('#order-' + target + '_address_postcode').removeClass(postcode_req);
726
+ }
727
+ }
728
+ }
729
+ }
730
+ });
731
+
732
+ var event = {type: 'change', target: this, srcElement: evt.target}
733
+ order.changeAddressField(event)
734
+
735
  } else if (evtTarget.attr('id') != baseFieldSelector + 'city' && evtTarget.attr('id') != baseFieldSelector + 'speedy_office_chooser') {
736
  var skipElements = ['order-billing_address_firstname',
737
  'order-billing_address_lastname',
753
 
754
 
755
  $j('#' + baseFieldSelector + 'city').change(function(evt) {
756
+ if (isFullSiteNomenclature == 'FULL' && $j('#' + baseFieldSelector + 'speedy_site_id').val() == false) {
757
+ $j(this).val('');
758
+ $j('#' + baseFieldSelector + 'speedy_quarter_id').val('');
759
+ $j('#' + baseFieldSelector + 'postcode').val('');
760
+ $j('#' + baseFieldSelector + 'region').val('');
761
+ updateForm(target);
762
+ var event = {type: 'change', target: this, srcElement: evt.target}
763
+ order.changeAddressField(event)
764
+ } else if (siteName != $j(this).val() && isFullSiteNomenclature == 'FULL') {
765
  $j(this).val('')
766
  $j('#' + baseFieldSelector + 'speedy_site_id').val('')
767
+ $j('#' + baseFieldSelector + 'postcode').val('')
768
+ $j('#' + baseFieldSelector + 'region').val('')
769
  updateForm(target);
770
  var event = {type: 'change', target: this, srcElement: evt.target}
771
  order.changeAddressField(event)
774
  updateForm(target);
775
  ;
776
  $j('#' + baseFieldSelector + 'speedy_site_id').val('')
777
+ $j('#' + baseFieldSelector + 'postcode').val('')
778
  // clearForm();
779
  var event = {type: 'change', target: this, srcElement: evt.target}
780
  order.changeAddressField(event)
783
  }
784
  })
785
 
786
+ //$j('#order-' + target + '_address_street1').hide();
787
  var possibleAddressSources = ['billing', 'shipping'];
788
 
789
  var isValidAddress = $j('#order-' + target + '_address_customer_address_id').val();
824
  disableAutocomplete();
825
  }
826
 
827
+ if ($j('#order-' + target + '_address_country_id').val() != 'BG') {
828
+ hideSpeedyAddressFields();
829
+ } else {
830
+ showSpeedyAddressFields();
 
 
831
 
832
+ initOfficeChooser(target);
833
 
834
+ var showOffice = $j('#order-' + target + '_address_speedy_office_chooser').val();
835
 
836
+ if (showOffice != 0) {
837
+ hideSpeedyAddressFieldsForOffice()
838
+ } else {
839
+ showSpeedyAddressFieldsForOffice()
840
+ }
841
  }
842
 
843
+ var isCityEmpty = $j('#order-' + target + '_address_city,#order-shipping_address_city').val();
844
 
845
  if (isCityEmpty == "") {
846
 
857
 
858
  if ($j(this).val() != false) {
859
 
860
+ hideSpeedyAddressFieldsForOffice()
861
 
862
  var zipCode = $j('#order-' + target + '_address_postcode').val();
863
  var regionCode = $j('#order-' + target + '_address_region').val();
882
  $j('#order-' + target + '_address_postcode').val(zipCode)
883
  $j('#order-' + target + '_address_region').val(regionCode);
884
 
885
+ showSpeedyAddressFieldsForOffice();
886
  concatenateStreetAddress();
887
 
888
 
896
  }
897
 
898
  function hideSpeedyAddressFields() {
899
+ $j('#order-' + target + '_address_street0').parentsUntil('tr').parent().show();
900
+ $j('#order-' + target + '_address_street1').parentsUntil('tr').parent().show();
901
+ $j('#order-' + target + '_address_fields input[id*="speedy"]').not(':hidden').hide().closest('tr').hide();
902
+ $j('#order-' + target + '_address_speedy_office_chooser').hide().closest('tr').hide();
903
+
904
+ $j('#order-' + target + '_address_speedy_quarter_name').hide().closest('tr').hide();
905
+ $j('#order-' + target + '_address_speedy_street_name').hide().closest('tr').hide();
906
+ $j('#order-' + target + '_address_speedy_street_number').hide().closest('tr').hide();
907
+ $j('#order-' + target + '_address_speedy_block_number').hide().closest('tr').hide();
908
+ $j('#order-' + target + '_address_speedy_entrance').hide().closest('tr').hide();
909
+ $j('#order-' + target + '_address_speedy_floor').hide().closest('tr').hide();
910
+ $j('#order-' + target + '_address_speedy_apartment').hide().closest('tr').hide();
911
+ $j('#order-' + target + '_address_speedy_note').hide().closest('tr').hide();
912
+ }
913
+ function showSpeedyAddressFields() {
914
+ $j('#order-' + target + '_address_street0').parentsUntil('tr').parent().hide();
915
+ $j('#order-' + target + '_address_street1').parentsUntil('tr').parent().hide();
916
+ $j('#order-' + target + '_address_fields input[id*="speedy"]').show().closest('tr').show();
917
+ $j('#order-' + target + '_address_speedy_office_name').hide().closest('tr').hide();
918
+
919
+ $j('#order-' + target + '_address_speedy_quarter_name').show().closest('tr').show();
920
+ $j('#order-' + target + '_address_speedy_street_name').show().closest('tr').show();
921
+ $j('#order-' + target + '_address_speedy_street_number').show().closest('tr').show();
922
+ $j('#order-' + target + '_address_speedy_block_number').show().closest('tr').show();
923
+ $j('#order-' + target + '_address_speedy_entrance').show().closest('tr').show();
924
+ $j('#order-' + target + '_address_speedy_floor').show().closest('tr').show();
925
+ $j('#order-' + target + '_address_speedy_apartment').show().closest('tr').show();
926
+ $j('#order-' + target + '_address_speedy_note').show().closest('tr').show();
927
+ }
928
 
929
+ function hideSpeedyAddressFieldsForOffice() {
930
  var selector = '#order-' + target + '_address_fields input[id*="speedy"]';
931
 
932
  $j(selector).not(':hidden').hide().closest('tr').hide()
933
  $j('#order-' + target + '_address_speedy_office_name').show().closest('tr').show()
934
  }
935
+ function showSpeedyAddressFieldsForOffice() {
936
  $j('#order-' + target + '_address input[id*="speedy"]').show().closest('tr').show()
937
  $j('#order-' + target + '_address_speedy_office_name').hide().closest('tr').hide()
938
  }
961
  url: city_autocomplete_url,
962
  dataType: "json",
963
  data: {
964
+ term: request.term,
965
+ countryid: $j('#order-' + activeTarget + '_address_speedy_country_id').val(),
966
+ countryiso: $j('#order-' + activeTarget + '_address_country_id').val()
967
  },
968
  success: function(data) {
969
 
974
  , minLength: 1
975
  , select: function(event, ui) {
976
 
 
977
  updateForm(activeTarget, true);
978
  // clearForm();
979
  $j(this).val(ui.item.label);
981
  $j('#order-' + activeTarget + '_address_speedy_site_id').val(ui.item.value)
982
  $j('#order-' + activeTarget + '_address_postcode').val(ui.item.post_code)
983
 
984
+ //$j('#order-' + activeTarget + '_address_country_id').val('BG');
985
 
986
  $j('#order-' + activeTarget + '_address_region_id').removeClass('required-entry validate-select validation-failed').hide();
987
 
1078
  dataType: "json",
1079
  data: {
1080
  term: request.term,
1081
+ cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val(),
1082
+ countryiso: $j('#order-' + activeTarget + '_address_country_id').val()
1083
  },
1084
  success: function(data) {
1085
  response(data);
1105
  dataType: "json",
1106
  data: {
1107
  term: request.term,
1108
+ cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val(),
1109
+ countryiso: $j('#order-' + activeTarget + '_address_country_id').val()
1110
  },
1111
  success: function(data) {
1112
  response(data);
1136
  dataType: "json",
1137
  data: {
1138
  term: request.term,
1139
+ cityid: $j('#order-' + activeTarget + '_address_speedy_site_id').val(),
1140
+ countryiso: $j('#order-' + activeTarget + '_address_country_id').val()
1141
  },
1142
  success: function(data) {
1143
  response(data);
1154
  return false;
1155
  }});
1156
 
1157
+ $j('#order-' + activeTarget + '_address_region').autocomplete({
1158
+ source: function(request, response) {
1159
+
1160
+ $j.ajax({
1161
+ url: region_autocomplete_url,
1162
+ dataType: "json",
1163
+ data: {
1164
+ term: request.term,
1165
+ countryid: $j('#order-' + activeTarget + '_address_speedy_country_id').val(),
1166
+ countryiso: $j('#order-' + activeTarget + '_address_country_id').val()
1167
+ },
1168
+ success: function(data) {
1169
+ response(data);
1170
+ }
1171
+ });
1172
+ }
1173
+ , minLength: 0
1174
+ , select: function(event, ui) {
1175
+ $j(this).val(ui.item.label);
1176
+ $j('#order-' + activeTarget + '_address_speedy_state_id').val(ui.item.value);
1177
+ var event = {type: 'change', target: this, srcElement: this}
1178
+ order.changeAddressField(event)
1179
+ return false;
1180
+ }});
1181
 
1182
  var selector = '#' + baseFieldSelector + 'speedy_street_number,' +
1183
  '#' + baseFieldSelector + 'speedy_block_number,' +
1189
  concatenateStreetAddress();
1190
 
1191
  })
 
1192
  }
1193
 
1194
  function initSiteData(jsonResponse, target) {
1392
  #order-" + target + "_address_speedy_office_name ").autocomplete("option", "disabled", true);
1393
  }
1394
 
1395
+ /*
1396
+ function enableSiteAutocomplete() {
1397
+ $j('#order-' + target + '_address_city').autocomplete("option", "disabled", false);
1398
+ }
1399
 
1400
+ function disableSiteAutocomplete() {
1401
+ $j('#order-' + target + '_address_city').autocomplete("option", "disabled", true);
1402
+ }
1403
+ */
1404
+ });
1405
+ </script>
app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/billing.phtml CHANGED
@@ -42,9 +42,12 @@
42
  </li>
43
  <?php endif; ?>
44
  <li class="wide">
45
- <div class="field" style="width: 100%">
46
- <div id="speedyBillingError" style="display: none" class="validation-failed">
47
- <?php echo $this->__("valid_address_desc") ?>
 
 
 
48
  </div>
49
  </div>
50
  </li>
@@ -56,7 +59,32 @@
56
  </div>
57
  </div>
58
  </li>
59
- <li class="fields">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  <label for=""><?php echo $this->__("Choose Speedy office") ?></label>
61
  <div class="field">
62
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
@@ -69,7 +97,7 @@
69
  <li>
70
  <input type="hidden" name="billing[speedy_site_id]" id="billing:speedy_site_id" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedySiteId()) ?>" />
71
  </li>
72
- <li>
73
 
74
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
75
  <div id="billing:speedy_office_address">
@@ -108,7 +136,7 @@
108
 
109
  <?php endif; ?>
110
  <ul>
111
- <li class="wide">
112
  <div class="field">
113
 
114
  <label for="speedy_quarter_name"><?php echo $this->__('Quarter') ?></label>
@@ -121,18 +149,24 @@
121
  </li>
122
  <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
123
  <li class="wide">
124
- <label for="speedy_street"><?php echo $this->__('speedy street name'); ?></label>
125
- <div class="input-box">
126
  <input type="text" name="billing[speedy_street_name]" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedyStreetName()) ?>" id="billing:speedy_street" class="input-text" />
127
  </div>
128
- <div class="street_holder" style="display: none">
129
- <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
130
  <div class="input-box">
131
- <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
 
 
 
 
 
 
132
  </div>
133
  </div>
134
  </li>
135
- <li class="fields">
136
 
137
  <div class="field">
138
  <label for="speedy_street_number"><?php echo $this->__('Street Number') ?></label>
@@ -149,7 +183,7 @@
149
 
150
 
151
 
152
- <li class="fields">
153
  <div class="field">
154
  <label for=""><?php echo $this->__("Entrance") ?></label>
155
  <div class="input-box">
@@ -161,14 +195,14 @@
161
  <input type="text" name="billing[speedy_floor]" id="billing:speedy_floor" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyFloor()) ?>"/></div>
162
  </div>
163
  </li>
164
- <li class="fields">
165
  <div class="field">
166
  <label for=""><?php echo $this->__("Apartment") ?></label>
167
  <div class="input-box">
168
  <input type="text" name="billing[speedy_apartment]" id="billing:speedy_apartment" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyApartment()) ?>" /></div>
169
  </div>
170
  </li>
171
- <li class="wide">
172
  <div class="field">
173
  <label for=""><?php echo $this->__("Address note") ?></label>
174
  <div class="input-box">
@@ -178,48 +212,21 @@
178
  </li>
179
  </ul>
180
  </div>
181
- <li class="fields">
182
- <div class="field">
183
- <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
184
- <div class="input-box">
185
- <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
186
- </div>
187
- </div>
188
- <div class="field">
189
- <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
190
- <div class="input-box">
191
- <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
192
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
193
- </select>
194
- <script type="text/javascript">
195
- //<![CDATA[
196
- $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
197
- //]]>
198
- </script>
199
- <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
200
- </div>
201
- </div>
202
- <div class="field">
203
- <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
204
- <div class="input-box">
205
- <?php echo $this->getCountryHtmlSelect('billing') ?>
206
- </div>
207
- </div>
208
- </li>
209
- <li class="fields">
210
- <div class="field">
211
- <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
212
- <div class="input-box">
213
- <input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
214
- </div>
215
  </div>
216
- <div class="field">
217
- <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
218
- <div class="input-box">
219
- <input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
220
- </div>
221
  </div>
222
- </li>
 
223
 
224
  <?php if (!$this->isCustomerLoggedIn()): ?>
225
 
@@ -287,6 +294,14 @@
287
  </li>
288
  <?php endif; ?>
289
 
 
 
 
 
 
 
 
 
290
  <?php if (!$this->canShip()): ?>
291
  <input type="hidden" name="billing[use_for_shipping]" value="1" />
292
  <?php endif; ?>
@@ -310,13 +325,25 @@
310
  //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
311
  $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
312
 
313
- var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
 
 
 
 
 
 
 
 
 
 
 
314
  //]]>
315
  var isNewBillingAddress = false;
316
 
317
  //This variable is necessary in the adjecent shipping address block
318
  //var shippingSiteNomenclature = null;
319
  var isFullNomenclature = 0;
 
320
  $j('document').ready(function() {
321
 
322
 
@@ -359,7 +386,13 @@
359
  var evtTarget = $j(evt.target);
360
  if (evtTarget.attr('id') == 'billing:city') {
361
 
362
- if (siteName != evtTarget.val()) {
 
 
 
 
 
 
363
 
364
  evtTarget.val('')
365
 
@@ -372,7 +405,7 @@
372
 
373
  updateForm();
374
  $j('#billing\\:speedy_site_id').val('')
375
- $j('#zip').val('')
376
  } else {
377
  // updateForm(true);
378
  }
@@ -387,6 +420,7 @@
387
  }
388
 
389
 
 
390
  else if (evtTarget.val() != streetName && isFullNomenclature == 'FULL') {
391
  evtTarget.val('')
392
  $j('#billing\\:speedy_street_id').val('');
@@ -418,6 +452,7 @@
418
  }
419
 
420
 
 
421
  } else if (evtTarget.attr('id') == 'billing:speedy_office_locator') {
422
 
423
 
@@ -455,6 +490,7 @@
455
  }
456
 
457
 
 
458
  $j('#billing\\:city,div#billing\\:speedy_normal_address input, div#billing\\:speedy_office_address input').blur(function(evt) {
459
 
460
 
@@ -475,6 +511,7 @@
475
  for (var i = 0; i < test.length; i++) {
476
 
477
 
 
478
  if (test[i] == isValidAddress || isValidAddress == "") {
479
 
480
  $j('#speedy_address_error').hide();
@@ -499,6 +536,7 @@
499
  $j('#billing\\:speedy_office_chooser').change(function(evt) {
500
 
501
 
 
502
  if ($j(this).is(':checked')) {
503
  $j('#billing\\:speedy_normal_address').hide().find('input').val('');
504
  $j('#billing\\:speedy_office_address').show().find('input').show();
@@ -511,6 +549,7 @@
511
  });
512
 
513
 
 
514
  $j('#billing-address-select').change(function(evt) {
515
 
516
  if (!$j(this).val()) {
@@ -539,7 +578,9 @@
539
  url: "<?php echo Mage::getUrl("speedyshippingfront/address/getSite"); ?>",
540
  dataType: "json",
541
  data: {
542
- term: request.term
 
 
543
  },
544
  success: function(data) {
545
 
@@ -555,8 +596,11 @@
555
 
556
  $j('#billing\\:speedy_site_id').val(ui.item.value)
557
  $j('#billing\\:postcode').val(ui.item.post_code)
558
- $j('#billing\\:region').val(ui.item.region)
559
- $j('#billing\\:country_id').val('BG');
 
 
 
560
  siteName = ui.item.label;
561
  if (ui.item.is_full_nomenclature == 'NO') {
562
  isFullNomenclature = 'NO';
@@ -615,6 +659,8 @@
615
 
616
 
617
 
 
 
618
  $j('#billing\\:speedy_quarter_name').autocomplete({
619
  source: function(request, response) {
620
 
@@ -623,7 +669,8 @@
623
  dataType: "json",
624
  data: {
625
  term: request.term,
626
- cityid: $j('#billing\\:speedy_site_id').val()
 
627
  },
628
  success: function(data) {
629
  response(data);
@@ -646,7 +693,8 @@
646
  dataType: "json",
647
  data: {
648
  term: request.term,
649
- cityid: $j('#billing\\:speedy_site_id').val()
 
650
  },
651
  success: function(data) {
652
  response(data);
@@ -662,6 +710,7 @@
662
  }});
663
 
664
 
 
665
  $j('#billing\\:speedy_block_number').autocomplete({
666
  source: function(request, response) {
667
 
@@ -670,7 +719,8 @@
670
  dataType: "json",
671
  data: {
672
  term: request.term,
673
- cityid: $j('#billing\\:speedy_site_id').val()
 
674
  },
675
  success: function(data) {
676
  response(data);
@@ -684,6 +734,35 @@
684
  return false;
685
  }});
686
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  function initSiteData(jsonResponse) {
688
  $j('#billing\\:speedy_site_id').val(jsonResponse.item.site_id)
689
  $j('#billing\\:postcode').val(jsonResponse.item.post_code)
@@ -718,6 +797,7 @@
718
  }
719
 
720
 
 
721
  }
722
 
723
 
@@ -725,6 +805,8 @@
725
 
726
 
727
 
 
 
728
  function validateAddress() {
729
  $j('div#speedyBillingError').hide();
730
  //evt.preventDefault();
@@ -747,28 +829,32 @@
747
  var speedy_office_id = $j(prefix + 'speedy_office_id').val();
748
 
749
 
 
750
  var isBillingSameAsShipping = $j('#billing\\:use_for_shipping_yes').is(':checked');
751
  var isNewAddress = $j('#billing-address-select').val();
752
 
753
  var isValid = 0;
754
 
755
  if (!isNewAddress) {
756
- if (quarter || quarter_id) {
757
- if ((street && number) || blockNo || number) {
 
 
 
758
 
 
759
  isValid = true;
760
- }
761
-
762
- } else if (speedy_pick_from_office && speedy_office_name && speedy_office_id) {
763
- isValid = true;
764
- } else if ((street || street_id)) {
765
- if (number || blockNo) {
766
 
 
767
  isValid = true;
768
  }
769
-
770
- } else if (address_note && address_note.length > 4) {
771
  isValid = true;
 
772
  }
773
 
774
  if (isValid) {
@@ -851,6 +937,7 @@
851
  var isBillingSameForShipping = $j('#billing\\:use_for_shipping_yes').is(':checked');
852
 
853
 
 
854
  if (isNewBillingAddress && isBillingSameForShipping) {
855
 
856
  isShippingFullNomenclature = isFullNomenclature;
@@ -863,7 +950,6 @@
863
  $j('div#speedyBillingError').hide();
864
  evt.preventDefault();
865
 
866
-
867
  var isValid = validateAddress();
868
 
869
  if (isValid) {
@@ -889,6 +975,7 @@
889
  })
890
 
891
 
 
892
  function updateForm(enable) {
893
 
894
  if (enable) {
@@ -926,3 +1013,137 @@
926
 
927
  })
928
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  </li>
43
  <?php endif; ?>
44
  <li class="wide">
45
+ <div class="field">
46
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
47
+ <input type="hidden" id="billing:speedy_country_id" name="billing[speedy_country_id]" value="" />
48
+ <input type="hidden" id="billing:active_currency_code" name="billing[active_currency_code]" value="" />
49
+ <div class="input-box">
50
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
51
  </div>
52
  </div>
53
  </li>
59
  </div>
60
  </div>
61
  </li>
62
+ <li class="wide">
63
+ <div class="field">
64
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
65
+ <div class="input-box">
66
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international" />
67
+ </div>
68
+ </div>
69
+ </li>
70
+ <li class="wide">
71
+ <div class="field">
72
+ <label for="billing:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
73
+ <div class="input-box">
74
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" style="display:none;">
75
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
76
+ </select>
77
+ <script type="text/javascript">
78
+ //<![CDATA[
79
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
80
+ //]]>
81
+ </script>
82
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" />
83
+ <input type="hidden" id="billing:speedy_state_id" name="billing[speedy_state_id]" value="" />
84
+ </div>
85
+ </div>
86
+ </li>
87
+ <li class="fields bg_field">
88
  <label for=""><?php echo $this->__("Choose Speedy office") ?></label>
89
  <div class="field">
90
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
97
  <li>
98
  <input type="hidden" name="billing[speedy_site_id]" id="billing:speedy_site_id" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedySiteId()) ?>" />
99
  </li>
100
+ <li class="bg_field">
101
 
102
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
103
  <div id="billing:speedy_office_address">
136
 
137
  <?php endif; ?>
138
  <ul>
139
+ <li class="wide bg_field">
140
  <div class="field">
141
 
142
  <label for="speedy_quarter_name"><?php echo $this->__('Quarter') ?></label>
149
  </li>
150
  <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
151
  <li class="wide">
152
+ <label for="speedy_street" class="bg_field"><?php echo $this->__('speedy street name'); ?></label>
153
+ <div class="input-box bg_field">
154
  <input type="text" name="billing[speedy_street_name]" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedyStreetName()) ?>" id="billing:speedy_street" class="input-text" />
155
  </div>
156
+ <div class="street_holder non_bg_field" style="display: none">
157
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
158
  <div class="input-box">
159
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
160
+ </div>
161
+ </div>
162
+ <div class="street_holder non_bg_field" style="display: none">
163
+ <label for="billing:street2"><?php echo $this->__('Street Address 2') ?></label>
164
+ <div class="input-box">
165
+ <input type="text" title="<?php echo $this->__('Street Address 2') ?>" name="billing[street][]" id="billing:street2" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(2)) ?>" class="input-text" />
166
  </div>
167
  </div>
168
  </li>
169
+ <li class="fields bg_field">
170
 
171
  <div class="field">
172
  <label for="speedy_street_number"><?php echo $this->__('Street Number') ?></label>
183
 
184
 
185
 
186
+ <li class="fields bg_field">
187
  <div class="field">
188
  <label for=""><?php echo $this->__("Entrance") ?></label>
189
  <div class="input-box">
195
  <input type="text" name="billing[speedy_floor]" id="billing:speedy_floor" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyFloor()) ?>"/></div>
196
  </div>
197
  </li>
198
+ <li class="fields bg_field">
199
  <div class="field">
200
  <label for=""><?php echo $this->__("Apartment") ?></label>
201
  <div class="input-box">
202
  <input type="text" name="billing[speedy_apartment]" id="billing:speedy_apartment" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyApartment()) ?>" /></div>
203
  </div>
204
  </li>
205
+ <li class="wide bg_field">
206
  <div class="field">
207
  <label for=""><?php echo $this->__("Address note") ?></label>
208
  <div class="input-box">
212
  </li>
213
  </ul>
214
  </div>
215
+ </li>
216
+ <li class="fields">
217
+ <div class="field">
218
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
219
+ <div class="input-box">
220
+ <input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  </div>
222
+ </div>
223
+ <div class="field">
224
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
225
+ <div class="input-box">
226
+ <input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
227
  </div>
228
+ </div>
229
+ </li>
230
 
231
  <?php if (!$this->isCustomerLoggedIn()): ?>
232
 
294
  </li>
295
  <?php endif; ?>
296
 
297
+ <li class="wide">
298
+ <div class="field" style="width: 100%">
299
+ <div id="speedyBillingError" style="display: none" class="validation-failed">
300
+ <?php echo $this->__("valid_address_desc") ?>
301
+ </div>
302
+ </div>
303
+ </li>
304
+
305
  <?php if (!$this->canShip()): ?>
306
  <input type="hidden" name="billing[use_for_shipping]" value="1" />
307
  <?php endif; ?>
325
  //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
326
  $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
327
 
328
+ <?php
329
+ $json_regions = json_decode($this->helper('directory')->getRegionJson());
330
+ if ($json_regions) {
331
+ $regionConfig = new StdClass();
332
+ $regionConfig->config = $json_regions->config;
333
+ $new_region_objects = json_encode($regionConfig);
334
+ } else {
335
+ $new_region_objects = $this->helper('directory')->getRegionJson();
336
+ }
337
+ ?>
338
+
339
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $new_region_objects ?>, undefined, 'billing:postcode');
340
  //]]>
341
  var isNewBillingAddress = false;
342
 
343
  //This variable is necessary in the adjecent shipping address block
344
  //var shippingSiteNomenclature = null;
345
  var isFullNomenclature = 0;
346
+ var isFullSiteNomenclature = 0;
347
  $j('document').ready(function() {
348
 
349
 
386
  var evtTarget = $j(evt.target);
387
  if (evtTarget.attr('id') == 'billing:city') {
388
 
389
+ if (isFullSiteNomenclature == 'FULL' && $j('#billing\\:speedy_site_id').val() == false) {
390
+ evtTarget.val('')
391
+ $j('#billing\\:speedy_quarter_id').val('');
392
+ $j('#billing\\:postcode').val('');
393
+ $j('#billing\\:region').val('')
394
+ updateForm();
395
+ } else if (siteName != evtTarget.val() && isFullSiteNomenclature == 'FULL') {
396
 
397
  evtTarget.val('')
398
 
405
 
406
  updateForm();
407
  $j('#billing\\:speedy_site_id').val('')
408
+ $j('#billing\\:postcode').val('')
409
  } else {
410
  // updateForm(true);
411
  }
420
  }
421
 
422
 
423
+
424
  else if (evtTarget.val() != streetName && isFullNomenclature == 'FULL') {
425
  evtTarget.val('')
426
  $j('#billing\\:speedy_street_id').val('');
452
  }
453
 
454
 
455
+
456
  } else if (evtTarget.attr('id') == 'billing:speedy_office_locator') {
457
 
458
 
490
  }
491
 
492
 
493
+
494
  $j('#billing\\:city,div#billing\\:speedy_normal_address input, div#billing\\:speedy_office_address input').blur(function(evt) {
495
 
496
 
511
  for (var i = 0; i < test.length; i++) {
512
 
513
 
514
+
515
  if (test[i] == isValidAddress || isValidAddress == "") {
516
 
517
  $j('#speedy_address_error').hide();
536
  $j('#billing\\:speedy_office_chooser').change(function(evt) {
537
 
538
 
539
+
540
  if ($j(this).is(':checked')) {
541
  $j('#billing\\:speedy_normal_address').hide().find('input').val('');
542
  $j('#billing\\:speedy_office_address').show().find('input').show();
549
  });
550
 
551
 
552
+
553
  $j('#billing-address-select').change(function(evt) {
554
 
555
  if (!$j(this).val()) {
578
  url: "<?php echo Mage::getUrl("speedyshippingfront/address/getSite"); ?>",
579
  dataType: "json",
580
  data: {
581
+ term: request.term,
582
+ countryid: $j('#billing\\:speedy_country_id').val(),
583
+ countryiso: $j('#billing\\:country_id').val()
584
  },
585
  success: function(data) {
586
 
596
 
597
  $j('#billing\\:speedy_site_id').val(ui.item.value)
598
  $j('#billing\\:postcode').val(ui.item.post_code)
599
+ if ($j('#billing\\:country_id').length != 0 && $j('#billing\\:country_id').val() == 'BG') {
600
+ $j('#billing\\:region').val(ui.item.region);
601
+ }
602
+
603
+ // $j('#billing\\:country_id').val('BG');
604
  siteName = ui.item.label;
605
  if (ui.item.is_full_nomenclature == 'NO') {
606
  isFullNomenclature = 'NO';
659
 
660
 
661
 
662
+
663
+
664
  $j('#billing\\:speedy_quarter_name').autocomplete({
665
  source: function(request, response) {
666
 
669
  dataType: "json",
670
  data: {
671
  term: request.term,
672
+ cityid: $j('#billing\\:speedy_site_id').val(),
673
+ countryiso: $j('#billing\\:country_id').val()
674
  },
675
  success: function(data) {
676
  response(data);
693
  dataType: "json",
694
  data: {
695
  term: request.term,
696
+ cityid: $j('#billing\\:speedy_site_id').val(),
697
+ countryiso: $j('#billing\\:country_id').val()
698
  },
699
  success: function(data) {
700
  response(data);
710
  }});
711
 
712
 
713
+
714
  $j('#billing\\:speedy_block_number').autocomplete({
715
  source: function(request, response) {
716
 
719
  dataType: "json",
720
  data: {
721
  term: request.term,
722
+ cityid: $j('#billing\\:speedy_site_id').val(),
723
+ countryiso: $j('#billing\\:country_id').val()
724
  },
725
  success: function(data) {
726
  response(data);
734
  return false;
735
  }});
736
 
737
+ $j('#billing\\:region').autocomplete({
738
+ source: function(request, response) {
739
+
740
+ $j.ajax({
741
+ url: "<?php echo Mage::getUrl("speedyshippingfront/address/getStates"); ?>",
742
+ dataType: "json",
743
+ data: {
744
+ term: request.term,
745
+ countryid: $j('#billing\\:speedy_country_id').val(),
746
+ countryiso: $j('#billing\\:country_id').val(),
747
+ },
748
+ success: function(data) {
749
+ response(data);
750
+ }
751
+ });
752
+ }
753
+ , response: function(event, ui) {
754
+ $j(this).autocomplete("option", "disabled", false);
755
+
756
+ }
757
+
758
+ , minLength: 0
759
+ , select: function(event, ui) {
760
+ $j(this).val(ui.item.label);
761
+ $j('#billing\\:speedy_state_id').val(ui.item.value);
762
+
763
+ return false;
764
+ }});
765
+
766
  function initSiteData(jsonResponse) {
767
  $j('#billing\\:speedy_site_id').val(jsonResponse.item.site_id)
768
  $j('#billing\\:postcode').val(jsonResponse.item.post_code)
797
  }
798
 
799
 
800
+
801
  }
802
 
803
 
805
 
806
 
807
 
808
+
809
+
810
  function validateAddress() {
811
  $j('div#speedyBillingError').hide();
812
  //evt.preventDefault();
829
  var speedy_office_id = $j(prefix + 'speedy_office_id').val();
830
 
831
 
832
+
833
  var isBillingSameAsShipping = $j('#billing\\:use_for_shipping_yes').is(':checked');
834
  var isNewAddress = $j('#billing-address-select').val();
835
 
836
  var isValid = 0;
837
 
838
  if (!isNewAddress) {
839
+ if ($j('#billing\\:country_id').length != 0 && $j('#billing\\:country_id').val() == 'BG') {
840
+ if (quarter || quarter_id) {
841
+ if ((street && number) || blockNo || number) {
842
+ isValid = true;
843
+ }
844
 
845
+ } else if (speedy_pick_from_office && speedy_office_name && speedy_office_id) {
846
  isValid = true;
847
+ } else if ((street || street_id)) {
848
+ if (number || blockNo) {
849
+ isValid = true;
850
+ }
 
 
851
 
852
+ } else if (address_note && address_note.length > 4) {
853
  isValid = true;
854
  }
855
+ } else {
 
856
  isValid = true;
857
+ return true;
858
  }
859
 
860
  if (isValid) {
937
  var isBillingSameForShipping = $j('#billing\\:use_for_shipping_yes').is(':checked');
938
 
939
 
940
+
941
  if (isNewBillingAddress && isBillingSameForShipping) {
942
 
943
  isShippingFullNomenclature = isFullNomenclature;
950
  $j('div#speedyBillingError').hide();
951
  evt.preventDefault();
952
 
 
953
  var isValid = validateAddress();
954
 
955
  if (isValid) {
975
  })
976
 
977
 
978
+
979
  function updateForm(enable) {
980
 
981
  if (enable) {
1013
 
1014
  })
1015
  </script>
1016
+
1017
+ <script>
1018
+ $j(document).ready(function () {
1019
+ function enableSiteAutocomplete() {
1020
+ $j("#billing\\:city").autocomplete("option", "disabled", false);
1021
+ }
1022
+
1023
+ function disableSiteAutocomplete() {
1024
+ $j("#billing\\:city").autocomplete("option", "disabled", true);
1025
+ }
1026
+
1027
+ $j('#billing\\:country_id').change(function () {
1028
+ if ($j(this).val() == 'BG') {
1029
+ $j('.non_bg_field').hide();
1030
+ $j('.bg_field').show();
1031
+ } else {
1032
+ if ($j('#billing\\:speedy_office_chooser').is(':checked')) {
1033
+ $j('#billing\\:speedy_office_chooser').attr('checked', false);
1034
+ $j('#billing\\:speedy_office_chooser').trigger('change');
1035
+ }
1036
+
1037
+ $j('.bg_field').hide();
1038
+ $j('.non_bg_field').show();
1039
+ $j('div#billing\\:speedy_normal_address input, #billing\\:speedy_office_address input').attr('disabled', false).val('');
1040
+ }
1041
+
1042
+ $j('#billing\\:speedy_site_id, #billing\\:city, #billing\\:postcode, #billing\\:region, #billing\\:speedy_state_id').val('');
1043
+
1044
+ $j.ajax({
1045
+ url: "<?php echo Mage::getUrl("speedyshippingfront/address/getCountries"); ?>",
1046
+ dataType: "json",
1047
+ async: false,
1048
+ data: {
1049
+ countryiso: $j('#billing\\:country_id').val()
1050
+ },
1051
+ success: function(data) {
1052
+ if (data && data.hasOwnProperty($j('#billing\\:country_id').val())) {
1053
+ if (data[$j('#billing\\:country_id').val()].hasOwnProperty('id')) {
1054
+ $j('#billing\\:speedy_country_id').val(data[$j('#billing\\:country_id').val()].id);
1055
+ }
1056
+
1057
+ if (data[$j('#billing\\:country_id').val()].hasOwnProperty('active_currency_code')) {
1058
+ $j('#billing\\:active_currency_code').val(data[$j('#billing\\:country_id').val()].active_currency_code);
1059
+ }
1060
+
1061
+ if (data[$j('#billing\\:country_id').val()].hasOwnProperty('is_full_nomenclature')) {
1062
+ if(!data[$j('#billing\\:country_id').val()].is_full_nomenclature) {
1063
+ isFullSiteNomenclature = 'NO';
1064
+ disableSiteAutocomplete();
1065
+ } else if (data[$j('#billing\\:country_id').val()].is_full_nomenclature == 2) {
1066
+ isFullSiteNomenclature = 'PARTIAL';
1067
+ enableSiteAutocomplete();
1068
+ } else {
1069
+ isFullSiteNomenclature = 'FULL';
1070
+ enableSiteAutocomplete();
1071
+ }
1072
+ }
1073
+
1074
+ if (data[$j('#billing\\:country_id').val()].hasOwnProperty('required_state')) {
1075
+ state_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>';
1076
+ if (data[$j('#billing\\:country_id').val()].required_state) {
1077
+ if (!$j('label[for=billing\\:region]').hasClass('required')) {
1078
+ $j('label[for=billing\\:region]').addClass('required');
1079
+ $j('label[for=billing\\:region]').find('em').show();
1080
+ }
1081
+
1082
+ if (!$j('#billing\\:region').hasClass(state_req)) {
1083
+ $j('#billing\\:region').addClass(state_req);
1084
+ }
1085
+ if (!$j('#billing\\:speedy_state_id').hasClass('required')) {
1086
+ $j('#billing\\:speedy_state_id').addClass('required');
1087
+ }
1088
+ } else {
1089
+ $j('label[for=billing\\:region]').removeClass('required');
1090
+ $j('label[for=billing\\:region]').find('em').hide();
1091
+ $j('#billing\\:region').removeClass(state_req);
1092
+ $j('#billing\\:speedy_state_id').removeClass('required');
1093
+ }
1094
+ }
1095
+
1096
+ if (data[$j('#billing\\:country_id').val()].hasOwnProperty('required_postcode')) {
1097
+ postcode_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>';
1098
+ if (data[$j('#billing\\:country_id').val()].required_postcode) {
1099
+ if (!$j('label[for=billing\\:postcode]').hasClass('required')) {
1100
+ $j('label[for=billing\\:postcode]').addClass('required');
1101
+ $j('label[for=billing\\:postcode]').find('em').show();
1102
+ }
1103
+
1104
+ if (!$j('#billing\\:postcode').hasClass(postcode_req)) {
1105
+ $j('#billing\\:postcode').addClass(postcode_req);
1106
+ }
1107
+ } else {
1108
+ $j('label[for=billing\\:postcode]').removeClass('required');
1109
+ $j('label[for=billing\\:postcode]').find('em').hide();
1110
+ $j('#billing\\:postcode').removeClass(postcode_req);
1111
+ }
1112
+ }
1113
+ }
1114
+ }
1115
+ });
1116
+ });
1117
+
1118
+ if ($j('#billing\\:country_id').length != 0) {
1119
+ $j('#billing\\:country_id').trigger('change');
1120
+ }
1121
+
1122
+ $j('#billing-new-address-form input').keypress(function(event){
1123
+ if ($j('#billing\\:country_id').val() != 'BG' && event.key.match(/[а-яА-я]/)) {
1124
+ event.preventDefault();
1125
+ alert('<?php echo $this->__('Please, use only latin characters!') ?>');
1126
+ }
1127
+ });
1128
+
1129
+ $j('#billing-new-address-form input:text').focusout(function(event){
1130
+ speedy_clear_input($j(this));
1131
+ });
1132
+
1133
+ $j('#billing-new-address-form input:text').each(function(index) {
1134
+ speedy_clear_input($j(this));
1135
+ });
1136
+
1137
+ function speedy_clear_input(element) {
1138
+ if ($j('#billing\\:country_id').val() != 'BG' && element.val().match(/[а-яА-я]/)) {
1139
+ alert('<?php echo $this->__('Please, use only latin characters!') ?>');
1140
+ element.val('');
1141
+ }
1142
+ }
1143
+ });
1144
+ </script>
1145
+ <style>
1146
+ .bg_field {
1147
+ display: none;
1148
+ }
1149
+ </style>
app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/shipping.phtml CHANGED
@@ -47,6 +47,16 @@
47
  </div>
48
  </li>
49
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
50
  <li class="wide">
51
  <div class="field">
52
  <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
@@ -55,7 +65,33 @@
55
  <input type="hidden" name="shipping[speedy_site_id]" id="shipping:speedy_site_id" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedySiteId()) ?>" />
56
  </div>
57
  </div>
58
- <li class="fields">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  <label for=""><?php echo $this->__("Choose Speedy office") ?></label>
60
  <div class="field">
61
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
@@ -65,7 +101,7 @@
65
  <?php endif; ?>
66
  </div>
67
  </li>
68
- <li>
69
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
70
  <div id="shipping:speedy_office_address">
71
  <?php else: ?>
@@ -93,7 +129,7 @@
93
 
94
  </ul>
95
  </div>
96
-
97
  <li>
98
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
99
 
@@ -103,7 +139,7 @@
103
 
104
  <?php endif; ?>
105
  <ul>
106
- <li class="wide">
107
  <div class="field">
108
 
109
  <label for="shipping:speedy_quarter_name"><?php echo $this->__('Quarter') ?></label>
@@ -115,20 +151,26 @@
115
  </li>
116
  <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
117
  <li class="wide">
118
- <label for="speedy_street"><?php echo $this->__('speedy street name'); ?></label>
119
- <div class="input-box">
120
  <input type="text" name="shipping[speedy_street_name]" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedyStreetName()) ?>" id="shipping:speedy_street" class="input-text" />
121
  </div>
122
- <div class="street_holder" style="display: none">
123
- <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
 
 
 
 
 
 
124
  <div class="input-box">
125
- <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
126
  </div>
127
  </div>
128
  </li>
129
 
130
 
131
- <li class="fields">
132
  <div class="field">
133
  <label for="speedy_street_number"><?php echo $this->__('Street Number') ?></label>
134
  <div class="input-box">
@@ -141,8 +183,9 @@
141
  <input type="text" class="input-text" name="shipping[speedy_block_number]" id="shipping:speedy_block_number" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyBlockNumber()) ?>" /></div>
142
  </div>
143
 
 
144
  </li>
145
- <li class="fields">
146
  <div class="field">
147
  <label for=""><?php echo $this->__("Entrance") ?></label>
148
  <div class="input-box">
@@ -154,14 +197,14 @@
154
  <input type="text" name="shipping[speedy_floor]" id="shipping:speedy_floor" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyFloor()) ?>"/></div>
155
  </div>
156
  </li>
157
- <li class="fields">
158
  <div class="field">
159
  <label for=""><?php echo $this->__("Apartment") ?></label>
160
  <div class="input-box">
161
  <input type="text" name="shipping[speedy_apartment]" id="shipping:speedy_apartment" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyApartment()) ?>" /></div>
162
  </div>
163
  </li>
164
- <li class="wide">
165
  <div class="field">
166
  <label for=""><?php echo $this->__("Address note") ?></label>
167
  <div class="input-box">
@@ -180,37 +223,6 @@
180
  </div>
181
  </li>
182
  <?php endif; ?>
183
- <li class="fields">
184
-
185
- <div class="field">
186
- <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
187
- <div class="input-box">
188
- <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
189
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
190
- </select>
191
- <script type="text/javascript">
192
- //<![CDATA[
193
- $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
194
- //]]>
195
- </script>
196
- <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
197
- </div>
198
- </div>
199
- </li>
200
- <li class="fields">
201
- <div class="field">
202
- <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
203
- <div class="input-box">
204
- <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
205
- </div>
206
- </div>
207
- <div class="field">
208
- <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
209
- <div class="input-box">
210
- <?php echo $this->getCountryHtmlSelect('shipping') ?>
211
- </div>
212
- </div>
213
- </li>
214
  <li class="fields">
215
  <div class="field">
216
  <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
@@ -232,6 +244,7 @@
232
  <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
233
  <?php endif; ?>
234
 
 
235
  </fieldset>
236
  </li>
237
  <li class="control" id="sameBillingBox">
@@ -259,11 +272,23 @@
259
  //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
260
  $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
261
 
262
- var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
 
 
 
 
 
 
 
 
 
 
 
263
  //]]>
264
 
265
 
266
  var isShippingFullNomenclature = 0;
 
267
 
268
  $j('document').ready(function() {
269
 
@@ -291,57 +316,60 @@
291
  var officeName = '';
292
 
293
 
294
- function initFields() {
295
 
296
- if ($j('#billing\\:speedy_quarter_name').val() != '') {
297
- quarterName = $j('#billing\\:speedy_quarter_name').val();
298
  }
299
 
300
 
301
- if ($j('#billing\\:street_1').val() != '') {
302
- streetName = $j('#billing\\:street_1').val();
303
  }
304
 
305
 
306
- if ($j('#billing\\:speedy_block_number').val() != '') {
307
- blokName = $j('#billing\\:speedy_block_number').val();
308
  }
309
 
310
- if ($j('#billing\\:speedy_office_locator').val() != '') {
311
- officeName = $j('#billing\\:speedy_office_locator').val();
312
  }
313
  }
314
 
315
 
316
 
317
- initFields();
318
 
319
 
320
- function checkFields(evt) {
321
  var evtTarget = $j(evt.target);
322
 
323
- if (evtTarget.attr('id') == 'shipping:city') {
324
 
325
- if (siteName != evtTarget.val()) {
326
 
 
327
  evtTarget.val('')
328
-
329
- $j('#shipping\\:speedy_site_id').val('')
330
  $j('#shipping\\:postcode').val('');
331
  $j('#shipping\\:region').val('')
332
  updateShippingForm();
333
- $j('#shipping\\:speedy_normal_address').show();
334
- $j('#shipping\\:speedy_office_address').hide();
335
 
 
336
 
 
 
 
 
 
337
  } else if (evtTarget.val() == "") {
 
338
  updateShippingForm();
339
- $j('#shipping\\:speedy_normal_address').show();
340
- $j('#shipping\\:speedy_office_address').hide();
341
  $j('#shipping\\:speedy_site_id').val('')
342
- $j('#zip').val('')
343
  } else {
344
- // updateForm(true);
345
  }
346
  }
347
 
@@ -424,7 +452,7 @@
424
 
425
  $j('#shipping\\:city,div#shipping\\:speedy_normal_address input, div#shipping\\:speedy_office_address input').change(function(evt) {
426
 
427
- checkFields(evt);
428
  synchronizeSameAddress();
429
 
430
  })
@@ -434,6 +462,7 @@
434
  $j('#opc-shipping div.step-title').click(function(evt) {
435
 
436
 
 
437
  checkShippingAddress();
438
  })
439
 
@@ -452,6 +481,7 @@
452
  }
453
 
454
 
 
455
  }
456
 
457
  if (showShippingError) {
@@ -494,6 +524,12 @@
494
 
495
 
496
 
 
 
 
 
 
 
497
  $j('#shipping\\:city').autocomplete({
498
  source: function(request, response) {
499
 
@@ -501,7 +537,9 @@
501
  url: "<?php echo Mage::getUrl("speedyshippingfront/address/getSite"); ?>",
502
  dataType: "json",
503
  data: {
504
- term: request.term
 
 
505
  },
506
  success: function(data) {
507
  response(data);
@@ -516,7 +554,7 @@
516
  $j('#shipping\\:speedy_site_id').val(ui.item.value)
517
  $j('#shipping\\:postcode').val(ui.item.post_code)
518
  $j('#shipping\\:region').val(ui.item.region)
519
- $j('#shipping\\:country_id').val('BG');
520
  siteName = ui.item.label;
521
  if (ui.item.is_full_nomenclature == 'NO') {
522
  isShippingFullNomenclature = 'NO'
@@ -578,7 +616,8 @@
578
  dataType: "json",
579
  data: {
580
  term: request.term,
581
- cityid: $j('#shipping\\:speedy_site_id').val()
 
582
  },
583
  success: function(data) {
584
  response(data);
@@ -601,7 +640,8 @@
601
  dataType: "json",
602
  data: {
603
  term: request.term,
604
- cityid: $j('#shipping\\:speedy_site_id').val()
 
605
  },
606
  success: function(data) {
607
  response(data);
@@ -624,7 +664,8 @@
624
  dataType: "json",
625
  data: {
626
  term: request.term,
627
- cityid: $j('#shipping\\:speedy_site_id').val()
 
628
  },
629
  success: function(data) {
630
  response(data);
@@ -637,9 +678,41 @@
637
 
638
  return false;
639
  }});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  }
641
 
642
 
 
 
643
  function initShippingSiteData(jsonResponse) {
644
  $j('#shipping\\:speedy_site_id').val(jsonResponse.item.site_id)
645
  $j('#shipping\\:postcode').val(jsonResponse.item.post_code)
@@ -662,7 +735,7 @@
662
  }
663
 
664
 
665
- function validateAddress() {
666
  $j('div#speedyShippingError').hide();
667
  var prefix = ' #shipping\\:';
668
  var quarter = $j(prefix + 'speedy_quarter_name').val();
@@ -686,29 +759,33 @@
686
  var isValidTest = null;
687
 
688
  if (!isNewAddress) {
 
 
 
 
 
 
689
 
690
- if (quarter != false || quarter_id != false) {
691
- if ((street && number) || blockNo || number) {
692
 
693
  isValidTest = 1;
694
- }
695
 
696
- } else if (speedy_pick_from_office != false && speedy_office_name != false && speedy_office_id != false) {
697
 
698
- isValidTest = 1;
 
 
699
 
 
700
 
701
- }
702
- else if ((street != false || street_id != false)) {
703
- if (number != false || blockNo != false) {
704
 
705
- isValidTest = 1;
706
 
 
707
  }
708
-
709
- } else if (address_note != false && address_note.length > 4) {
710
-
711
- isValidTest = 1;
712
  }
713
  } else {
714
  $j('#shipping\\:street1').val(quarter + street + number + blockNo + entrance + floor_no + apartment + address_note);
@@ -818,6 +895,7 @@
818
  })
819
 
820
 
 
821
  function enableAutocomplete() {
822
  $j("#shipping\\:speedy_quarter_name, \n\
823
  #shipping\\:speedy_street,\n\
@@ -834,7 +912,7 @@
834
  $j('div#speedyShippingError').hide();
835
  evt.preventDefault();
836
 
837
- var isValid = validateAddress();
838
 
839
  if (isValid) {
840
  shipping.save();
@@ -883,3 +961,137 @@
883
 
884
 
885
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  </div>
48
  </li>
49
  <?php endif; ?>
50
+ <li class="wide">
51
+ <div class="field">
52
+ <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
53
+ <input type="hidden" id="shipping:speedy_country_id" name="shipping[speedy_country_id]" value="" />
54
+ <input type="hidden" id="shipping:active_currency_code" name="shipping[active_currency_code]" value="" />
55
+ <div class="input-box">
56
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
57
+ </div>
58
+ </div>
59
+ </li>
60
  <li class="wide">
61
  <div class="field">
62
  <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
65
  <input type="hidden" name="shipping[speedy_site_id]" id="shipping:speedy_site_id" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedySiteId()) ?>" />
66
  </div>
67
  </div>
68
+ </li>
69
+ <li class="wide">
70
+ <div class="field">
71
+ <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
72
+ <div class="input-box">
73
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
74
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
75
+ </select>
76
+ <script type="text/javascript">
77
+ //<![CDATA[
78
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
79
+ //]]>
80
+ </script>
81
+ <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" />
82
+ <input type="hidden" id="shipping:speedy_state_id" name="shipping[speedy_state_id]" value="" />
83
+ </div>
84
+ </div>
85
+ </li>
86
+ <li class="wide">
87
+ <div class="field">
88
+ <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
89
+ <div class="input-box">
90
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
91
+ </div>
92
+ </div>
93
+ </li>
94
+ <li class="fields bg_field_shipping">
95
  <label for=""><?php echo $this->__("Choose Speedy office") ?></label>
96
  <div class="field">
97
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
101
  <?php endif; ?>
102
  </div>
103
  </li>
104
+ <li class="bg_field_shipping">
105
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
106
  <div id="shipping:speedy_office_address">
107
  <?php else: ?>
129
 
130
  </ul>
131
  </div>
132
+ </li>
133
  <li>
134
  <?php if ($this->getAddress()->getSpeedyOfficeId()): ?>
135
 
139
 
140
  <?php endif; ?>
141
  <ul>
142
+ <li class="wide bg_field_shipping">
143
  <div class="field">
144
 
145
  <label for="shipping:speedy_quarter_name"><?php echo $this->__('Quarter') ?></label>
151
  </li>
152
  <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
153
  <li class="wide">
154
+ <label for="speedy_street" class="bg_field_shipping"><?php echo $this->__('speedy street name'); ?></label>
155
+ <div class="input-box bg_field_shipping">
156
  <input type="text" name="shipping[speedy_street_name]" value="<?php echo $this->escapeHtml($this->getAddress()->getSpeedyStreetName()) ?>" id="shipping:speedy_street" class="input-text" />
157
  </div>
158
+ <div class="street_holder non_bg_field_shipping" style="display: none">
159
+ <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
160
+ <div class="input-box">
161
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" onchange="shipping.setSameAsBilling(false);" />
162
+ </div>
163
+ </div>
164
+ <div class="street_holder non_bg_field_shipping" style="display: none">
165
+ <label for="shipping:street2"><?php echo $this->__('Street Address 2') ?></label>
166
  <div class="input-box">
167
+ <input type="text" title="<?php echo $this->__('Street Address 2') ?>" name="shipping[street][]" id="shipping:street2" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(2)) ?>" class="input-text" onchange="shipping.setSameAsBilling(false);" />
168
  </div>
169
  </div>
170
  </li>
171
 
172
 
173
+ <li class="fields bg_field_shipping">
174
  <div class="field">
175
  <label for="speedy_street_number"><?php echo $this->__('Street Number') ?></label>
176
  <div class="input-box">
183
  <input type="text" class="input-text" name="shipping[speedy_block_number]" id="shipping:speedy_block_number" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyBlockNumber()) ?>" /></div>
184
  </div>
185
 
186
+
187
  </li>
188
+ <li class="fields bg_field_shipping">
189
  <div class="field">
190
  <label for=""><?php echo $this->__("Entrance") ?></label>
191
  <div class="input-box">
197
  <input type="text" name="shipping[speedy_floor]" id="shipping:speedy_floor" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyFloor()) ?>"/></div>
198
  </div>
199
  </li>
200
+ <li class="fields bg_field_shipping">
201
  <div class="field">
202
  <label for=""><?php echo $this->__("Apartment") ?></label>
203
  <div class="input-box">
204
  <input type="text" name="shipping[speedy_apartment]" id="shipping:speedy_apartment" class="input-text" value="<?php echo $this->htmlEscape($this->getAddress()->getSpeedyApartment()) ?>" /></div>
205
  </div>
206
  </li>
207
+ <li class="wide bg_field_shipping">
208
  <div class="field">
209
  <label for=""><?php echo $this->__("Address note") ?></label>
210
  <div class="input-box">
223
  </div>
224
  </li>
225
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  <li class="fields">
227
  <div class="field">
228
  <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
244
  <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
245
  <?php endif; ?>
246
 
247
+
248
  </fieldset>
249
  </li>
250
  <li class="control" id="sameBillingBox">
272
  //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
273
  $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
274
 
275
+ <?php
276
+ $json_regions = json_decode($this->helper('directory')->getRegionJson());
277
+ if ($json_regions) {
278
+ $regionConfig = new StdClass();
279
+ $regionConfig->config = $json_regions->config;
280
+ $new_region_objects = json_encode($regionConfig);
281
+ } else {
282
+ $new_region_objects = $this->helper('directory')->getRegionJson();
283
+ }
284
+ ?>
285
+
286
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $new_region_objects ?>, undefined, 'shipping:postcode');
287
  //]]>
288
 
289
 
290
  var isShippingFullNomenclature = 0;
291
+ var isShippingFullSiteNomenclature = 0;
292
 
293
  $j('document').ready(function() {
294
 
316
  var officeName = '';
317
 
318
 
319
+ function initShippingFields() {
320
 
321
+ if ($j('#shipping\\:speedy_quarter_name').val() != '') {
322
+ quarterName = $j('#shipping\\:speedy_quarter_name').val();
323
  }
324
 
325
 
326
+ if ($j('#shipping\\:street_1').val() != '') {
327
+ streetName = $j('#shipping\\:street_1').val();
328
  }
329
 
330
 
331
+ if ($j('#shipping\\:speedy_block_number').val() != '') {
332
+ blokName = $j('#shipping\\:speedy_block_number').val();
333
  }
334
 
335
+ if ($j('#shipping\\:speedy_office_locator').val() != '') {
336
+ officeName = $j('#shipping\\:speedy_office_locator').val();
337
  }
338
  }
339
 
340
 
341
 
342
+ initShippingFields();
343
 
344
 
345
+ function checkShippingFields(evt) {
346
  var evtTarget = $j(evt.target);
347
 
 
348
 
349
+ if (evtTarget.attr('id') == 'shipping:city') {
350
 
351
+ if (isShippingFullSiteNomenclature == 'FULL' && $j('#shipping\\:speedy_site_id').val() == false) {
352
  evtTarget.val('')
353
+ $j('#shipping\\:speedy_quarter_id').val('');
 
354
  $j('#shipping\\:postcode').val('');
355
  $j('#shipping\\:region').val('')
356
  updateShippingForm();
357
+ } else if (siteName != evtTarget.val() && isShippingFullSiteNomenclature == 'FULL') {
 
358
 
359
+ evtTarget.val('')
360
 
361
+ // $j('#shipping\\:speedy_office_chooser').removeAttr('checked');
362
+ $j('#shipping\\:speedy_site_id').val('');
363
+ $j('#shipping\\:postcode').val('');
364
+ $j('#shipping\\:region').val('')
365
+ updateShippingForm();
366
  } else if (evtTarget.val() == "") {
367
+
368
  updateShippingForm();
 
 
369
  $j('#shipping\\:speedy_site_id').val('')
370
+ $j('#shipping\\:postcode').val('')
371
  } else {
372
+ // updateShippingForm(true);
373
  }
374
  }
375
 
452
 
453
  $j('#shipping\\:city,div#shipping\\:speedy_normal_address input, div#shipping\\:speedy_office_address input').change(function(evt) {
454
 
455
+ checkShippingFields(evt);
456
  synchronizeSameAddress();
457
 
458
  })
462
  $j('#opc-shipping div.step-title').click(function(evt) {
463
 
464
 
465
+
466
  checkShippingAddress();
467
  })
468
 
481
  }
482
 
483
 
484
+
485
  }
486
 
487
  if (showShippingError) {
524
 
525
 
526
 
527
+
528
+
529
+
530
+
531
+
532
+
533
  $j('#shipping\\:city').autocomplete({
534
  source: function(request, response) {
535
 
537
  url: "<?php echo Mage::getUrl("speedyshippingfront/address/getSite"); ?>",
538
  dataType: "json",
539
  data: {
540
+ term: request.term,
541
+ countryid: $j('#shipping\\:speedy_country_id').val(),
542
+ countryiso: $j('#shipping\\:country_id').val()
543
  },
544
  success: function(data) {
545
  response(data);
554
  $j('#shipping\\:speedy_site_id').val(ui.item.value)
555
  $j('#shipping\\:postcode').val(ui.item.post_code)
556
  $j('#shipping\\:region').val(ui.item.region)
557
+ // $j('#shipping\\:country_id').val('BG');
558
  siteName = ui.item.label;
559
  if (ui.item.is_full_nomenclature == 'NO') {
560
  isShippingFullNomenclature = 'NO'
616
  dataType: "json",
617
  data: {
618
  term: request.term,
619
+ cityid: $j('#shipping\\:speedy_site_id').val(),
620
+ countryiso: $j('#shipping\\:country_id').val()
621
  },
622
  success: function(data) {
623
  response(data);
640
  dataType: "json",
641
  data: {
642
  term: request.term,
643
+ cityid: $j('#shipping\\:speedy_site_id').val(),
644
+ countryiso: $j('#shipping\\:country_id').val()
645
  },
646
  success: function(data) {
647
  response(data);
664
  dataType: "json",
665
  data: {
666
  term: request.term,
667
+ cityid: $j('#shipping\\:speedy_site_id').val(),
668
+ countryiso: $j('#shipping\\:country_id').val()
669
  },
670
  success: function(data) {
671
  response(data);
678
 
679
  return false;
680
  }});
681
+
682
+ $j('#shipping\\:region').autocomplete({
683
+ source: function(request, response) {
684
+
685
+ $j.ajax({
686
+ url: "<?php echo Mage::getUrl("speedyshippingfront/address/getStates"); ?>",
687
+ dataType: "json",
688
+ data: {
689
+ term: request.term,
690
+ countryid: $j('#shipping\\:speedy_country_id').val(),
691
+ countryiso: $j('#shipping\\:country_id').val(),
692
+ },
693
+ success: function(data) {
694
+ response(data);
695
+ }
696
+ });
697
+ }
698
+ , response: function(event, ui) {
699
+ $j(this).autocomplete("option", "disabled", false);
700
+
701
+ }
702
+
703
+ , minLength: 0
704
+ , select: function(event, ui) {
705
+ $j(this).val(ui.item.label);
706
+ $j('#shipping\\:speedy_state_id').val(ui.item.value);
707
+
708
+ return false;
709
+ }});
710
+
711
  }
712
 
713
 
714
+
715
+
716
  function initShippingSiteData(jsonResponse) {
717
  $j('#shipping\\:speedy_site_id').val(jsonResponse.item.site_id)
718
  $j('#shipping\\:postcode').val(jsonResponse.item.post_code)
735
  }
736
 
737
 
738
+ function validateShippingAddress() {
739
  $j('div#speedyShippingError').hide();
740
  var prefix = ' #shipping\\:';
741
  var quarter = $j(prefix + 'speedy_quarter_name').val();
759
  var isValidTest = null;
760
 
761
  if (!isNewAddress) {
762
+ if ($j('#shipping\\:country_id').length != 0 && $j('#shipping\\:country_id').val() == 'BG') {
763
+ if (quarter != false || quarter_id != false) {
764
+ if ((street && number) || blockNo || number) {
765
+
766
+ isValidTest = 1;
767
+ }
768
 
769
+ } else if (speedy_pick_from_office != false && speedy_office_name != false && speedy_office_id != false) {
 
770
 
771
  isValidTest = 1;
 
772
 
 
773
 
774
+ }
775
+ else if ((street != false || street_id != false)) {
776
+ if (number != false || blockNo != false) {
777
 
778
+ isValidTest = 1;
779
 
780
+ }
 
 
781
 
782
+ } else if (address_note != false && address_note.length > 4) {
783
 
784
+ isValidTest = 1;
785
  }
786
+ } else {
787
+ isValidTest = true;
788
+ return true;
 
789
  }
790
  } else {
791
  $j('#shipping\\:street1').val(quarter + street + number + blockNo + entrance + floor_no + apartment + address_note);
895
  })
896
 
897
 
898
+
899
  function enableAutocomplete() {
900
  $j("#shipping\\:speedy_quarter_name, \n\
901
  #shipping\\:speedy_street,\n\
912
  $j('div#speedyShippingError').hide();
913
  evt.preventDefault();
914
 
915
+ var isValid = validateShippingAddress();
916
 
917
  if (isValid) {
918
  shipping.save();
961
 
962
 
963
  </script>
964
+
965
+ <script>
966
+ $j(document).ready(function () {
967
+ function enableSiteShippingAutocomplete() {
968
+ $j("#shipping\\:city").autocomplete("option", "disabled", false);
969
+ }
970
+
971
+ function disableSiteShippingAutocomplete() {
972
+ $j("#shipping\\:city").autocomplete("option", "disabled", true);
973
+ }
974
+
975
+ $j('#shipping\\:country_id').change(function () {
976
+ if ($j(this).val() == 'BG') {
977
+ $j('.non_bg_field_shipping').hide();
978
+ $j('.bg_field_shipping').show();
979
+ } else {
980
+ if ($j('#shipping\\:speedy_office_chooser').is(':checked')) {
981
+ $j('#shipping\\:speedy_office_chooser').attr('checked', false);
982
+ $j('#shipping\\:speedy_office_chooser').trigger('change');
983
+ }
984
+
985
+ $j('.bg_field_shipping').hide();
986
+ $j('.non_bg_field_shipping').show();
987
+ $j('div#shipping\\:speedy_normal_address input, #shipping\\:speedy_office_address input').attr('disabled', false).val('');
988
+ }
989
+
990
+ $j('#shipping\\:speedy_site_id, #shipping\\:city, #shipping\\:postcode, #shipping\\:region, #shipping\\:speedy_state_id').val('');
991
+
992
+ $j.ajax({
993
+ url: "<?php echo Mage::getUrl("speedyshippingfront/address/getCountries"); ?>",
994
+ dataType: "json",
995
+ async: false,
996
+ data: {
997
+ countryiso: $j('#shipping\\:country_id').val()
998
+ },
999
+ success: function(data) {
1000
+ if (data && data.hasOwnProperty($j('#shipping\\:country_id').val())) {
1001
+ if (data[$j('#shipping\\:country_id').val()].hasOwnProperty('id')) {
1002
+ $j('#shipping\\:speedy_country_id').val(data[$j('#shipping\\:country_id').val()].id);
1003
+ }
1004
+
1005
+ if (data[$j('#shipping\\:country_id').val()].hasOwnProperty('active_currency_code')) {
1006
+ $j('#shipping\\:active_currency_code').val(data[$j('#shipping\\:country_id').val()].active_currency_code);
1007
+ }
1008
+
1009
+ if (data[$j('#shipping\\:country_id').val()].hasOwnProperty('is_full_nomenclature')) {
1010
+ if(!data[$j('#shipping\\:country_id').val()].is_full_nomenclature) {
1011
+ isShippingFullSiteNomenclature = 'NO';
1012
+ disableSiteShippingAutocomplete();
1013
+ } else if (data[$j('#shipping\\:country_id').val()].is_full_nomenclature == 2) {
1014
+ isShippingFullSiteNomenclature = 'PARTIAL';
1015
+ enableSiteShippingAutocomplete();
1016
+ } else {
1017
+ isShippingFullSiteNomenclature = 'FULL';
1018
+ enableSiteShippingAutocomplete();
1019
+ }
1020
+ }
1021
+
1022
+ if (data[$j('#shipping\\:country_id').val()].hasOwnProperty('required_state')) {
1023
+ state_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>';
1024
+ if (data[$j('#shipping\\:country_id').val()].required_state) {
1025
+ if (!$j('label[for=shipping\\:region]').hasClass('required')) {
1026
+ $j('label[for=shipping\\:region]').addClass('required');
1027
+ $j('label[for=shipping\\:region]').find('em').show();
1028
+ }
1029
+
1030
+ if (!$j('#shipping\\:region').hasClass(state_req)) {
1031
+ $j('#shipping\\:region').addClass(state_req);
1032
+ }
1033
+ if (!$j('#shipping\\:speedy_state_id').hasClass('required')) {
1034
+ $j('#shipping\\:speedy_state_id').addClass('required');
1035
+ }
1036
+ } else {
1037
+ $j('label[for=shipping\\:region]').removeClass('required');
1038
+ $j('label[for=shipping\\:region]').find('em').hide();
1039
+ $j('#shipping\\:region').removeClass(state_req);
1040
+ $j('#shipping\\:speedy_state_id').removeClass('required');
1041
+ }
1042
+ }
1043
+
1044
+ if (data[$j('#shipping\\:country_id').val()].hasOwnProperty('required_postcode')) {
1045
+ postcode_req = '<?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>';
1046
+ if (data[$j('#shipping\\:country_id').val()].required_postcode) {
1047
+ if (!$j('label[for=shipping\\:postcode]').hasClass('required')) {
1048
+ $j('label[for=shipping\\:postcode]').addClass('required');
1049
+ $j('label[for=shipping\\:postcode]').find('em').show();
1050
+ }
1051
+
1052
+ if (!$j('#shipping\\:postcode').hasClass(postcode_req)) {
1053
+ $j('#shipping\\:postcode').addClass(postcode_req);
1054
+ }
1055
+ } else {
1056
+ $j('label[for=shipping\\:postcode]').removeClass('required');
1057
+ $j('label[for=shipping\\:postcode]').find('em').hide();
1058
+ $j('#shipping\\:postcode').removeClass(postcode_req);
1059
+ }
1060
+ }
1061
+ }
1062
+ }
1063
+ });
1064
+ });
1065
+
1066
+ if ($j('#shipping\\:country_id').length != 0) {
1067
+ $j('#shipping\\:country_id').trigger('change');
1068
+ }
1069
+
1070
+ $j('#shipping-new-address-form input').keypress(function(event){
1071
+ if ($j('#shipping\\:country_id').val() != 'BG' && event.key.match(/[а-яА-я]/)) {
1072
+ event.preventDefault();
1073
+ alert('<?php echo $this->__('Please, use only latin characters!') ?>');
1074
+ }
1075
+ });
1076
+
1077
+ $j('#shipping-new-address-form input:text').focusout(function(event){
1078
+ speedy_clear_input($j(this));
1079
+ });
1080
+
1081
+ $j('#shipping-new-address-form input:text').each(function(index) {
1082
+ speedy_clear_input($j(this));
1083
+ });
1084
+
1085
+ function speedy_clear_input(element) {
1086
+ if ($j('#shipping\\:country_id').val() != 'BG' && element.val().match(/[а-яА-я]/)) {
1087
+ alert('<?php echo $this->__('Please, use only latin characters!') ?>');
1088
+ element.val('');
1089
+ }
1090
+ }
1091
+ });
1092
+ </script>
1093
+ <style>
1094
+ .bg_field_shipping {
1095
+ display: none;
1096
+ }
1097
+ </style>
app/design/frontend/base/default/template/speedy_speedyshipping/checkout/onepage/shipping_method/available.phtml CHANGED
@@ -28,6 +28,7 @@
28
  <?php
29
  $_sole = count($_shippingRateGroups) == 1;
30
  foreach ($_shippingRateGroups as $code => $_rates):
 
31
  ?>
32
  <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
33
  <dd>
@@ -41,6 +42,7 @@
41
  <?php $shippingCodePrice[] = "'" . $_rate->getCode() . "':" . (float) $_rate->getPrice(); ?>
42
  <li>
43
  <?php if ($_rate->getErrorMessage()): ?>
 
44
  <ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
45
  <?php else: ?>
46
  <?php if ($_sole) : ?>
@@ -105,7 +107,7 @@
105
  <?php
106
  $carrier = Mage::getModel('shipping/config')->getCarrierInstance($code);
107
 
108
- if ($carrier->getFormName()) {
109
 
110
  $block = $this->getLayout()->createBlock($carrier->getFormName());
111
  $block->setMethodCode($code);
28
  <?php
29
  $_sole = count($_shippingRateGroups) == 1;
30
  foreach ($_shippingRateGroups as $code => $_rates):
31
+ $_rate_error = false;
32
  ?>
33
  <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
34
  <dd>
42
  <?php $shippingCodePrice[] = "'" . $_rate->getCode() . "':" . (float) $_rate->getPrice(); ?>
43
  <li>
44
  <?php if ($_rate->getErrorMessage()): ?>
45
+ <?php $_rate_error = true; ?>
46
  <ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
47
  <?php else: ?>
48
  <?php if ($_sole) : ?>
107
  <?php
108
  $carrier = Mage::getModel('shipping/config')->getCarrierInstance($code);
109
 
110
+ if ($carrier->getFormName() && !$_rate_error) {
111
 
112
  $block = $this->getLayout()->createBlock($carrier->getFormName());
113
  $block->setMethodCode($code);
app/locale/bg_BG/speedyTranslate.csv CHANGED
@@ -1,4 +1,4 @@
1
- "Insurance","Застраховка на пратката :"
2
  "Middle Name/Initial","Презиме"
3
  "Pick from Speedy Office","Вземи от офис на Спиди?"
4
  "City","Град"
@@ -100,16 +100,19 @@
100
  "postpone_taking_date","Брой дни за отместване на датата за изпращане"
101
  "default_packing","Опаковка по подразбиране"
102
  "default_weight_per_item","Тегло по подразбиране за един брой"
 
 
103
  "label_printer","Принтер за етикети"
104
- "add_insurance_label","Добави застраховка"
105
  "has_fragile_items","Чупливи стоки"
106
- "fragile_label_comment","'Чупливо' може да бъде избрано, само ако е избрана и застраховка "
107
  "send_from_speedy_office","Изпрати от офис"
108
  "choose_sending_office","Избери офис"
109
  "activate_free_shipping","Активирай безплатна доставка"
110
  "minimum_order_amount_for_freeshipping","Праг на стойност на поръчката за безплатна доставка"
111
  "free_city_service","Безплатна градска услуга"
112
  "free_interurban_service","Безплатна междуградска услуга"
 
113
  "does_contain_documents","Съдържа документи"
114
  "Ship to applicable countries","Доставка до избраните държави"
115
  "fixed_hour_delivery","Фиксиран час на доставка"
@@ -126,3 +129,19 @@
126
  "check_credentials_btn_label","Тест на настройките"
127
  "enter_password_reminder","Моля, въведете парола"
128
  "enter_username_reminder","Моля, въведете потребителско име"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Insurance","Обявена стойност на пратката :"
2
  "Middle Name/Initial","Презиме"
3
  "Pick from Speedy Office","Вземи от офис на Спиди?"
4
  "City","Град"
100
  "postpone_taking_date","Брой дни за отместване на датата за изпращане"
101
  "default_packing","Опаковка по подразбиране"
102
  "default_weight_per_item","Тегло по подразбиране за един брой"
103
+ "money_transfer","Паричен превод (вместо наложен платеж)"
104
+ "money_transfer_description","Използвай Пощенски Паричен Превод вместо Наложен платеж при създаване на товарителница."
105
  "label_printer","Принтер за етикети"
106
+ "add_insurance_label","Добави обявена стойност"
107
  "has_fragile_items","Чупливи стоки"
108
+ "fragile_label_comment","'Чупливо' може да бъде избрано, само ако е избрана и обявена стойност"
109
  "send_from_speedy_office","Изпрати от офис"
110
  "choose_sending_office","Избери офис"
111
  "activate_free_shipping","Активирай безплатна доставка"
112
  "minimum_order_amount_for_freeshipping","Праг на стойност на поръчката за безплатна доставка"
113
  "free_city_service","Безплатна градска услуга"
114
  "free_interurban_service","Безплатна междуградска услуга"
115
+ "free_international_service","Безплатна международна услуга"
116
  "does_contain_documents","Съдържа документи"
117
  "Ship to applicable countries","Доставка до избраните държави"
118
  "fixed_hour_delivery","Фиксиран час на доставка"
129
  "check_credentials_btn_label","Тест на настройките"
130
  "enter_password_reminder","Моля, въведете парола"
131
  "enter_username_reminder","Моля, въведете потребителско име"
132
+ "options_before_payment","Опции преди плащане:"
133
+ "No option","Без опция"
134
+ "Test before payment","Теставай преди да платиш (ТПП)"
135
+ "Open before payment","Отвори преди да платиш (ОПП)"
136
+ "table_rate","Цена от файл"
137
+ "csv_format","(CSV формат)"
138
+ "Please select another office or change your shipping address.","Моля, изберете друг офис или променете адреса за доставка."
139
+ "Service ID:","Куриерска Услуга ID:"
140
+ "You can't use Cash on Delivery, the currency %s is missing. Please contact the administrators of the store!","Не може да използвате Наложен платеж, валутата %s лиспва. Моля обърнете се към администраторите на магазина!"
141
+ "invoice_courier_sevice_as_text","Цената за доставка участва във фактурата"
142
+ "invoice_courier_sevice_as_text_description","Настройка, която определя дали куриерска услуга за сметка на получателя се добавя като стойност в стоковата разписка (фактура) или се визуализира със стойност в името на артикула и нулева цена."
143
+ "Please enter a valid postcode","Моля, въведете валиден пощенски код"
144
+ "The currency %s is missing or invalid. Please contact the administrators of the store!","Валутата %s липсва или е невалидна. Моля обърнете се към администраторите на магазина!"
145
+ "The currency %s is missing or invalid.","Валутата %s липсва или е невалидна."
146
+ "Please, use only latin characters!","Моля, използвайте само латински символи!"
147
+ "For this order can not be calculated price. Please contact the administrators of the store!","За тази поръчка не може да бъде калкулиран цена. Моля, обърнете се към администратора на магазина!"
app/locale/en_US/speedyTranslate.csv CHANGED
@@ -1,4 +1,4 @@
1
- "Insurance","Insurance :"
2
  "Pick from Speedy Office","Take from Speedy office?"
3
  "City","City"
4
  "Post Code","Postcode "
@@ -100,16 +100,19 @@
100
  "postpone_taking_date","Days to postpone taking of the shipment"
101
  "default_packing","Default packing"
102
  "default_weight_per_item","Default weight for one item"
 
 
103
  "label_printer","Label printer"
104
- "add_insurance_label","Add insurance"
105
  "has_fragile_items","Fragile items"
106
- "fragile_label_comment","'Fragile items' can be active only if insurance is set"
107
  "send_from_speedy_office","Send from Speedy office"
108
  "choose_sending_office","Choose sending office"
109
  "activate_free_shipping","Activate free shipping"
110
  "minimum_order_amount_for_freeshipping","Minimum order amount for free shipping"
111
  "free_city_service","Free city service"
112
  "free_interurban_service","Free intercity service"
 
113
  "does_contain_documents","Contains documents"
114
  "fixed_hour_delivery","Fixed hour for delivery"
115
  "back_receipt_request","Back receipt request"
@@ -125,3 +128,19 @@
125
  "check_credentials_btn_label","Test account"
126
  "enter_password_reminder","Please, enter your password."
127
  "enter_username_reminder","Please, enter your username"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Insurance","Declared value:"
2
  "Pick from Speedy Office","Take from Speedy office?"
3
  "City","City"
4
  "Post Code","Postcode "
100
  "postpone_taking_date","Days to postpone taking of the shipment"
101
  "default_packing","Default packing"
102
  "default_weight_per_item","Default weight for one item"
103
+ "money_transfer","Money transfer(instead Cash on Delivery)"
104
+ "money_transfer_description","Use Post Money Transfer instead Cash on Delivery at the generation of bill of lading."
105
  "label_printer","Label printer"
106
+ "add_insurance_label","Add declared value"
107
  "has_fragile_items","Fragile items"
108
+ "fragile_label_comment","'Fragile items' can be active only if declared value is set"
109
  "send_from_speedy_office","Send from Speedy office"
110
  "choose_sending_office","Choose sending office"
111
  "activate_free_shipping","Activate free shipping"
112
  "minimum_order_amount_for_freeshipping","Minimum order amount for free shipping"
113
  "free_city_service","Free city service"
114
  "free_interurban_service","Free intercity service"
115
+ "free_international_service","Free international service"
116
  "does_contain_documents","Contains documents"
117
  "fixed_hour_delivery","Fixed hour for delivery"
118
  "back_receipt_request","Back receipt request"
128
  "check_credentials_btn_label","Test account"
129
  "enter_password_reminder","Please, enter your password."
130
  "enter_username_reminder","Please, enter your username"
131
+ "options_before_payment","Options before payment"
132
+ "No option","No option"
133
+ "Test before payment","Test before payment"
134
+ "Open before payment","Open before payment"
135
+ "table_rate","Price from file"
136
+ "csv_format","(CSV format)"
137
+ "Please select another office or change your shipping address.","Please select another office or change your shipping address."
138
+ "Service ID:","Service ID:"
139
+ "You can't use Cash on Delivery, the currency %s is missing. Please contact the administrators of the store!","You can't use Cash on Delivery, the currency %s is missing. Please contact the administrators of the store!"
140
+ "invoice_courier_sevice_as_text","Shipping cost is included in invoice"
141
+ "invoice_courier_sevice_as_text_description","Setting, which determines whether a courier service from the payee is added as a value in the goods receipt (invoice ), or visualize a value in the item name and zero price."
142
+ "Please enter a valid postcode","Please enter a valid postcode"
143
+ "The currency %s is missing or invalid. Please contact the administrators of the store!","The currency %s is missing or invalid. Please contact the administrators of the store!"
144
+ "The currency %s is missing or invalid.","The currency %s is missing or invalid."
145
+ "Please, use only latin characters!","Please, use only latin characters!"
146
+ "For this order can not be calculated price. Please contact the administrators of the store!","For this order can not be calculated price. Please contact the administrators of the store!"
lib/SpeedyEPS/ver01/EPSFacade.class.php CHANGED
@@ -1,985 +1,1015 @@
1
- <?php
2
-
3
- require_once 'ClientException.class.php';
4
- require_once 'EPSInterface.class.php';
5
-
6
- /**
7
- * Speedy EPS Service
8
- */
9
- class EPSFacade {
10
-
11
- /**
12
- * EPS Interface implementation
13
- * @since 1.0
14
- * @var EPSInterface
15
- */
16
- private $_epsInterfaceImpl;
17
-
18
- /**
19
- * User name
20
- * @since 1.0
21
- * @var string
22
- */
23
- private $_username;
24
-
25
- /**
26
- * User password
27
- * @since 1.0
28
- * @var string
29
- */
30
- private $_password;
31
-
32
- /**
33
- * Result of login Speedy web service method clall
34
- * @since 1.0
35
- * @var ResultLogin
36
- */
37
- private $_resultLogin;
38
-
39
- /**
40
- * Constructs new instance of EPS Facade
41
- * @since 1.0
42
- * @param EPSInterface $epsInterfaceImpl EPS interface implementation
43
- * @param string $username User name
44
- * @param string $password User password
45
- */
46
- function __construct($epsInterfaceImpl, $username, $password) {
47
- $this->_epsInterfaceImpl = $epsInterfaceImpl;
48
- $this->_username = $username;
49
- $this->_password = $password;
50
- }
51
-
52
- /**
53
- * Check session state before calling a business web service method
54
- * @since 1.0
55
- * @throws ClientException Thrown in case EPS interface implementation is not set
56
- */
57
- private function checkStateBeforeCall() {
58
- if (!isset($this->_epsInterfaceImpl)) {
59
- throw new ClientException("EPS Interface implementation is not set");
60
- }
61
- }
62
-
63
- /**
64
- * Set EPS interface implementation
65
- * @since 1.0
66
- * @param EPSInterface $epsInterfaceImpl
67
- */
68
- public function setEPSInterfaceImpl($epsInterfaceImpl) {
69
- $this->_epsInterfaceImpl = $epsInterfaceImpl;
70
- }
71
-
72
- /**
73
- * Return EPS interface implementation
74
- * @since 1.0
75
- * @return EPSInterface
76
- */
77
- public function getEPSInterfaceImpl() {
78
- return $this->_epsInterfaceImpl;
79
- }
80
-
81
- /**
82
- * Set user name
83
- * @since 1.0
84
- * @param string $username
85
- */
86
- public function setUsername($username) {
87
- $this->_username = $username;
88
- }
89
-
90
- /**
91
- * Return user name
92
- * @since 1.0
93
- * @return string User name
94
- */
95
- public function getUsername() {
96
- return $this->_username;
97
- }
98
-
99
- /**
100
- * Set user password
101
- * @since 1.0
102
- * @param string $password
103
- */
104
- public function setPassword($password) {
105
- $this->_password = $password;
106
- }
107
-
108
- /**
109
- * Return user password
110
- * @since 1.0
111
- * @return string User password
112
- */
113
- public function getPassword() {
114
- return $this->_password;
115
- }
116
-
117
- /**
118
- * Return result login.
119
- * Optionally tries to open new session in case it is not active
120
- * @since 1.0
121
- * @param boolean $openNewIfNotActive Whether to try to open new connection. Default is true
122
- * @throws ClientException Thrown in case EPS interface implementation is not set
123
- * @throws ServerException Thrown in case communication with server has failed
124
- * @return ResultLogin
125
- */
126
- public function getResultLogin($openNewIfNotActive=true) {
127
- if ($openNewIfNotActive && !$this->isSessionActive(true)) {
128
- $this->_resultLogin = $this->login();
129
- }
130
- return $this->_resultLogin;
131
- }
132
-
133
- /**
134
- * Set result login.
135
- * @param ResultLogin $resultLogin Previuos session result login
136
- */
137
- public function setResultLogin($resultLogin) {
138
- $this->_resultLogin = $resultLogin;
139
- }
140
-
141
- /**
142
- * Login web service method
143
- * @since 1.0
144
- * @throws ClientException Thrown in case EPS interface implementation is not set
145
- * @throws ServerException Thrown in case communication with server has failed
146
- * @return ResultLogin Result of login
147
- */
148
- public function login() {
149
- $this->checkStateBeforeCall();
150
- $this->_resultLogin = $this->_epsInterfaceImpl->login($this->_username, $this->_password);
151
- return $this->_resultLogin;
152
- }
153
-
154
- /**
155
- * Returns flag whether the session is active
156
- * @since 1.0
157
- * @param boolean $refreshSession In case the session is active, this parameter specifies if the session should be automatically refreshed
158
- * @throws ClientException Thrown in case EPS interface implementation is not set
159
- * @throws ServerException Thrown in case communication with server has failed
160
- * @return boolean Session active flag
161
- */
162
- public function isSessionActive($refreshSession) {
163
- $this->checkStateBeforeCall();
164
- if (isset($this->_resultLogin)) {
165
- return $this->_epsInterfaceImpl->isSessionActive($this->_resultLogin->getSessionId(), $refreshSession);
166
- } else {
167
- return false;
168
- }
169
- }
170
-
171
- /**
172
- * Returns the list of courier services valid on this date
173
- * @since 1.0
174
- * @param date $date
175
- * @param ParamLanguage $language (added in 2.5.0)
176
- * @throws ClientException Thrown in case EPS interface implementation is not set
177
- * @throws ServerException Thrown in case communication with server has failed
178
- * @return array List of ResultCourierService instances
179
- */
180
- public function listServices($date, $language = null) {
181
- $this->checkStateBeforeCall();
182
- return $this->_epsInterfaceImpl->listServices($this->getResultLogin(true)->getSessionId(), $date, $language);
183
- }
184
-
185
- /**
186
- * Returns a list of sites matching the search criteria.
187
- * The result is limited to 10 records
188
- * @since 1.0
189
- * @param string $type Type of site
190
- * @param string $name Site name or part of it
191
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
192
- * @throws ClientException Thrown in case EPS interface implementation is not set
193
- * @throws ServerException Thrown in case communication with server has failed
194
- * @return array List of ResultSite instances
195
- */
196
- public function listSites($type, $name, $language = null) {
197
- $this->checkStateBeforeCall();
198
- return $this->_epsInterfaceImpl->listSites($this->getResultLogin(true)->getSessionId(), $type, $name, $language);
199
- }
200
-
201
- /**
202
- * Returns a list of sites. The method aims to find the closest matches.
203
- * The result is limited to 10 records
204
- * @since 1.0
205
- * @param ParamFilterSite $paramFilterSite
206
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
207
- * @throws ClientException Thrown in case EPS interface implementation is not set
208
- * @throws ServerException Thrown in case communication with server has failed
209
- * @return array List of ResultSiteEx instances
210
- */
211
- public function listSitesEx($paramFilterSite, $language = null) {
212
- $this->checkStateBeforeCall();
213
- return $this->_epsInterfaceImpl->listSitesEx($this->getResultLogin(true)->getSessionId(), $paramFilterSite, $language);
214
- }
215
-
216
- /**
217
- * Returns the list of courier services valid on this date and sites.
218
- * @since 1.0
219
- * @param datetime $date
220
- * @param integer $senderSiteId Signed 64-bit integer sender's site ID;
221
- * @param integer $receiverSiteId Signed 64-bit integer receiver's site ID;
222
- * @param integer $senderCountryId Signed 64-bit integer sender's country ID (added in 2.5.0);
223
- * @param string $senderPostCode sender's post code (added in 2.5.0);
224
- * @param integer $receiverCountryId Signed 64-bit integer receiver's country ID (added in 2.5.0);
225
- * @param string $receiverPostCode receiver's post code (added in 2.5.0);
226
- * @param ParamLanguage $language language (added in 2.5.0)
227
- * @throws ServerException Thrown in case communication with server has failed
228
- * @return array List of ResultCourierServiceExt instances
229
- */
230
- public function listServicesForSites(
231
- $date, $senderSiteId, $receiverSiteId,
232
- $senderCountryId = null, $senderPostCode = null, $receiverCountryId = null, $receiverPostCode = null, $language = null
233
- ) {
234
- $this->checkStateBeforeCall();
235
- return $this->_epsInterfaceImpl->listServicesForSites(
236
- $this->getResultLogin(true)->getSessionId(), $date, $senderSiteId, $receiverSiteId,
237
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language
238
- );
239
- }
240
-
241
- /**
242
- * Returns the min/max weight allowed for the given shipment parameters
243
- * @since 2.5.0
244
- * @param integer $serviceTypeId Signed 64-bit ID of the courier service
245
- * @param integer $senderSiteId Signed 64-bit Sender's site ID
246
- * @param integer $receiverSiteId Signed 64-bit Receiver's site ID
247
- * @param date $date
248
- * @param boolean $documents Specifies if the shipment consists of documents
249
- * @param integer $senderCountryId Signed 64-bit Sender's country ID (added in 2.5.0)
250
- * @param string $senderPostCode Sender's post code (added in 2.5.0)
251
- * @param integer $receiverCountryId Signed 64-bit Receiver's country ID (added in 2.5.0)
252
- * @param string $receiverPostCode Receiver's post code (added in 2.5.0)
253
- * @throws ClientException Thrown in case EPS interface implementation is not set
254
- * @throws ServerException Thrown in case communication with server has failed
255
- * @return ResultMinMaxReal
256
- */
257
- public function getWeightInterval(
258
- $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
259
- $senderCountryId = null, $senderPostCode = null, $receiverCountryId = null, $receiverPostCode = null
260
- ) {
261
- $this->checkStateBeforeCall();
262
- return $this->_epsInterfaceImpl->getWeightInterval(
263
- $this->getResultLogin(true)->getSessionId(), $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
264
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode
265
- );
266
- }
267
-
268
- /**
269
- * Returns CSV-formatted data (depending on the nomenType value).
270
- * Column numbers can change in the future so it's recommended to address the data using the column names in the header row.
271
- * The data for some nomenTypes requires a payed license (additional licensing contract) and permissions (access rights).
272
- * To obtain such license please contact our IT department or your Speedy key account manager.
273
- * Type 1 - returns a list of all countries
274
- * Type 50 - returns a list of all states
275
- * Type 100 - returns a list of all sites.
276
- * Type 300 - returns a list of all streets (requires a license).
277
- * Type 400 - returns a list of all quarters (requires a license).
278
- * Type 500 - returns a list of all common objects (requires a license).
279
- * Type 700 - returns a list of all block names (requires a license).
280
- * Type 800 - returns a list of all post codes (requires a license). * @since 1.0
281
- * @param integer $nomenType Signed 32-bit The type of address nomenclature
282
- * @param integer $countryId Signed 64-bit (added in 2.5.0)
283
- * @throws ClientException Thrown in case EPS interface implementation is not set
284
- * @throws ServerException Thrown in case communication with server has failed
285
- * @return string CSV formatted
286
- */
287
- public function getAddressNomenclature($nomenType, $countryId = null) {
288
- $this->checkStateBeforeCall();
289
- return $this->_epsInterfaceImpl->getAddressNomenclature($this->getResultLogin(true)->getSessionId(), $nomenType, $countryId);
290
- }
291
-
292
- /**
293
- * Returns a list of all sites.
294
- * Note: This method is relatively slow (because of the size of its response). You shouldn't call it more than several times a day.
295
- * The methods is designed to provide data which should be locally stored/cached by client apps.
296
- * The address-related nomenclature data is updated only several times a year.
297
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
298
- * @param integer $countryId signed 64-bit Country id (added in 2.5.0)
299
- * @since 1.0
300
- * @throws ClientException Thrown in case EPS interface implementation is not set
301
- * @throws ServerException Thrown in case communication with server has failed
302
- * @return array List of ResultSite instances
303
- */
304
- public function listAllSites($language = null, $countryId = null) {
305
- $this->checkStateBeforeCall();
306
- return $this->_epsInterfaceImpl->listAllSites($this->getResultLogin(true)->getSessionId(), $language, $countryId);
307
- }
308
-
309
- /**
310
- * Returns a site by ID
311
- * @since 1.0
312
- * @param integer $siteId Signed 64-bit Site ID
313
- * @throws ClientException Thrown in case EPS interface implementation is not set
314
- * @throws ServerException Thrown in case communication with server has failed
315
- * @return ResultSite
316
- */
317
- public function getSiteById($siteId) {
318
- $this->checkStateBeforeCall();
319
- return $this->_epsInterfaceImpl->getSiteById($this->getResultLogin(true)->getSessionId(), $siteId);
320
- }
321
-
322
- /**
323
- * Returns sites having either full or partial address nomenclature (streets, quarters etc.).
324
- * @since 1.0
325
- * @param AddrNomen $addrNomen Only values FULL and PARTIAL are allowed
326
- * @throws ClientException Thrown in case EPS interface implementation is not set
327
- * @throws ServerException Thrown in case communication with server has failed
328
- * @return array List of ResultSite
329
- */
330
- public function getSitesByAddrNomenType($addrNomen) {
331
- $this->checkStateBeforeCall();
332
- return $this->_epsInterfaceImpl->getSitesByAddrNomenType($this->getResultLogin(true)->getSessionId(), $addrNomen);
333
- }
334
-
335
- /**
336
- * Returns a list of the most common types of streets.
337
- * @since 1.0
338
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
339
- * @throws ClientException Thrown in case EPS interface implementation is not set
340
- * @throws ServerException Thrown in case communication with server has failed
341
- * @return array string List of the most common types of streets
342
- */
343
- public function listStreetTypes($language = null) {
344
- $this->checkStateBeforeCall();
345
- return $this->_epsInterfaceImpl->listStreetTypes($this->getResultLogin(true)->getSessionId(), $language);
346
- }
347
-
348
- /**
349
- * Returns a list of the most common types of quarters (districts).
350
- * @since 1.0
351
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
352
- * @throws ClientException Thrown in case EPS interface implementation is not set
353
- * @throws ServerException Thrown in case communication with server has failed
354
- * @return array string List of the most common types of quarters (districts).
355
- */
356
- public function listQuarterTypes($language = null) {
357
- $this->checkStateBeforeCall();
358
- return $this->_epsInterfaceImpl->listQuarterTypes($this->getResultLogin(true)->getSessionId(), $language);
359
- }
360
-
361
- /**
362
- * Returns a list of streets matching the search criteria
363
- * The list is limited to 10 records.
364
- * @since 1.0
365
- * @param string $name Street name (or part of it)
366
- * @param integer $siteId Signed 64-bit Site ID
367
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
368
- * @throws ClientException Thrown in case EPS interface implementation is not set
369
- * @throws ServerException Thrown in case communication with server has failed
370
- * @return array ResultStreet List of streets
371
- */
372
- public function listStreets($name, $siteId, $language = null) {
373
- $this->checkStateBeforeCall();
374
- return $this->_epsInterfaceImpl->listStreets($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
375
- }
376
-
377
- /**
378
- * Returns a list of quarters matching the search criteria
379
- * The list is limited to 10 records.
380
- * @since 1.0
381
- * @param string $name Quarter name (or part of it)
382
- * @param integer $siteId Signed 64-bit Site ID
383
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
384
- * @throws ClientException Thrown in case EPS interface implementation is not set
385
- * @throws ServerException Thrown in case communication with server has failed
386
- * @return array ResultQuarter List of quarters
387
- */
388
- public function listQuarters($name, $siteId, $language = null) {
389
- $this->checkStateBeforeCall();
390
- return $this->_epsInterfaceImpl->listQuarters($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
391
- }
392
-
393
- /**
394
- * Returns a list of common objects matching the search criteria.
395
- * The list is limited to 10 records.
396
- * @since 1.0
397
- * @param string $name Common object name (or part of it)
398
- * @param integer $siteId Signed 64-bit Site ID
399
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
400
- * @throws ClientException Thrown in case EPS interface implementation is not set
401
- * @throws ServerException Thrown in case communication with server has failed
402
- * @return array ResultCommonObject List of common objects
403
- */
404
- public function listCommonObjects($name, $siteId, $language = null) {
405
- $this->checkStateBeforeCall();
406
- return $this->_epsInterfaceImpl->listCommonObjects($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
407
- }
408
-
409
- /**
410
- * Returns a list of blocks matching the search criteria.
411
- * The list is limited to 10 records.
412
- * @since 1.0
413
- * @param string $name Block name (or part of it)
414
- * @param integer $siteId Signed 64-bit Site ID
415
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
416
- * @throws ClientException Thrown in case EPS interface implementation is not set
417
- * @throws ServerException Thrown in case communication with server has failed
418
- * @return array string List of blocks
419
- */
420
- public function listBlocks($name, $siteId, $language = null) {
421
- $this->checkStateBeforeCall();
422
- return $this->_epsInterfaceImpl->listBlocks($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
423
- }
424
-
425
- /**
426
- * Returns a list of Speedy offices matching the search criteria
427
- * The list is limited to 10 records.
428
- * @since 1.0
429
- * @param string $name Office name (or part of it);
430
- * @param integer $siteId Signed 64-bit Site ID
431
- * @throws ClientException Thrown in case EPS interface implementation is not set
432
- * @throws ServerException Thrown in case communication with server has failed
433
- * @return array ResultOffice List of offices
434
- */
435
- public function listOffices($name, $siteId) {
436
- $this->checkStateBeforeCall();
437
- return $this->_epsInterfaceImpl->listOffices($this->getResultLogin(true)->getSessionId(), $name, $siteId);
438
- }
439
-
440
- /**
441
- * Returns data for client by ID.
442
- * Allowed values for clientId are only the ones of members of the user's contract and the predefined partners
443
- * in the WebClients application.
444
- * @since 1.0
445
- * @param integer $clientId Signed 64-bit integer – Client/Partner ID
446
- * @throws ClientException Thrown in case EPS interface implementation is not set
447
- * @throws ServerException Thrown in case communication with server has failed
448
- * @return ResultClientData
449
- */
450
- public function getClientById($clientId) {
451
- $this->checkStateBeforeCall();
452
- return $this->_epsInterfaceImpl->getClientById($this->getResultLogin(true)->getSessionId(), $clientId);
453
- }
454
-
455
- /**
456
- * Returns the dates when the shipment can be ordered for pick-up.
457
- * The "time" component represents the deadline for creating an order
458
- * (or the deadline for delivering the shipment to a Speedy office when senderOfficeId is set).
459
- * (This method could be used for the "takingDate" property of ParamPicking or ParamCalculation.)
460
- * Note: Either senderSiteId or senderOfficeId should be set, or neither of them. Both parameters having "not null" values is not allowed.
461
- * @since 2.5.0
462
- * @param integer $serviceTypeId
463
- * @param integer $senderSiteId Signed 64-bit – Sender's site ID
464
- * @param integer $senderOfficeId Signed 64-bit – If the sender intends to deliver the shipment to a Speedy office, the office ID could be set as a filter
465
- * @param date $minDate - When the "time" component is set then this date is to be included in the result list only if the time is not after the working time of Speedy;
466
- * @param integer $senderCountryId Signed 64-bit Sender's country id (added in 2.5.0)
467
- * @param string $senderPostCode Sender's post code (added in 2.5.0)
468
- * @throws ClientException Thrown in case EPS interface implementation is not set
469
- * @throws ServerException Thrown in case communication with server has failed
470
- * @return array List of dates
471
- */
472
- public function getAllowedDaysForTaking(
473
- $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId = null, $senderPostCode = null
474
- ) {
475
- $this->checkStateBeforeCall();
476
- return $this->_epsInterfaceImpl->getAllowedDaysForTaking(
477
- $this->getResultLogin(true)->getSessionId(), $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate,
478
- $senderCountryId, $senderPostCode
479
- );
480
- }
481
-
482
- /**
483
- * Returns a list of addresses matching the search criteria.
484
- * @since 1.0
485
- * @param ParamAddressSearch $address Search criteria (filter)
486
- * @throws ClientException Thrown in case EPS interface implementation is not set
487
- * @throws ServerException Thrown in case communication with server has failed
488
- * @return array List of ResultAddressSearch
489
- */
490
- public function addressSearch($address) {
491
- $this->checkStateBeforeCall();
492
- return $this->_epsInterfaceImpl->addressSearch($this->getResultLogin(true)->getSessionId(), $address);
493
- }
494
-
495
- /**
496
- * Calculate method
497
- * @since 1.0
498
- * @param ParamCalculation $calculation
499
- * @throws ClientException Thrown in case EPS interface implementation is not set
500
- * @throws ServerException Thrown in case communication with server has failed
501
- * @return ResultCalculation
502
- */
503
- public function calculate($calculation) {
504
- $this->checkStateBeforeCall();
505
- return $this->_epsInterfaceImpl->calculate($this->getResultLogin(true)->getSessionId(), $calculation);
506
- }
507
-
508
- /**
509
- * This method could be used for preliminary check-up of shipment's price for a range of courier services.
510
- * @since 1.0
511
- * @param ParamCalculation $calculation Data needed to perform the calculation;
512
- * @param array $serviceTypeIds List<signed 64-bit integer> A list of courier service IDs for which price needs to be calculated
513
- * @throws ClientException Thrown in case EPS interface implementation is not set
514
- * @throws ServerException Thrown in case communication with server has failed
515
- * @return array List of ResultCalculationMS
516
- */
517
- public function calculateMultipleServices($calculation, $serviceTypeIds) {
518
- $this->checkStateBeforeCall();
519
- return $this->_epsInterfaceImpl->calculateMultipleServices($this->getResultLogin(true)->getSessionId(), $calculation, $serviceTypeIds);
520
- }
521
-
522
- /**
523
- * This is an alternative method for shipment price calculation where the parameter is of type ParamPicking.
524
- * Clients are encouraged to use the method that best fits their needs.
525
- * @since 1.0
526
- * @param ParamPicking $picking
527
- * @throws ClientException Thrown in case EPS interface implementation is not set
528
- * @throws ServerException Thrown in case communication with server has failed
529
- * @return ResultCalculation
530
- */
531
- public function calculatePicking($picking) {
532
- $this->checkStateBeforeCall();
533
- return $this->_epsInterfaceImpl->calculatePicking($this->getResultLogin(true)->getSessionId(), $picking);
534
- }
535
-
536
- /**
537
- * The method used to create BOL.
538
- * @since 1.0
539
- * @param ParamPicking $picking
540
- * @throws ClientException Thrown in case EPS interface implementation is not set
541
- * @throws ServerException Thrown in case communication with server has failed
542
- * @return ResultBOL
543
- */
544
- public function createBillOfLading($picking) {
545
- $this->checkStateBeforeCall();
546
- return $this->_epsInterfaceImpl->createBillOfLading($this->getResultLogin(true)->getSessionId(), $picking);
547
- }
548
-
549
- /**
550
- * Used for creating PDF documents to be printed (BOLs, labels etc.)
551
- * Examples:
552
- * •Bill of Lading;
553
- * •Bill of Lading with "cash on delivery";
554
- * •Custom travel label (type 20);
555
- * •Custom travel label (type 20) with "cash on delivery".
556
- * @since 1.0
557
- * @param ParamPDF $params
558
- * @throws ClientException Thrown in case EPS interface implementation is not set
559
- * @throws ServerException Thrown in case communication with server has failed
560
- * @return array bytes
561
- */
562
- public function createPDF($params) {
563
- $this->checkStateBeforeCall();
564
- return $this->_epsInterfaceImpl->createPDF($this->getResultLogin(true)->getSessionId(), $params);
565
- }
566
-
567
- /**
568
- * Creates PDF document for BOL.
569
- * The method is deprecated, "createPDF" should be used instead.
570
- * @deprecated The method is deprecated, "createPDF" should be used instead.
571
- * @since 1.0
572
- * @param integer $billOfLading Signed 64-bit
573
- * @param boolean $includeAutoPrintJS Specifies if embedded JavaScript code for direct printing to be generated
574
- * @throws ClientException Thrown in case EPS interface implementation is not set
575
- * @throws ServerException Thrown in case communication with server has failed
576
- * @return array of bytes
577
- */
578
- public function createBillOfLadingPDF($billOfLading, $includeAutoPrintJS) {
579
- $this->checkStateBeforeCall();
580
- return $this->_epsInterfaceImpl->createBillOfLadingPDF($this->getResultLogin(true)->getSessionId(), $billOfLading, $includeAutoPrintJS);
581
- }
582
-
583
- /**
584
- * Creates PDF document of "type I". The method is deprecated, "createPDF" should be used instead.
585
- * @deprecated The method is deprecated, "createPDF" should be used instead.
586
- * @since 1.0
587
- * @param integer $parcelId Signed 64-bit Parcel ID
588
- * @throws ClientException Thrown in case EPS interface implementation is not set
589
- * @throws ServerException Thrown in case communication with server has failed
590
- * @return array of bytes
591
- */
592
- public function createCustomTravelLabelPDFType1($parcelId) {
593
- $this->checkStateBeforeCall();
594
- return $this->_epsInterfaceImpl->createCustomTravelLabelPDFType1($this->getResultLogin(true)->getSessionId(), $parcelId);
595
- }
596
-
597
- /**
598
- * Used to cancel BOL.
599
- * Only allowed when the shipment is neither ordered nor picked up by Speedy.
600
- * @since 1.0
601
- * @param integer $billOfLading Signed 64-bit
602
- * @param string $cancelComment
603
- * @throws ClientException Thrown in case EPS interface implementation is not set
604
- * @throws ServerException Thrown in case communication with server has failed
605
- */
606
- public function invalidatePicking($billOfLading, $cancelComment=null) {
607
- $this->checkStateBeforeCall();
608
- return $this->_epsInterfaceImpl->invalidatePicking($this->getResultLogin(true)->getSessionId(), $billOfLading, $cancelComment);
609
- }
610
-
611
- /**
612
- * This method is used to update BOL.
613
- * Only allowed if BOL was created with pendingShipmentDescription = true.
614
- * @since 1.0
615
- * @param ParamPicking $picking Data for the shipment (BOL)
616
- * @throws ClientException Thrown in case EPS interface implementation is not set
617
- * @throws ServerException Thrown in case communication with server has failed
618
- * @return ResultBOL
619
- */
620
- public function updateBillOfLading($picking) {
621
- $this->checkStateBeforeCall();
622
- return $this->_epsInterfaceImpl->updateBillOfLading($this->getResultLogin(true)->getSessionId(), $picking);
623
- }
624
-
625
- /**
626
- * This method is used to add parcel to an existing BOL
627
- * (only allowed if BOL was created with pendingParcelsDescription = true).
628
- * @since 1.0
629
- * @param ParamParcel $parcel Parcel data
630
- * @throws ClientException Thrown in case EPS interface implementation is not set
631
- * @throws ServerException Thrown in case communication with server has failed
632
- * @return integer Signed 64-bit parcel's ID
633
- */
634
- public function addParcel($parcel) {
635
- $this->checkStateBeforeCall();
636
- return $this->_epsInterfaceImpl->addParcel($this->getResultLogin(true)->getSessionId(), $parcel);
637
- }
638
-
639
- /**
640
- * Makes BOL "fully created".
641
- * Only applies to BOLs created with pendingParcelsDescription = true.
642
- * @since 1.0
643
- * @param integer $billOfLading Signed 64-bit
644
- * @throws ClientException Thrown in case EPS interface implementation is not set
645
- * @throws ServerException Thrown in case communication with server has failed
646
- * @return ResultBOL
647
- */
648
- public function finalizeBillOfLadingCreation($billOfLading) {
649
- $this->checkStateBeforeCall();
650
- return $this->_epsInterfaceImpl->finalizeBillOfLadingCreation($this->getResultLogin(true)->getSessionId(), $billOfLading);
651
- }
652
-
653
- /**
654
- * Creates an order for shipments pick-up (i.e. a visit by courier of Speedy).
655
- * The retuned list contains objects corresponding to each BOL (one object per BOL).
656
- * When the validation errors list of at least one of the objects is not empty, that means the order has not been created.
657
- * @since 1.0
658
- * @param ParamOrder $order Order details
659
- * @throws ClientException Thrown in case EPS interface implementation is not set
660
- * @throws ServerException Thrown in case communication with server has failed
661
- * @return array List of ResultOrderPickingInfo
662
- */
663
- public function createOrder($order) {
664
- $this->checkStateBeforeCall();
665
- return $this->_epsInterfaceImpl->createOrder($this->getResultLogin(true)->getSessionId(), $order);
666
- }
667
-
668
- /**
669
- * Returns a list with all parcels of a shipment.
670
- * @since 1.0
671
- * @param integer $billOfLading Signed 64-bit
672
- * @throws ClientException Thrown in case EPS interface implementation is not set
673
- * @throws ServerException Thrown in case communication with server has failed
674
- * @return array List of ResultParcelInfo
675
- */
676
- public function getPickingParcels($billOfLading) {
677
- $this->checkStateBeforeCall();
678
- return $this->_epsInterfaceImpl->getPickingParcels($this->getResultLogin(true)->getSessionId(), $billOfLading);
679
- }
680
-
681
- /**
682
- * This method can be used to track the state/history of a shipment.
683
- * @deprecated Use trackPickingEx instead
684
- * @since 1.0
685
- * @param integer $billOfLading Signed 64-bit
686
- * @throws ClientException Thrown in case EPS interface implementation is not set
687
- * @throws ServerException Thrown in case communication with server has failed
688
- * @return array List of ResultTrackPicking
689
- */
690
- public function trackPicking($billOfLading) {
691
- $this->checkStateBeforeCall();
692
- return $this->_epsInterfaceImpl->trackPicking($this->getResultLogin(true)->getSessionId(), $billOfLading);
693
- }
694
-
695
- /**
696
- * This method can be used to track the state/history of a shipment.
697
- * @since 1.2
698
- * @param integer $billOfLading Signed 64-bit
699
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
700
- * @throws ClientException Thrown in case EPS interface implementation is not set
701
- * @throws ServerException Thrown in case communication with server has failed
702
- * @return array List of ResultTrackPickingEx
703
- */
704
- public function trackPickingEx($billOfLading, $language) {
705
- $this->checkStateBeforeCall();
706
- return $this->_epsInterfaceImpl->trackPickingEx($this->getResultLogin(true)->getSessionId(), $billOfLading, $language);
707
- }
708
-
709
- /**
710
- * This method can be used to track the state/history of a shipment.
711
- * @since 1.4
712
- * @param integer $parcelId Signed 64-bit
713
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
714
- * @throws ClientException Thrown in case EPS interface implementation is not set
715
- * @throws ServerException Thrown in case communication with server has failed
716
- * @return array List of ResultTrackPickingEx
717
- */
718
- public function trackParcel($parcelId, $language) {
719
- $this->checkStateBeforeCall();
720
- return $this->_epsInterfaceImpl->trackParcel($this->getResultLogin(true)->getSessionId(), $parcelId, $language);
721
- }
722
-
723
- /**
724
- * This method can be used to track the state/history of a shipment parcel.
725
- * @since 2.8.0
726
- * @param List of integer (Signed 64-bit) $barcodes
727
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
728
- * @throws ServerException Thrown in case communication with server has failed
729
- * @return array List of ResultTrackPickingEx
730
- */
731
- public function trackParcelMultiple($barcodes, $language) {
732
- $this->checkStateBeforeCall();
733
- return $this->_epsInterfaceImpl->trackParcelMultiple($this->getResultLogin(true)->getSessionId(), $barcodes, $language);
734
- }
735
-
736
-
737
- /**
738
- * Search BOLs by reference codes (ref1 and/or ref2).
739
- * @since 1.0
740
- * @param ParamSearchByRefNum $params
741
- * @throws ClientException Thrown in case EPS interface implementation is not set
742
- * @throws ServerException Thrown in case communication with server has failed
743
- * @return array List of BOLs found (signed 64-bit integers)
744
- */
745
- public function searchPickingsByRefNumber($params) {
746
- $this->checkStateBeforeCall();
747
- return $this->_epsInterfaceImpl->searchPickingsByRefNumber($this->getResultLogin(true)->getSessionId(), $params);
748
- }
749
-
750
- /**
751
- * Get microregion id for provided GPS coordinates
752
- * @since 1.5
753
- * @param signed 64-bit treal $coordX
754
- * @param signed 64-bit treal $coordY
755
- * @throws ClientException Thrown in case EPS interface implementation is not set
756
- * @throws ServerException Thrown in case communication with server has failed
757
- * @return Mocregion id (signed 64-bit integer)
758
- */
759
- public function getMicroregionId($coordX, $coordY) {
760
- $this->checkStateBeforeCall();
761
- return $this->_epsInterfaceImpl->getMicroregionId($this->getResultLogin(true)->getSessionId(), $coordX, $coordY);
762
- }
763
-
764
- /**
765
- * Returns data for clients by specified client ID or other search criteria.
766
- * If client ID is specified the behaviour of this method is the same as getClientById.
767
- * Otherwise, the search returns results that satisfy search criteria
768
- * @since 1.6
769
- * @param ParamClientSearch $clientQuery
770
- * @throws ClientException Thrown in case EPS interface implementation is not set
771
- * @throws ServerException Thrown in case communication with server has failed
772
- * @return array List of ResultClientData
773
- */
774
- public function searchClients($clientQuery) {
775
- $this->checkStateBeforeCall();
776
- return $this->_epsInterfaceImpl->searchClients($this->getResultLogin(true)->getSessionId(), $clientQuery);
777
- }
778
-
779
-
780
- /**
781
- * Returns list with available special delivery requirements for logged user
782
- * @throws ClientException Thrown in case EPS interface implementation is not set
783
- * @throws ServerException Thrown in case communication with server has failed
784
- * @return array List of ResultSpecialDeliveryRequirement
785
- * @since 2.1.0
786
- */
787
- public function listSpecialDeliveryRequirements() {
788
- $this->checkStateBeforeCall();
789
- return $this->_epsInterfaceImpl->listSpecialDeliveryRequirements($this->getResultLogin(true)->getSessionId());
790
- }
791
-
792
- /**
793
- * Validates address and returns validation result
794
- * - validationMode = 0 (default) - Extended validation w/o GIS info (address uniqueness is not verified);
795
- * - validationMode = 1 (NOT IMPLEMENTED YET - reserved for future implementation) Extended validation with GIS info (address uniqueness is verified);
796
- * - validationMode = 2 - basic validation (the same as address validation in createBillOfLading)
797
- * @param ParamAddress $address
798
- * @param integer $validationMode signed 32 bit
799
- * @throws ServerException Thrown in case communication with server has failed
800
- * @throws ClientException Thrown in case EPS interface implementation is not set
801
- * @throws PickingValidationException Thrown in case address validation has failed
802
- * @return boolean Validation result flag
803
- * @since 2.2.0
804
- */
805
- public function validateAddress($address, $validationMode) {
806
- $this->checkStateBeforeCall();
807
- return $this->_epsInterfaceImpl->validateAddress($this->getResultLogin(true)->getSessionId(), $address, $validationMode);
808
- }
809
-
810
- /**
811
- * Returns all client objects ( including logged user's ) having the same contract as logged client's contract.
812
- * @throws ServerException Thrown in case communication with server has failed
813
- * @throws ClientException Thrown in case EPS interface implementation is not set
814
- * @return List of ResultClientData
815
- * @since 2.2.0
816
- */
817
- public function listContractClients() {
818
- $this->checkStateBeforeCall();
819
- return $this->_epsInterfaceImpl->listContractClients($this->getResultLogin(true)->getSessionId());
820
- }
821
-
822
- /**
823
- * Returns a list of Speedy offices matching the search criteria
824
- * The list is limited to 10 records.
825
- * @since 2.2.0
826
- * @param string $name Office name (or part of it);
827
- * @param integer $siteId Signed 64-bit Site ID
828
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
829
- * @throws ServerException Thrown in case communication with server has failed
830
- * @throws ClientException Thrown in case EPS interface implementation is not set
831
- * @return array ResultOfficeEx List of offices
832
- */
833
- public function listOfficesEx($name, $siteId, $language = null) {
834
- $this->checkStateBeforeCall();
835
- return $this->_epsInterfaceImpl->listOfficesEx($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
836
- }
837
-
838
- /**
839
- * Returns deserialized address from serialized string address
840
- * @param string $address Serialized address
841
- * @return ParamAddress Deserliazed address
842
- * @throws ServerException Thrown in case communication with server has failed
843
- * @throws ClientException Thrown in case EPS interface implementation is not set
844
- * @since 2.3.0
845
- */
846
- public function deserializeAddress($address) {
847
- $this->checkStateBeforeCall();
848
- return $this->_epsInterfaceImpl->deserializeAddress($this->getResultLogin(true)->getSessionId(), $address);
849
- }
850
-
851
- /**
852
- * Returns deserialized address from serialized string address
853
- * @param ParamAddress $address Address
854
- * @return Serialized string address
855
- * @throws ServerException Thrown in case communication with server has failed
856
- * @throws ClientException Thrown in case EPS interface implementation is not set
857
- * @since 2.3.0
858
- */
859
- public function serializeAddress($address) {
860
- $this->checkStateBeforeCall();
861
- return $this->_epsInterfaceImpl->serializeAddress($this->getResultLogin(true)->getSessionId(), $address);
862
- }
863
-
864
- /**
865
- * Make address text representations - city address, local address, full address
866
- * @param ParamAddress $address Base address
867
- * @throws ServerException Thrown in case communication with server has failed
868
- * @throws ClientException Thrown in case EPS interface implementation is not set
869
- * @return ResultAddressString
870
- */
871
- public function makeAddressString($address) {
872
- $this->checkStateBeforeCall();
873
- return $this->_epsInterfaceImpl->makeAddressString($this->getResultLogin(true)->getSessionId(), $address);
874
- }
875
-
876
- /**
877
- * Get list of additional user parameters
878
- * @param date $date Effective date. If null is provided then current date is applied
879
- * @return array signed 32-bit integers - List of additional user parameters
880
- * @throws ClientException Thrown in case EPS interface implementation is not set
881
- * @throws ServerException Thrown in case communication with server has failed
882
- */
883
- public function getAdditionalUserParams($date) {
884
- $this->checkStateBeforeCall();
885
- return $this->_epsInterfaceImpl->getAdditionalUserParams($this->getResultLogin(true)->getSessionId(), $date);
886
- }
887
-
888
- /**
889
- * Returns a list of countries matching the search criteria.
890
- * The result is limited to 10 records
891
- * @param string $name Country name or part of it
892
- * @param ParamLanguage $language Language
893
- * @return array of ResultCountry
894
- * @throws ClientException Thrown in case EPS interface implementation is not set
895
- * @throws ServerException Thrown in case communication with server has failed
896
- * @since 2.5.0
897
- */
898
- public function listCountries($name, $language = null) {
899
- $this->checkStateBeforeCall();
900
- return $this->_epsInterfaceImpl->listCountries($this->getResultLogin(true)->getSessionId(), $name, $language);
901
- }
902
-
903
- /**
904
- * Returns a list of countries matching the search criteria.
905
- * The result is limited to 10 records
906
- * @param ParamFilterCountry $filter Country search filter
907
- * @param ParamLanguage $language Language
908
- * @return array of ResultCountry
909
- * @throws ClientException Thrown in case EPS interface implementation is not set
910
- * @throws ServerException Thrown in case communication with server has failed
911
- * @since 2.5.0
912
- */
913
- public function listCountriesEx($filter, $language = null) {
914
- $this->checkStateBeforeCall();
915
- return $this->_epsInterfaceImpl->listCountriesEx($this->getResultLogin(true)->getSessionId(), $filter, $language);
916
- }
917
-
918
- /**
919
- * Returns a list of country states matching the search criteria.
920
- * The result is limited to 10 records
921
- * @param integer $countryId signed 64-bit Country id
922
- * @param string $name Country state name or part of it
923
- * @return array of ResultState
924
- * @throws ClientException Thrown in case EPS interface implementation is not set
925
- * @throws ServerException Thrown in case communication with server has failed
926
- * @since 2.5.0
927
- */
928
- public function listStates($countryId, $name) {
929
- $this->checkStateBeforeCall();
930
- return $this->_epsInterfaceImpl->listStates($this->getResultLogin(true)->getSessionId(), $countryId, $name);
931
- }
932
-
933
- /**
934
- * Returns a country state by id
935
- * @param string $stateId Country state id
936
- * @return ResultState Country state
937
- * @throws ClientException Thrown in case EPS interface implementation is not set
938
- * @throws ServerException Thrown in case communication with server has failed
939
- * @since 2.5.0
940
- */
941
- public function getStateById($stateId) {
942
- $this->checkStateBeforeCall();
943
- return $this->_epsInterfaceImpl->getStateById($this->getResultLogin(true)->getSessionId(), $stateId);
944
- }
945
-
946
- /**
947
- * Validates post code
948
- * @param integer $countryId signed 64-bit Country id
949
- * @param string $postCode Post code
950
- * @return True or false regarding the post code validation result
951
- * @throws ClientException Thrown in case EPS interface implementation is not set
952
- * @throws ServerException Thrown in case communication with server has failed
953
- * @since 2.5.0
954
- */
955
- public function validatePostCode($countryId, $postCode) {
956
- $this->checkStateBeforeCall();
957
- return $this->_epsInterfaceImpl->validatePostCode($this->getResultLogin(true)->getSessionId(), $countryId, $postCode);
958
- }
959
-
960
- /**
961
- * This method can be used to get delivery info for a shipment.
962
- * Returns null if no info is available
963
- * @since 2.6.0
964
- * @param billOfLading Signed 64-bit
965
- * @param language Language
966
- * @throws ServerException Thrown in case communication with server has failed
967
- * @return ResultTrackPickingEx
968
- */
969
- public function getPickingDeliveryInfo($billOfLading, $language) {
970
- $this->checkStateBeforeCall();
971
- return $this->_epsInterfaceImpl->getPickingDeliveryInfo($this->getResultLogin(true)->getSessionId(), $billOfLading, $language);
972
- }
973
-
974
- /**
975
- * Returns a list with all not canceled pickings, which are secondary to the picking with the specified billOfLading.
976
- * @since 2.6.0
977
- * @param paramSearchSecondaryPickings ParamSearchSecondaryPickings
978
- * @return List of ResultPickingInfo
979
- */
980
- public function searchSecondaryPickings($paramSearchSecondaryPickings) {
981
- $this->checkStateBeforeCall();
982
- return $this->_epsInterfaceImpl->searchSecondaryPickings($this->getResultLogin(true)->getSessionId(), $paramSearchSecondaryPickings);
983
- }
984
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
  ?>
1
+ <?php
2
+
3
+ require_once 'ClientException.class.php';
4
+ require_once 'EPSInterface.class.php';
5
+
6
+ /**
7
+ * Speedy EPS Service
8
+ */
9
+ class EPSFacade {
10
+
11
+ /**
12
+ * EPS Interface implementation
13
+ * @since 1.0
14
+ * @var EPSInterface
15
+ */
16
+ private $_epsInterfaceImpl;
17
+
18
+ /**
19
+ * User name
20
+ * @since 1.0
21
+ * @var string
22
+ */
23
+ private $_username;
24
+
25
+ /**
26
+ * User password
27
+ * @since 1.0
28
+ * @var string
29
+ */
30
+ private $_password;
31
+
32
+ /**
33
+ * Result of login Speedy web service method clall
34
+ * @since 1.0
35
+ * @var ResultLogin
36
+ */
37
+ private $_resultLogin;
38
+
39
+ /**
40
+ * Constructs new instance of EPS Facade
41
+ * @since 1.0
42
+ * @param EPSInterface $epsInterfaceImpl EPS interface implementation
43
+ * @param string $username User name
44
+ * @param string $password User password
45
+ */
46
+ function __construct($epsInterfaceImpl, $username, $password) {
47
+ $this->_epsInterfaceImpl = $epsInterfaceImpl;
48
+ $this->_username = $username;
49
+ $this->_password = $password;
50
+ }
51
+
52
+ /**
53
+ * Check session state before calling a business web service method
54
+ * @since 1.0
55
+ * @throws ClientException Thrown in case EPS interface implementation is not set
56
+ */
57
+ private function checkStateBeforeCall() {
58
+ if (!isset($this->_epsInterfaceImpl)) {
59
+ throw new ClientException("EPS Interface implementation is not set");
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Set EPS interface implementation
65
+ * @since 1.0
66
+ * @param EPSInterface $epsInterfaceImpl
67
+ */
68
+ public function setEPSInterfaceImpl($epsInterfaceImpl) {
69
+ $this->_epsInterfaceImpl = $epsInterfaceImpl;
70
+ }
71
+
72
+ /**
73
+ * Return EPS interface implementation
74
+ * @since 1.0
75
+ * @return EPSInterface
76
+ */
77
+ public function getEPSInterfaceImpl() {
78
+ return $this->_epsInterfaceImpl;
79
+ }
80
+
81
+ /**
82
+ * Set user name
83
+ * @since 1.0
84
+ * @param string $username
85
+ */
86
+ public function setUsername($username) {
87
+ $this->_username = $username;
88
+ }
89
+
90
+ /**
91
+ * Return user name
92
+ * @since 1.0
93
+ * @return string User name
94
+ */
95
+ public function getUsername() {
96
+ return $this->_username;
97
+ }
98
+
99
+ /**
100
+ * Set user password
101
+ * @since 1.0
102
+ * @param string $password
103
+ */
104
+ public function setPassword($password) {
105
+ $this->_password = $password;
106
+ }
107
+
108
+ /**
109
+ * Return user password
110
+ * @since 1.0
111
+ * @return string User password
112
+ */
113
+ public function getPassword() {
114
+ return $this->_password;
115
+ }
116
+
117
+ /**
118
+ * Return result login.
119
+ * Optionally tries to open new session in case it is not active
120
+ * @since 1.0
121
+ * @param boolean $openNewIfNotActive Whether to try to open new connection. Default is true
122
+ * @throws ClientException Thrown in case EPS interface implementation is not set
123
+ * @throws ServerException Thrown in case communication with server has failed
124
+ * @return ResultLogin
125
+ */
126
+ public function getResultLogin($openNewIfNotActive=true) {
127
+ if ($openNewIfNotActive && !$this->isSessionActive(true)) {
128
+ $this->_resultLogin = $this->login();
129
+ }
130
+ return $this->_resultLogin;
131
+ }
132
+
133
+ /**
134
+ * Set result login.
135
+ * @param ResultLogin $resultLogin Previuos session result login
136
+ */
137
+ public function setResultLogin($resultLogin) {
138
+ $this->_resultLogin = $resultLogin;
139
+ }
140
+
141
+ /**
142
+ * Login web service method
143
+ * @since 1.0
144
+ * @throws ClientException Thrown in case EPS interface implementation is not set
145
+ * @throws ServerException Thrown in case communication with server has failed
146
+ * @return ResultLogin Result of login
147
+ */
148
+ public function login() {
149
+ $this->checkStateBeforeCall();
150
+ $this->_resultLogin = $this->_epsInterfaceImpl->login($this->_username, $this->_password);
151
+ return $this->_resultLogin;
152
+ }
153
+
154
+ /**
155
+ * Returns flag whether the session is active
156
+ * @since 1.0
157
+ * @param boolean $refreshSession In case the session is active, this parameter specifies if the session should be automatically refreshed
158
+ * @throws ClientException Thrown in case EPS interface implementation is not set
159
+ * @throws ServerException Thrown in case communication with server has failed
160
+ * @return boolean Session active flag
161
+ */
162
+ public function isSessionActive($refreshSession) {
163
+ $this->checkStateBeforeCall();
164
+ if (isset($this->_resultLogin)) {
165
+ return $this->_epsInterfaceImpl->isSessionActive($this->_resultLogin->getSessionId(), $refreshSession);
166
+ } else {
167
+ return false;
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Returns the list of courier services valid on this date
173
+ * @since 1.0
174
+ * @param date $date
175
+ * @param ParamLanguage $language (added in 2.5.0)
176
+ * @throws ClientException Thrown in case EPS interface implementation is not set
177
+ * @throws ServerException Thrown in case communication with server has failed
178
+ * @return array List of ResultCourierService instances
179
+ */
180
+ public function listServices($date, $language = null) {
181
+ $this->checkStateBeforeCall();
182
+ return $this->_epsInterfaceImpl->listServices($this->getResultLogin(true)->getSessionId(), $date, $language);
183
+ }
184
+
185
+ /**
186
+ * Returns a list of sites matching the search criteria.
187
+ * The result is limited to 10 records
188
+ * @since 1.0
189
+ * @param string $type Type of site
190
+ * @param string $name Site name or part of it
191
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
192
+ * @throws ClientException Thrown in case EPS interface implementation is not set
193
+ * @throws ServerException Thrown in case communication with server has failed
194
+ * @return array List of ResultSite instances
195
+ */
196
+ public function listSites($type, $name, $language = null) {
197
+ $this->checkStateBeforeCall();
198
+ return $this->_epsInterfaceImpl->listSites($this->getResultLogin(true)->getSessionId(), $type, $name, $language);
199
+ }
200
+
201
+ /**
202
+ * Returns a list of sites. The method aims to find the closest matches.
203
+ * The result is limited to 10 records
204
+ * @since 1.0
205
+ * @param ParamFilterSite $paramFilterSite
206
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
207
+ * @throws ClientException Thrown in case EPS interface implementation is not set
208
+ * @throws ServerException Thrown in case communication with server has failed
209
+ * @return array List of ResultSiteEx instances
210
+ */
211
+ public function listSitesEx($paramFilterSite, $language = null) {
212
+ $this->checkStateBeforeCall();
213
+ return $this->_epsInterfaceImpl->listSitesEx($this->getResultLogin(true)->getSessionId(), $paramFilterSite, $language);
214
+ }
215
+
216
+ /**
217
+ * Returns the list of courier services valid on this date and sites.
218
+ * @since 1.0
219
+ * @param datetime $date
220
+ * @param integer $senderSiteId Signed 64-bit integer sender's site ID;
221
+ * @param integer $receiverSiteId Signed 64-bit integer receiver's site ID;
222
+ * @param integer $senderCountryId Signed 64-bit integer sender's country ID (added in 2.5.0);
223
+ * @param string $senderPostCode sender's post code (added in 2.5.0);
224
+ * @param integer $receiverCountryId Signed 64-bit integer receiver's country ID (added in 2.5.0);
225
+ * @param string $receiverPostCode receiver's post code (added in 2.5.0);
226
+ * @param ParamLanguage $language language (added in 2.5.0)
227
+ * @throws ServerException Thrown in case communication with server has failed
228
+ * @return array List of ResultCourierServiceExt instances
229
+ * @param $senderId (signed 64-bit integer nullable) – Sender ID (added in 2.9.0);
230
+ * @param $receiverId (signed 64-bit integer nullable) – Receiver ID (added in 2.9.0);
231
+ * @param $senderOfficeId (signed 64-bit integer nullable) – Sender office ID (added in 2.9.0);
232
+ * @param $receiverOfficeId (signed 64-bit integer nullable) Receiver office ID (added in 2.9.0);
233
+ */
234
+ public function listServicesForSites(
235
+ $date, $senderSiteId, $receiverSiteId,
236
+ $senderCountryId = null, $senderPostCode = null, $receiverCountryId = null, $receiverPostCode = null, $language = null,
237
+ $senderId = null, $receiverId = null, $senderOfficeId = null, $receiverOfficeId = null
238
+ ) {
239
+ $this->checkStateBeforeCall();
240
+ return $this->_epsInterfaceImpl->listServicesForSites(
241
+ $this->getResultLogin(true)->getSessionId(), $date, $senderSiteId, $receiverSiteId,
242
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language,
243
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
244
+ );
245
+ }
246
+
247
+ /**
248
+ * Returns the min/max weight allowed for the given shipment parameters
249
+ * @since 2.5.0
250
+ * @param integer $serviceTypeId Signed 64-bit ID of the courier service
251
+ * @param integer $senderSiteId Signed 64-bit Sender's site ID
252
+ * @param integer $receiverSiteId Signed 64-bit Receiver's site ID
253
+ * @param date $date
254
+ * @param boolean $documents Specifies if the shipment consists of documents
255
+ * @param integer $senderCountryId Signed 64-bit Sender's country ID (added in 2.5.0)
256
+ * @param string $senderPostCode Sender's post code (added in 2.5.0)
257
+ * @param integer $receiverCountryId Signed 64-bit Receiver's country ID (added in 2.5.0)
258
+ * @param string $receiverPostCode Receiver's post code (added in 2.5.0)
259
+ * @throws ClientException Thrown in case EPS interface implementation is not set
260
+ * @throws ServerException Thrown in case communication with server has failed
261
+ * @param $senderId (signed 64-bit integer nullable) – Sender ID (added in 2.9.0);
262
+ * @param $receiverId (signed 64-bit integer nullable) – Receiver ID (added in 2.9.0);
263
+ * @param $senderOfficeId (signed 64-bit integer nullable) Sender office ID (added in 2.9.0);
264
+ * @param $receiverOfficeId (signed 64-bit integer nullable) – Receiver office ID (added in 2.9.0);
265
+ * @return ResultMinMaxReal
266
+ */
267
+ public function getWeightInterval(
268
+ $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
269
+ $senderCountryId = null, $senderPostCode = null, $receiverCountryId = null, $receiverPostCode = null,
270
+ $senderId = null, $receiverId = null, $senderOfficeId = null, $receiverOfficeId = null
271
+ ) {
272
+ $this->checkStateBeforeCall();
273
+ return $this->_epsInterfaceImpl->getWeightInterval(
274
+ $this->getResultLogin(true)->getSessionId(), $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
275
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode,
276
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
277
+ );
278
+ }
279
+
280
+ /**
281
+ * Returns CSV-formatted data (depending on the nomenType value).
282
+ * Column numbers can change in the future so it's recommended to address the data using the column names in the header row.
283
+ * The data for some nomenTypes requires a payed license (additional licensing contract) and permissions (access rights).
284
+ * To obtain such license please contact our IT department or your Speedy key account manager.
285
+ * Type 1 - returns a list of all countries
286
+ * Type 50 - returns a list of all states
287
+ * Type 100 - returns a list of all sites.
288
+ * Type 300 - returns a list of all streets (requires a license).
289
+ * Type 400 - returns a list of all quarters (requires a license).
290
+ * Type 500 - returns a list of all common objects (requires a license).
291
+ * Type 700 - returns a list of all block names (requires a license).
292
+ * Type 800 - returns a list of all post codes (requires a license). * @since 1.0
293
+ * @param integer $nomenType Signed 32-bit The type of address nomenclature
294
+ * @param integer $countryId Signed 64-bit (added in 2.5.0)
295
+ * @throws ClientException Thrown in case EPS interface implementation is not set
296
+ * @throws ServerException Thrown in case communication with server has failed
297
+ * @return string CSV formatted
298
+ */
299
+ public function getAddressNomenclature($nomenType, $countryId = null) {
300
+ $this->checkStateBeforeCall();
301
+ return $this->_epsInterfaceImpl->getAddressNomenclature($this->getResultLogin(true)->getSessionId(), $nomenType, $countryId);
302
+ }
303
+
304
+ /**
305
+ * Returns a list of all sites.
306
+ * Note: This method is relatively slow (because of the size of its response). You shouldn't call it more than several times a day.
307
+ * The methods is designed to provide data which should be locally stored/cached by client apps.
308
+ * The address-related nomenclature data is updated only several times a year.
309
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
310
+ * @param integer $countryId signed 64-bit Country id (added in 2.5.0)
311
+ * @since 1.0
312
+ * @throws ClientException Thrown in case EPS interface implementation is not set
313
+ * @throws ServerException Thrown in case communication with server has failed
314
+ * @return array List of ResultSite instances
315
+ */
316
+ public function listAllSites($language = null, $countryId = null) {
317
+ $this->checkStateBeforeCall();
318
+ return $this->_epsInterfaceImpl->listAllSites($this->getResultLogin(true)->getSessionId(), $language, $countryId);
319
+ }
320
+
321
+ /**
322
+ * Returns a site by ID
323
+ * @since 1.0
324
+ * @param integer $siteId Signed 64-bit Site ID
325
+ * @throws ClientException Thrown in case EPS interface implementation is not set
326
+ * @throws ServerException Thrown in case communication with server has failed
327
+ * @return ResultSite
328
+ */
329
+ public function getSiteById($siteId) {
330
+ $this->checkStateBeforeCall();
331
+ return $this->_epsInterfaceImpl->getSiteById($this->getResultLogin(true)->getSessionId(), $siteId);
332
+ }
333
+
334
+ /**
335
+ * Returns sites having either full or partial address nomenclature (streets, quarters etc.).
336
+ * @since 1.0
337
+ * @param AddrNomen $addrNomen Only values FULL and PARTIAL are allowed
338
+ * @throws ClientException Thrown in case EPS interface implementation is not set
339
+ * @throws ServerException Thrown in case communication with server has failed
340
+ * @return array List of ResultSite
341
+ */
342
+ public function getSitesByAddrNomenType($addrNomen) {
343
+ $this->checkStateBeforeCall();
344
+ return $this->_epsInterfaceImpl->getSitesByAddrNomenType($this->getResultLogin(true)->getSessionId(), $addrNomen);
345
+ }
346
+
347
+ /**
348
+ * Returns a list of the most common types of streets.
349
+ * @since 1.0
350
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
351
+ * @throws ClientException Thrown in case EPS interface implementation is not set
352
+ * @throws ServerException Thrown in case communication with server has failed
353
+ * @return array string List of the most common types of streets
354
+ */
355
+ public function listStreetTypes($language = null) {
356
+ $this->checkStateBeforeCall();
357
+ return $this->_epsInterfaceImpl->listStreetTypes($this->getResultLogin(true)->getSessionId(), $language);
358
+ }
359
+
360
+ /**
361
+ * Returns a list of the most common types of quarters (districts).
362
+ * @since 1.0
363
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
364
+ * @throws ClientException Thrown in case EPS interface implementation is not set
365
+ * @throws ServerException Thrown in case communication with server has failed
366
+ * @return array string List of the most common types of quarters (districts).
367
+ */
368
+ public function listQuarterTypes($language = null) {
369
+ $this->checkStateBeforeCall();
370
+ return $this->_epsInterfaceImpl->listQuarterTypes($this->getResultLogin(true)->getSessionId(), $language);
371
+ }
372
+
373
+ /**
374
+ * Returns a list of streets matching the search criteria
375
+ * The list is limited to 10 records.
376
+ * @since 1.0
377
+ * @param string $name Street name (or part of it)
378
+ * @param integer $siteId Signed 64-bit Site ID
379
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
380
+ * @throws ClientException Thrown in case EPS interface implementation is not set
381
+ * @throws ServerException Thrown in case communication with server has failed
382
+ * @return array ResultStreet List of streets
383
+ */
384
+ public function listStreets($name, $siteId, $language = null) {
385
+ $this->checkStateBeforeCall();
386
+ return $this->_epsInterfaceImpl->listStreets($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
387
+ }
388
+
389
+ /**
390
+ * Returns a list of quarters matching the search criteria
391
+ * The list is limited to 10 records.
392
+ * @since 1.0
393
+ * @param string $name Quarter name (or part of it)
394
+ * @param integer $siteId Signed 64-bit Site ID
395
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
396
+ * @throws ClientException Thrown in case EPS interface implementation is not set
397
+ * @throws ServerException Thrown in case communication with server has failed
398
+ * @return array ResultQuarter List of quarters
399
+ */
400
+ public function listQuarters($name, $siteId, $language = null) {
401
+ $this->checkStateBeforeCall();
402
+ return $this->_epsInterfaceImpl->listQuarters($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
403
+ }
404
+
405
+ /**
406
+ * Returns a list of common objects matching the search criteria.
407
+ * The list is limited to 10 records.
408
+ * @since 1.0
409
+ * @param string $name Common object name (or part of it)
410
+ * @param integer $siteId Signed 64-bit Site ID
411
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
412
+ * @throws ClientException Thrown in case EPS interface implementation is not set
413
+ * @throws ServerException Thrown in case communication with server has failed
414
+ * @return array ResultCommonObject List of common objects
415
+ */
416
+ public function listCommonObjects($name, $siteId, $language = null) {
417
+ $this->checkStateBeforeCall();
418
+ return $this->_epsInterfaceImpl->listCommonObjects($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
419
+ }
420
+
421
+ /**
422
+ * Returns a list of blocks matching the search criteria.
423
+ * The list is limited to 10 records.
424
+ * @since 1.0
425
+ * @param string $name Block name (or part of it)
426
+ * @param integer $siteId Signed 64-bit Site ID
427
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
428
+ * @throws ClientException Thrown in case EPS interface implementation is not set
429
+ * @throws ServerException Thrown in case communication with server has failed
430
+ * @return array string List of blocks
431
+ */
432
+ public function listBlocks($name, $siteId, $language = null) {
433
+ $this->checkStateBeforeCall();
434
+ return $this->_epsInterfaceImpl->listBlocks($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
435
+ }
436
+
437
+ /**
438
+ * Returns a list of Speedy offices matching the search criteria
439
+ * The list is limited to 10 records.
440
+ * @since 1.0
441
+ * @param string $name Office name (or part of it);
442
+ * @param integer $siteId Signed 64-bit Site ID
443
+ * @throws ClientException Thrown in case EPS interface implementation is not set
444
+ * @throws ServerException Thrown in case communication with server has failed
445
+ * @return array ResultOffice List of offices
446
+ */
447
+ public function listOffices($name, $siteId) {
448
+ $this->checkStateBeforeCall();
449
+ return $this->_epsInterfaceImpl->listOffices($this->getResultLogin(true)->getSessionId(), $name, $siteId);
450
+ }
451
+
452
+ /**
453
+ * Returns data for client by ID.
454
+ * Allowed values for clientId are only the ones of members of the user's contract and the predefined partners
455
+ * in the WebClients application.
456
+ * @since 1.0
457
+ * @param integer $clientId Signed 64-bit integer Client/Partner ID
458
+ * @throws ClientException Thrown in case EPS interface implementation is not set
459
+ * @throws ServerException Thrown in case communication with server has failed
460
+ * @return ResultClientData
461
+ */
462
+ public function getClientById($clientId) {
463
+ $this->checkStateBeforeCall();
464
+ return $this->_epsInterfaceImpl->getClientById($this->getResultLogin(true)->getSessionId(), $clientId);
465
+ }
466
+
467
+ /**
468
+ * Returns the dates when the shipment can be ordered for pick-up.
469
+ * The "time" component represents the deadline for creating an order
470
+ * (or the deadline for delivering the shipment to a Speedy office when senderOfficeId is set).
471
+ * (This method could be used for the "takingDate" property of ParamPicking or ParamCalculation.)
472
+ * Note: Either senderSiteId or senderOfficeId should be set, or neither of them. Both parameters having "not null" values is not allowed.
473
+ * @since 2.5.0
474
+ * @param integer $serviceTypeId
475
+ * @param integer $senderSiteId Signed 64-bit – Sender's site ID
476
+ * @param integer $senderOfficeId Signed 64-bit – If the sender intends to deliver the shipment to a Speedy office, the office ID could be set as a filter
477
+ * @param date $minDate - When the "time" component is set then this date is to be included in the result list only if the time is not after the working time of Speedy;
478
+ * @param integer $senderCountryId Signed 64-bit Sender's country id (added in 2.5.0)
479
+ * @param string $senderPostCode Sender's post code (added in 2.5.0)
480
+ * @throws ClientException Thrown in case EPS interface implementation is not set
481
+ * @throws ServerException Thrown in case communication with server has failed
482
+ * @param integer $senderId Signed 64-bit Sender's ID (added in 2.9.0)
483
+ * @return array List of dates
484
+ */
485
+ public function getAllowedDaysForTaking(
486
+ $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId = null, $senderPostCode = null, $senderId = null
487
+ ) {
488
+ $this->checkStateBeforeCall();
489
+ return $this->_epsInterfaceImpl->getAllowedDaysForTaking(
490
+ $this->getResultLogin(true)->getSessionId(), $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate,
491
+ $senderCountryId, $senderPostCode, $senderId
492
+ );
493
+ }
494
+
495
+ /**
496
+ * Returns a list of addresses matching the search criteria.
497
+ * @since 1.0
498
+ * @param ParamAddressSearch $address Search criteria (filter)
499
+ * @throws ClientException Thrown in case EPS interface implementation is not set
500
+ * @throws ServerException Thrown in case communication with server has failed
501
+ * @return array List of ResultAddressSearch
502
+ */
503
+ public function addressSearch($address) {
504
+ $this->checkStateBeforeCall();
505
+ return $this->_epsInterfaceImpl->addressSearch($this->getResultLogin(true)->getSessionId(), $address);
506
+ }
507
+
508
+ /**
509
+ * Calculate method
510
+ * @since 1.0
511
+ * @param ParamCalculation $calculation
512
+ * @throws ClientException Thrown in case EPS interface implementation is not set
513
+ * @throws ServerException Thrown in case communication with server has failed
514
+ * @return ResultCalculation
515
+ */
516
+ public function calculate($calculation) {
517
+ $this->checkStateBeforeCall();
518
+ return $this->_epsInterfaceImpl->calculate($this->getResultLogin(true)->getSessionId(), $calculation);
519
+ }
520
+
521
+ /**
522
+ * This method could be used for preliminary check-up of shipment's price for a range of courier services.
523
+ * @since 1.0
524
+ * @param ParamCalculation $calculation Data needed to perform the calculation;
525
+ * @param array $serviceTypeIds List<signed 64-bit integer> – A list of courier service IDs for which price needs to be calculated
526
+ * @throws ClientException Thrown in case EPS interface implementation is not set
527
+ * @throws ServerException Thrown in case communication with server has failed
528
+ * @return array List of ResultCalculationMS
529
+ */
530
+ public function calculateMultipleServices($calculation, $serviceTypeIds) {
531
+ $this->checkStateBeforeCall();
532
+ return $this->_epsInterfaceImpl->calculateMultipleServices($this->getResultLogin(true)->getSessionId(), $calculation, $serviceTypeIds);
533
+ }
534
+
535
+ /**
536
+ * This is an alternative method for shipment price calculation where the parameter is of type ParamPicking.
537
+ * Clients are encouraged to use the method that best fits their needs.
538
+ * @since 1.0
539
+ * @param ParamPicking $picking
540
+ * @throws ClientException Thrown in case EPS interface implementation is not set
541
+ * @throws ServerException Thrown in case communication with server has failed
542
+ * @return ResultCalculation
543
+ */
544
+ public function calculatePicking($picking) {
545
+ $this->checkStateBeforeCall();
546
+ return $this->_epsInterfaceImpl->calculatePicking($this->getResultLogin(true)->getSessionId(), $picking);
547
+ }
548
+
549
+ /**
550
+ * The method used to create BOL.
551
+ * @since 1.0
552
+ * @param ParamPicking $picking
553
+ * @throws ClientException Thrown in case EPS interface implementation is not set
554
+ * @throws ServerException Thrown in case communication with server has failed
555
+ * @return ResultBOL
556
+ */
557
+ public function createBillOfLading($picking) {
558
+ $this->checkStateBeforeCall();
559
+ return $this->_epsInterfaceImpl->createBillOfLading($this->getResultLogin(true)->getSessionId(), $picking);
560
+ }
561
+
562
+ /**
563
+ * Used for creating PDF documents to be printed (BOLs, labels etc.)
564
+ * Examples:
565
+ * •Bill of Lading;
566
+ * •Bill of Lading with "cash on delivery";
567
+ * •Custom travel label (type 20);
568
+ * •Custom travel label (type 20) with "cash on delivery".
569
+ * @since 1.0
570
+ * @param ParamPDF $params
571
+ * @throws ClientException Thrown in case EPS interface implementation is not set
572
+ * @throws ServerException Thrown in case communication with server has failed
573
+ * @return array bytes
574
+ */
575
+ public function createPDF($params) {
576
+ $this->checkStateBeforeCall();
577
+ return $this->_epsInterfaceImpl->createPDF($this->getResultLogin(true)->getSessionId(), $params);
578
+ }
579
+
580
+ /**
581
+ * Creates PDF document for BOL.
582
+ * The method is deprecated, "createPDF" should be used instead.
583
+ * @deprecated The method is deprecated, "createPDF" should be used instead.
584
+ * @since 1.0
585
+ * @param integer $billOfLading Signed 64-bit
586
+ * @param boolean $includeAutoPrintJS Specifies if embedded JavaScript code for direct printing to be generated
587
+ * @throws ClientException Thrown in case EPS interface implementation is not set
588
+ * @throws ServerException Thrown in case communication with server has failed
589
+ * @return array of bytes
590
+ */
591
+ public function createBillOfLadingPDF($billOfLading, $includeAutoPrintJS) {
592
+ $this->checkStateBeforeCall();
593
+ return $this->_epsInterfaceImpl->createBillOfLadingPDF($this->getResultLogin(true)->getSessionId(), $billOfLading, $includeAutoPrintJS);
594
+ }
595
+
596
+ /**
597
+ * Creates PDF document of "type I". The method is deprecated, "createPDF" should be used instead.
598
+ * @deprecated The method is deprecated, "createPDF" should be used instead.
599
+ * @since 1.0
600
+ * @param integer $parcelId Signed 64-bit Parcel ID
601
+ * @throws ClientException Thrown in case EPS interface implementation is not set
602
+ * @throws ServerException Thrown in case communication with server has failed
603
+ * @return array of bytes
604
+ */
605
+ public function createCustomTravelLabelPDFType1($parcelId) {
606
+ $this->checkStateBeforeCall();
607
+ return $this->_epsInterfaceImpl->createCustomTravelLabelPDFType1($this->getResultLogin(true)->getSessionId(), $parcelId);
608
+ }
609
+
610
+ /**
611
+ * Used to cancel BOL.
612
+ * Only allowed when the shipment is neither ordered nor picked up by Speedy.
613
+ * @since 1.0
614
+ * @param integer $billOfLading Signed 64-bit
615
+ * @param string $cancelComment
616
+ * @throws ClientException Thrown in case EPS interface implementation is not set
617
+ * @throws ServerException Thrown in case communication with server has failed
618
+ */
619
+ public function invalidatePicking($billOfLading, $cancelComment=null) {
620
+ $this->checkStateBeforeCall();
621
+ return $this->_epsInterfaceImpl->invalidatePicking($this->getResultLogin(true)->getSessionId(), $billOfLading, $cancelComment);
622
+ }
623
+
624
+ /**
625
+ * This method is used to update BOL.
626
+ * Only allowed if BOL was created with pendingShipmentDescription = true.
627
+ * @since 1.0
628
+ * @param ParamPicking $picking Data for the shipment (BOL)
629
+ * @throws ClientException Thrown in case EPS interface implementation is not set
630
+ * @throws ServerException Thrown in case communication with server has failed
631
+ * @return ResultBOL
632
+ */
633
+ public function updateBillOfLading($picking) {
634
+ $this->checkStateBeforeCall();
635
+ return $this->_epsInterfaceImpl->updateBillOfLading($this->getResultLogin(true)->getSessionId(), $picking);
636
+ }
637
+
638
+ /**
639
+ * This method is used to add parcel to an existing BOL
640
+ * (only allowed if BOL was created with pendingParcelsDescription = true).
641
+ * @since 1.0
642
+ * @param ParamParcel $parcel Parcel data
643
+ * @throws ClientException Thrown in case EPS interface implementation is not set
644
+ * @throws ServerException Thrown in case communication with server has failed
645
+ * @return integer Signed 64-bit parcel's ID
646
+ */
647
+ public function addParcel($parcel) {
648
+ $this->checkStateBeforeCall();
649
+ return $this->_epsInterfaceImpl->addParcel($this->getResultLogin(true)->getSessionId(), $parcel);
650
+ }
651
+
652
+ /**
653
+ * Makes BOL "fully created".
654
+ * Only applies to BOLs created with pendingParcelsDescription = true.
655
+ * @since 1.0
656
+ * @param integer $billOfLading Signed 64-bit
657
+ * @throws ClientException Thrown in case EPS interface implementation is not set
658
+ * @throws ServerException Thrown in case communication with server has failed
659
+ * @return ResultBOL
660
+ */
661
+ public function finalizeBillOfLadingCreation($billOfLading) {
662
+ $this->checkStateBeforeCall();
663
+ return $this->_epsInterfaceImpl->finalizeBillOfLadingCreation($this->getResultLogin(true)->getSessionId(), $billOfLading);
664
+ }
665
+
666
+ /**
667
+ * Creates an order for shipments pick-up (i.e. a visit by courier of Speedy).
668
+ * The retuned list contains objects corresponding to each BOL (one object per BOL).
669
+ * When the validation errors list of at least one of the objects is not empty, that means the order has not been created.
670
+ * @since 1.0
671
+ * @param ParamOrder $order Order details
672
+ * @throws ClientException Thrown in case EPS interface implementation is not set
673
+ * @throws ServerException Thrown in case communication with server has failed
674
+ * @return array List of ResultOrderPickingInfo
675
+ */
676
+ public function createOrder($order) {
677
+ $this->checkStateBeforeCall();
678
+ return $this->_epsInterfaceImpl->createOrder($this->getResultLogin(true)->getSessionId(), $order);
679
+ }
680
+
681
+ /**
682
+ * Returns a list with all parcels of a shipment.
683
+ * @since 1.0
684
+ * @param integer $billOfLading Signed 64-bit
685
+ * @throws ClientException Thrown in case EPS interface implementation is not set
686
+ * @throws ServerException Thrown in case communication with server has failed
687
+ * @return array List of ResultParcelInfo
688
+ */
689
+ public function getPickingParcels($billOfLading) {
690
+ $this->checkStateBeforeCall();
691
+ return $this->_epsInterfaceImpl->getPickingParcels($this->getResultLogin(true)->getSessionId(), $billOfLading);
692
+ }
693
+
694
+ /**
695
+ * This method can be used to track the state/history of a shipment.
696
+ * @deprecated Use trackPickingEx instead
697
+ * @since 1.0
698
+ * @param integer $billOfLading Signed 64-bit (@since 2.9.0 @param string $billOfLading)
699
+ * @throws ClientException Thrown in case EPS interface implementation is not set
700
+ * @throws ServerException Thrown in case communication with server has failed
701
+ * @return array List of ResultTrackPicking
702
+ */
703
+ public function trackPicking($billOfLading) {
704
+ $this->checkStateBeforeCall();
705
+ return $this->_epsInterfaceImpl->trackPicking($this->getResultLogin(true)->getSessionId(), $billOfLading);
706
+ }
707
+
708
+ /**
709
+ * This method can be used to track the state/history of a shipment.
710
+ * @since 1.2
711
+ * @param integer $billOfLading Signed 64-bit (@since 2.9.0 @param string $billOfLading)
712
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
713
+ * @throws ClientException Thrown in case EPS interface implementation is not set
714
+ * @throws ServerException Thrown in case communication with server has failed
715
+ * @return array List of ResultTrackPickingEx
716
+ * @since 2.9.0
717
+ * @param boolean returnOnlyLastOperation; false is the default value
718
+ */
719
+ public function trackPickingEx($billOfLading, $language, $returnOnlyLastOperation = false) {
720
+ $this->checkStateBeforeCall();
721
+ return $this->_epsInterfaceImpl->trackPickingEx($this->getResultLogin(true)->getSessionId(), $billOfLading, $language, $returnOnlyLastOperation);
722
+ }
723
+
724
+ /**
725
+ * This method can be used to track the state/history of a shipment.
726
+ * @since 1.4
727
+ * @param integer $parcelId Signed 64-bit (@since 2.9.0 @param string $parcelId)
728
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
729
+ * @throws ClientException Thrown in case EPS interface implementation is not set
730
+ * @throws ServerException Thrown in case communication with server has failed
731
+ * @return array List of ResultTrackPickingEx
732
+ * @since 2.9.0
733
+ * @param boolean returnOnlyLastOperation; false is the default value
734
+ */
735
+ public function trackParcel($parcelId, $language, $returnOnlyLastOperation = false) {
736
+ $this->checkStateBeforeCall();
737
+ return $this->_epsInterfaceImpl->trackParcel($this->getResultLogin(true)->getSessionId(), $parcelId, $language, $returnOnlyLastOperation);
738
+ }
739
+
740
+ /**
741
+ * This method can be used to track the state/history of a shipment parcel.
742
+ * @since 2.8.0
743
+ * @param List of integer (Signed 64-bit) $barcodes (@since 2.9.0 @param string $barcodes)
744
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
745
+ * @throws ServerException Thrown in case communication with server has failed
746
+ * @return array List of ResultTrackPickingEx
747
+ * @since 2.9.0
748
+ * @param boolean returnOnlyLastOperation; false is the default value
749
+ */
750
+ public function trackParcelMultiple($barcodes, $language, $returnOnlyLastOperation = false) {
751
+ $this->checkStateBeforeCall();
752
+ return $this->_epsInterfaceImpl->trackParcelMultiple($this->getResultLogin(true)->getSessionId(), $barcodes, $language, $returnOnlyLastOperation);
753
+ }
754
+
755
+
756
+ /**
757
+ * Search BOLs by reference codes (ref1 and/or ref2).
758
+ * @since 1.0
759
+ * @param ParamSearchByRefNum $params
760
+ * @throws ClientException Thrown in case EPS interface implementation is not set
761
+ * @throws ServerException Thrown in case communication with server has failed
762
+ * @return array List of BOLs found (signed 64-bit integers)
763
+ */
764
+ public function searchPickingsByRefNumber($params) {
765
+ $this->checkStateBeforeCall();
766
+ return $this->_epsInterfaceImpl->searchPickingsByRefNumber($this->getResultLogin(true)->getSessionId(), $params);
767
+ }
768
+
769
+ /**
770
+ * Get microregion id for provided GPS coordinates
771
+ * @since 1.5
772
+ * @param signed 64-bit treal $coordX
773
+ * @param signed 64-bit treal $coordY
774
+ * @throws ClientException Thrown in case EPS interface implementation is not set
775
+ * @throws ServerException Thrown in case communication with server has failed
776
+ * @return Mocregion id (signed 64-bit integer)
777
+ */
778
+ public function getMicroregionId($coordX, $coordY) {
779
+ $this->checkStateBeforeCall();
780
+ return $this->_epsInterfaceImpl->getMicroregionId($this->getResultLogin(true)->getSessionId(), $coordX, $coordY);
781
+ }
782
+
783
+ /**
784
+ * Returns data for clients by specified client ID or other search criteria.
785
+ * If client ID is specified the behaviour of this method is the same as getClientById.
786
+ * Otherwise, the search returns results that satisfy search criteria
787
+ * @since 1.6
788
+ * @param ParamClientSearch $clientQuery
789
+ * @throws ClientException Thrown in case EPS interface implementation is not set
790
+ * @throws ServerException Thrown in case communication with server has failed
791
+ * @return array List of ResultClientData
792
+ */
793
+ public function searchClients($clientQuery) {
794
+ $this->checkStateBeforeCall();
795
+ return $this->_epsInterfaceImpl->searchClients($this->getResultLogin(true)->getSessionId(), $clientQuery);
796
+ }
797
+
798
+
799
+ /**
800
+ * Returns list with available special delivery requirements for logged user
801
+ * @throws ClientException Thrown in case EPS interface implementation is not set
802
+ * @throws ServerException Thrown in case communication with server has failed
803
+ * @return array List of ResultSpecialDeliveryRequirement
804
+ * @since 2.1.0
805
+ */
806
+ public function listSpecialDeliveryRequirements() {
807
+ $this->checkStateBeforeCall();
808
+ return $this->_epsInterfaceImpl->listSpecialDeliveryRequirements($this->getResultLogin(true)->getSessionId());
809
+ }
810
+
811
+ /**
812
+ * Validates address and returns validation result
813
+ * - validationMode = 0 (default) - Extended validation w/o GIS info (address uniqueness is not verified);
814
+ * - validationMode = 1 (NOT IMPLEMENTED YET - reserved for future implementation) Extended validation with GIS info (address uniqueness is verified);
815
+ * - validationMode = 2 - basic validation (the same as address validation in createBillOfLading)
816
+ * @param ParamAddress $address
817
+ * @param integer $validationMode signed 32 bit
818
+ * @throws ServerException Thrown in case communication with server has failed
819
+ * @throws ClientException Thrown in case EPS interface implementation is not set
820
+ * @throws PickingValidationException Thrown in case address validation has failed
821
+ * @return boolean Validation result flag
822
+ * @since 2.2.0
823
+ */
824
+ public function validateAddress($address, $validationMode) {
825
+ $this->checkStateBeforeCall();
826
+ return $this->_epsInterfaceImpl->validateAddress($this->getResultLogin(true)->getSessionId(), $address, $validationMode);
827
+ }
828
+
829
+ /**
830
+ * Returns all client objects ( including logged user's ) having the same contract as logged client's contract.
831
+ * @throws ServerException Thrown in case communication with server has failed
832
+ * @throws ClientException Thrown in case EPS interface implementation is not set
833
+ * @return List of ResultClientData
834
+ * @since 2.2.0
835
+ */
836
+ public function listContractClients() {
837
+ $this->checkStateBeforeCall();
838
+ return $this->_epsInterfaceImpl->listContractClients($this->getResultLogin(true)->getSessionId());
839
+ }
840
+
841
+ /**
842
+ * Returns a list of Speedy offices matching the search criteria
843
+ * The list is limited to 10 records.
844
+ * @since 2.2.0
845
+ * @param string $name Office name (or part of it);
846
+ * @param integer $siteId Signed 64-bit Site ID
847
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG (added in 2.3.0)
848
+ * @throws ServerException Thrown in case communication with server has failed
849
+ * @throws ClientException Thrown in case EPS interface implementation is not set
850
+ * @return array ResultOfficeEx List of offices
851
+ */
852
+ public function listOfficesEx($name, $siteId, $language = null) {
853
+ $this->checkStateBeforeCall();
854
+ return $this->_epsInterfaceImpl->listOfficesEx($this->getResultLogin(true)->getSessionId(), $name, $siteId, $language);
855
+ }
856
+
857
+ /**
858
+ * Returns deserialized address from serialized string address
859
+ * @param string $address Serialized address
860
+ * @return ParamAddress Deserliazed address
861
+ * @throws ServerException Thrown in case communication with server has failed
862
+ * @throws ClientException Thrown in case EPS interface implementation is not set
863
+ * @since 2.3.0
864
+ */
865
+ public function deserializeAddress($address) {
866
+ $this->checkStateBeforeCall();
867
+ return $this->_epsInterfaceImpl->deserializeAddress($this->getResultLogin(true)->getSessionId(), $address);
868
+ }
869
+
870
+ /**
871
+ * Returns deserialized address from serialized string address
872
+ * @param ParamAddress $address Address
873
+ * @return Serialized string address
874
+ * @throws ServerException Thrown in case communication with server has failed
875
+ * @throws ClientException Thrown in case EPS interface implementation is not set
876
+ * @since 2.3.0
877
+ */
878
+ public function serializeAddress($address) {
879
+ $this->checkStateBeforeCall();
880
+ return $this->_epsInterfaceImpl->serializeAddress($this->getResultLogin(true)->getSessionId(), $address);
881
+ }
882
+
883
+ /**
884
+ * Make address text representations - city address, local address, full address
885
+ * @param ParamAddress $address Base address
886
+ * @throws ServerException Thrown in case communication with server has failed
887
+ * @throws ClientException Thrown in case EPS interface implementation is not set
888
+ * @return ResultAddressString
889
+ */
890
+ public function makeAddressString($address) {
891
+ $this->checkStateBeforeCall();
892
+ return $this->_epsInterfaceImpl->makeAddressString($this->getResultLogin(true)->getSessionId(), $address);
893
+ }
894
+
895
+ /**
896
+ * Get list of additional user parameters
897
+ * @param date $date Effective date. If null is provided then current date is applied
898
+ * @return array signed 32-bit integers - List of additional user parameters
899
+ * @throws ClientException Thrown in case EPS interface implementation is not set
900
+ * @throws ServerException Thrown in case communication with server has failed
901
+ */
902
+ public function getAdditionalUserParams($date) {
903
+ $this->checkStateBeforeCall();
904
+ return $this->_epsInterfaceImpl->getAdditionalUserParams($this->getResultLogin(true)->getSessionId(), $date);
905
+ }
906
+
907
+ /**
908
+ * Returns a list of countries matching the search criteria.
909
+ * The result is limited to 10 records
910
+ * @param string $name Country name or part of it
911
+ * @param ParamLanguage $language Language
912
+ * @return array of ResultCountry
913
+ * @throws ClientException Thrown in case EPS interface implementation is not set
914
+ * @throws ServerException Thrown in case communication with server has failed
915
+ * @since 2.5.0
916
+ */
917
+ public function listCountries($name, $language = null) {
918
+ $this->checkStateBeforeCall();
919
+ return $this->_epsInterfaceImpl->listCountries($this->getResultLogin(true)->getSessionId(), $name, $language);
920
+ }
921
+
922
+ /**
923
+ * Returns a list of countries matching the search criteria.
924
+ * The result is limited to 10 records
925
+ * @param ParamFilterCountry $filter Country search filter
926
+ * @param ParamLanguage $language Language
927
+ * @return array of ResultCountry
928
+ * @throws ClientException Thrown in case EPS interface implementation is not set
929
+ * @throws ServerException Thrown in case communication with server has failed
930
+ * @since 2.5.0
931
+ */
932
+ public function listCountriesEx($filter, $language = null) {
933
+ $this->checkStateBeforeCall();
934
+ return $this->_epsInterfaceImpl->listCountriesEx($this->getResultLogin(true)->getSessionId(), $filter, $language);
935
+ }
936
+
937
+ /**
938
+ * Returns a list of country states matching the search criteria.
939
+ * The result is limited to 10 records
940
+ * @param integer $countryId signed 64-bit Country id
941
+ * @param string $name Country state name or part of it
942
+ * @return array of ResultState
943
+ * @throws ClientException Thrown in case EPS interface implementation is not set
944
+ * @throws ServerException Thrown in case communication with server has failed
945
+ * @since 2.5.0
946
+ */
947
+ public function listStates($countryId, $name) {
948
+ $this->checkStateBeforeCall();
949
+ return $this->_epsInterfaceImpl->listStates($this->getResultLogin(true)->getSessionId(), $countryId, $name);
950
+ }
951
+
952
+ /**
953
+ * Returns a country state by id
954
+ * @param string $stateId Country state id
955
+ * @return ResultState Country state
956
+ * @throws ClientException Thrown in case EPS interface implementation is not set
957
+ * @throws ServerException Thrown in case communication with server has failed
958
+ * @since 2.5.0
959
+ */
960
+ public function getStateById($stateId) {
961
+ $this->checkStateBeforeCall();
962
+ return $this->_epsInterfaceImpl->getStateById($this->getResultLogin(true)->getSessionId(), $stateId);
963
+ }
964
+
965
+ /**
966
+ * Validates post code
967
+ * @param integer $countryId signed 64-bit Country id
968
+ * @param string $postCode Post code
969
+ * @return True or false regarding the post code validation result
970
+ * @throws ClientException Thrown in case EPS interface implementation is not set
971
+ * @throws ServerException Thrown in case communication with server has failed
972
+ * @since 2.5.0
973
+ */
974
+ public function validatePostCode($countryId, $postCode) {
975
+ $this->checkStateBeforeCall();
976
+ return $this->_epsInterfaceImpl->validatePostCode($this->getResultLogin(true)->getSessionId(), $countryId, $postCode);
977
+ }
978
+
979
+ /**
980
+ * This method can be used to get delivery info for a shipment.
981
+ * Returns null if no info is available
982
+ * @since 2.6.0
983
+ * @param billOfLading Signed 64-bit
984
+ * @param language Language
985
+ * @throws ServerException Thrown in case communication with server has failed
986
+ * @return ResultTrackPickingEx
987
+ */
988
+ public function getPickingDeliveryInfo($billOfLading, $language) {
989
+ $this->checkStateBeforeCall();
990
+ return $this->_epsInterfaceImpl->getPickingDeliveryInfo($this->getResultLogin(true)->getSessionId(), $billOfLading, $language);
991
+ }
992
+
993
+ /**
994
+ * Returns a list with all not canceled pickings, which are secondary to the picking with the specified billOfLading.
995
+ * @since 2.6.0
996
+ * @param paramSearchSecondaryPickings ParamSearchSecondaryPickings
997
+ * @return List of ResultPickingInfo
998
+ */
999
+ public function searchSecondaryPickings($paramSearchSecondaryPickings) {
1000
+ $this->checkStateBeforeCall();
1001
+ return $this->_epsInterfaceImpl->searchSecondaryPickings($this->getResultLogin(true)->getSessionId(), $paramSearchSecondaryPickings);
1002
+ }
1003
+
1004
+ /**
1005
+ * Returns extended information about the picking with the specified billOfLading.
1006
+ * @param integer $billOfLading signed 64-bit
1007
+ * @return List of ResultPickingExtendedInfo Information about picking
1008
+ * @since 2.9.0
1009
+ */
1010
+ public function getPickingExtendedInfo($billOfLading) {
1011
+ $this->checkStateBeforeCall();
1012
+ return $this->_epsInterfaceImpl->getPickingExtendedInfo($this->getResultLogin(true)->getSessionId(), $billOfLading);
1013
+ }
1014
+ }
1015
  ?>
lib/SpeedyEPS/ver01/EPSInterface.class.php CHANGED
@@ -1,704 +1,735 @@
1
- <?php
2
-
3
- require_once 'ServerException.class.php';
4
- require_once 'ResultAddressString.class.php';
5
- require_once 'ResultLogin.class.php';
6
- require_once 'ResultSite.class.php';
7
- require_once 'ResultSiteEx.class.php';
8
- require_once 'ResultCourierService.class.php';
9
- require_once 'ResultCourierServiceExt.class.php';
10
- require_once 'ResultMinMaxReal.class.php';
11
- require_once 'ResultStreet.class.php';
12
- require_once 'ResultQuarter.class.php';
13
- require_once 'ResultCommonObject.class.php';
14
- require_once 'ResultOffice.class.php';
15
- require_once 'ResultOfficeEx.class.php';
16
- require_once 'ResultClientData.class.php';
17
- require_once 'ResultAddressSearch.class.php';
18
- require_once 'ResultCalculation.class.php';
19
- require_once 'ResultCalculationMS.class.php';
20
- require_once 'ResultBOL.class.php';
21
- require_once 'ResultOrderPickingInfo.class.php';
22
- require_once 'ResultTrackPicking.class.php';
23
- require_once 'ResultTrackPickingEx.class.php';
24
- require_once 'ResultSpecialDeliveryRequirement.class.php';
25
- require_once 'ResultCountry.class.php';
26
- require_once 'ResultState.class.php';
27
- require_once 'ResultPickingInfo.class.php';
28
- require_once 'ParamCalculation.class.php';
29
- require_once 'ParamFilterSite.class.php';
30
- require_once 'ParamAddress.class.php';
31
- require_once 'ParamAddressSearch.class.php';
32
- require_once 'ParamFilterCountry.class.php';
33
- require_once 'ParamLanguage.class.php';
34
- require_once 'ParamPicking.class.php';
35
- require_once 'ParamPDF.class.php';
36
- require_once 'ParamParcel.class.php';
37
- require_once 'ParamOrder.class.php';
38
- require_once 'ParamSearchByRefNum.class.php';
39
- require_once 'ParamClientSearch.class.php';
40
- require_once 'ParamSearchSecondaryPickings.class.php';
41
-
42
- /**
43
- * Speedy EPS Service Interface.
44
- * This interface should be implemented by all specific protocol class implementations (SOAP, REST, etc.)
45
- */
46
- interface EPSInterface {
47
-
48
- /**
49
- * Login web service method
50
- * @since 1.0
51
- * @param string $username User name
52
- * @param string $password User password
53
- * @throws ServerException Thrown in case communication with server has failed
54
- * @return ResultLogin Result of login
55
- */
56
- public function login($username, $password);
57
-
58
- /**
59
- * Returns whether the session is active
60
- * @since 1.0
61
- * @param string $sessionId The session ID to be tested
62
- * @param boolean $refreshSession In case the session is active, this parameter specifies if the session should be automatically refreshed
63
- * @throws ServerException Thrown in case communication with server has failed
64
- * @return boolean Session active flag
65
- */
66
- public function isSessionActive($sessionId, $refreshSession);
67
-
68
- /**
69
- * Returns the list of courier services valid on this date
70
- * @since 1.0
71
- * @param string $sessionId
72
- * @param date $date
73
- * @param ParamLanguage $language Language (added in 2.5.0)
74
- * @throws ServerException Thrown in case communication with server has failed
75
- * @return array List of ResultCourierService instances
76
- */
77
- public function listServices($sessionId, $date, $language);
78
-
79
- /**
80
- * Returns the list of courier services valid on this date and sites.
81
- * @since 1.0
82
- * @param string $sessionId
83
- * @param datetime $date
84
- * @param integer $senderSiteId Signed 64-bit integer sender's site ID;
85
- * @param integer $receiverSiteId Signed 64-bit integer receiver's site ID;
86
- * @param integer $senderCountryId Signed 64-bit integer sender's country ID (added in 2.5.0);
87
- * @param string $senderPostCode sender's post code (added in 2.5.0);
88
- * @param integer $receiverCountryId Signed 64-bit integer receiver's country ID (added in 2.5.0);
89
- * @param string $receiverPostCode receiver's post code (added in 2.5.0);
90
- * @param ParamLanguage $language language (added in 2.5.0)
91
- * @throws ServerException Thrown in case communication with server has failed
92
- * @return array List of ResultCourierServiceExt instances
93
- */
94
- public function listServicesForSites(
95
- $sessionId, $date, $senderSiteId, $receiverSiteId,
96
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language
97
- );
98
-
99
- /**
100
- * Returns a list of sites matching the search criteria.
101
- * The result is limited to 10 records
102
- * The method is deprecated starting from 2.5.0, "listSitesEx" should be used instead.
103
- * @deprecated The method is deprecated, "createPDF" should be used instead.
104
- * @since 1.0
105
- * @param string $sessionId
106
- * @param string $type
107
- * @param string $name
108
- * @param ParamLanguage $paramLanguage
109
- * @throws ServerException Thrown in case communication with server has failed
110
- * @return array List of ResultSite instances
111
- */
112
- public function listSites($sessionId, $type, $name, $paramLanguage);
113
-
114
- /**
115
- * Returns a list of sites. The method aims to find the closest matches.
116
- * The result is limited to 10 records
117
- * @since 1.0
118
- * @param string $sessionId
119
- * @param ParamFilterSite $paramFilterSite
120
- * @param ParamLanguage $language
121
- * @throws ServerException Thrown in case communication with server has failed
122
- * @return array List of ResultSiteEx instances
123
- */
124
- public function listSitesEx($sessionId, $paramFilterSite, $language);
125
-
126
- /**
127
- * Returns the min/max weight allowed for the given shipment parameters
128
- * @since 1.0
129
- * @param string $sessionId
130
- * @param integer $serviceTypeId Signed 64-bit ID of the courier service
131
- * @param integer $senderSiteId Signed 64-bit Sender's site ID
132
- * @param integer $receiverSiteId Signed 64-bit Receiver's site ID
133
- * @param date $date
134
- * @param boolean $documents Specifies if the shipment consists of documents
135
- * @param integer $senderCountryId Signed 64-bit Sender's country ID (added in 2.5.0)
136
- * @param string $senderPostCode Sender's post code (added in 2.5.0)
137
- * @param integer $receiverCountryId Signed 64-bit Receiver's country ID (added in 2.5.0)
138
- * @param string $receiverPostCode Receiver's post code (added in 2.5.0)
139
- * @throws ServerException Thrown in case communication with server has failed
140
- * @return ResultMinMaxReal
141
- */
142
- public function getWeightInterval(
143
- $sessionId, $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
144
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode
145
- );
146
-
147
- /**
148
- * Returns CSV-formatted data (depending on the nomenType value).
149
- * Column numbers can change in the future so it's recommended to address the data using the column names in the header row.
150
- * The data for some nomenTypes requires a payed license (additional licensing contract) and permissions (access rights).
151
- * To obtain such license please contact our IT department or your Speedy key account manager.
152
- * Type 1 - returns a list of all countries
153
- * Type 50 - returns a list of all states
154
- * Type 100 - returns a list of all sites.
155
- * Type 300 - returns a list of all streets (requires a license).
156
- * Type 400 - returns a list of all quarters (requires a license).
157
- * Type 500 - returns a list of all common objects (requires a license).
158
- * Type 700 - returns a list of all block names (requires a license).
159
- * Type 800 - returns a list of all post codes (requires a license).
160
- * @since 1.0
161
- * @param string $sessionId
162
- * @param integer $nomenType Signed 32-bit The type of address nomenclature
163
- * @param integer $countryId Signed 64-bit Country id (added in 2.5.0)
164
- * @throws ServerException Thrown in case communication with server has failed
165
- * @return string CSV formatted
166
- */
167
- public function getAddressNomenclature($sessionId, $nomenType, $countryId);
168
-
169
- /**
170
- * Returns a list of all sites.
171
- * Note: This method is relatively slow (because of the size of its response). You shouldn't call it more than several times a day.
172
- * The methods is designed to provide data which should be locally stored/cached by client apps.
173
- * The address-related nomenclature data is updated only several times a year.
174
- * @since 1.0
175
- * @param string $sessionId
176
- * @param ParamLanguage $paramLanguage Language
177
- * @param integer $countryId signed 64-bit Country id (added in 2.5.0)
178
- * @throws ServerException Thrown in case communication with server has failed
179
- * @return array List of ResultSite instances
180
- */
181
- public function listAllSites($sessionId, $paramLanguage, $countryId);
182
-
183
- /**
184
- * Returns a site by ID
185
- * @since 1.0
186
- * @param string $sessionId
187
- * @param integer $siteId Signed 64-bit Site ID
188
- * @throws ServerException Thrown in case communication with server has failed
189
- * @return ResultSite
190
- */
191
- public function getSiteById($sessionId, $siteId);
192
-
193
- /**
194
- * Returns sites having either full or partial address nomenclature (streets, quarters etc.).
195
- * @since 1.0
196
- * @param string $sessionId
197
- * @param AddrNomen $addrNomen Only values FULL and PARTIAL are allowed
198
- * @throws ServerException Thrown in case communication with server has failed
199
- * @return List of ResultSite
200
- */
201
- public function getSitesByAddrNomenType($sessionId, $addrNomen);
202
-
203
- /**
204
- * Returns a list of the most common types of streets.
205
- * @since 1.0
206
- * @param string $sessionId
207
- * @throws ServerException Thrown in case communication with server has failed
208
- * @return array string List of the most common types of streets
209
- */
210
- public function listStreetTypes($sessionId, $language);
211
-
212
- /**
213
- * Returns a list of the most common types of quarters (districts).
214
- * @since 1.0
215
- * @param string $sessionId
216
- * @param ParamLanguage $language
217
- * @throws ServerException Thrown in case communication with server has failed
218
- * @return array string List of the most common types of quarters (districts).
219
- */
220
- public function listQuarterTypes($sessionId, $language);
221
-
222
- /**
223
- * Returns a list of streets matching the search criteria
224
- * The list is limited to 10 records.
225
- * @since 1.0
226
- * @param string $sessionId
227
- * @param string $name Street name (or part of it)
228
- * @param integer $siteId Signed 64-bit Site ID
229
- * @param ParamLanguage $language Language
230
- * @throws ServerException Thrown in case communication with server has failed
231
- * @return array ResultStreet List of streets
232
- */
233
- public function listStreets($sessionId, $name, $siteId, $language);
234
-
235
- /**
236
- * Returns a list of quarters matching the search criteria
237
- * The list is limited to 10 records.
238
- * @since 1.0
239
- * @param string $sessionId
240
- * @param string $name Quarter name (or part of it)
241
- * @param integer $siteId Signed 64-bit Site ID
242
- * @param ParamLanguage $language Language
243
- * @throws ServerException Thrown in case communication with server has failed
244
- * @return array ResultQuarter List of streets
245
- */
246
- public function listQuarters($sessionId, $name, $siteId, $language);
247
-
248
- /**
249
- * Returns a list of common objects matching the search criteria.
250
- * The list is limited to 10 records.
251
- * @since 1.0
252
- * @param string $sessionId
253
- * @param string $name Common object name (or part of it)
254
- * @param integer $siteId Signed 64-bit Site ID
255
- * @param ParamLanguage $language Language
256
- * @throws ServerException Thrown in case communication with server has failed
257
- * @return array ResultCommonObject List of common objects
258
- */
259
- public function listCommonObjects($sessionId, $name, $siteId, $language);
260
-
261
- /**
262
- * Returns a list of blocks matching the search criteria.
263
- * The list is limited to 10 records.
264
- * @since 1.0
265
- * @param string $sessionId
266
- * @param string $name Block name (or part of it)
267
- * @param integer $siteId Signed 64-bit Site ID
268
- * @param ParamLanguage $language Language
269
- * @throws ServerException Thrown in case communication with server has failed
270
- * @return array string List of blocks
271
- */
272
- public function listBlocks($sessionId, $name, $siteId, $language);
273
-
274
- /**
275
- * Returns a list of Speedy offices matching the search criteria
276
- * The list is limited to 10 records.
277
- * @since 1.0
278
- * @param string $sessionId
279
- * @param string $name Office name (or part of it);
280
- * @param integer $siteId Signed 64-bit Site ID
281
- * @throws ServerException Thrown in case communication with server has failed
282
- * @return array ResultOffice List of offices
283
- */
284
- public function listOffices($sessionId, $name, $siteId);
285
-
286
- /**
287
- * Returns data for client by ID.
288
- * Allowed values for clientId are only the ones of members of the user's contract and the predefined partners
289
- * in the WebClients application.
290
- * @since 1.0
291
- * @param string $sessionId
292
- * @param integer $clientId Signed 64-bit integer – Client/Partner ID
293
- * @throws ServerException Thrown in case communication with server has failed
294
- * @return ResultClientData
295
- */
296
- public function getClientById($sessionId, $clientId);
297
-
298
- /**
299
- * Returns the dates when the shipment can be ordered for pick-up.
300
- * The "time" component represents the deadline for creating an order
301
- * (or the deadline for delivering the shipment to a Speedy office when senderOfficeId is set).
302
- * (This method could be used for the "takingDate" property of ParamPicking or ParamCalculation.)
303
- * Note: Either senderSiteId or senderOfficeId should be set, or neither of them. Both parameters having "not null" values is not allowed.
304
- * @since 1.0
305
- * @param string $sessionId
306
- * @param integer $serviceTypeId
307
- * @param integer $senderSiteId Signed 64-bit Sender's site ID
308
- * @param integer $senderOfficeId Signed 64-bit – If the sender intends to deliver the shipment to a Speedy office, the office ID could be set as a filter
309
- * @param date $minDate - When the "time" component is set then this date is to be included in the result list only if the time is not after the working time of Speedy;
310
- * @param integer $senderCountryId Signed 64-bit Sender's country id (added in 2.5.0)
311
- * @param string $senderPostCode Sender's post code (added in 2.5.0)
312
- * @throws ServerException Thrown in case communication with server has failed
313
- * @return array List of dates
314
- */
315
- public function getAllowedDaysForTaking(
316
- $sessionId, $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId, $senderPostCode
317
- );
318
-
319
- /**
320
- * Returns a list of addresses matching the search criteria.
321
- * @since 1.0
322
- * @param string $sessionId
323
- * @param ParamAddressSearch $address Search criteria (filter)
324
- * @throws ServerException Thrown in case communication with server has failed
325
- * @return array List of ResultAddressSearch
326
- */
327
- public function addressSearch($sessionId, $address);
328
-
329
- /**
330
- * Calculate method
331
- * @since 1.0
332
- * @param string $sessionId Session ID
333
- * @param ParamCalculation $paramCalculation
334
- * @throws ServerException Thrown in case communication with server has failed
335
- * @return ResultCalculation
336
- */
337
- public function calculate($sessionId, $calculation);
338
-
339
- /**
340
- * This method could be used for preliminary check-up of shipment's price for a range of courier services.
341
- * Service type ID field of $calculation structure is overriden by this method to required value (0) before call.
342
- * @since 1.0
343
- * @param string $sessionId
344
- * @param ParamCalculation $calculation Data needed to perform the calculation;
345
- * @param array $serviceTypeIds List<signed 64-bit integer> – A list of courier service IDs for which price needs to be calculated
346
- * @throws ServerException Thrown in case communication with server has failed
347
- * @return array List of ResultCalculationMS
348
- */
349
- public function calculateMultipleServices($sessionId, $calculation, $serviceTypeIds);
350
-
351
- /**
352
- * This is an alternative method for shipment price calculation where the parameter is of type ParamPicking.
353
- * Clients are encouraged to use the method that best fits their needs.
354
- * @since 1.0
355
- * @param string $sessionId
356
- * @param ParamPicking $picking
357
- * @throws ServerException Thrown in case communication with server has failed
358
- * @return ResultCalculation
359
- */
360
- public function calculatePicking($sessionId, $picking);
361
-
362
- /**
363
- * The method used to create BOL.
364
- * @since 1.0
365
- * @param string $sessionId
366
- * @param ParamPicking $picking Data for the shipment (BOL)
367
- * @throws ServerException Thrown in case communication with server has failed
368
- * @return ResultBOL
369
- */
370
- public function createBillOfLading($sessionId, $picking);
371
-
372
- /**
373
- * Used for creating PDF documents to be printed (BOLs, labels etc.)
374
- * Examples:
375
- * •Bill of Lading;
376
- * •Bill of Lading with "cash on delivery";
377
- * •Custom travel label (type 20);
378
- * •Custom travel label (type 20) with "cash on delivery".
379
- * @since 1.0
380
- * @param string $sessionId
381
- * @param ParamPDF $params
382
- * @throws ServerException Thrown in case communication with server has failed
383
- * @return array bytes
384
- */
385
- public function createPDF($sessionId, $params);
386
-
387
- /**
388
- * Creates PDF document for BOL.
389
- * The method is deprecated, "createPDF" should be used instead.
390
- * @deprecated The method is deprecated, "createPDF" should be used instead.
391
- * @since 1.0
392
- * @param string $sessionId
393
- * @param integer $billOfLading Signed 64-bit
394
- * @param boolean $includeAutoPrintJS Specifies if embedded JavaScript code for direct printing to be generated
395
- * @throws ServerException Thrown in case communication with server has failed
396
- * @return array of bytes
397
- */
398
- public function createBillOfLadingPDF($sessionId, $billOfLading, $includeAutoPrintJS);
399
-
400
- /**
401
- * Creates PDF document of "type I". The method is deprecated, "createPDF" should be used instead.
402
- * @deprecated The method is deprecated, "createPDF" should be used instead.
403
- * @since 1.0
404
- * @param string $sessionId
405
- * @param integer $parcelId Signed 64-bit Parcel ID
406
- * @throws ServerException Thrown in case communication with server has failed
407
- * @return array of bytes
408
- */
409
- public function createCustomTravelLabelPDFType1($sessionId, $parcelId);
410
-
411
- /**
412
- * Used to cancel BOL.
413
- * Only allowed when the shipment is neither ordered nor picked up by Speedy.
414
- * @since 1.0
415
- * @param string $sessionId
416
- * @param integer $billOfLading Signed 64-bit
417
- * @param string $cancelComment Cancel comment
418
- * @throws ServerException Thrown in case communication with server has failed
419
- */
420
- public function invalidatePicking($sessionId, $billOfLading, $cancelComment);
421
-
422
- /**
423
- * This method is used to update BOL.
424
- * Only allowed if BOL was created with pendingShipmentDescription = true.
425
- * @since 1.0
426
- * @param string $sessionId
427
- * @param ParamPicking $picking Data for the shipment (BOL)
428
- * @throws ServerException Thrown in case communication with server has failed
429
- * @return ResultBOL
430
- */
431
- public function updateBillOfLading($sessionId, $picking);
432
-
433
- /**
434
- * This method is used to add parcel to an existing BOL
435
- * (only allowed if BOL was created with pendingParcelsDescription = true).
436
- * @since 1.0
437
- * @param string $sessionId
438
- * @param ParamParcel $parcel Parcel data
439
- * @throws ServerException Thrown in case communication with server has failed
440
- * @return integer Signed 64-bit parcel's ID
441
- */
442
- public function addParcel($sessionId, $parcel);
443
-
444
- /**
445
- * Makes BOL "fully created".
446
- * Only applies to BOLs created with pendingParcelsDescription = true.
447
- * @since 1.0
448
- * @param string $sessionId
449
- * @param integer $billOfLading Signed 64-bit
450
- * @throws ServerException Thrown in case communication with server has failed
451
- * @return ResultBOL
452
- */
453
- public function finalizeBillOfLadingCreation($sessionId, $billOfLading);
454
-
455
- /**
456
- * Creates an order for shipments pick-up (i.e. a visit by courier of Speedy).
457
- * The returned list contains objects corresponding to each BOL (one object per BOL).
458
- * When the validation errors list of at least one of the objects is not empty, that means the order has not been created.
459
- * @since 1.0
460
- * @param string $sessionId
461
- * @param ParamOrder $order Order details
462
- * @throws ServerException Thrown in case communication with server has failed
463
- * @return array List of ResultOrderPickingInfo
464
- */
465
- public function createOrder($sessionId, $order);
466
-
467
- /**
468
- * Returns a list with all parcels of a shipment.
469
- * @since 1.0
470
- * @param string $sessionId
471
- * @param integer $billOfLading Signed 64-bit
472
- * @throws ServerException Thrown in case communication with server has failed
473
- * @return array List of ResultParcelInfo
474
- */
475
- public function getPickingParcels($sessionId, $billOfLading);
476
-
477
- /**
478
- * This method can be used to track the state/history of a shipment.
479
- * @deprecated Use trackPickingEx instead
480
- * @since 1.0
481
- * @param string $sessionId
482
- * @param integer $billOfLading Signed 64-bit
483
- * @throws ServerException Thrown in case communication with server has failed
484
- * @return array List of ResultTrackPicking
485
- */
486
- public function trackPicking($sessionId, $billOfLading);
487
-
488
- /**
489
- * This method can be used to track the state/history of a shipment.
490
- * @since 1.2
491
- * @param string $sessionId
492
- * @param integer $billOfLading Signed 64-bit
493
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
494
- * @throws ServerException Thrown in case communication with server has failed
495
- * @return array List of ResultTrackPickingEx
496
- */
497
- public function trackPickingEx($sessionId, $billOfLading, $language);
498
-
499
- /**
500
- * This method can be used to track the state/history of a shipment parcel.
501
- * @since 1.4
502
- * @param string $sessionId
503
- * @param integer $parcelId Signed 64-bit
504
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
505
- * @throws ServerException Thrown in case communication with server has failed
506
- * @return array List of ResultTrackPickingEx
507
- */
508
- public function trackParcel($sessionId, $parcelId, $language);
509
-
510
- /**
511
- * This method can be used to track the state/history of a shipment parcel.
512
- * @since 2.8.0
513
- * @param string $sessionId
514
- * @param List of integer (Signed 64-bit) $barcodes
515
- * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
516
- * @throws ServerException Thrown in case communication with server has failed
517
- * @return array List of ResultTrackPickingEx
518
- */
519
- public function trackParcelMultiple($sessionId, $barcodes, $language);
520
-
521
- /**
522
- * Search BOLs by reference codes (ref1 and/or ref2).
523
- * @since 1.0
524
- * @param string $sessionId
525
- * @param ParamSearchByRefNum $params
526
- * @throws ServerException Thrown in case communication with server has failed
527
- * @return array List of BOLs found (signed 64-bit integers)
528
- */
529
- public function searchPickingsByRefNumber($sessionId, $params);
530
-
531
- /**
532
- * Get microregion id for provided GPS corrdinates
533
- * @since 1.5
534
- * @param string $sessionId
535
- * @param signed 64-bit treal $coordX
536
- * @param signed 64-bit treal $coordY
537
- * @throws ServerException Thrown in case communication with server has failed
538
- * @return Mocregion id (signed 64-bit integer)
539
- */
540
- public function getMicroregionId($sessionId, $coordX, $coordY);
541
-
542
- /**
543
- * Returns data for clients by specified client ID or other search criteria.
544
- * If client ID is specified the behaviour of this method is the same as getClientById.
545
- * Otherwise, the search returns results that satisfy search criteria
546
- * @since 1.6
547
- * @param string $sessionId
548
- * @param ParamClientSearch $clientQuery
549
- * @throws ServerException Thrown in case communication with server has failed
550
- * @return array List of ResultClientData
551
- */
552
- public function searchClients($sessionId, $clientQuery);
553
-
554
- /**
555
- * Returns list with available special delivery requirements for logged user
556
- * @param string $sessionId
557
- * @throws ServerException Thrown in case communication with server has failed
558
- * @return array List of ResultSpecialDeliveryRequirement
559
- * @since 2.1.0
560
- */
561
- public function listSpecialDeliveryRequirements($sessionId);
562
-
563
- /**
564
- * Validates address and returns validation result
565
- * - validationMode = 0 (default) - Extended validation w/o GIS info (address uniqueness is not verified);
566
- * - validationMode = 1 (NOT IMPLEMENTED YET - reserved for future implementation) Extended validation with GIS info (address uniqueness is verified);
567
- * - validationMode = 2 - basic validation (the same as address validation in createBillOfLading)
568
- * @param string $sessionId
569
- * @param ParamAddress $address
570
- * @param integer $validationMode signed 32 bit
571
- * @throws ServerException Thrown in case communication with server has failed
572
- * @throws PickingValidationException Thrown in case address validation has failed
573
- * @return boolean Validation result flag
574
- * @since 2.2.0
575
- */
576
- public function validateAddress($sessionId, $address, $validationMode);
577
-
578
- /**
579
- * Returns all client objects ( including logged user's ) having the same contract as logged client's contract.
580
- * @param string $sessionId
581
- * @throws ServerException Thrown in case communication with server has failed
582
- * @return List of ResultClientData
583
- * @since 2.2.0
584
- */
585
- public function listContractClients($sessionId);
586
-
587
- /**
588
- * Returns a list of Speedy offices matching the search criteria
589
- * The list is limited to 10 records.
590
- * @since 2.2.0
591
- * @param string $sessionId
592
- * @param string $name Office name (or part of it);
593
- * @param integer $siteId Signed 64-bit Site ID
594
- * @param ParamLanguage $language Language
595
- * @throws ServerException Thrown in case communication with server has failed
596
- * @return array ResultOfficeEx List of offices
597
- */
598
- public function listOfficesEx($sessionId, $name, $siteId, $language);
599
-
600
- /**
601
- * Returns deserialized address from serialized string address
602
- * @param string $sessionId
603
- * @param string $address Serialized address
604
- * @return ParamAddress Deserliazed address
605
- * @throws ServerException Thrown in case communication with server has failed
606
- * @since 2.3.0
607
- */
608
- public function deserializeAddress($sessionId, $address);
609
-
610
- /**
611
- * Returns deserialized address from serialized string address
612
- * @param string $sessionId
613
- * @param ParamAddress $address Address
614
- * @return Serialized string address
615
- * @throws ServerException Thrown in case communication with server has failed
616
- * @since 2.3.0
617
- */
618
- public function serializeAddress($sessionId, $address);
619
-
620
- /**
621
- * Make address text representations - city address, local address, full address
622
- * @param string $sessionId
623
- * @param ParamAddress $address Base address
624
- * @return ResultAddressString
625
- * @since 2.3.0
626
- */
627
- public function makeAddressString($sessionId, $address);
628
-
629
- /**
630
- * Get list of additional user paramters
631
- * @param string $sessionId
632
- * @param date $date Effective date. If null is provided then current date is applied
633
- * @return array signed 32-bit integers - List of additional user parameters
634
- * @since 2.3.0
635
- */
636
- public function getAdditionalUserParams($sessionId, $date);
637
-
638
- /**
639
- * Returns a list of countries matching the search criteria.
640
- * The result is limited to 10 records
641
- * @param string $sessionId
642
- * @param string $name Country name or part of it
643
- * @param ParamLanguage $language Language
644
- * @return array of ResultCountry
645
- * @throws ServerException Thrown in case communication with server has failed
646
- * @since 2.5.0
647
- */
648
- public function listCountries($sessionId, $name, $language);
649
-
650
- /**
651
- * Returns a list of countries matching the search criteria.
652
- * The result is limited to 10 records
653
- * @param string $sessionId
654
- * @param ParamFilterCountry $filter Country search filter
655
- * @param ParamLanguage $language Language
656
- * @return array of ResultCountry
657
- * @throws ServerException Thrown in case communication with server has failed
658
- * @since 2.5.0
659
- */
660
- public function listCountriesEx($sessionId, $filter, $language);
661
-
662
- /**
663
- * Returns a list of country states matching the search criteria.
664
- * The result is limited to 10 records
665
- * @param string $sessionId
666
- * @param integer $countryId signed 64-bit Country id
667
- * @param string $name Country state name or part of it
668
- * @return array of ResultState
669
- * @throws ServerException Thrown in case communication with server has failed
670
- * @since 2.5.0
671
- */
672
- public function listStates($sessionId, $countryId, $name);
673
-
674
- /**
675
- * Returns a country state by id
676
- * @param string $sessionId
677
- * @param string $stateId Country state id
678
- * @return ResultState Country state
679
- * @throws ServerException Thrown in case communication with server has failed
680
- * @since 2.5.0
681
- */
682
- public function getStateById($sessionId, $stateId);
683
-
684
- /**
685
- * Validates post code
686
- * @param string $sessionId
687
- * @param integer $countryId signed 64-bit Country id
688
- * @param string $postCode Post code
689
- * @return True or false regarding the post code validation result
690
- * @throws ServerException Thrown in case communication with server has failed
691
- * @since 2.5.0
692
- */
693
- public function validatePostCode($sessionId, $countryId, $postCode);
694
-
695
- /**
696
- * Returns a list with all not canceled pickings, which are secondary to the picking with the specified billOfLading.
697
- * @param string $sessionId
698
- * @param ParamSearchSecondaryPickings $paramSearchSecondaryPickings
699
- * @return List of ResultPickingInfo Information about secondary pickings
700
- * @since 2.6.0
701
- */
702
- public function searchSecondaryPickings($sessionId, $paramSearchSecondaryPickings);
703
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  ?>
1
+ <?php
2
+
3
+ require_once 'ServerException.class.php';
4
+ require_once 'ResultAddressString.class.php';
5
+ require_once 'ResultLogin.class.php';
6
+ require_once 'ResultSite.class.php';
7
+ require_once 'ResultSiteEx.class.php';
8
+ require_once 'ResultCourierService.class.php';
9
+ require_once 'ResultCourierServiceExt.class.php';
10
+ require_once 'ResultMinMaxReal.class.php';
11
+ require_once 'ResultStreet.class.php';
12
+ require_once 'ResultQuarter.class.php';
13
+ require_once 'ResultCommonObject.class.php';
14
+ require_once 'ResultOffice.class.php';
15
+ require_once 'ResultOfficeEx.class.php';
16
+ require_once 'ResultClientData.class.php';
17
+ require_once 'ResultAddressSearch.class.php';
18
+ require_once 'ResultCalculation.class.php';
19
+ require_once 'ResultCalculationMS.class.php';
20
+ require_once 'ResultBOL.class.php';
21
+ require_once 'ResultOrderPickingInfo.class.php';
22
+ require_once 'ResultTrackPicking.class.php';
23
+ require_once 'ResultTrackPickingEx.class.php';
24
+ require_once 'ResultSpecialDeliveryRequirement.class.php';
25
+ require_once 'ResultCountry.class.php';
26
+ require_once 'ResultState.class.php';
27
+ require_once 'ResultPickingInfo.class.php';
28
+ require_once 'ResultClientInfo.class.php';
29
+ require_once 'ResultAddressInfo.class.php';
30
+
31
+ require_once 'ResultPickingExtendedInfo.class.php';
32
+ require_once 'ParamCalculation.class.php';
33
+ require_once 'ParamFilterSite.class.php';
34
+ require_once 'ParamAddress.class.php';
35
+ require_once 'ParamAddressSearch.class.php';
36
+ require_once 'ParamFilterCountry.class.php';
37
+ require_once 'ParamLanguage.class.php';
38
+ require_once 'ParamPicking.class.php';
39
+ require_once 'ParamPDF.class.php';
40
+ require_once 'ParamParcel.class.php';
41
+ require_once 'ParamOrder.class.php';
42
+ require_once 'ParamSearchByRefNum.class.php';
43
+ require_once 'ParamClientSearch.class.php';
44
+ require_once 'ParamSearchSecondaryPickings.class.php';
45
+
46
+ /**
47
+ * Speedy EPS Service Interface.
48
+ * This interface should be implemented by all specific protocol class implementations (SOAP, REST, etc.)
49
+ */
50
+ interface EPSInterface {
51
+
52
+ /**
53
+ * Login web service method
54
+ * @since 1.0
55
+ * @param string $username User name
56
+ * @param string $password User password
57
+ * @throws ServerException Thrown in case communication with server has failed
58
+ * @return ResultLogin Result of login
59
+ */
60
+ public function login($username, $password);
61
+
62
+ /**
63
+ * Returns whether the session is active
64
+ * @since 1.0
65
+ * @param string $sessionId The session ID to be tested
66
+ * @param boolean $refreshSession In case the session is active, this parameter specifies if the session should be automatically refreshed
67
+ * @throws ServerException Thrown in case communication with server has failed
68
+ * @return boolean Session active flag
69
+ */
70
+ public function isSessionActive($sessionId, $refreshSession);
71
+
72
+ /**
73
+ * Returns the list of courier services valid on this date
74
+ * @since 1.0
75
+ * @param string $sessionId
76
+ * @param date $date
77
+ * @param ParamLanguage $language Language (added in 2.5.0)
78
+ * @throws ServerException Thrown in case communication with server has failed
79
+ * @return array List of ResultCourierService instances
80
+ */
81
+ public function listServices($sessionId, $date, $language);
82
+
83
+ /**
84
+ * Returns the list of courier services valid on this date and sites.
85
+ * @since 1.0
86
+ * @param string $sessionId
87
+ * @param datetime $date
88
+ * @param integer $senderSiteId Signed 64-bit integer sender's site ID;
89
+ * @param integer $receiverSiteId Signed 64-bit integer receiver's site ID;
90
+ * @param integer $senderCountryId Signed 64-bit integer sender's country ID (added in 2.5.0);
91
+ * @param string $senderPostCode sender's post code (added in 2.5.0);
92
+ * @param integer $receiverCountryId Signed 64-bit integer receiver's country ID (added in 2.5.0);
93
+ * @param string $receiverPostCode receiver's post code (added in 2.5.0);
94
+ * @param ParamLanguage $language language (added in 2.5.0)
95
+ * @throws ServerException Thrown in case communication with server has failed
96
+ * @return array List of ResultCourierServiceExt instances
97
+ * @param $senderId (signed 64-bit integer nullable) – Sender ID (added in 2.9.0);
98
+ * @param $receiverId (signed 64-bit integer nullable) – Receiver ID (added in 2.9.0);
99
+ * @param $senderOfficeId (signed 64-bit integer nullable) – Sender office ID (added in 2.9.0);
100
+ * @param $receiverOfficeId (signed 64-bit integer nullable) Receiver office ID (added in 2.9.0);
101
+ */
102
+ public function listServicesForSites(
103
+ $sessionId, $date, $senderSiteId, $receiverSiteId,
104
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language,
105
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
106
+ );
107
+
108
+ /**
109
+ * Returns a list of sites matching the search criteria.
110
+ * The result is limited to 10 records
111
+ * The method is deprecated starting from 2.5.0, "listSitesEx" should be used instead.
112
+ * @deprecated The method is deprecated, "createPDF" should be used instead.
113
+ * @since 1.0
114
+ * @param string $sessionId
115
+ * @param string $type
116
+ * @param string $name
117
+ * @param ParamLanguage $paramLanguage
118
+ * @throws ServerException Thrown in case communication with server has failed
119
+ * @return array List of ResultSite instances
120
+ */
121
+ public function listSites($sessionId, $type, $name, $paramLanguage);
122
+
123
+ /**
124
+ * Returns a list of sites. The method aims to find the closest matches.
125
+ * The result is limited to 10 records
126
+ * @since 1.0
127
+ * @param string $sessionId
128
+ * @param ParamFilterSite $paramFilterSite
129
+ * @param ParamLanguage $language
130
+ * @throws ServerException Thrown in case communication with server has failed
131
+ * @return array List of ResultSiteEx instances
132
+ */
133
+ public function listSitesEx($sessionId, $paramFilterSite, $language);
134
+
135
+ /**
136
+ * Returns the min/max weight allowed for the given shipment parameters
137
+ * @since 1.0
138
+ * @param string $sessionId
139
+ * @param integer $serviceTypeId Signed 64-bit ID of the courier service
140
+ * @param integer $senderSiteId Signed 64-bit Sender's site ID
141
+ * @param integer $receiverSiteId Signed 64-bit Receiver's site ID
142
+ * @param date $date
143
+ * @param boolean $documents Specifies if the shipment consists of documents
144
+ * @param integer $senderCountryId Signed 64-bit Sender's country ID (added in 2.5.0)
145
+ * @param string $senderPostCode Sender's post code (added in 2.5.0)
146
+ * @param integer $receiverCountryId Signed 64-bit Receiver's country ID (added in 2.5.0)
147
+ * @param string $receiverPostCode Receiver's post code (added in 2.5.0)
148
+ * @throws ServerException Thrown in case communication with server has failed
149
+ * @param $senderId (signed 64-bit integer nullable) Sender ID (added in 2.9.0);
150
+ * @param $receiverId (signed 64-bit integer nullable) Receiver ID (added in 2.9.0);
151
+ * @param $senderOfficeId (signed 64-bit integer nullable) Sender office ID (added in 2.9.0);
152
+ * @param $receiverOfficeId (signed 64-bit integer nullable) Receiver office ID (added in 2.9.0);
153
+ * @return ResultMinMaxReal
154
+ */
155
+ public function getWeightInterval(
156
+ $sessionId, $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
157
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode,
158
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
159
+ );
160
+
161
+ /**
162
+ * Returns CSV-formatted data (depending on the nomenType value).
163
+ * Column numbers can change in the future so it's recommended to address the data using the column names in the header row.
164
+ * The data for some nomenTypes requires a payed license (additional licensing contract) and permissions (access rights).
165
+ * To obtain such license please contact our IT department or your Speedy key account manager.
166
+ * Type 1 - returns a list of all countries
167
+ * Type 50 - returns a list of all states
168
+ * Type 100 - returns a list of all sites.
169
+ * Type 300 - returns a list of all streets (requires a license).
170
+ * Type 400 - returns a list of all quarters (requires a license).
171
+ * Type 500 - returns a list of all common objects (requires a license).
172
+ * Type 700 - returns a list of all block names (requires a license).
173
+ * Type 800 - returns a list of all post codes (requires a license).
174
+ * @since 1.0
175
+ * @param string $sessionId
176
+ * @param integer $nomenType Signed 32-bit The type of address nomenclature
177
+ * @param integer $countryId Signed 64-bit Country id (added in 2.5.0)
178
+ * @throws ServerException Thrown in case communication with server has failed
179
+ * @return string CSV formatted
180
+ */
181
+ public function getAddressNomenclature($sessionId, $nomenType, $countryId);
182
+
183
+ /**
184
+ * Returns a list of all sites.
185
+ * Note: This method is relatively slow (because of the size of its response). You shouldn't call it more than several times a day.
186
+ * The methods is designed to provide data which should be locally stored/cached by client apps.
187
+ * The address-related nomenclature data is updated only several times a year.
188
+ * @since 1.0
189
+ * @param string $sessionId
190
+ * @param ParamLanguage $paramLanguage Language
191
+ * @param integer $countryId signed 64-bit Country id (added in 2.5.0)
192
+ * @throws ServerException Thrown in case communication with server has failed
193
+ * @return array List of ResultSite instances
194
+ */
195
+ public function listAllSites($sessionId, $paramLanguage, $countryId);
196
+
197
+ /**
198
+ * Returns a site by ID
199
+ * @since 1.0
200
+ * @param string $sessionId
201
+ * @param integer $siteId Signed 64-bit Site ID
202
+ * @throws ServerException Thrown in case communication with server has failed
203
+ * @return ResultSite
204
+ */
205
+ public function getSiteById($sessionId, $siteId);
206
+
207
+ /**
208
+ * Returns sites having either full or partial address nomenclature (streets, quarters etc.).
209
+ * @since 1.0
210
+ * @param string $sessionId
211
+ * @param AddrNomen $addrNomen Only values FULL and PARTIAL are allowed
212
+ * @throws ServerException Thrown in case communication with server has failed
213
+ * @return List of ResultSite
214
+ */
215
+ public function getSitesByAddrNomenType($sessionId, $addrNomen);
216
+
217
+ /**
218
+ * Returns a list of the most common types of streets.
219
+ * @since 1.0
220
+ * @param string $sessionId
221
+ * @throws ServerException Thrown in case communication with server has failed
222
+ * @return array string List of the most common types of streets
223
+ */
224
+ public function listStreetTypes($sessionId, $language);
225
+
226
+ /**
227
+ * Returns a list of the most common types of quarters (districts).
228
+ * @since 1.0
229
+ * @param string $sessionId
230
+ * @param ParamLanguage $language
231
+ * @throws ServerException Thrown in case communication with server has failed
232
+ * @return array string List of the most common types of quarters (districts).
233
+ */
234
+ public function listQuarterTypes($sessionId, $language);
235
+
236
+ /**
237
+ * Returns a list of streets matching the search criteria
238
+ * The list is limited to 10 records.
239
+ * @since 1.0
240
+ * @param string $sessionId
241
+ * @param string $name Street name (or part of it)
242
+ * @param integer $siteId Signed 64-bit Site ID
243
+ * @param ParamLanguage $language Language
244
+ * @throws ServerException Thrown in case communication with server has failed
245
+ * @return array ResultStreet List of streets
246
+ */
247
+ public function listStreets($sessionId, $name, $siteId, $language);
248
+
249
+ /**
250
+ * Returns a list of quarters matching the search criteria
251
+ * The list is limited to 10 records.
252
+ * @since 1.0
253
+ * @param string $sessionId
254
+ * @param string $name Quarter name (or part of it)
255
+ * @param integer $siteId Signed 64-bit Site ID
256
+ * @param ParamLanguage $language Language
257
+ * @throws ServerException Thrown in case communication with server has failed
258
+ * @return array ResultQuarter List of streets
259
+ */
260
+ public function listQuarters($sessionId, $name, $siteId, $language);
261
+
262
+ /**
263
+ * Returns a list of common objects matching the search criteria.
264
+ * The list is limited to 10 records.
265
+ * @since 1.0
266
+ * @param string $sessionId
267
+ * @param string $name Common object name (or part of it)
268
+ * @param integer $siteId Signed 64-bit Site ID
269
+ * @param ParamLanguage $language Language
270
+ * @throws ServerException Thrown in case communication with server has failed
271
+ * @return array ResultCommonObject List of common objects
272
+ */
273
+ public function listCommonObjects($sessionId, $name, $siteId, $language);
274
+
275
+ /**
276
+ * Returns a list of blocks matching the search criteria.
277
+ * The list is limited to 10 records.
278
+ * @since 1.0
279
+ * @param string $sessionId
280
+ * @param string $name Block name (or part of it)
281
+ * @param integer $siteId Signed 64-bit Site ID
282
+ * @param ParamLanguage $language Language
283
+ * @throws ServerException Thrown in case communication with server has failed
284
+ * @return array string List of blocks
285
+ */
286
+ public function listBlocks($sessionId, $name, $siteId, $language);
287
+
288
+ /**
289
+ * Returns a list of Speedy offices matching the search criteria
290
+ * The list is limited to 10 records.
291
+ * @since 1.0
292
+ * @param string $sessionId
293
+ * @param string $name Office name (or part of it);
294
+ * @param integer $siteId Signed 64-bit Site ID
295
+ * @throws ServerException Thrown in case communication with server has failed
296
+ * @return array ResultOffice List of offices
297
+ */
298
+ public function listOffices($sessionId, $name, $siteId);
299
+
300
+ /**
301
+ * Returns data for client by ID.
302
+ * Allowed values for clientId are only the ones of members of the user's contract and the predefined partners
303
+ * in the WebClients application.
304
+ * @since 1.0
305
+ * @param string $sessionId
306
+ * @param integer $clientId Signed 64-bit integer – Client/Partner ID
307
+ * @throws ServerException Thrown in case communication with server has failed
308
+ * @return ResultClientData
309
+ */
310
+ public function getClientById($sessionId, $clientId);
311
+
312
+ /**
313
+ * Returns the dates when the shipment can be ordered for pick-up.
314
+ * The "time" component represents the deadline for creating an order
315
+ * (or the deadline for delivering the shipment to a Speedy office when senderOfficeId is set).
316
+ * (This method could be used for the "takingDate" property of ParamPicking or ParamCalculation.)
317
+ * Note: Either senderSiteId or senderOfficeId should be set, or neither of them. Both parameters having "not null" values is not allowed.
318
+ * @since 1.0
319
+ * @param string $sessionId
320
+ * @param integer $serviceTypeId
321
+ * @param integer $senderSiteId Signed 64-bit – Sender's site ID
322
+ * @param integer $senderOfficeId Signed 64-bit – If the sender intends to deliver the shipment to a Speedy office, the office ID could be set as a filter
323
+ * @param date $minDate - When the "time" component is set then this date is to be included in the result list only if the time is not after the working time of Speedy;
324
+ * @param integer $senderCountryId Signed 64-bit Sender's country id (added in 2.5.0)
325
+ * @param string $senderPostCode Sender's post code (added in 2.5.0)
326
+ * @throws ServerException Thrown in case communication with server has failed
327
+ * @return array List of dates
328
+ * @param integer $senderId Signed 64-bit Sender's ID (added in 2.9.0)
329
+ */
330
+ public function getAllowedDaysForTaking(
331
+ $sessionId, $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId, $senderPostCode, $senderId
332
+ );
333
+
334
+ /**
335
+ * Returns a list of addresses matching the search criteria.
336
+ * @since 1.0
337
+ * @param string $sessionId
338
+ * @param ParamAddressSearch $address Search criteria (filter)
339
+ * @throws ServerException Thrown in case communication with server has failed
340
+ * @return array List of ResultAddressSearch
341
+ */
342
+ public function addressSearch($sessionId, $address);
343
+
344
+ /**
345
+ * Calculate method
346
+ * @since 1.0
347
+ * @param string $sessionId Session ID
348
+ * @param ParamCalculation $paramCalculation
349
+ * @throws ServerException Thrown in case communication with server has failed
350
+ * @return ResultCalculation
351
+ */
352
+ public function calculate($sessionId, $calculation);
353
+
354
+ /**
355
+ * This method could be used for preliminary check-up of shipment's price for a range of courier services.
356
+ * Service type ID field of $calculation structure is overriden by this method to required value (0) before call.
357
+ * @since 1.0
358
+ * @param string $sessionId
359
+ * @param ParamCalculation $calculation Data needed to perform the calculation;
360
+ * @param array $serviceTypeIds List<signed 64-bit integer> – A list of courier service IDs for which price needs to be calculated
361
+ * @throws ServerException Thrown in case communication with server has failed
362
+ * @return array List of ResultCalculationMS
363
+ */
364
+ public function calculateMultipleServices($sessionId, $calculation, $serviceTypeIds);
365
+
366
+ /**
367
+ * This is an alternative method for shipment price calculation where the parameter is of type ParamPicking.
368
+ * Clients are encouraged to use the method that best fits their needs.
369
+ * @since 1.0
370
+ * @param string $sessionId
371
+ * @param ParamPicking $picking
372
+ * @throws ServerException Thrown in case communication with server has failed
373
+ * @return ResultCalculation
374
+ */
375
+ public function calculatePicking($sessionId, $picking);
376
+
377
+ /**
378
+ * The method used to create BOL.
379
+ * @since 1.0
380
+ * @param string $sessionId
381
+ * @param ParamPicking $picking Data for the shipment (BOL)
382
+ * @throws ServerException Thrown in case communication with server has failed
383
+ * @return ResultBOL
384
+ */
385
+ public function createBillOfLading($sessionId, $picking);
386
+
387
+ /**
388
+ * Used for creating PDF documents to be printed (BOLs, labels etc.)
389
+ * Examples:
390
+ * •Bill of Lading;
391
+ * •Bill of Lading with "cash on delivery";
392
+ * •Custom travel label (type 20);
393
+ * •Custom travel label (type 20) with "cash on delivery".
394
+ * @since 1.0
395
+ * @param string $sessionId
396
+ * @param ParamPDF $params
397
+ * @throws ServerException Thrown in case communication with server has failed
398
+ * @return array bytes
399
+ */
400
+ public function createPDF($sessionId, $params);
401
+
402
+ /**
403
+ * Creates PDF document for BOL.
404
+ * The method is deprecated, "createPDF" should be used instead.
405
+ * @deprecated The method is deprecated, "createPDF" should be used instead.
406
+ * @since 1.0
407
+ * @param string $sessionId
408
+ * @param integer $billOfLading Signed 64-bit
409
+ * @param boolean $includeAutoPrintJS Specifies if embedded JavaScript code for direct printing to be generated
410
+ * @throws ServerException Thrown in case communication with server has failed
411
+ * @return array of bytes
412
+ */
413
+ public function createBillOfLadingPDF($sessionId, $billOfLading, $includeAutoPrintJS);
414
+
415
+ /**
416
+ * Creates PDF document of "type I". The method is deprecated, "createPDF" should be used instead.
417
+ * @deprecated The method is deprecated, "createPDF" should be used instead.
418
+ * @since 1.0
419
+ * @param string $sessionId
420
+ * @param integer $parcelId Signed 64-bit Parcel ID
421
+ * @throws ServerException Thrown in case communication with server has failed
422
+ * @return array of bytes
423
+ */
424
+ public function createCustomTravelLabelPDFType1($sessionId, $parcelId);
425
+
426
+ /**
427
+ * Used to cancel BOL.
428
+ * Only allowed when the shipment is neither ordered nor picked up by Speedy.
429
+ * @since 1.0
430
+ * @param string $sessionId
431
+ * @param integer $billOfLading Signed 64-bit
432
+ * @param string $cancelComment Cancel comment
433
+ * @throws ServerException Thrown in case communication with server has failed
434
+ */
435
+ public function invalidatePicking($sessionId, $billOfLading, $cancelComment);
436
+
437
+ /**
438
+ * This method is used to update BOL.
439
+ * Only allowed if BOL was created with pendingShipmentDescription = true.
440
+ * @since 1.0
441
+ * @param string $sessionId
442
+ * @param ParamPicking $picking Data for the shipment (BOL)
443
+ * @throws ServerException Thrown in case communication with server has failed
444
+ * @return ResultBOL
445
+ */
446
+ public function updateBillOfLading($sessionId, $picking);
447
+
448
+ /**
449
+ * This method is used to add parcel to an existing BOL
450
+ * (only allowed if BOL was created with pendingParcelsDescription = true).
451
+ * @since 1.0
452
+ * @param string $sessionId
453
+ * @param ParamParcel $parcel Parcel data
454
+ * @throws ServerException Thrown in case communication with server has failed
455
+ * @return integer Signed 64-bit parcel's ID
456
+ */
457
+ public function addParcel($sessionId, $parcel);
458
+
459
+ /**
460
+ * Makes BOL "fully created".
461
+ * Only applies to BOLs created with pendingParcelsDescription = true.
462
+ * @since 1.0
463
+ * @param string $sessionId
464
+ * @param integer $billOfLading Signed 64-bit
465
+ * @throws ServerException Thrown in case communication with server has failed
466
+ * @return ResultBOL
467
+ */
468
+ public function finalizeBillOfLadingCreation($sessionId, $billOfLading);
469
+
470
+ /**
471
+ * Creates an order for shipments pick-up (i.e. a visit by courier of Speedy).
472
+ * The returned list contains objects corresponding to each BOL (one object per BOL).
473
+ * When the validation errors list of at least one of the objects is not empty, that means the order has not been created.
474
+ * @since 1.0
475
+ * @param string $sessionId
476
+ * @param ParamOrder $order Order details
477
+ * @throws ServerException Thrown in case communication with server has failed
478
+ * @return array List of ResultOrderPickingInfo
479
+ */
480
+ public function createOrder($sessionId, $order);
481
+
482
+ /**
483
+ * Returns a list with all parcels of a shipment.
484
+ * @since 1.0
485
+ * @param string $sessionId
486
+ * @param integer $billOfLading Signed 64-bit
487
+ * @throws ServerException Thrown in case communication with server has failed
488
+ * @return array List of ResultParcelInfo
489
+ */
490
+ public function getPickingParcels($sessionId, $billOfLading);
491
+
492
+ /**
493
+ * This method can be used to track the state/history of a shipment.
494
+ * @deprecated Use trackPickingEx instead
495
+ * @since 1.0
496
+ * @param string $sessionId
497
+ * @param integer $billOfLading Signed 64-bit (@since 2.9.0 @param string $billOfLading)
498
+ * @throws ServerException Thrown in case communication with server has failed
499
+ * @return array List of ResultTrackPicking
500
+ */
501
+ public function trackPicking($sessionId, $billOfLading);
502
+
503
+ /**
504
+ * This method can be used to track the state/history of a shipment.
505
+ * @since 1.2
506
+ * @param string $sessionId
507
+ * @param integer $billOfLading Signed 64-bit (@since 2.9.0 @param string $billOfLading)
508
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
509
+ * @throws ServerException Thrown in case communication with server has failed
510
+ * @return array List of ResultTrackPickingEx
511
+ * @since 2.9.0
512
+ * @param boolean returnOnlyLastOperation; false is the default value
513
+ */
514
+ public function trackPickingEx($sessionId, $billOfLading, $language, $returnOnlyLastOperation);
515
+
516
+ /**
517
+ * This method can be used to track the state/history of a shipment parcel.
518
+ * @since 1.4
519
+ * @param string $sessionId
520
+ * @param integer $parcelId Signed 64-bit (@since 2.9.0 @param string $parcelId)
521
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
522
+ * @throws ServerException Thrown in case communication with server has failed
523
+ * @return array List of ResultTrackPickingEx
524
+ * @since 2.9.0
525
+ * @param boolean returnOnlyLastOperation; false is the default value
526
+ */
527
+ public function trackParcel($sessionId, $parcelId, $language, $returnOnlyLastOperation);
528
+
529
+ /**
530
+ * This method can be used to track the state/history of a shipment parcel.
531
+ * @since 2.8.0
532
+ * @param string $sessionId
533
+ * @param List of integer (Signed 64-bit) $barcodes (@since 2.9.0 @param string $barcodes)
534
+ * @param ParamLanguage $language BG or EN. If set to null the server defaults to BG
535
+ * @throws ServerException Thrown in case communication with server has failed
536
+ * @return array List of ResultTrackPickingEx
537
+ * @since 2.9.0
538
+ * @param boolean returnOnlyLastOperation; false is the default value
539
+ */
540
+ public function trackParcelMultiple($sessionId, $barcodes, $language, $returnOnlyLastOperation);
541
+
542
+ /**
543
+ * Search BOLs by reference codes (ref1 and/or ref2).
544
+ * @since 1.0
545
+ * @param string $sessionId
546
+ * @param ParamSearchByRefNum $params
547
+ * @throws ServerException Thrown in case communication with server has failed
548
+ * @return array List of BOLs found (signed 64-bit integers)
549
+ */
550
+ public function searchPickingsByRefNumber($sessionId, $params);
551
+
552
+ /**
553
+ * Get microregion id for provided GPS corrdinates
554
+ * @since 1.5
555
+ * @param string $sessionId
556
+ * @param signed 64-bit treal $coordX
557
+ * @param signed 64-bit treal $coordY
558
+ * @throws ServerException Thrown in case communication with server has failed
559
+ * @return Mocregion id (signed 64-bit integer)
560
+ */
561
+ public function getMicroregionId($sessionId, $coordX, $coordY);
562
+
563
+ /**
564
+ * Returns data for clients by specified client ID or other search criteria.
565
+ * If client ID is specified the behaviour of this method is the same as getClientById.
566
+ * Otherwise, the search returns results that satisfy search criteria
567
+ * @since 1.6
568
+ * @param string $sessionId
569
+ * @param ParamClientSearch $clientQuery
570
+ * @throws ServerException Thrown in case communication with server has failed
571
+ * @return array List of ResultClientData
572
+ */
573
+ public function searchClients($sessionId, $clientQuery);
574
+
575
+ /**
576
+ * Returns list with available special delivery requirements for logged user
577
+ * @param string $sessionId
578
+ * @throws ServerException Thrown in case communication with server has failed
579
+ * @return array List of ResultSpecialDeliveryRequirement
580
+ * @since 2.1.0
581
+ */
582
+ public function listSpecialDeliveryRequirements($sessionId);
583
+
584
+ /**
585
+ * Validates address and returns validation result
586
+ * - validationMode = 0 (default) - Extended validation w/o GIS info (address uniqueness is not verified);
587
+ * - validationMode = 1 (NOT IMPLEMENTED YET - reserved for future implementation) Extended validation with GIS info (address uniqueness is verified);
588
+ * - validationMode = 2 - basic validation (the same as address validation in createBillOfLading)
589
+ * @param string $sessionId
590
+ * @param ParamAddress $address
591
+ * @param integer $validationMode signed 32 bit
592
+ * @throws ServerException Thrown in case communication with server has failed
593
+ * @throws PickingValidationException Thrown in case address validation has failed
594
+ * @return boolean Validation result flag
595
+ * @since 2.2.0
596
+ */
597
+ public function validateAddress($sessionId, $address, $validationMode);
598
+
599
+ /**
600
+ * Returns all client objects ( including logged user's ) having the same contract as logged client's contract.
601
+ * @param string $sessionId
602
+ * @throws ServerException Thrown in case communication with server has failed
603
+ * @return List of ResultClientData
604
+ * @since 2.2.0
605
+ */
606
+ public function listContractClients($sessionId);
607
+
608
+ /**
609
+ * Returns a list of Speedy offices matching the search criteria
610
+ * The list is limited to 10 records.
611
+ * @since 2.2.0
612
+ * @param string $sessionId
613
+ * @param string $name Office name (or part of it);
614
+ * @param integer $siteId Signed 64-bit Site ID
615
+ * @param ParamLanguage $language Language
616
+ * @throws ServerException Thrown in case communication with server has failed
617
+ * @return array ResultOfficeEx List of offices
618
+ */
619
+ public function listOfficesEx($sessionId, $name, $siteId, $language);
620
+
621
+ /**
622
+ * Returns deserialized address from serialized string address
623
+ * @param string $sessionId
624
+ * @param string $address Serialized address
625
+ * @return ParamAddress Deserliazed address
626
+ * @throws ServerException Thrown in case communication with server has failed
627
+ * @since 2.3.0
628
+ */
629
+ public function deserializeAddress($sessionId, $address);
630
+
631
+ /**
632
+ * Returns deserialized address from serialized string address
633
+ * @param string $sessionId
634
+ * @param ParamAddress $address Address
635
+ * @return Serialized string address
636
+ * @throws ServerException Thrown in case communication with server has failed
637
+ * @since 2.3.0
638
+ */
639
+ public function serializeAddress($sessionId, $address);
640
+
641
+ /**
642
+ * Make address text representations - city address, local address, full address
643
+ * @param string $sessionId
644
+ * @param ParamAddress $address Base address
645
+ * @return ResultAddressString
646
+ * @since 2.3.0
647
+ */
648
+ public function makeAddressString($sessionId, $address);
649
+
650
+ /**
651
+ * Get list of additional user paramters
652
+ * @param string $sessionId
653
+ * @param date $date Effective date. If null is provided then current date is applied
654
+ * @return array signed 32-bit integers - List of additional user parameters
655
+ * @since 2.3.0
656
+ */
657
+ public function getAdditionalUserParams($sessionId, $date);
658
+
659
+ /**
660
+ * Returns a list of countries matching the search criteria.
661
+ * The result is limited to 10 records
662
+ * @param string $sessionId
663
+ * @param string $name Country name or part of it
664
+ * @param ParamLanguage $language Language
665
+ * @return array of ResultCountry
666
+ * @throws ServerException Thrown in case communication with server has failed
667
+ * @since 2.5.0
668
+ */
669
+ public function listCountries($sessionId, $name, $language);
670
+
671
+ /**
672
+ * Returns a list of countries matching the search criteria.
673
+ * The result is limited to 10 records
674
+ * @param string $sessionId
675
+ * @param ParamFilterCountry $filter Country search filter
676
+ * @param ParamLanguage $language Language
677
+ * @return array of ResultCountry
678
+ * @throws ServerException Thrown in case communication with server has failed
679
+ * @since 2.5.0
680
+ */
681
+ public function listCountriesEx($sessionId, $filter, $language);
682
+
683
+ /**
684
+ * Returns a list of country states matching the search criteria.
685
+ * The result is limited to 10 records
686
+ * @param string $sessionId
687
+ * @param integer $countryId signed 64-bit Country id
688
+ * @param string $name Country state name or part of it
689
+ * @return array of ResultState
690
+ * @throws ServerException Thrown in case communication with server has failed
691
+ * @since 2.5.0
692
+ */
693
+ public function listStates($sessionId, $countryId, $name);
694
+
695
+ /**
696
+ * Returns a country state by id
697
+ * @param string $sessionId
698
+ * @param string $stateId Country state id
699
+ * @return ResultState Country state
700
+ * @throws ServerException Thrown in case communication with server has failed
701
+ * @since 2.5.0
702
+ */
703
+ public function getStateById($sessionId, $stateId);
704
+
705
+ /**
706
+ * Validates post code
707
+ * @param string $sessionId
708
+ * @param integer $countryId signed 64-bit Country id
709
+ * @param string $postCode Post code
710
+ * @return True or false regarding the post code validation result
711
+ * @throws ServerException Thrown in case communication with server has failed
712
+ * @since 2.5.0
713
+ */
714
+ public function validatePostCode($sessionId, $countryId, $postCode);
715
+
716
+ /**
717
+ * Returns a list with all not canceled pickings, which are secondary to the picking with the specified billOfLading.
718
+ * @param string $sessionId
719
+ * @param ParamSearchSecondaryPickings $paramSearchSecondaryPickings
720
+ * @return List of ResultPickingInfo Information about secondary pickings
721
+ * @since 2.6.0
722
+ */
723
+ public function searchSecondaryPickings($sessionId, $paramSearchSecondaryPickings);
724
+
725
+ /**
726
+ * Returns extended information about the picking with the specified billOfLading.
727
+ * @param string $sessionId
728
+ * @param integer $billOfLading signed 64-bit
729
+ * @return List of ResultPickingExtendedInfo Information about picking
730
+ * @since 2.9.0
731
+ */
732
+ public function getPickingExtendedInfo($sessionId, $billOfLading);
733
+
734
+ }
735
  ?>
lib/SpeedyEPS/ver01/ParamCalculation.class.php CHANGED
@@ -1,938 +1,963 @@
1
- <?php
2
-
3
- /**
4
- * This class represents ParamCalculation type
5
- */
6
- class ParamCalculation {
7
-
8
- /**
9
- * Payer type: sender
10
- * @var integer Signed 32-bit
11
- */
12
- const PAYER_TYPE_SENDER = 0;
13
-
14
- /**
15
- * Payer type: receiver
16
- * @var integer Signed 32-bit
17
- */
18
- const PAYER_TYPE_RECEIVER = 1;
19
-
20
- /**
21
- * Payer type: third party
22
- * @var integer Signed 32-bit
23
- */
24
- const PAYER_TYPE_THIRD_PARTY = 2;
25
-
26
- /**
27
- * Service type ID to set when this structire is used for multiple service calculations
28
- * @var integer Signed 64-bit
29
- */
30
- const CALCULATE_MULTUPLE_SERVICES_SERVICE_TYPE_ID = 0;
31
-
32
- /**
33
- * The date for shipment pick-up (the "time" component is ignored). Default value is "today".
34
- * MANDATORY: NO
35
- * @access private
36
- * @var date
37
- */
38
- private $_takingDate;
39
-
40
- /**
41
- * If set to true, the "takingDate" field is not just to be validated, but the first allowed (following)
42
- * date will be used instead (in compliance with the pick-up schedule etc.).
43
- * MANDATORY: NO
44
- * @access private
45
- * @var boolean
46
- */
47
- private $_autoAdjustTakingDate;
48
-
49
- /**
50
- * Courier service type ID
51
- * MANDATORY: YES
52
- * @access private
53
- * @var integer Signed 64-bit
54
- */
55
- private $_serviceTypeId;
56
-
57
- /**
58
- * Specifies the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
59
- * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
60
- * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
61
- * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
62
- * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
63
- * MANDATORY: NO
64
- * @access private
65
- * @var integer signed 64-bit
66
- * @since 2.8.0
67
- */
68
- private $_willBringToOfficeId;
69
-
70
- /**
71
- * Specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
72
- * MANDATORY: YES
73
- * @access private
74
- * @var boolean
75
- */
76
- private $_broughtToOffice;
77
-
78
- /**
79
- * ID of an office "to be called".
80
- * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
81
- * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
82
- * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
83
- * MANDATORY: NO
84
- * @access private
85
- * @var integer signed 64-bit
86
- * @since 2.8.0
87
- */
88
- private $_officeToBeCalledId;
89
-
90
- /**
91
- * Specifies if the shipment is "to be called"
92
- * MANDATORY: YES
93
- * @access private
94
- * @var boolean
95
- */
96
- private $_toBeCalled;
97
-
98
- /**
99
- * Fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
100
- * Depending on the courier service, this property could be required, allowed or banned
101
- * MANDATORY: NO
102
- * @access private
103
- * @var integer Signed 16-bit
104
- */
105
- private $_fixedTimeDelivery;
106
-
107
- /**
108
- * In some rare cases users might prefer the delivery to be deferred by a day or two.
109
- * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
110
- * Max value is 2.
111
- * MANDATORY: NO
112
- * @access private
113
- * @var integer Signed 32-bit
114
- */
115
- private $_deferredDeliveryWorkDays;
116
-
117
- /**
118
- * Shipment insurance value (if the shipment is insured).
119
- * The limit of this value depends on user's permissions and Speedy's current policy.
120
- * MANDATORY: NO
121
- * @access private
122
- * @var integer Signed 64-bit
123
- */
124
- private $_amountInsuranceBase;
125
-
126
- /**
127
- * Cash-on-Delivery (COD) amount
128
- * The limit of this value depends on user's permissions and Speedy's current policy.
129
- * MANDATORY: NO
130
- * @access private
131
- * @var integer Signed 64-bit
132
- */
133
- private $_amountCodBase;
134
-
135
- /**
136
- * Specifies if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
137
- * MANDATORY: NO
138
- * @access private
139
- * @var boolean
140
- */
141
- private $_payCodToThirdParty;
142
-
143
- /**
144
- * Parcels count.
145
- * Max 999.
146
- * MANDATORY: YES
147
- * @access private
148
- * @var integer Signed 32-bit
149
- */
150
- private $_parcelsCount;
151
-
152
- /**
153
- * Data for parcels with explicit/fixed IDs (from the second one onward)
154
- * The list has maximum lenght 998
155
- * MANDATORY: NO
156
- * @var array List of ParamParcelInfo
157
- */
158
- private $_parcels;
159
-
160
- /**
161
- * Declared weight (the greater of "volume" and "real" weight values).
162
- * Max 100.00
163
- * MANDATORY: YES
164
- * @access private
165
- * @var double Signed 64-bit
166
- */
167
- private $_weightDeclared;
168
-
169
- /**
170
- * Specifies whether the shipment consists of documents
171
- * MANDATORY: YES
172
- * @access private
173
- * @var boolean
174
- */
175
- private $_documents;
176
-
177
- /**
178
- * Specifies whether the shipment is fragile - necessary when the price of insurance is being calculated
179
- * MANDATORY: YES
180
- * @access private
181
- * @var boolean
182
- */
183
- private $_fragile;
184
-
185
- /**
186
- * Specifies whether the shipment is palletized
187
- * MANDATORY: YES
188
- * @access private
189
- * @var boolean
190
- */
191
- private $_palletized;
192
-
193
- /**
194
- * Sender's ID.
195
- * Either senderId or senderSiteId must be set
196
- * MANDATORY: NO
197
- * @access private
198
- * @var integer Signed 64-bit
199
- */
200
- private $_senderId;
201
-
202
- /**
203
- * Sender's site ID.
204
- * Either senderId or senderSiteId must be set
205
- * MANDATORY: NO
206
- * @access private
207
- * @var integer Signed 64-bit
208
- */
209
- private $_senderSiteId;
210
-
211
- /**
212
- * Receiver's ID.
213
- * Either receiverId or receiverSiteId must be set
214
- * MANDATORY: NO
215
- * @access private
216
- * @var integer Signed 64-bit
217
- */
218
- private $_receiverId;
219
-
220
- /**
221
- * Receiver's site ID
222
- * Either receiverId or receiverSiteId must be set
223
- * MANDATORY: NO
224
- * @access private
225
- * @var integer Signed 64-bit
226
- */
227
- private $_receiverSiteId;
228
-
229
- /**
230
- * Payer type (0=sender, 1=receiver or 2=third party)
231
- * MANDATORY: YES
232
- * @access private
233
- * @var integer Signed 32-bit
234
- */
235
- private $_payerType;
236
-
237
- /**
238
- * Payer ID. Must be set <=> payer is "third party".
239
- * MANDATORY: NO
240
- * @access private
241
- * @var integer Signed 64-bit
242
- */
243
- private $_payerRefId;
244
-
245
- /**
246
- * Insurance payer type (0=sender, 1=reciever or 2=third party).
247
- * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
248
- * MANDATORY: NO
249
- * @access private
250
- * @var integer Signed 32-bit
251
- */
252
- private $_payerTypeInsurance;
253
-
254
- /**
255
- * Packings payer type (0=sender, 1=reciever or 2=third party)
256
- * MANDATORY: NO. If not set, the payer of the packings' surcharge will be the same as the one indicated by payerType.
257
- * @var integer Signed 32-bit
258
- * @since 2.3.0
259
- */
260
- private $_payerTypePackings;
261
-
262
- /**
263
- * Insurance payer ID. Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
264
- * MANDATORY: NO
265
- * @access private
266
- * @var integer Signed 64-bit
267
- */
268
- private $_payerRefInsuranceId;
269
-
270
- /**
271
- * Packings payer id
272
- * MANDATORY: Must be set <=> payerTypePackings is "third party".
273
- * @var integer Signed 64-bit
274
- * @since 2.3.0
275
- */
276
- protected $_payerRefPackingsId;
277
-
278
- /**
279
- * Special delivery id
280
- * MANDATORY: NO
281
- * @var signed 32-bit integer
282
- * @since 2.3.0
283
- */
284
- protected $_specialDeliveryId;
285
-
286
- /**
287
- * Receiver's country ID
288
- * MANDATORY: NO. Defaults to Bulgaria when not specified
289
- * @var integer Signed 64-bit
290
- * @since 2.5.0
291
- */
292
- private $_receiverCountryId;
293
-
294
- /**
295
- * Receiver's post code
296
- * MANDATORY: According to internal nomenclature support
297
- * @var string
298
- * @since 2.5.0
299
- */
300
- private $_receiverPostCode;
301
-
302
- /**
303
- * Sender's country ID
304
- * MANDATORY: NO. Defaults to Bulgaria when not specified
305
- * @var integer Signed 64-bit
306
- * @since 2.5.0
307
- */
308
- private $_senderCountryId;
309
-
310
- /**
311
- * Sender's post code
312
- * MANDATORY: According to internal nomenclature support
313
- * @var string
314
- * @since 2.5.0
315
- */
316
- private $_senderPostCode;
317
-
318
- /**
319
- * Set the date for shipment pick-up (the "time" component is ignored).
320
- * Server defaults this value to "today" if it is not set
321
- * @param date $takingDate
322
- */
323
- public function setTakingDate($takingDate) {
324
- $this->_takingDate = $takingDate;
325
- }
326
-
327
- /**
328
- * Get date for shipment pick-up (the "time" component is ignored).
329
- * @return date Taking date
330
- */
331
- public function getTakingDate() {
332
- return $this->_takingDate;
333
- }
334
-
335
- /**
336
- * Set flag to auto-adjist or not taking date.
337
- * If set to true, the "takingDate" field is not just to be validated, but the first allowed (following)
338
- * date will be used instead (in compliance with the pick-up schedule etc.).
339
- * @param boolean $autoAdjustTakingDate
340
- */
341
- public function setAutoAdjustTakingDate($autoAdjustTakingDate) {
342
- $this->_autoAdjustTakingDate = $autoAdjustTakingDate;
343
- }
344
-
345
- /**
346
- * Get flag for taking date auto-adjustment
347
- * @return boolean Auto-adjust taking date flag
348
- */
349
- public function isAutoAdjustTakingDate() {
350
- return $this->_autoAdjustTakingDate;
351
- }
352
-
353
- /**
354
- * Set courier service type ID from.
355
- * @param integer $serviceTypeId Signed 64-bit value from Speedy service nomenclature
356
- */
357
- public function setServiceTypeId($serviceTypeId) {
358
- $this->_serviceTypeId = $serviceTypeId;
359
- }
360
-
361
- /**
362
- * Get courier service type ID from nomenclature.
363
- * @return integer Courier service type ID - signed 64-bit value from Speedy service nomenclature
364
- */
365
- public function getServiceTypeId() {
366
- return $this->_serviceTypeId;
367
- }
368
-
369
- /**
370
- * Set the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
371
- * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
372
- * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
373
- * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
374
- * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
375
- * @param integer signed 64-bit $willBringToOfficeId Bring-to-office id
376
- * @since 2.8.0
377
- */
378
- public function setWillBringToOfficeId($willBringToOfficeId) {
379
- $this->_willBringToOfficeId = $willBringToOfficeId;
380
- }
381
-
382
- /**
383
- * Get the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
384
- * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
385
- * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
386
- * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
387
- * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
388
- * @return integer signed 64-bit Bring-to-office id
389
- * @since 2.8.0
390
- */
391
- public function getWillBringToOfficeId() {
392
- return $this->_willBringToOfficeId;
393
- }
394
-
395
- /**
396
- * Set flag for brought-to-office
397
- * This flag specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
398
- * @param boolean $broughtToOffice Brought-to-office flag
399
- */
400
- public function setBroughtToOffice($broughtToOffice) {
401
- $this->_broughtToOffice = $broughtToOffice;
402
- }
403
-
404
- /**
405
- * Get flag for brought-to-office
406
- * @return boolean Brought-to-office flag
407
- */
408
- public function isBroughtToOffice() {
409
- return $this->_broughtToOffice;
410
- }
411
-
412
- /**
413
- * Set ID of the office "to be called".
414
- * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
415
- * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
416
- * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
417
- * @param integer signed 64-bit $officeToBeCalledId Office-to-be-called id
418
- * @since 2.8.0
419
- */
420
- public function setOfficeToBeCalledId($officeToBeCalledId) {
421
- $this->_officeToBeCalledId = $officeToBeCalledId;
422
- }
423
-
424
- /**
425
- * Get ID of the office "to be called".
426
- * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
427
- * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
428
- * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
429
- * @return integer signed 64-bit Office-to-be-called id
430
- * @since 2.8.0
431
- */
432
- public function getOfficeToBeCalledId() {
433
- return $this->_officeToBeCalledId;
434
- }
435
-
436
- /**
437
- * Set flag for to-be-called. Specifies if the shipment is "to be called"
438
- * @param boolean $toBeCalled Brought-to-office flag
439
- */
440
- public function setToBeCalled($toBeCalled) {
441
- $this->_toBeCalled = $toBeCalled;
442
- }
443
-
444
- /**
445
- * Get flag for to-be-called
446
- * @return boolean To-be-called flag
447
- */
448
- public function isToBeCalled() {
449
- return $this->_toBeCalled;
450
- }
451
-
452
- /**
453
- * Set fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
454
- * Depending on the courier service, this property could be required, allowed or banned
455
- * @param integer $fixedTimeDelivery Signed 16-bit
456
- */
457
- public function setFixedTimeDelivery($fixedTimeDelivery) {
458
- $this->_fixedTimeDelivery = $fixedTimeDelivery;
459
- }
460
-
461
- /**
462
- * Get fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
463
- * @return integer Fixed time for delivery - signed 16-bit
464
- */
465
- public function getFixedTimeDelivery() {
466
- return $this->_fixedTimeDelivery;
467
- }
468
-
469
- /**
470
- * Set deferred delivery work days.
471
- * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
472
- * Max value is 2.
473
- * @param integer $deferredDeliveryWorkDays Signed 32-bit
474
- */
475
- public function setDeferredDeliveryWorkDays($deferredDeliveryWorkDays) {
476
- $this->_deferredDeliveryWorkDays = $deferredDeliveryWorkDays;
477
- }
478
-
479
- /**
480
- * Get deferred delivery work days.
481
- * @return integer Deferred delivery work days - signed 32-bit
482
- */
483
- public function getDeferredDeliveryWorkDays() {
484
- return $this->_deferredDeliveryWorkDays;
485
- }
486
-
487
- /**
488
- * Set shipment insurance value (if the shipment is insured).
489
- * The limit of this value depends on user's permissions and Speedy's current policy.
490
- * @param integer $amountInsuranceBase Signed 64-bit
491
- */
492
- public function setAmountInsuranceBase($amountInsuranceBase) {
493
- $this->_amountInsuranceBase = $amountInsuranceBase;
494
- }
495
-
496
- /**
497
- * Get shipment insurance value
498
- * @return integer Shipment insurance value - signed 64-bit
499
- */
500
- public function getAmountInsuranceBase() {
501
- return $this->_amountInsuranceBase;
502
- }
503
-
504
- /**
505
- * Set cash-on-Delivery (COD) amount.
506
- * The limit of this value depends on user's permissions and Speedy's current policy.
507
- * @param integer $amountCodBase Signed 64-bit
508
- */
509
- public function setAmountCodBase($amountCodBase) {
510
- $this->_amountCodBase = $amountCodBase;
511
- }
512
-
513
- /**
514
- * Get cash-on-Delivery (COD) amount.
515
- * @return integer Cash-on-Delivery (COD) amount - signed 64-bit
516
- */
517
- public function getAmountCodBase() {
518
- return $this->_amountCodBase;
519
- }
520
-
521
- /**
522
- * Set flag, if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
523
- * @param boolean $payCodToThirdParty
524
- */
525
- public function setPayCodToThirdParty($payCodToThirdParty) {
526
- $this->_payCodToThirdParty = $payCodToThirdParty;
527
- }
528
-
529
- /**
530
- * Get flag for COD value to be paid to a third party
531
- * @return boolean Flag for cash-on-Delivery (COD) to third party
532
- */
533
- public function isPayCodToThirdParty() {
534
- return $this->_payCodToThirdParty;
535
- }
536
-
537
- /**
538
- * Set parcels count.
539
- * Max 999.
540
- * @param integer $parcelsCount Parcels count - signed 32-bit
541
- */
542
- public function setParcelsCount($parcelsCount) {
543
- $this->_parcelsCount = $parcelsCount;
544
- }
545
-
546
- /**
547
- * Get parcels count.
548
- * @return integer Parcels count - signed 32-bit
549
- */
550
- public function getParcelsCount() {
551
- return $this->_parcelsCount;
552
- }
553
-
554
- /**
555
- * Set declared weight (the greater of "volume" and "real" weight values).
556
- * Max 100.00
557
- * @param double $weightDeclared Declared weight - signed 64-bit
558
- */
559
- public function setWeightDeclared($weightDeclared) {
560
- $this->_weightDeclared = $weightDeclared;
561
- }
562
-
563
- /**
564
- * Get declared weight
565
- * @return double Declared weight - signed 64-bit
566
- */
567
- public function getWeightDeclared() {
568
- return $this->_weightDeclared;
569
- }
570
-
571
- /**
572
- * Set flag whether the shipment consists of documents
573
- * @param boolean $documents Documents flag
574
- */
575
- public function setDocuments($documents) {
576
- $this->_documents = $documents;
577
- }
578
-
579
- /**
580
- * Get flag whether the shipment consists of documents
581
- * @return boolean Documents flag
582
- */
583
- public function isDocuments() {
584
- return $this->_documents;
585
- }
586
-
587
- /**
588
- * Set flag whether the shipment is fragile - necessary when the price of insurance is being calculated
589
- * @param boolean $fragile Fragile flag
590
- */
591
- public function setFragile($fragile) {
592
- $this->_fragile = $fragile;
593
- }
594
-
595
- /**
596
- * Get flag whether the shipment is fragile
597
- * @return boolean Fragile flag
598
- */
599
- public function isFragile() {
600
- return $this->_fragile;
601
- }
602
-
603
- /**
604
- * Set flag whether the shipment is for pallets
605
- * @param boolean $palletized Palletized flag
606
- */
607
- public function setPalletized($palletized) {
608
- $this->_palletized = $palletized;
609
- }
610
-
611
- /**
612
- * Get flag whether the shipment is for pallets
613
- * @return boolean Palletized flag
614
- */
615
- public function isPalletized() {
616
- return $this->_palletized;
617
- }
618
-
619
- /**
620
- * Set sender's ID. From Speedy client nomenclature.
621
- * Either senderId or senderSiteId must be set
622
- * @param integer $senderId Signed 64-bit
623
- */
624
- public function setSenderId($senderId) {
625
- $this->_senderId = $senderId;
626
- }
627
-
628
- /**
629
- * Get sender's ID. From Speedy client nomenclature.
630
- * @return integer Sender's ID - signed 64-bit
631
- */
632
- public function getSenderId() {
633
- return $this->_senderId;
634
- }
635
-
636
- /**
637
- * Set sender's site ID. From Speedy site nomenclature.
638
- * Either senderId or senderSiteId must be set
639
- * @param integer $senderSiteId Signed 64-bit
640
- */
641
- public function setSenderSiteId($senderSiteId) {
642
- $this->_senderSiteId = $senderSiteId;
643
- }
644
-
645
- /**
646
- * Get sender's site ID. From Speedy site nomenclature.
647
- * @return integer Sender's site ID - signed 64-bit
648
- */
649
- public function getSenderSiteId() {
650
- return $this->_senderSiteId;
651
- }
652
-
653
- /**
654
- * Receiver's ID. From Speedy client nomenclature.
655
- * Either receiverId or receiverSiteId must be set
656
- * @param integer $receiverId Signed 64-bit
657
- */
658
- public function setReceiverId($receiverId) {
659
- $this->_receiverId = $receiverId;
660
- }
661
-
662
- /**
663
- * Get receiver's ID. From Speedy client nomenclature.
664
- * @return integer Receiver's ID - signed 64-bit
665
- */
666
- public function getReceiverId() {
667
- return $this->_receiverId;
668
- }
669
-
670
- /**
671
- * Set receiver's site ID. From Speedy site nomenclature.
672
- * Either receiverId or receiverSiteId must be set
673
- * @param integer $receiverSiteId Signed 64-bit
674
- */
675
- public function setReceiverSiteId($receiverSiteId) {
676
- $this->_receiverSiteId = $receiverSiteId;
677
- }
678
-
679
- /**
680
- * Get receiver's site ID. From Speedy site nomenclature.
681
- * @return integer Receiver's site ID - signed 64-bit
682
- */
683
- public function getReceiverSiteId() {
684
- return $this->_receiverSiteId;
685
- }
686
-
687
- /**
688
- * Set payer type (0=sender, 1=receiver or 2=third party)
689
- * @param integer $payerType Signed 32-bit
690
- */
691
- public function setPayerType($payerType) {
692
- $this->_payerType = $payerType;
693
- }
694
-
695
- /**
696
- * Get payer type (0=sender, 1=receiver or 2=third party)
697
- * @return integer Payer type - signed 32-bit
698
- */
699
- public function getPayerType() {
700
- return $this->_payerType;
701
- }
702
-
703
- /**
704
- * Set payer ID from Speedy client nomenclature.
705
- * Must be set <=> payer is "third party".
706
- * @param integer $payerRefId Signed 64-bit
707
- */
708
- public function setPayerRefId($payerRefId) {
709
- $this->_payerRefId = $payerRefId;
710
- }
711
-
712
- /**
713
- * Get payer ID from Speedy client nomenclature.
714
- * @return integer Payer ID - signed 64-bit
715
- */
716
- public function getPayerRefId() {
717
- return $this->_payerRefId;
718
- }
719
-
720
- /**
721
- * Set insurance payer type (0=sender, 1=reciever or 2=third party).
722
- * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
723
- * @param integer $payerTypeInsurance Signed 32-bit
724
- */
725
- public function setPayerTypeInsurance($payerTypeInsurance) {
726
- $this->_payerTypeInsurance = $payerTypeInsurance;
727
- }
728
-
729
- /**
730
- * Get insurance payer type (0=sender, 1=reciever or 2=third party).
731
- * @return integer Insurance payer type - signed 32-bit
732
- */
733
- public function getPayerTypeInsurance() {
734
- return $this->_payerTypeInsurance;
735
- }
736
-
737
-
738
- /**
739
- * Set packings payer type (0=sender, 1=reciever or 2=third party).
740
- * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
741
- * @param integer $payerTypePackings Signed 32-bit
742
- */
743
- public function setPayerTypePackings($payerTypePackings) {
744
- $this->_payerTypePackings = $payerTypePackings;
745
- }
746
-
747
- /**
748
- * Get packings payer type (0=sender, 1=reciever or 2=third party).
749
- * @return integer Insurance payer type - signed 32-bit
750
- */
751
- public function getPayerTypePackings() {
752
- return $this->_payerTypePackings;
753
- }
754
-
755
- /**
756
- * Set insurance payer ID from Speedy client nomenclature.
757
- * Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
758
- * @param integer $payerRefInsuranceId Signed 64-bit
759
- */
760
- public function setPayerRefInsuranceId($payerRefInsuranceId) {
761
- $this->_payerRefInsuranceId = $payerRefInsuranceId;
762
- }
763
-
764
- /**
765
- * Get insurance payer ID from Speedy client nomenclature.
766
- * @return integer Insurance payer ID - signed 64-bit
767
- */
768
- public function getPayerRefInsuranceId() {
769
- return $this->_payerRefInsuranceId;
770
- }
771
-
772
- /**
773
- * Set packings payer ID
774
- * @param integer $payerRefPackingsId Signed 64-bit
775
- */
776
- public function setPayerRefPackingsId($payerRefPackingsId) {
777
- $this->_payerRefPackingsId = $payerRefPackingsId;
778
- }
779
-
780
- /**
781
- * Get packings payer ID
782
- * @return integer Signed 64-bit
783
- */
784
- public function getPayerRefPackingsId() {
785
- return $this->_payerRefPackingsId;
786
- }
787
-
788
- /**
789
- * Gets the special delivery id
790
- * @return signed 32-bit integer special delivery id
791
- */
792
- public function getSpecialDeliveryId() {
793
- return $this->_specialDeliveryId;
794
- }
795
-
796
- /**
797
- * Sets the special delivery id
798
- * @param signed 32-bit integer $specialDeliveryId Special delivery id
799
- */
800
- public function setSpecialDeliveryId($specialDeliveryId) {
801
- $this->_specialDeliveryId = $specialDeliveryId;
802
- }
803
-
804
- /**
805
- * Set the receiver country id
806
- * @param integer signed 64-bit $receiverCountryId
807
- */
808
- public function setReceiverCountryId($receiverCountryId) {
809
- $this->_receiverCountryId = $receiverCountryId;
810
- }
811
-
812
- /**
813
- * Get receiver country id.
814
- * @return integer signed 64-bit Receiver country id
815
- */
816
- public function getReceiverCountryId() {
817
- return $this->_receiverCountryId;
818
- }
819
-
820
- /**
821
- * Set the receiver post code
822
- * @param string $receiverPostCode
823
- */
824
- public function setReceiverPostCode($receiverPostCode) {
825
- $this->_receiverPostCode = $receiverPostCode;
826
- }
827
-
828
- /**
829
- * Get receiver post code
830
- * @return string Receiver post code
831
- */
832
- public function getReceiverPostCode() {
833
- return $this->_receiverPostCode;
834
- }
835
-
836
- /**
837
- * Set the sender country id
838
- * @param integer signed 64-bit $senderCountryId
839
- */
840
- public function setSenderCountryId($senderCountryId) {
841
- $this->_senderCountryId = $senderCountryId;
842
- }
843
-
844
- /**
845
- * Get sender country id.
846
- * @return integer signed 64-bit Sender country id
847
- */
848
- public function getSenderCountryId() {
849
- return $this->_senderCountryId;
850
- }
851
-
852
- /**
853
- * Set the sender post code
854
- * @param string $senderPostCode
855
- */
856
- public function setSenderPostCode($senderPostCode) {
857
- $this->_senderPostCode = $senderPostCode;
858
- }
859
-
860
- /**
861
- * Get sender post code
862
- * @return string Sender post code
863
- */
864
- public function getSenderPostCode() {
865
- return $this->_senderPostCode;
866
- }
867
-
868
- /**
869
- * Set data for parcels with explicit/fixed IDs (from the second one onward)
870
- * @param array $parcels List of ParamParcelInfo
871
- */
872
- public function setParcels($parcels) {
873
- $this->_parcels = $parcels;
874
- }
875
-
876
- /**
877
- * Get data for parcels with explicit/fixed IDs (from the second one onward)
878
- * @return array List of ParamParcelInfo
879
- */
880
- public function getParcels() {
881
- return $this->_parcels;
882
- }
883
-
884
- /**
885
- * Return standard class from this class
886
- * @return stdClass
887
- */
888
- public function toStdClass() {
889
- $stdClass = new stdClass();
890
- $stdClass->takingDate = $this->_takingDate;
891
- $stdClass->autoAdjustTakingDate = $this->_autoAdjustTakingDate;
892
- $stdClass->serviceTypeId = $this->_serviceTypeId;
893
- $stdClass->willBringToOfficeId = $this->_willBringToOfficeId;
894
- $stdClass->broughtToOffice = $this->_broughtToOffice;
895
- $stdClass->officeToBeCalledId = $this->_officeToBeCalledId;
896
- $stdClass->toBeCalled = $this->_toBeCalled;
897
- $stdClass->fixedTimeDelivery = $this->_fixedTimeDelivery;
898
- $stdClass->deferredDeliveryWorkDays = $this->_deferredDeliveryWorkDays;
899
- $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;
900
- $stdClass->amountCodBase = $this->_amountCodBase;
901
- $stdClass->payCodToThirdParty = $this->_payCodToThirdParty;
902
- $stdClass->parcelsCount = $this->_parcelsCount;
903
- $stdClass->weightDeclared = $this->_weightDeclared;
904
- $stdClass->documents = $this->_documents;
905
- $stdClass->fragile = $this->_fragile;
906
- $stdClass->palletized = $this->_palletized;
907
- $stdClass->senderId = $this->_senderId;
908
- $stdClass->senderSiteId = $this->_senderSiteId;
909
- $stdClass->receiverId = $this->_receiverId;
910
- $stdClass->receiverSiteId = $this->_receiverSiteId;
911
- $stdClass->payerType = $this->_payerType;
912
- $stdClass->payerRefId = $this->_payerRefId;
913
- $stdClass->payerTypeInsurance = $this->_payerTypeInsurance;
914
- $stdClass->payerTypePackings = $this->_payerTypePackings;
915
- $stdClass->payerRefInsuranceId = $this->_payerRefInsuranceId;
916
- $stdClass->payerRefPackingsId = $this->_payerRefPackingsId;
917
- $stdClass->specialDeliveryId = $this->_specialDeliveryId;
918
- $stdClass->receiverCountryId = $this->_receiverCountryId;
919
- $stdClass->receiverPostCode = $this->_receiverPostCode;
920
- $stdClass->senderCountryId = $this->_senderCountryId;
921
- $stdClass->senderPostCode = $this->_senderPostCode;
922
-
923
- $arrStdClassParamParcelInfo = array();
924
- if (isset($this->_parcels)) {
925
- if (is_array($this->_parcels)) {
926
- for($i = 0; $i < count($this->_parcels); $i++) {
927
- $arrStdClassParamParcelInfo[$i] = $this->_parcels[$i]->toStdClass();
928
- }
929
- } else {
930
- $arrStdClassParamParcelInfo[0] = $this->_parcels->toStdClass();
931
- }
932
- }
933
- $stdClass->parcels = $arrStdClassParamParcelInfo;
934
-
935
- return $stdClass;
936
- }
937
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
938
  ?>
1
+ <?php
2
+
3
+ /**
4
+ * This class represents ParamCalculation type
5
+ */
6
+ class ParamCalculation {
7
+
8
+ /**
9
+ * Payer type: sender
10
+ * @var integer Signed 32-bit
11
+ */
12
+ const PAYER_TYPE_SENDER = 0;
13
+
14
+ /**
15
+ * Payer type: receiver
16
+ * @var integer Signed 32-bit
17
+ */
18
+ const PAYER_TYPE_RECEIVER = 1;
19
+
20
+ /**
21
+ * Payer type: third party
22
+ * @var integer Signed 32-bit
23
+ */
24
+ const PAYER_TYPE_THIRD_PARTY = 2;
25
+
26
+ /**
27
+ * Service type ID to set when this structire is used for multiple service calculations
28
+ * @var integer Signed 64-bit
29
+ */
30
+ const CALCULATE_MULTUPLE_SERVICES_SERVICE_TYPE_ID = 0;
31
+
32
+ /**
33
+ * The date for shipment pick-up (the "time" component is ignored). Default value is "today".
34
+ * MANDATORY: NO
35
+ * @access private
36
+ * @var date
37
+ */
38
+ private $_takingDate;
39
+
40
+ /**
41
+ * If set to true, the "takingDate" field is not just to be validated, but the first allowed (following)
42
+ * date will be used instead (in compliance with the pick-up schedule etc.).
43
+ * MANDATORY: NO
44
+ * @access private
45
+ * @var boolean
46
+ */
47
+ private $_autoAdjustTakingDate;
48
+
49
+ /**
50
+ * Courier service type ID
51
+ * MANDATORY: YES
52
+ * @access private
53
+ * @var integer Signed 64-bit
54
+ */
55
+ private $_serviceTypeId;
56
+
57
+ /**
58
+ * Specifies the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
59
+ * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
60
+ * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
61
+ * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
62
+ * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
63
+ * MANDATORY: NO
64
+ * @access private
65
+ * @var integer signed 64-bit
66
+ * @since 2.8.0
67
+ */
68
+ private $_willBringToOfficeId;
69
+
70
+ /**
71
+ * Specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
72
+ * MANDATORY: YES
73
+ * @access private
74
+ * @var boolean
75
+ */
76
+ private $_broughtToOffice;
77
+
78
+ /**
79
+ * ID of an office "to be called".
80
+ * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
81
+ * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
82
+ * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
83
+ * MANDATORY: NO
84
+ * @access private
85
+ * @var integer signed 64-bit
86
+ * @since 2.8.0
87
+ */
88
+ private $_officeToBeCalledId;
89
+
90
+ /**
91
+ * Specifies if the shipment is "to be called"
92
+ * MANDATORY: YES
93
+ * @access private
94
+ * @var boolean
95
+ */
96
+ private $_toBeCalled;
97
+
98
+ /**
99
+ * Fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
100
+ * Depending on the courier service, this property could be required, allowed or banned
101
+ * MANDATORY: NO
102
+ * @access private
103
+ * @var integer Signed 16-bit
104
+ */
105
+ private $_fixedTimeDelivery;
106
+
107
+ /**
108
+ * In some rare cases users might prefer the delivery to be deferred by a day or two.
109
+ * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
110
+ * Max value is 2.
111
+ * MANDATORY: NO
112
+ * @access private
113
+ * @var integer Signed 32-bit
114
+ */
115
+ private $_deferredDeliveryWorkDays;
116
+
117
+ /**
118
+ * Shipment insurance value (if the shipment is insured).
119
+ * The limit of this value depends on user's permissions and Speedy's current policy.
120
+ * MANDATORY: NO
121
+ * @access private
122
+ * @var integer Signed 64-bit
123
+ */
124
+ private $_amountInsuranceBase;
125
+
126
+ /**
127
+ * Cash-on-Delivery (COD) amount
128
+ * The limit of this value depends on user's permissions and Speedy's current policy.
129
+ * MANDATORY: NO
130
+ * @access private
131
+ * @var integer Signed 64-bit
132
+ */
133
+ private $_amountCodBase;
134
+
135
+ /**
136
+ * Specifies if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
137
+ * MANDATORY: NO
138
+ * @access private
139
+ * @var boolean
140
+ */
141
+ private $_payCodToThirdParty;
142
+
143
+ /**
144
+ * Parcels count.
145
+ * Max 999.
146
+ * MANDATORY: YES
147
+ * @access private
148
+ * @var integer Signed 32-bit
149
+ */
150
+ private $_parcelsCount;
151
+
152
+ /**
153
+ * Data for parcels with explicit/fixed IDs (from the second one onward)
154
+ * The list has maximum lenght 998
155
+ * MANDATORY: NO
156
+ * @var array List of ParamParcelInfo
157
+ */
158
+ private $_parcels;
159
+
160
+ /**
161
+ * Declared weight (the greater of "volume" and "real" weight values).
162
+ * Max 100.00
163
+ * MANDATORY: YES
164
+ * @access private
165
+ * @var double Signed 64-bit
166
+ */
167
+ private $_weightDeclared;
168
+
169
+ /**
170
+ * Specifies whether the shipment consists of documents
171
+ * MANDATORY: YES
172
+ * @access private
173
+ * @var boolean
174
+ */
175
+ private $_documents;
176
+
177
+ /**
178
+ * Specifies whether the shipment is fragile - necessary when the price of insurance is being calculated
179
+ * MANDATORY: YES
180
+ * @access private
181
+ * @var boolean
182
+ */
183
+ private $_fragile;
184
+
185
+ /**
186
+ * Specifies whether the shipment is palletized
187
+ * MANDATORY: YES
188
+ * @access private
189
+ * @var boolean
190
+ */
191
+ private $_palletized;
192
+
193
+ /**
194
+ * Sender's ID.
195
+ * Either senderId or senderSiteId must be set
196
+ * MANDATORY: NO
197
+ * @access private
198
+ * @var integer Signed 64-bit
199
+ */
200
+ private $_senderId;
201
+
202
+ /**
203
+ * Sender's site ID.
204
+ * Either senderId or senderSiteId must be set
205
+ * MANDATORY: NO
206
+ * @access private
207
+ * @var integer Signed 64-bit
208
+ */
209
+ private $_senderSiteId;
210
+
211
+ /**
212
+ * Receiver's ID.
213
+ * Either receiverId or receiverSiteId must be set
214
+ * MANDATORY: NO
215
+ * @access private
216
+ * @var integer Signed 64-bit
217
+ */
218
+ private $_receiverId;
219
+
220
+ /**
221
+ * Receiver's site ID
222
+ * Either receiverId or receiverSiteId must be set
223
+ * MANDATORY: NO
224
+ * @access private
225
+ * @var integer Signed 64-bit
226
+ */
227
+ private $_receiverSiteId;
228
+
229
+ /**
230
+ * Payer type (0=sender, 1=receiver or 2=third party)
231
+ * MANDATORY: YES
232
+ * @access private
233
+ * @var integer Signed 32-bit
234
+ */
235
+ private $_payerType;
236
+
237
+ /**
238
+ * Payer ID. Must be set <=> payer is "third party".
239
+ * MANDATORY: NO
240
+ * @access private
241
+ * @var integer Signed 64-bit
242
+ */
243
+ private $_payerRefId;
244
+
245
+ /**
246
+ * Insurance payer type (0=sender, 1=reciever or 2=third party).
247
+ * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
248
+ * MANDATORY: NO
249
+ * @access private
250
+ * @var integer Signed 32-bit
251
+ */
252
+ private $_payerTypeInsurance;
253
+
254
+ /**
255
+ * Packings payer type (0=sender, 1=reciever or 2=third party)
256
+ * MANDATORY: NO. If not set, the payer of the packings' surcharge will be the same as the one indicated by payerType.
257
+ * @var integer Signed 32-bit
258
+ * @since 2.3.0
259
+ */
260
+ private $_payerTypePackings;
261
+
262
+ /**
263
+ * Insurance payer ID. Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
264
+ * MANDATORY: NO
265
+ * @access private
266
+ * @var integer Signed 64-bit
267
+ */
268
+ private $_payerRefInsuranceId;
269
+
270
+ /**
271
+ * Packings payer id
272
+ * MANDATORY: Must be set <=> payerTypePackings is "third party".
273
+ * @var integer Signed 64-bit
274
+ * @since 2.3.0
275
+ */
276
+ protected $_payerRefPackingsId;
277
+
278
+ /**
279
+ * Special delivery id
280
+ * MANDATORY: NO
281
+ * @var signed 32-bit integer
282
+ * @since 2.3.0
283
+ */
284
+ protected $_specialDeliveryId;
285
+
286
+ /**
287
+ * Receiver's country ID
288
+ * MANDATORY: NO. Defaults to Bulgaria when not specified
289
+ * @var integer Signed 64-bit
290
+ * @since 2.5.0
291
+ */
292
+ private $_receiverCountryId;
293
+
294
+ /**
295
+ * Receiver's post code
296
+ * MANDATORY: According to internal nomenclature support
297
+ * @var string
298
+ * @since 2.5.0
299
+ */
300
+ private $_receiverPostCode;
301
+
302
+ /**
303
+ * Sender's country ID
304
+ * MANDATORY: NO. Defaults to Bulgaria when not specified
305
+ * @var integer Signed 64-bit
306
+ * @since 2.5.0
307
+ */
308
+ private $_senderCountryId;
309
+
310
+ /**
311
+ * Sender's post code
312
+ * MANDATORY: According to internal nomenclature support
313
+ * @var string
314
+ * @since 2.5.0
315
+ */
316
+ private $_senderPostCode;
317
+
318
+ /**
319
+ * Flag indicating whether the shipping price should be included into the cash on delivery price.
320
+ * MANDATORY: NO
321
+ * @var boolean
322
+ * @since 2.9.0
323
+ */
324
+ private $_includeShippingPriceInCod;
325
+
326
+ /**
327
+ * Set the date for shipment pick-up (the "time" component is ignored).
328
+ * Server defaults this value to "today" if it is not set
329
+ * @param date $takingDate
330
+ */
331
+ public function setTakingDate($takingDate) {
332
+ $this->_takingDate = $takingDate;
333
+ }
334
+
335
+ /**
336
+ * Get date for shipment pick-up (the "time" component is ignored).
337
+ * @return date Taking date
338
+ */
339
+ public function getTakingDate() {
340
+ return $this->_takingDate;
341
+ }
342
+
343
+ /**
344
+ * Set flag to auto-adjist or not taking date.
345
+ * If set to true, the "takingDate" field is not just to be validated, but the first allowed (following)
346
+ * date will be used instead (in compliance with the pick-up schedule etc.).
347
+ * @param boolean $autoAdjustTakingDate
348
+ */
349
+ public function setAutoAdjustTakingDate($autoAdjustTakingDate) {
350
+ $this->_autoAdjustTakingDate = $autoAdjustTakingDate;
351
+ }
352
+
353
+ /**
354
+ * Get flag for taking date auto-adjustment
355
+ * @return boolean Auto-adjust taking date flag
356
+ */
357
+ public function isAutoAdjustTakingDate() {
358
+ return $this->_autoAdjustTakingDate;
359
+ }
360
+
361
+ /**
362
+ * Set courier service type ID from.
363
+ * @param integer $serviceTypeId Signed 64-bit value from Speedy service nomenclature
364
+ */
365
+ public function setServiceTypeId($serviceTypeId) {
366
+ $this->_serviceTypeId = $serviceTypeId;
367
+ }
368
+
369
+ /**
370
+ * Get courier service type ID from nomenclature.
371
+ * @return integer Courier service type ID - signed 64-bit value from Speedy service nomenclature
372
+ */
373
+ public function getServiceTypeId() {
374
+ return $this->_serviceTypeId;
375
+ }
376
+
377
+ /**
378
+ * Set the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
379
+ * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
380
+ * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
381
+ * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
382
+ * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
383
+ * @param integer signed 64-bit $willBringToOfficeId Bring-to-office id
384
+ * @since 2.8.0
385
+ */
386
+ public function setWillBringToOfficeId($willBringToOfficeId) {
387
+ $this->_willBringToOfficeId = $willBringToOfficeId;
388
+ }
389
+
390
+ /**
391
+ * Get the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
392
+ * If willBringToOfficeId is provided, willBringToOffice flag is considered "true" and the picking "from office", regardless the value provided.
393
+ * If willBringToOfficeId is not provied (null) and willBringToOffice flag is "true", willBringToOfficeId is automatically set with default value configured for caller user profile.
394
+ * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
395
+ * If willBringToOfficeId is set to 0, broughtToOffice flag is considered "false".
396
+ * @return integer signed 64-bit Bring-to-office id
397
+ * @since 2.8.0
398
+ */
399
+ public function getWillBringToOfficeId() {
400
+ return $this->_willBringToOfficeId;
401
+ }
402
+
403
+ /**
404
+ * Set flag for brought-to-office
405
+ * This flag specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
406
+ * @param boolean $broughtToOffice Brought-to-office flag
407
+ */
408
+ public function setBroughtToOffice($broughtToOffice) {
409
+ $this->_broughtToOffice = $broughtToOffice;
410
+ }
411
+
412
+ /**
413
+ * Get flag for brought-to-office
414
+ * @return boolean Brought-to-office flag
415
+ */
416
+ public function isBroughtToOffice() {
417
+ return $this->_broughtToOffice;
418
+ }
419
+
420
+ /**
421
+ * Set ID of the office "to be called".
422
+ * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
423
+ * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
424
+ * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
425
+ * @param integer signed 64-bit $officeToBeCalledId Office-to-be-called id
426
+ * @since 2.8.0
427
+ */
428
+ public function setOfficeToBeCalledId($officeToBeCalledId) {
429
+ $this->_officeToBeCalledId = $officeToBeCalledId;
430
+ }
431
+
432
+ /**
433
+ * Get ID of the office "to be called".
434
+ * Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
435
+ * If officeToBeCalledId is provided (non-null and non-zero), toBeCalled flag is considered "true".
436
+ * If officeToBeCalledId is set to 0, toBeCalled flag is considered "false".
437
+ * @return integer signed 64-bit Office-to-be-called id
438
+ * @since 2.8.0
439
+ */
440
+ public function getOfficeToBeCalledId() {
441
+ return $this->_officeToBeCalledId;
442
+ }
443
+
444
+ /**
445
+ * Set flag for to-be-called. Specifies if the shipment is "to be called"
446
+ * @param boolean $toBeCalled Brought-to-office flag
447
+ */
448
+ public function setToBeCalled($toBeCalled) {
449
+ $this->_toBeCalled = $toBeCalled;
450
+ }
451
+
452
+ /**
453
+ * Get flag for to-be-called
454
+ * @return boolean To-be-called flag
455
+ */
456
+ public function isToBeCalled() {
457
+ return $this->_toBeCalled;
458
+ }
459
+
460
+ /**
461
+ * Set fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
462
+ * Depending on the courier service, this property could be required, allowed or banned
463
+ * @param integer $fixedTimeDelivery Signed 16-bit
464
+ */
465
+ public function setFixedTimeDelivery($fixedTimeDelivery) {
466
+ $this->_fixedTimeDelivery = $fixedTimeDelivery;
467
+ }
468
+
469
+ /**
470
+ * Get fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
471
+ * @return integer Fixed time for delivery - signed 16-bit
472
+ */
473
+ public function getFixedTimeDelivery() {
474
+ return $this->_fixedTimeDelivery;
475
+ }
476
+
477
+ /**
478
+ * Set deferred delivery work days.
479
+ * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
480
+ * Max value is 2.
481
+ * @param integer $deferredDeliveryWorkDays Signed 32-bit
482
+ */
483
+ public function setDeferredDeliveryWorkDays($deferredDeliveryWorkDays) {
484
+ $this->_deferredDeliveryWorkDays = $deferredDeliveryWorkDays;
485
+ }
486
+
487
+ /**
488
+ * Get deferred delivery work days.
489
+ * @return integer Deferred delivery work days - signed 32-bit
490
+ */
491
+ public function getDeferredDeliveryWorkDays() {
492
+ return $this->_deferredDeliveryWorkDays;
493
+ }
494
+
495
+ /**
496
+ * Set shipment insurance value (if the shipment is insured).
497
+ * The limit of this value depends on user's permissions and Speedy's current policy.
498
+ * @param integer $amountInsuranceBase Signed 64-bit
499
+ */
500
+ public function setAmountInsuranceBase($amountInsuranceBase) {
501
+ $this->_amountInsuranceBase = $amountInsuranceBase;
502
+ }
503
+
504
+ /**
505
+ * Get shipment insurance value
506
+ * @return integer Shipment insurance value - signed 64-bit
507
+ */
508
+ public function getAmountInsuranceBase() {
509
+ return $this->_amountInsuranceBase;
510
+ }
511
+
512
+ /**
513
+ * Set cash-on-Delivery (COD) amount.
514
+ * The limit of this value depends on user's permissions and Speedy's current policy.
515
+ * @param integer $amountCodBase Signed 64-bit
516
+ */
517
+ public function setAmountCodBase($amountCodBase) {
518
+ $this->_amountCodBase = $amountCodBase;
519
+ }
520
+
521
+ /**
522
+ * Get cash-on-Delivery (COD) amount.
523
+ * @return integer Cash-on-Delivery (COD) amount - signed 64-bit
524
+ */
525
+ public function getAmountCodBase() {
526
+ return $this->_amountCodBase;
527
+ }
528
+
529
+ /**
530
+ * Set flag, if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
531
+ * @param boolean $payCodToThirdParty
532
+ */
533
+ public function setPayCodToThirdParty($payCodToThirdParty) {
534
+ $this->_payCodToThirdParty = $payCodToThirdParty;
535
+ }
536
+
537
+ /**
538
+ * Get flag for COD value to be paid to a third party
539
+ * @return boolean Flag for cash-on-Delivery (COD) to third party
540
+ */
541
+ public function isPayCodToThirdParty() {
542
+ return $this->_payCodToThirdParty;
543
+ }
544
+
545
+ /**
546
+ * Set parcels count.
547
+ * Max 999.
548
+ * @param integer $parcelsCount Parcels count - signed 32-bit
549
+ */
550
+ public function setParcelsCount($parcelsCount) {
551
+ $this->_parcelsCount = $parcelsCount;
552
+ }
553
+
554
+ /**
555
+ * Get parcels count.
556
+ * @return integer Parcels count - signed 32-bit
557
+ */
558
+ public function getParcelsCount() {
559
+ return $this->_parcelsCount;
560
+ }
561
+
562
+ /**
563
+ * Set declared weight (the greater of "volume" and "real" weight values).
564
+ * Max 100.00
565
+ * @param double $weightDeclared Declared weight - signed 64-bit
566
+ */
567
+ public function setWeightDeclared($weightDeclared) {
568
+ $this->_weightDeclared = $weightDeclared;
569
+ }
570
+
571
+ /**
572
+ * Get declared weight
573
+ * @return double Declared weight - signed 64-bit
574
+ */
575
+ public function getWeightDeclared() {
576
+ return $this->_weightDeclared;
577
+ }
578
+
579
+ /**
580
+ * Set flag whether the shipment consists of documents
581
+ * @param boolean $documents Documents flag
582
+ */
583
+ public function setDocuments($documents) {
584
+ $this->_documents = $documents;
585
+ }
586
+
587
+ /**
588
+ * Get flag whether the shipment consists of documents
589
+ * @return boolean Documents flag
590
+ */
591
+ public function isDocuments() {
592
+ return $this->_documents;
593
+ }
594
+
595
+ /**
596
+ * Set flag whether the shipment is fragile - necessary when the price of insurance is being calculated
597
+ * @param boolean $fragile Fragile flag
598
+ */
599
+ public function setFragile($fragile) {
600
+ $this->_fragile = $fragile;
601
+ }
602
+
603
+ /**
604
+ * Get flag whether the shipment is fragile
605
+ * @return boolean Fragile flag
606
+ */
607
+ public function isFragile() {
608
+ return $this->_fragile;
609
+ }
610
+
611
+ /**
612
+ * Set flag whether the shipment is for pallets
613
+ * @param boolean $palletized Palletized flag
614
+ */
615
+ public function setPalletized($palletized) {
616
+ $this->_palletized = $palletized;
617
+ }
618
+
619
+ /**
620
+ * Get flag whether the shipment is for pallets
621
+ * @return boolean Palletized flag
622
+ */
623
+ public function isPalletized() {
624
+ return $this->_palletized;
625
+ }
626
+
627
+ /**
628
+ * Set sender's ID. From Speedy client nomenclature.
629
+ * Either senderId or senderSiteId must be set
630
+ * @param integer $senderId Signed 64-bit
631
+ */
632
+ public function setSenderId($senderId) {
633
+ $this->_senderId = $senderId;
634
+ }
635
+
636
+ /**
637
+ * Get sender's ID. From Speedy client nomenclature.
638
+ * @return integer Sender's ID - signed 64-bit
639
+ */
640
+ public function getSenderId() {
641
+ return $this->_senderId;
642
+ }
643
+
644
+ /**
645
+ * Set sender's site ID. From Speedy site nomenclature.
646
+ * Either senderId or senderSiteId must be set
647
+ * @param integer $senderSiteId Signed 64-bit
648
+ */
649
+ public function setSenderSiteId($senderSiteId) {
650
+ $this->_senderSiteId = $senderSiteId;
651
+ }
652
+
653
+ /**
654
+ * Get sender's site ID. From Speedy site nomenclature.
655
+ * @return integer Sender's site ID - signed 64-bit
656
+ */
657
+ public function getSenderSiteId() {
658
+ return $this->_senderSiteId;
659
+ }
660
+
661
+ /**
662
+ * Receiver's ID. From Speedy client nomenclature.
663
+ * Either receiverId or receiverSiteId must be set
664
+ * @param integer $receiverId Signed 64-bit
665
+ */
666
+ public function setReceiverId($receiverId) {
667
+ $this->_receiverId = $receiverId;
668
+ }
669
+
670
+ /**
671
+ * Get receiver's ID. From Speedy client nomenclature.
672
+ * @return integer Receiver's ID - signed 64-bit
673
+ */
674
+ public function getReceiverId() {
675
+ return $this->_receiverId;
676
+ }
677
+
678
+ /**
679
+ * Set receiver's site ID. From Speedy site nomenclature.
680
+ * Either receiverId or receiverSiteId must be set
681
+ * @param integer $receiverSiteId Signed 64-bit
682
+ */
683
+ public function setReceiverSiteId($receiverSiteId) {
684
+ $this->_receiverSiteId = $receiverSiteId;
685
+ }
686
+
687
+ /**
688
+ * Get receiver's site ID. From Speedy site nomenclature.
689
+ * @return integer Receiver's site ID - signed 64-bit
690
+ */
691
+ public function getReceiverSiteId() {
692
+ return $this->_receiverSiteId;
693
+ }
694
+
695
+ /**
696
+ * Set payer type (0=sender, 1=receiver or 2=third party)
697
+ * @param integer $payerType Signed 32-bit
698
+ */
699
+ public function setPayerType($payerType) {
700
+ $this->_payerType = $payerType;
701
+ }
702
+
703
+ /**
704
+ * Get payer type (0=sender, 1=receiver or 2=third party)
705
+ * @return integer Payer type - signed 32-bit
706
+ */
707
+ public function getPayerType() {
708
+ return $this->_payerType;
709
+ }
710
+
711
+ /**
712
+ * Set payer ID from Speedy client nomenclature.
713
+ * Must be set <=> payer is "third party".
714
+ * @param integer $payerRefId Signed 64-bit
715
+ */
716
+ public function setPayerRefId($payerRefId) {
717
+ $this->_payerRefId = $payerRefId;
718
+ }
719
+
720
+ /**
721
+ * Get payer ID from Speedy client nomenclature.
722
+ * @return integer Payer ID - signed 64-bit
723
+ */
724
+ public function getPayerRefId() {
725
+ return $this->_payerRefId;
726
+ }
727
+
728
+ /**
729
+ * Set insurance payer type (0=sender, 1=reciever or 2=third party).
730
+ * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
731
+ * @param integer $payerTypeInsurance Signed 32-bit
732
+ */
733
+ public function setPayerTypeInsurance($payerTypeInsurance) {
734
+ $this->_payerTypeInsurance = $payerTypeInsurance;
735
+ }
736
+
737
+ /**
738
+ * Get insurance payer type (0=sender, 1=reciever or 2=third party).
739
+ * @return integer Insurance payer type - signed 32-bit
740
+ */
741
+ public function getPayerTypeInsurance() {
742
+ return $this->_payerTypeInsurance;
743
+ }
744
+
745
+
746
+ /**
747
+ * Set packings payer type (0=sender, 1=reciever or 2=third party).
748
+ * Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
749
+ * @param integer $payerTypePackings Signed 32-bit
750
+ */
751
+ public function setPayerTypePackings($payerTypePackings) {
752
+ $this->_payerTypePackings = $payerTypePackings;
753
+ }
754
+
755
+ /**
756
+ * Get packings payer type (0=sender, 1=reciever or 2=third party).
757
+ * @return integer Insurance payer type - signed 32-bit
758
+ */
759
+ public function getPayerTypePackings() {
760
+ return $this->_payerTypePackings;
761
+ }
762
+
763
+ /**
764
+ * Set insurance payer ID from Speedy client nomenclature.
765
+ * Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
766
+ * @param integer $payerRefInsuranceId Signed 64-bit
767
+ */
768
+ public function setPayerRefInsuranceId($payerRefInsuranceId) {
769
+ $this->_payerRefInsuranceId = $payerRefInsuranceId;
770
+ }
771
+
772
+ /**
773
+ * Get insurance payer ID from Speedy client nomenclature.
774
+ * @return integer Insurance payer ID - signed 64-bit
775
+ */
776
+ public function getPayerRefInsuranceId() {
777
+ return $this->_payerRefInsuranceId;
778
+ }
779
+
780
+ /**
781
+ * Set packings payer ID
782
+ * @param integer $payerRefPackingsId Signed 64-bit
783
+ */
784
+ public function setPayerRefPackingsId($payerRefPackingsId) {
785
+ $this->_payerRefPackingsId = $payerRefPackingsId;
786
+ }
787
+
788
+ /**
789
+ * Get packings payer ID
790
+ * @return integer Signed 64-bit
791
+ */
792
+ public function getPayerRefPackingsId() {
793
+ return $this->_payerRefPackingsId;
794
+ }
795
+
796
+ /**
797
+ * Gets the special delivery id
798
+ * @return signed 32-bit integer special delivery id
799
+ */
800
+ public function getSpecialDeliveryId() {
801
+ return $this->_specialDeliveryId;
802
+ }
803
+
804
+ /**
805
+ * Sets the special delivery id
806
+ * @param signed 32-bit integer $specialDeliveryId Special delivery id
807
+ */
808
+ public function setSpecialDeliveryId($specialDeliveryId) {
809
+ $this->_specialDeliveryId = $specialDeliveryId;
810
+ }
811
+
812
+ /**
813
+ * Set the receiver country id
814
+ * @param integer signed 64-bit $receiverCountryId
815
+ */
816
+ public function setReceiverCountryId($receiverCountryId) {
817
+ $this->_receiverCountryId = $receiverCountryId;
818
+ }
819
+
820
+ /**
821
+ * Get receiver country id.
822
+ * @return integer signed 64-bit Receiver country id
823
+ */
824
+ public function getReceiverCountryId() {
825
+ return $this->_receiverCountryId;
826
+ }
827
+
828
+ /**
829
+ * Set the receiver post code
830
+ * @param string $receiverPostCode
831
+ */
832
+ public function setReceiverPostCode($receiverPostCode) {
833
+ $this->_receiverPostCode = $receiverPostCode;
834
+ }
835
+
836
+ /**
837
+ * Get receiver post code
838
+ * @return string Receiver post code
839
+ */
840
+ public function getReceiverPostCode() {
841
+ return $this->_receiverPostCode;
842
+ }
843
+
844
+ /**
845
+ * Set the sender country id
846
+ * @param integer signed 64-bit $senderCountryId
847
+ */
848
+ public function setSenderCountryId($senderCountryId) {
849
+ $this->_senderCountryId = $senderCountryId;
850
+ }
851
+
852
+ /**
853
+ * Get sender country id.
854
+ * @return integer signed 64-bit Sender country id
855
+ */
856
+ public function getSenderCountryId() {
857
+ return $this->_senderCountryId;
858
+ }
859
+
860
+ /**
861
+ * Set the sender post code
862
+ * @param string $senderPostCode
863
+ */
864
+ public function setSenderPostCode($senderPostCode) {
865
+ $this->_senderPostCode = $senderPostCode;
866
+ }
867
+
868
+ /**
869
+ * Get sender post code
870
+ * @return string Sender post code
871
+ */
872
+ public function getSenderPostCode() {
873
+ return $this->_senderPostCode;
874
+ }
875
+
876
+ /**
877
+ * Set data for parcels with explicit/fixed IDs (from the second one onward)
878
+ * @param array $parcels List of ParamParcelInfo
879
+ */
880
+ public function setParcels($parcels) {
881
+ $this->_parcels = $parcels;
882
+ }
883
+
884
+ /**
885
+ * Get data for parcels with explicit/fixed IDs (from the second one onward)
886
+ * @return array List of ParamParcelInfo
887
+ */
888
+ public function getParcels() {
889
+ return $this->_parcels;
890
+ }
891
+
892
+ /**
893
+ * Set Flag indicating whether the shipping price should be included into the cash on delivery price.
894
+ * @param boolean
895
+ */
896
+ public function setIncludeShippingPriceInCod($includeShippingPriceInCod) {
897
+ $this->_includeShippingPriceInCod = $includeShippingPriceInCod;
898
+ }
899
+
900
+ /**
901
+ * Get Flag indicating whether the shipping price should be included into the cash on delivery price.
902
+ * @return boolean
903
+ */
904
+ public function getIncludeShippingPriceInCod() {
905
+ return $this->_includeShippingPriceInCod;
906
+ }
907
+
908
+ /**
909
+ * Return standard class from this class
910
+ * @return stdClass
911
+ */
912
+ public function toStdClass() {
913
+ $stdClass = new stdClass();
914
+ $stdClass->takingDate = $this->_takingDate;
915
+ $stdClass->autoAdjustTakingDate = $this->_autoAdjustTakingDate;
916
+ $stdClass->serviceTypeId = $this->_serviceTypeId;
917
+ $stdClass->willBringToOfficeId = $this->_willBringToOfficeId;
918
+ $stdClass->broughtToOffice = $this->_broughtToOffice;
919
+ $stdClass->officeToBeCalledId = $this->_officeToBeCalledId;
920
+ $stdClass->toBeCalled = $this->_toBeCalled;
921
+ $stdClass->fixedTimeDelivery = $this->_fixedTimeDelivery;
922
+ $stdClass->deferredDeliveryWorkDays = $this->_deferredDeliveryWorkDays;
923
+ $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;
924
+ $stdClass->amountCodBase = $this->_amountCodBase;
925
+ $stdClass->payCodToThirdParty = $this->_payCodToThirdParty;
926
+ $stdClass->parcelsCount = $this->_parcelsCount;
927
+ $stdClass->weightDeclared = $this->_weightDeclared;
928
+ $stdClass->documents = $this->_documents;
929
+ $stdClass->fragile = $this->_fragile;
930
+ $stdClass->palletized = $this->_palletized;
931
+ $stdClass->senderId = $this->_senderId;
932
+ $stdClass->senderSiteId = $this->_senderSiteId;
933
+ $stdClass->receiverId = $this->_receiverId;
934
+ $stdClass->receiverSiteId = $this->_receiverSiteId;
935
+ $stdClass->payerType = $this->_payerType;
936
+ $stdClass->payerRefId = $this->_payerRefId;
937
+ $stdClass->payerTypeInsurance = $this->_payerTypeInsurance;
938
+ $stdClass->payerTypePackings = $this->_payerTypePackings;
939
+ $stdClass->payerRefInsuranceId = $this->_payerRefInsuranceId;
940
+ $stdClass->payerRefPackingsId = $this->_payerRefPackingsId;
941
+ $stdClass->specialDeliveryId = $this->_specialDeliveryId;
942
+ $stdClass->receiverCountryId = $this->_receiverCountryId;
943
+ $stdClass->receiverPostCode = $this->_receiverPostCode;
944
+ $stdClass->senderCountryId = $this->_senderCountryId;
945
+ $stdClass->senderPostCode = $this->_senderPostCode;
946
+
947
+ $arrStdClassParamParcelInfo = array();
948
+ if (isset($this->_parcels)) {
949
+ if (is_array($this->_parcels)) {
950
+ for($i = 0; $i < count($this->_parcels); $i++) {
951
+ $arrStdClassParamParcelInfo[$i] = $this->_parcels[$i]->toStdClass();
952
+ }
953
+ } else {
954
+ $arrStdClassParamParcelInfo[0] = $this->_parcels->toStdClass();
955
+ }
956
+ }
957
+ $stdClass->parcels = $arrStdClassParamParcelInfo;
958
+ $stdClass->includeShippingPriceInCod= $this->_includeShippingPriceInCod;
959
+
960
+ return $stdClass;
961
+ }
962
+ }
963
  ?>
lib/SpeedyEPS/ver01/ParamPicking.class.php CHANGED
@@ -1,1233 +1,1321 @@
1
- <?php
2
-
3
- require_once 'Size.class.php';
4
- require_once 'ParamClientData.class.php';
5
- require_once 'FixedDiscountCardId.class.php';
6
- require_once 'ParamParcelInfo.class.php';
7
- require_once 'ParamOptionsBeforePayment.class.php';
8
- require_once 'ParamPackings.class.php';
9
- require_once 'ParamReturnServiceRequest.class.php';
10
- require_once 'ParamReturnShipmentRequest.class.php';
11
-
12
- /**
13
- * Instances of this class are passed as a parameter of Speedy web service calls for calclualation and registration
14
- * @since 1.0
15
- */
16
- class ParamPicking {
17
-
18
- /**
19
- * BOL number
20
- * MANDATORY: Only for updateBillOfLading. Null otherwise
21
- * @var integer Signed 64-bit
22
- */
23
- private $_billOfLading;
24
-
25
- /**
26
- * The date for shipment pick-up (the "time" component is ignored). Default value is "today".
27
- * MANDATORY: NO
28
- * @var date
29
- */
30
- private $_takingDate;
31
-
32
- /**
33
- * Courier service type ID
34
- * MANDATORY: YES
35
- * @var integer Signed 64-bit
36
- */
37
- private $_serviceTypeId;
38
-
39
- /**
40
- * ID of an office "to be called"
41
- * MANDATORY: Only for "to be called" pickings
42
- * @var integer Signed 64-bit
43
- */
44
- private $_officeToBeCalledId;
45
-
46
- /**
47
- * Options before payment
48
- * MANDATORY: NO
49
- * @var ParamOptionsBeforePayment
50
- * @since 2.3.0
51
- */
52
- protected $_optionsBeforePayment;
53
-
54
- /**
55
- * Fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.)
56
- * MANDATORY: Depending on the courier service, this property could be required, allowed or banned
57
- * @var integer Signed 16-bit
58
- */
59
- private $_fixedTimeDelivery;
60
-
61
- /**
62
- * In some rare cases users might prefer the delivery to be deferred by a day or two.
63
- * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
64
- * Max 2 days
65
- * MANDATORY: No
66
- * @var integer Signed 32-bit
67
- */
68
- private $_deferredDeliveryWorkDays;
69
-
70
- /**
71
- * Specifies if the shipment has a "request for return documents"
72
- * MANDATORY: YES
73
- * @var boolean
74
- */
75
- private $_backDocumentsRequest;
76
-
77
- /**
78
- * Specifies if the shipment has a "request for return receipt"
79
- * MANDATORY: YES
80
- * @var boolean
81
- */
82
- private $_backReceiptRequest;
83
-
84
- /**
85
- * Specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
86
- * MANDATORY: YES
87
- * @var boolean
88
- */
89
- private $_willBringToOffice;
90
-
91
- /**
92
- * Special delivery id
93
- * MANDATORY: NO
94
- * @var signed 32-bit integer
95
- * @since 2.3.0
96
- */
97
- protected $_specialDeliveryId;
98
-
99
- /**
100
- * Specifies the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
101
- * If willBringToOfficeId is provided, willBringToOffice flag is considered "true", regardless the value provided.
102
- * If willBringToOfficeId is not provied (0 or null) and willBringToOffice flag is "true",
103
- * willBringToOfficeId is automatically set with default value configured for caller user profile.
104
- * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
105
- * MANDATORY: NO
106
- * @since 1.3
107
- * @var integer Signed 64-bit
108
- */
109
- private $_willBringToOfficeId;
110
-
111
- /**
112
- * Shipment insurance value (if the shipment is insured).
113
- * The value is limited depending on user's permissions and Speedy's current policy
114
- * MANDATORY: NO
115
- * @var double Signed 64-bit
116
- */
117
- private $_amountInsuranceBase;
118
-
119
- /**
120
- * Cash-on-Delivery (COD) amount.
121
- * The value is limited depending on user's permissions and Speedy's current policy
122
- * MANDATORY: NO
123
- * @var double Signed 64-bit
124
- */
125
- private $_amountCodBase;
126
-
127
- /**
128
- * Specifies if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
129
- * MANDATORY: NO
130
- * @var boolean
131
- */
132
- private $_payCodToThirdParty;
133
-
134
- /**
135
- * Return money-transfer request amount
136
- * The value is limited depending on user's permissions and Speedy's current policy
137
- * MANDATORY: NO
138
- * @var double Signed 64-bit
139
- */
140
- private $_retMoneyTransferReqAmount;
141
-
142
- /**
143
- * Return third party payer flag
144
- * MANDATORY: NO
145
- * @var boolean
146
- * @since 2.3.0
147
- */
148
- protected $_retThirdPartyPayer;
149
-
150
- /**
151
- * Parcels count. Maximum value is 999.
152
- * MANDATORY: YES
153
- * @var integer Signed 32-bit
154
- */
155
- private $_parcelsCount;
156
-
157
- /**
158
- * Size of shipment
159
- * MANDATORY: NO
160
- * @var Size
161
- */
162
- private $_size;
163
-
164
- /**
165
- * Declared weight (the greater of "volume" and "real" weight values).
166
- * Maximum value is 100.00
167
- * MANDATORY: YES
168
- * @var double Signed 64-bit
169
- */
170
- private $_weightDeclared;
171
-
172
- /**
173
- * Contents. Max text size - 50 symbols
174
- * MANDATORY: YES
175
- * @var string
176
- */
177
- private $_contents;
178
-
179
- /**
180
- * Packing
181
- * MANDATORY: YES
182
- * @var string
183
- */
184
- private $_packing;
185
-
186
- /**
187
- * Data for packings. For internal use only
188
- * MANDATORY: NO
189
- * @var ParamPackings
190
- * @since 2.3.0
191
- */
192
- private $_packings;
193
-
194
- /**
195
- * Packing ID (number)
196
- * MANDATORY: NO
197
- * @var integer Signed 64-bit
198
- */
199
- private $_packId;
200
-
201
- /**
202
- * Specifies whether the shipment consists of documents
203
- * MANDATORY: YES
204
- * @var boolean
205
- */
206
- private $_documents;
207
-
208
- /**
209
- * Specifies whether the shipment is fragile - necessary when the price of insurance is being calculated
210
- * MANDATORY: YES
211
- * @var boolean
212
- */
213
- private $_fragile;
214
-
215
- /**
216
- * Specifies whether the shipment is palletized
217
- * MANDATORY: YES
218
- * @var boolean
219
- */
220
- private $_palletized;
221
-
222
- /**
223
- * Data for the sender
224
- * MANDATORY: YES
225
- * @var ParamClientData
226
- */
227
- private $_sender;
228
-
229
- /**
230
- * Data for the receiver
231
- * MANDATORY: YES
232
- * @var ParamClientData
233
- */
234
- private $_receiver;
235
-
236
- /**
237
- * Payer type (0=sender, 1=receiver or 2=third party)
238
- * MANDATORY: YES
239
- * @var integer Signed 32-bit
240
- */
241
- private $_payerType;
242
-
243
- /**
244
- * Payer ID.
245
- * MANDATORY: Must be set <=> payer is "third party".
246
- * @var integer Signed 64-bit
247
- */
248
- private $_payerRefId;
249
-
250
- /**
251
- * Insurance payer type (0=sender, 1=reciever or 2=third party)
252
- * MANDATORY: Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
253
- * @var integer Signed 32-bit
254
- */
255
- private $_payerTypeInsurance;
256
-
257
- /**
258
- * Packings payer type (0=sender, 1=reciever or 2=third party)
259
- * MANDATORY: No.If not set, the payer of the packings' surcharge will be the same as the one indicated by payerType.
260
- * @var integer Signed 32-bit
261
- * @since 2.3.0
262
- */
263
- protected $_payerTypePackings;
264
-
265
- /**
266
- * Insurance payer ID
267
- * MANDATORY: Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
268
- * @var integer Signed 64-bit
269
- */
270
- private $_payerRefInsuranceId;
271
-
272
- /**
273
- * Packings payer ID
274
- * MANDATORY: Must be set <=> payerTypePackings is "third party".
275
- * @var integer Signed 64-bit
276
- * @since 2.3.0
277
- */
278
- protected $_payerRefPackingsId;
279
-
280
- /**
281
- * Client's note
282
- * MANDATORY: NO
283
- * @var string
284
- */
285
- private $_noteClient;
286
-
287
- /**
288
- * Card/Coupon/Voucher number for fixed discount
289
- * MANDATORY: NO
290
- * @var FixedDiscountCardId
291
- */
292
- private $_discCalc;
293
-
294
- /**
295
- * ID of the client who is to receive the return receipt and/or the return documents.
296
- * If payer is "third party" then this client has to be payer's contract member.
297
- * Otherwise the client has to be sender's contract member.
298
- * MANDATORY: NO
299
- * @var integer Signed 64-bit
300
- */
301
- private $_retToClientId;
302
-
303
- /**
304
- * An optional reference code.
305
- * Maximum 30 symbols
306
- * MANDATORY: NO
307
- * @var string
308
- */
309
- private $_ref1;
310
-
311
- /**
312
- * An optional reference code.
313
- * Maximum 30 symbols
314
- * MANDATORY: NO
315
- * @var string
316
- */
317
- private $_ref2;
318
-
319
- /**
320
- * An optional value used to identify user's client software.
321
- * Please verify the allowed values with Speedy's IT Department.
322
- * MANDATORY: NO
323
- * @var integer Signed 64-bit
324
- */
325
- private $_clientSystemId;
326
-
327
- /**
328
- * Data for parcels with explicit/fixed IDs (from the second one onward)
329
- * The list has maximum lenght 998
330
- * MANDATORY: NO
331
- * @var array List of ParamParcelInfo
332
- */
333
- private $_parcels;
334
-
335
- /**
336
- * When parcelsCount > 1 and no explicit data has been set in the parcels property during the creation,
337
- * then parcels will be created automatically by default.
338
- * This parameter allows users to control this behaviour.
339
- * MANDATORY: NO
340
- * @var boolean
341
- */
342
- private $_skipAutomaticParcelsCreation;
343
-
344
- /**
345
- * Specifies if the service/system should allow parcels to be added to the shipment at a later stage.
346
- * MANDATORY: NO
347
- * @var boolean
348
- */
349
- private $_pendingParcelsDescription;
350
-
351
- /**
352
- * Specifies if the service/system should allow BOL's modification at a later stage.
353
- * MANDATORY: NO
354
- * @var boolean
355
- */
356
- private $_pendingShipmentDescription;
357
-
358
- /**
359
- * Return service request
360
- * MANDATORY: NO
361
- * @var array of ParamReturnServiceRequest
362
- * since 2.5.0
363
- */
364
- private $_retServicesRequest;
365
-
366
- /**
367
- * Return shipment request
368
- * MANDATORY: NO
369
- * @var ParamReturnShipmentRequest
370
- * since 2.5.0
371
- */
372
- private $_retShipmentRequest;
373
-
374
- /**
375
- * Set BOL number
376
- * @param integer $billOfLading Signed 64-bit
377
- */
378
- public function setBillOfLading($billOfLading) {
379
- $this->_billOfLading = $billOfLading;
380
- }
381
-
382
- /**
383
- * Get BOL number
384
- * @return integer Signed 64-bit
385
- */
386
- public function getBillOfLading() {
387
- return $this->_billOfLading;
388
- }
389
-
390
- /**
391
- * Set date for shipment pick-up (the "time" component is ignored).
392
- * @param date $takingDate
393
- */
394
- public function setTakingDate($takingDate) {
395
- $this->_takingDate = $takingDate;
396
- }
397
-
398
- /**
399
- * Get BOL number
400
- * @return date
401
- */
402
- public function getTakingDate() {
403
- return $this->_takingDate;
404
- }
405
-
406
- /**
407
- * Set courier service type ID
408
- * @param integer $serviceTypeId Signed 64-bit
409
- */
410
- public function setServiceTypeId($serviceTypeId) {
411
- $this->_serviceTypeId = $serviceTypeId;
412
- }
413
-
414
- /**
415
- * Get courier service type ID
416
- * @return integer Signed 64-bit
417
- */
418
- public function getServiceTypeId() {
419
- return $this->_serviceTypeId;
420
- }
421
-
422
- /**
423
- * Set ID of an office "to be called"
424
- * @param integer $officeToBeCalledId Signed 64-bit
425
- */
426
- public function setOfficeToBeCalledId($officeToBeCalledId) {
427
- $this->_officeToBeCalledId = $officeToBeCalledId;
428
- }
429
-
430
- /**
431
- * Get ID of an office "to be called"
432
- * @return integer Signed 64-bit
433
- */
434
- public function getOfficeToBeCalledId() {
435
- return $this->_officeToBeCalledId;
436
- }
437
-
438
- /**
439
- * Set options before payment
440
- * @param ParamOptionsBeforePayment $optionsBeforePayment
441
- */
442
- public function setOptionsBeforePayment($optionsBeforePayment) {
443
- $this->_optionsBeforePayment = $optionsBeforePayment;
444
- }
445
-
446
- /**
447
- * Get options before payment
448
- * @return integer Signed 64-bit
449
- */
450
- public function getOptionsBeforePayment() {
451
- return $this->_optionsBeforePayment;
452
- }
453
-
454
- /**
455
- * Set fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.)
456
- * @param integer $fixedTimeDelivery Signed 16-bit
457
- */
458
- public function setFixedTimeDelivery($fixedTimeDelivery) {
459
- $this->_fixedTimeDelivery = $fixedTimeDelivery;
460
- }
461
-
462
- /**
463
- * Get fixed time for delivery
464
- * @return integer Signed 16-bit
465
- */
466
- public function getFixedTimeDelivery() {
467
- return $this->_fixedTimeDelivery;
468
- }
469
-
470
- /**
471
- * Set working days to postpone the shipment delivery. Allowe values are 1 or 2
472
- * @param integer $deferredDeliveryWorkDays Signed 32-bit
473
- */
474
- public function setDeferredDeliveryWorkDays($deferredDeliveryWorkDays) {
475
- $this->_deferredDeliveryWorkDays = $deferredDeliveryWorkDays;
476
- }
477
-
478
- /**
479
- * Get working days to postpone the shipment delivery
480
- * @return integer Signed 32-bit
481
- */
482
- public function getDeferredDeliveryWorkDays() {
483
- return $this->_deferredDeliveryWorkDays;
484
- }
485
-
486
- /**
487
- * Set "request for return documents" flag for shipment
488
- * @param boolean $backDocumentsRequest
489
- */
490
- public function setBackDocumentsRequest($backDocumentsRequest) {
491
- $this->_backDocumentsRequest = $backDocumentsRequest;
492
- }
493
-
494
- /**
495
- * Check "request for return documents" flag for shipment
496
- * @return boolean
497
- */
498
- public function isBackDocumentsRequest() {
499
- return $this->_backDocumentsRequest;
500
- }
501
-
502
- /**
503
- * Set "request for return receipt" flag for shipment
504
- * @param boolean $backReceiptRequest
505
- */
506
- public function setBackReceiptRequest($backReceiptRequest) {
507
- $this->_backReceiptRequest = $backReceiptRequest;
508
- }
509
-
510
- /**
511
- * Check "request for return receipt" flag for shipment
512
- * @return boolean
513
- */
514
- public function isBackReceiptRequest() {
515
- return $this->_backReceiptRequest;
516
- }
517
-
518
- /**
519
- * Set "bring to office" flag for shipment
520
- * @param boolean $willBringToOffice
521
- */
522
- public function setWillBringToOffice($willBringToOffice) {
523
- $this->_willBringToOffice = $willBringToOffice;
524
- }
525
-
526
- /**
527
- * Check "bring to office" flag for shipment
528
- * @return boolean
529
- */
530
- public function getWillBringToOffice() {
531
- return $this->_willBringToOffice;
532
- }
533
-
534
- /**
535
- * Set "bring to office" id
536
- * @since 1.3
537
- * @param Signed 64-bit $willBringToOfficeId
538
- */
539
- public function setWillBringToOfficeId($willBringToOfficeId) {
540
- $this->_willBringToOfficeId = $willBringToOfficeId;
541
- }
542
-
543
- /**
544
- * Get "bring to office" id
545
- * @since 1.3
546
- * @return Signed 64-bit
547
- */
548
- public function getWillBringToOfficeId() {
549
- return $this->_willBringToOfficeId;
550
- }
551
-
552
- /**
553
- * Gets the special delivery id
554
- * @return signed 32-bit integer special delivery id
555
- */
556
- public function getSpecialDeliveryId() {
557
- return $this->_specialDeliveryId;
558
- }
559
-
560
- /**
561
- * Sets the special delivery id
562
- * @param signed 32-bit integer $specialDeliveryId Special delivery id
563
- */
564
- public function setSpecialDeliveryId($specialDeliveryId) {
565
- $this->_specialDeliveryId = $specialDeliveryId;
566
- }
567
-
568
- /**
569
- * Set shipment insurance value (if the shipment is insured).
570
- * @param double $amountInsuranceBase Signed 64-bit
571
- */
572
- public function setAmountInsuranceBase($amountInsuranceBase) {
573
- $this->_amountInsuranceBase = $amountInsuranceBase;
574
- }
575
-
576
- /**
577
- * Get shipment insurance value
578
- * @return double Signed 64-bit
579
- */
580
- public function getAmountInsuranceBase() {
581
- return $this->_amountInsuranceBase;
582
- }
583
-
584
- /**
585
- * Set cash-on-Delivery (COD) amount.
586
- * @param double $amountCodBase Signed 64-bit
587
- */
588
- public function setAmountCodBase($amountCodBase) {
589
- $this->_amountCodBase = $amountCodBase;
590
- }
591
-
592
- /**
593
- * Get cash-on-Delivery (COD) amount.
594
- * @return double Signed 64-bit
595
- */
596
- public function getAmountCodBase() {
597
- return $this->_amountCodBase;
598
- }
599
-
600
- /**
601
- * Set flag for COD value to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
602
- * @param boolean $payCodToThirdParty
603
- */
604
- public function setPayCodToThirdParty($payCodToThirdParty) {
605
- $this->_payCodToThirdParty = $payCodToThirdParty;
606
- }
607
-
608
- /**
609
- * Check flag for COD value to be paid to a third party
610
- * @return boolean
611
- */
612
- public function isPayCodToThirdParty() {
613
- return $this->_payCodToThirdParty;
614
- }
615
-
616
- /**
617
- * Set return money-transfer request amount
618
- * @param double $retMoneyTransferReqAmount Signed 64-bit
619
- */
620
- public function setRetMoneyTransferReqAmount($retMoneyTransferReqAmount) {
621
- $this->_retMoneyTransferReqAmount = $retMoneyTransferReqAmount;
622
- }
623
-
624
- /**
625
- * Get return money-transfer request amount
626
- * @return double Signed 64-bit
627
- */
628
- public function getRetMoneyTransferReqAmount() {
629
- return $this->_retMoneyTransferReqAmount;
630
- }
631
-
632
- /**
633
- * Set return picking third party payer flag
634
- * @param boolean $retThirdPartyPayer return picking third party payer flag
635
- */
636
- public function setRetThirdPartyPayer($retThirdPartyPayer) {
637
- $this->_retThirdPartyPayer = $retThirdPartyPayer;
638
- }
639
-
640
- /**
641
- * Gets return picking third party payer flag
642
- * @return boolean Picking third party payer flag
643
- */
644
- public function isRetThirdPartyPayer() {
645
- return $this->_retThirdPartyPayer;
646
- }
647
-
648
- /**
649
- * Set parcels count. Maximum value is 999
650
- * @param integer $parcelsCount Signed 32-bit
651
- */
652
- public function setParcelsCount($parcelsCount) {
653
- $this->_parcelsCount = $parcelsCount;
654
- }
655
-
656
- /**
657
- * Get parcels count
658
- * @return integer Signed 32-bit
659
- */
660
- public function getParcelsCount() {
661
- return $this->_parcelsCount;
662
- }
663
-
664
- /**
665
- * Set size of shipment
666
- * @param Size $size
667
- */
668
- public function setSize($size) {
669
- $this->_size = $size;
670
- }
671
-
672
- /**
673
- * Get size of shipment
674
- * @return Size
675
- */
676
- public function getSize() {
677
- return $this->_size;
678
- }
679
-
680
- /**
681
- * Set declared weight (the greater of "volume" and "real" weight values). Maximum value is 100.00
682
- * @param double $weightDeclared Signed 64-bit
683
- */
684
- public function setWeightDeclared($weightDeclared) {
685
- $this->_weightDeclared = $weightDeclared;
686
- }
687
-
688
- /**
689
- * Get declared weight
690
- * @return double Signed 64-bit
691
- */
692
- public function getWeightDeclared() {
693
- return $this->_weightDeclared;
694
- }
695
-
696
- /**
697
- * Set contents. Max text size - 50 symbols
698
- * @param string $contents
699
- */
700
- public function setContents($contents) {
701
- $this->_contents = $contents;
702
- }
703
-
704
- /**
705
- * Get contents.
706
- * @return string
707
- */
708
- public function getContents() {
709
- return $this->_contents;
710
- }
711
-
712
- /**
713
- * Set contents. Max text size - 50 symbols
714
- * @param string $packing
715
- */
716
- public function setPacking($packing) {
717
- $this->_packing = $packing;
718
- }
719
-
720
- /**
721
- * Get contents.
722
- * @return string
723
- */
724
- public function getPacking() {
725
- return $this->_packing;
726
- }
727
-
728
- /**
729
- * Set packings
730
- * @param Array of ParamPackings $packings
731
- */
732
- public function setPackings($packings) {
733
- $this->_packings = $packings;
734
- }
735
-
736
- /**
737
- * Get packings.
738
- * @return Array of ParamPackings
739
- */
740
- public function getPackings() {
741
- return $this->_packings;
742
- }
743
-
744
-
745
- /**
746
- * Set packing ID (number)
747
- * @param integer $packId Signed 64-bit
748
- */
749
- public function setPackId($packId) {
750
- $this->_packId = $packId;
751
- }
752
-
753
- /**
754
- * Get packing ID (number).
755
- * @return integer Signed 64-bit
756
- */
757
- public function getPackId() {
758
- return $this->_packId;
759
- }
760
-
761
- /**
762
- * Set flag whether shipment consists of documents
763
- * @param boolean $documents
764
- */
765
- public function setDocuments($documents) {
766
- $this->_documents = $documents;
767
- }
768
-
769
- /**
770
- * Check whether shipment consists if documents
771
- * @return boolean
772
- */
773
- public function isDocuments() {
774
- return $this->_documents;
775
- }
776
-
777
- /**
778
- * Set flag whether shipment is fragile - necessary when the price of insurance is being calculated
779
- * @param boolean $fragile
780
- */
781
- public function setFragile($fragile) {
782
- $this->_fragile = $fragile;
783
- }
784
-
785
- /**
786
- * Check whether shipment is fragile
787
- * @return boolean
788
- */
789
- public function isFragile() {
790
- return $this->_fragile;
791
- }
792
-
793
- /**
794
- * Set flag whether shipment is palletized
795
- * @param boolean $palletized
796
- */
797
- public function setPalletized($palletized) {
798
- $this->_palletized = $palletized;
799
- }
800
-
801
- /**
802
- * Check whether shipment is palletized
803
- * @return boolean
804
- */
805
- public function isPalletized() {
806
- return $this->_palletized;
807
- }
808
-
809
- /**
810
- * Set data for the sender
811
- * @param ParamClientData $sender
812
- */
813
- public function setSender($sender) {
814
- $this->_sender = $sender;
815
- }
816
-
817
- /**
818
- * Get data for the sender
819
- * @return ParamClientData
820
- */
821
- public function getSender() {
822
- return $this->_sender;
823
- }
824
-
825
- /**
826
- * Set data for the receiver
827
- * @param ParamClientData $receiver
828
- */
829
- public function setReceiver($receiver) {
830
- $this->_receiver = $receiver;
831
- }
832
-
833
- /**
834
- * Get data for the receiver
835
- * @return ParamClientData
836
- */
837
- public function getReceiver() {
838
- return $this->_receiver;
839
- }
840
-
841
- /**
842
- * Set payer type (0=sender, 1=receiver or 2=third party)
843
- * @param integer $payerType Signed 32-bit
844
- */
845
- public function setPayerType($payerType) {
846
- $this->_payerType = $payerType;
847
- }
848
-
849
- /**
850
- * Get payer type (0=sender, 1=receiver or 2=third party)
851
- * @return integer Signed 32-bit
852
- */
853
- public function getPayerType() {
854
- return $this->_payerType;
855
- }
856
-
857
- /**
858
- * Set payer ID
859
- * @param integer $payerRefId Signed 64-bit
860
- */
861
- public function setPayerRefId($payerRefId) {
862
- $this->_payerRefId = $payerRefId;
863
- }
864
-
865
- /**
866
- * Get payer ID
867
- * @return integer Signed 64-bit
868
- */
869
- public function getPayerRefId() {
870
- return $this->_payerRefId;
871
- }
872
-
873
- /**
874
- * Set insurance payer type (0=sender, 1=reciever or 2=third party)
875
- * @param integer $payerTypeInsurance Signed 32-bit
876
- */
877
- public function setPayerTypeInsurance($payerTypeInsurance) {
878
- $this->_payerTypeInsurance = $payerTypeInsurance;
879
- }
880
-
881
- /**
882
- * Get insurance payer type
883
- * @return integer Signed 32-bit
884
- */
885
- public function getPayerTypeInsurance() {
886
- return $this->_payerTypeInsurance;
887
- }
888
-
889
- /**
890
- * Set packings payer type (0=sender, 1=reciever or 2=third party)
891
- * @param integer $payerTypePackings Signed 32-bit
892
- */
893
- public function setPayerTypePackings($payerTypePackings) {
894
- $this->_payerTypePackings = $payerTypePackings;
895
- }
896
-
897
- /**
898
- * Get packings payer type
899
- * @return integer Signed 32-bit
900
- */
901
- public function getPayerTypePackings() {
902
- return $this->_payerTypePackings;
903
- }
904
-
905
- /**
906
- * Set insurance payer ID
907
- * @param integer $payerRefInsuranceId Signed 64-bit
908
- */
909
- public function setPayerRefInsuranceId($payerRefInsuranceId) {
910
- $this->_payerRefInsuranceId = $payerRefInsuranceId;
911
- }
912
-
913
- /**
914
- * Get insurance payer ID
915
- * @return integer Signed 64-bit
916
- */
917
- public function getPayerRefInsuranceId() {
918
- return $this->_payerRefInsuranceId;
919
- }
920
-
921
-
922
- /**
923
- * Set packings payer ID
924
- * @param integer $payerRefPackingsId Signed 64-bit
925
- */
926
- public function setPayerRefPackingsId($payerRefPackingsId) {
927
- $this->_payerRefPackingsId = $payerRefPackingsId;
928
- }
929
-
930
- /**
931
- * Get packings payer ID
932
- * @return integer Signed 64-bit
933
- */
934
- public function getPayerRefPackingsId() {
935
- return $this->_payerRefPackingsId;
936
- }
937
-
938
- /**
939
- * Set client's note
940
- * @param string $noteClient
941
- */
942
- public function setNoteClient($noteClient) {
943
- $this->_noteClient = $noteClient;
944
- }
945
-
946
- /**
947
- * Get client's note
948
- * @return string
949
- */
950
- public function getNoteClient() {
951
- return $this->_noteClient;
952
- }
953
-
954
- /**
955
- * Set card/coupon/voucher number for fixed discount
956
- * @param FixedDiscountCardId $discCalc
957
- */
958
- public function setDiscCalc($discCalc) {
959
- $this->_discCalc = $discCalc;
960
- }
961
-
962
- /**
963
- * Get card/coupon/voucher number for fixed discount
964
- * @return FixedDiscountCardId
965
- */
966
- public function getDiscCalc() {
967
- return $this->_discCalc;
968
- }
969
-
970
- /**
971
- * Set ID of the client who is to receive the return receipt and/or the return documents.
972
- * If payer is "third party" then this client has to be payer's contract member.
973
- * Otherwise the client has to be sender's contract member.
974
- * @param integer $retToClientId Signed 64-bit
975
- */
976
- public function setRetToClientId($retToClientId) {
977
- $this->_retToClientId = $retToClientId;
978
- }
979
-
980
- /**
981
- * Get ID of the client who is to receive the return receipt and/or the return documents.
982
- * @return integer Signed 64-bit
983
- */
984
- public function getRetToClientId() {
985
- return $this->_retToClientId;
986
- }
987
-
988
- /**
989
- * Set optional reference code. Maximum 30 symbols.
990
- * @param string $ref1
991
- */
992
- public function setRef1($ref1) {
993
- $this->_ref1 = $ref1;
994
- }
995
-
996
- /**
997
- * Get optional reference code. Maximum 30 symbols.
998
- * @return string
999
- */
1000
- public function getRef1() {
1001
- return $this->_ref1;
1002
- }
1003
-
1004
- /**
1005
- * Set optional reference code 2. Maximum 30 symbols.
1006
- * @param string $ref2
1007
- */
1008
- public function setRef2($ref2) {
1009
- $this->_ref2 = $ref2;
1010
- }
1011
-
1012
- /**
1013
- * Get optional reference code 2. Maximum 30 symbols.
1014
- * @return string
1015
- */
1016
- public function getRef2() {
1017
- return $this->_ref2;
1018
- }
1019
-
1020
- /**
1021
- * Set optional value used to identify user's client software.
1022
- * @param integer $clientSystemId Signed 64-bit
1023
- */
1024
- public function setClientSystemId($clientSystemId) {
1025
- $this->_clientSystemId = $clientSystemId;
1026
- }
1027
-
1028
- /**
1029
- * Get optional value used to identify user's client software.
1030
- * @return integer Signed 64-bit
1031
- */
1032
- public function getClientSystemId() {
1033
- return $this->_clientSystemId;
1034
- }
1035
-
1036
- /**
1037
- * Set data for parcels with explicit/fixed IDs (from the second one onward)
1038
- * @param array $parcels List of ParamParcelInfo
1039
- */
1040
- public function setParcels($parcels) {
1041
- $this->_parcels = $parcels;
1042
- }
1043
-
1044
- /**
1045
- * Get data for parcels with explicit/fixed IDs (from the second one onward)
1046
- * @return array List of ParamParcelInfo
1047
- */
1048
- public function getParcels() {
1049
- return $this->_parcels;
1050
- }
1051
-
1052
- /**
1053
- * Set flag to set or not explicit data on processing parcels with sequence number > 1
1054
- * @param boolean $skipAutomaticParcelsCreation
1055
- */
1056
- public function setSkipAutomaticParcelsCreation($skipAutomaticParcelsCreation) {
1057
- $this->_skipAutomaticParcelsCreation = $skipAutomaticParcelsCreation;
1058
- }
1059
-
1060
- /**
1061
- * Check flag to set or not explicit data on processing parcels with sequence number > 1
1062
- * @return boolean
1063
- */
1064
- public function isSkipAutomaticParcelsCreation() {
1065
- return $this->_skipAutomaticParcelsCreation;
1066
- }
1067
-
1068
- /**
1069
- * Set flag service/system to allow parcels to be added to the shipment at a later stage
1070
- * @param boolean $pendingParcelsDescription
1071
- */
1072
- public function setPendingParcelsDescription($pendingParcelsDescription) {
1073
- $this->_pendingParcelsDescription = $pendingParcelsDescription;
1074
- }
1075
-
1076
- /**
1077
- * Check whether service/system to allow parcels to be added to the shipment at a later stage
1078
- * @return boolean
1079
- */
1080
- public function isPendingParcelsDescription() {
1081
- return $this->_pendingParcelsDescription;
1082
- }
1083
-
1084
- /**
1085
- * Set flag the service/system to allow BOL's modification at a later stage.
1086
- * @param boolean $pendingShipmentDescription
1087
- */
1088
- public function setPendingShipmentDescription($pendingShipmentDescription) {
1089
- $this->_pendingShipmentDescription = $pendingShipmentDescription;
1090
- }
1091
-
1092
- /**
1093
- * Check whether the service/system should allow BOL's modification at a later stage.
1094
- * @return boolean
1095
- */
1096
- public function isPendingShipmentDescription() {
1097
- return $this->_pendingShipmentDescription;
1098
- }
1099
-
1100
- /**
1101
- * Get return service request list
1102
- * @return array of ParamReturnServiceRequest
1103
- */
1104
- public function getRetServicesRequest() {
1105
- return $this->_retServicesRequest;
1106
- }
1107
-
1108
- /**
1109
- * Set return service request list
1110
- * @param array of ParamReturnServiceRequest
1111
- */
1112
- public function setRetServicesRequest($retServicesRequest) {
1113
- $this->_retServicesRequest = $retServicesRequest;
1114
- }
1115
-
1116
- /**
1117
- * Get return service request list
1118
- * @return ParamReturnShipmentRequest
1119
- */
1120
- public function getRetShipmentRequest() {
1121
- return $this->_retShipmentRequest;
1122
- }
1123
-
1124
- /**
1125
- * Set return shipment request
1126
- * @param ParamReturnShipmentRequest $retShipmentRequest
1127
- */
1128
- public function setRetShipmentRequest($retShipmentRequest) {
1129
- $this->_retShipmentRequest = $retShipmentRequest;
1130
- }
1131
-
1132
- /**
1133
- * Return standard class from this class
1134
- * @return stdClass
1135
- */
1136
- public function toStdClass() {
1137
- $stdClass = new stdClass();
1138
- $stdClass->billOfLading = $this->_billOfLading;
1139
- $stdClass->takingDate = $this->_takingDate;
1140
- $stdClass->serviceTypeId = $this->_serviceTypeId;
1141
- $stdClass->officeToBeCalledId = $this->_officeToBeCalledId;
1142
- if (isset($this->_optionsBeforePayment)) {
1143
- $stdClass->optionsBeforePayment = $this->_optionsBeforePayment->toStdClass();
1144
- }
1145
-
1146
- $stdClass->fixedTimeDelivery = $this->_fixedTimeDelivery;
1147
- $stdClass->deferredDeliveryWorkDays = $this->_deferredDeliveryWorkDays;
1148
- $stdClass->backDocumentsRequest = $this->_backDocumentsRequest;
1149
- $stdClass->backReceiptRequest = $this->_backReceiptRequest;
1150
- $stdClass->willBringToOffice = $this->_willBringToOffice;
1151
- $stdClass->willBringToOfficeId = $this->_willBringToOfficeId;
1152
- $stdClass->specialDeliveryId = $this->_specialDeliveryId;
1153
- $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;
1154
- $stdClass->amountCodBase = $this->_amountCodBase;
1155
- $stdClass->payCodToThirdParty = $this->_payCodToThirdParty;
1156
- $stdClass->retMoneyTransferReqAmount = $this->_retMoneyTransferReqAmount;
1157
- $stdClass->retThirdPartyPayer = $this->_retThirdPartyPayer;
1158
- $stdClass->parcelsCount = $this->_parcelsCount;
1159
- if (isset($this->_size)) {
1160
- $stdClass->size = $this->_size->toStdClass();
1161
- }
1162
- $stdClass->weightDeclared = $this->_weightDeclared;
1163
- $stdClass->contents = $this->_contents;
1164
- $stdClass->packing = $this->_packing;
1165
-
1166
- $arrStdClassParamPackings = array();
1167
- if (isset($this->_packings)) {
1168
- if (is_array($this->_packings)) {
1169
- for($i = 0; $i < count($this->_packings); $i++) {
1170
- $arrStdClassParamPackings[$i] = $this->_packings[$i]->toStdClass();
1171
- }
1172
- } else {
1173
- $arrStdClassParamPackings[0] = $this->_packings->toStdClass();
1174
- }
1175
- }
1176
- $stdClass->packings = $arrStdClassParamPackings;
1177
-
1178
- $stdClass->packId = $this->_packId;
1179
- $stdClass->documents = $this->_documents;
1180
- $stdClass->fragile = $this->_fragile;
1181
- $stdClass->palletized = $this->_palletized;
1182
- if (isset($this->_sender)) {
1183
- $stdClass->sender = $this->_sender->toStdClass();
1184
- }
1185
- if (isset($this->_receiver)) {
1186
- $stdClass->receiver = $this->_receiver->toStdClass();
1187
- }
1188
- $stdClass->payerType = $this->_payerType;
1189
- $stdClass->payerRefId = $this->_payerRefId;
1190
- $stdClass->payerTypeInsurance = $this->_payerTypeInsurance;
1191
- $stdClass->payerTypePackings = $this->_payerTypePackings;
1192
- $stdClass->payerRefInsuranceId = $this->_payerRefInsuranceId;
1193
- $stdClass->payerRefPackingsId = $this->_payerRefPackingsId;
1194
- $stdClass->noteClient = $this->_noteClient;
1195
- if (isset($this->_discCalc)) {
1196
- $stdClass->discCalc = $this->_discCalc->toStdClass();
1197
- }
1198
- $stdClass->retToClientId = $this->_retToClientId;
1199
- $stdClass->ref1 = $this->_ref1;
1200
- $stdClass->ref2 = $this->_ref2;
1201
- $stdClass->clientSystemId = $this->_clientSystemId;
1202
- $arrStdClassParamParcelInfo = array();
1203
- if (isset($this->_parcels)) {
1204
- if (is_array($this->_parcels)) {
1205
- for($i = 0; $i < count($this->_parcels); $i++) {
1206
- $arrStdClassParamParcelInfo[$i] = $this->_parcels[$i]->toStdClass();
1207
- }
1208
- } else {
1209
- $arrStdClassParamParcelInfo[0] = $this->_parcels->toStdClass();
1210
- }
1211
- }
1212
- $stdClass->parcels = $arrStdClassParamParcelInfo;
1213
- $stdClass->skipAutomaticParcelsCreation = $this->_skipAutomaticParcelsCreation;
1214
- $stdClass->pendingParcelsDescription = $this->_pendingParcelsDescription;
1215
- $stdClass->pendingShipmentDescription = $this->_pendingShipmentDescription;
1216
- $arrStdClassParamReturnServiceRequest = array();
1217
- if (isset($this->_retServicesRequest)) {
1218
- if (is_array($this->_retServicesRequest)) {
1219
- for($i = 0; $i < count($this->_retServicesRequest); $i++) {
1220
- $arrStdClassParamReturnServiceRequest[$i] = $this->_retServicesRequest[$i]->toStdClass();
1221
- }
1222
- } else {
1223
- $arrStdClassParamReturnServiceRequest[0] = $this->_retServicesRequest->toStdClass();
1224
- }
1225
- }
1226
- $stdClass->retServicesRequest = $arrStdClassParamReturnServiceRequest;
1227
- if (isset($this->_retShipmentRequest)) {
1228
- $stdClass->retShipmentRequest = $this->_retShipmentRequest->toStdClass();
1229
- }
1230
- return $stdClass;
1231
- }
1232
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
  ?>
1
+ <?php
2
+
3
+ require_once 'Size.class.php';
4
+ require_once 'ParamClientData.class.php';
5
+ require_once 'FixedDiscountCardId.class.php';
6
+ require_once 'ParamParcelInfo.class.php';
7
+ require_once 'ParamOptionsBeforePayment.class.php';
8
+ require_once 'ParamPackings.class.php';
9
+ require_once 'ParamReturnServiceRequest.class.php';
10
+ require_once 'ParamReturnShipmentRequest.class.php';
11
+ require_once 'ParamReturnVoucher.class.php';
12
+
13
+ /**
14
+ * Instances of this class are passed as a parameter of Speedy web service calls for calclualation and registration
15
+ * @since 1.0
16
+ */
17
+ class ParamPicking {
18
+
19
+ /**
20
+ * BOL number
21
+ * MANDATORY: Only for updateBillOfLading. Null otherwise
22
+ * @var integer Signed 64-bit
23
+ */
24
+ private $_billOfLading;
25
+
26
+ /**
27
+ * The date for shipment pick-up (the "time" component is ignored). Default value is "today".
28
+ * MANDATORY: NO
29
+ * @var date
30
+ */
31
+ private $_takingDate;
32
+
33
+ /**
34
+ * Courier service type ID
35
+ * MANDATORY: YES
36
+ * @var integer Signed 64-bit
37
+ */
38
+ private $_serviceTypeId;
39
+
40
+ /**
41
+ * ID of an office "to be called"
42
+ * MANDATORY: Only for "to be called" pickings
43
+ * @var integer Signed 64-bit
44
+ */
45
+ private $_officeToBeCalledId;
46
+
47
+ /**
48
+ * Options before payment
49
+ * MANDATORY: NO
50
+ * @var ParamOptionsBeforePayment
51
+ * @since 2.3.0
52
+ */
53
+ protected $_optionsBeforePayment;
54
+
55
+ /**
56
+ * Fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.)
57
+ * MANDATORY: Depending on the courier service, this property could be required, allowed or banned
58
+ * @var integer Signed 16-bit
59
+ */
60
+ private $_fixedTimeDelivery;
61
+
62
+ /**
63
+ * In some rare cases users might prefer the delivery to be deferred by a day or two.
64
+ * This parameter allows users to specify by how many (working) days they would like to postpone the shipment delivery.
65
+ * Max 2 days
66
+ * MANDATORY: No
67
+ * @var integer Signed 32-bit
68
+ */
69
+ private $_deferredDeliveryWorkDays;
70
+
71
+ /**
72
+ * Specifies if the shipment has a "request for return documents"
73
+ * MANDATORY: YES
74
+ * @var boolean
75
+ */
76
+ private $_backDocumentsRequest;
77
+
78
+ /**
79
+ * Specifies if the shipment has a "request for return receipt"
80
+ * MANDATORY: YES
81
+ * @var boolean
82
+ */
83
+ private $_backReceiptRequest;
84
+
85
+ /**
86
+ * Specifies if the sender intends to deliver the shipment to a Speedy office by him/herself instead of ordering a visit by courier
87
+ * MANDATORY: YES
88
+ * @var boolean
89
+ */
90
+ private $_willBringToOffice;
91
+
92
+ /**
93
+ * Special delivery id
94
+ * MANDATORY: NO
95
+ * @var signed 32-bit integer
96
+ * @since 2.3.0
97
+ */
98
+ protected $_specialDeliveryId;
99
+
100
+ /**
101
+ * Specifies the specific Speedy office, where the sender intends to deliver the shipment by him/herself.
102
+ * If willBringToOfficeId is provided, willBringToOffice flag is considered "true", regardless the value provided.
103
+ * If willBringToOfficeId is not provied (0 or null) and willBringToOffice flag is "true",
104
+ * willBringToOfficeId is automatically set with default value configured for caller user profile.
105
+ * The default willBringToOfficeId value could be managed using profile configuration page in client's Speedy web site.
106
+ * MANDATORY: NO
107
+ * @since 1.3
108
+ * @var integer Signed 64-bit
109
+ */
110
+ private $_willBringToOfficeId;
111
+
112
+ /**
113
+ * Shipment insurance value (if the shipment is insured).
114
+ * The value is limited depending on user's permissions and Speedy's current policy
115
+ * MANDATORY: NO
116
+ * @var double Signed 64-bit
117
+ */
118
+ private $_amountInsuranceBase;
119
+
120
+ /**
121
+ * Cash-on-Delivery (COD) amount.
122
+ * The value is limited depending on user's permissions and Speedy's current policy
123
+ * MANDATORY: NO
124
+ * @var double Signed 64-bit
125
+ */
126
+ private $_amountCodBase;
127
+
128
+ /**
129
+ * Specifies if the COD value is to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
130
+ * MANDATORY: NO
131
+ * @var boolean
132
+ */
133
+ private $_payCodToThirdParty;
134
+
135
+ /**
136
+ * Return money-transfer request amount
137
+ * The value is limited depending on user's permissions and Speedy's current policy
138
+ * MANDATORY: NO
139
+ * @var double Signed 64-bit
140
+ */
141
+ private $_retMoneyTransferReqAmount;
142
+
143
+ /**
144
+ * Return third party payer flag
145
+ * MANDATORY: NO
146
+ * @var boolean
147
+ * @since 2.3.0
148
+ */
149
+ protected $_retThirdPartyPayer;
150
+
151
+ /**
152
+ * Parcels count. Maximum value is 999.
153
+ * MANDATORY: YES
154
+ * @var integer Signed 32-bit
155
+ */
156
+ private $_parcelsCount;
157
+
158
+ /**
159
+ * Size of shipment
160
+ * MANDATORY: NO
161
+ * @var Size
162
+ */
163
+ private $_size;
164
+
165
+ /**
166
+ * Declared weight (the greater of "volume" and "real" weight values).
167
+ * Maximum value is 100.00
168
+ * MANDATORY: YES
169
+ * @var double Signed 64-bit
170
+ */
171
+ private $_weightDeclared;
172
+
173
+ /**
174
+ * Contents. Max text size - 50 symbols
175
+ * MANDATORY: YES
176
+ * @var string
177
+ */
178
+ private $_contents;
179
+
180
+ /**
181
+ * Packing
182
+ * MANDATORY: YES
183
+ * @var string
184
+ */
185
+ private $_packing;
186
+
187
+ /**
188
+ * Data for packings. For internal use only
189
+ * MANDATORY: NO
190
+ * @var ParamPackings
191
+ * @since 2.3.0
192
+ */
193
+ private $_packings;
194
+
195
+ /**
196
+ * Packing ID (number)
197
+ * MANDATORY: NO
198
+ * @var integer Signed 64-bit
199
+ */
200
+ private $_packId;
201
+
202
+ /**
203
+ * Specifies whether the shipment consists of documents
204
+ * MANDATORY: YES
205
+ * @var boolean
206
+ */
207
+ private $_documents;
208
+
209
+ /**
210
+ * Specifies whether the shipment is fragile - necessary when the price of insurance is being calculated
211
+ * MANDATORY: YES
212
+ * @var boolean
213
+ */
214
+ private $_fragile;
215
+
216
+ /**
217
+ * Specifies whether the shipment is palletized
218
+ * MANDATORY: YES
219
+ * @var boolean
220
+ */
221
+ private $_palletized;
222
+
223
+ /**
224
+ * Data for the sender
225
+ * MANDATORY: YES
226
+ * @var ParamClientData
227
+ */
228
+ private $_sender;
229
+
230
+ /**
231
+ * Data for the receiver
232
+ * MANDATORY: YES
233
+ * @var ParamClientData
234
+ */
235
+ private $_receiver;
236
+
237
+ /**
238
+ * Payer type (0=sender, 1=receiver or 2=third party)
239
+ * MANDATORY: YES
240
+ * @var integer Signed 32-bit
241
+ */
242
+ private $_payerType;
243
+
244
+ /**
245
+ * Payer ID.
246
+ * MANDATORY: Must be set <=> payer is "third party".
247
+ * @var integer Signed 64-bit
248
+ */
249
+ private $_payerRefId;
250
+
251
+ /**
252
+ * Insurance payer type (0=sender, 1=reciever or 2=third party)
253
+ * MANDATORY: Must be set <=> shipment is insured (i.e. amountInsuranceBase > 0).
254
+ * @var integer Signed 32-bit
255
+ */
256
+ private $_payerTypeInsurance;
257
+
258
+ /**
259
+ * Packings payer type (0=sender, 1=reciever or 2=third party)
260
+ * MANDATORY: No.If not set, the payer of the packings' surcharge will be the same as the one indicated by payerType.
261
+ * @var integer Signed 32-bit
262
+ * @since 2.3.0
263
+ */
264
+ protected $_payerTypePackings;
265
+
266
+ /**
267
+ * Insurance payer ID
268
+ * MANDATORY: Must be set <=> shipment has insurance (i.e. amountInsuranceBase > 0) and it is payed by a "third party".
269
+ * @var integer Signed 64-bit
270
+ */
271
+ private $_payerRefInsuranceId;
272
+
273
+ /**
274
+ * Packings payer ID
275
+ * MANDATORY: Must be set <=> payerTypePackings is "third party".
276
+ * @var integer Signed 64-bit
277
+ * @since 2.3.0
278
+ */
279
+ protected $_payerRefPackingsId;
280
+
281
+ /**
282
+ * Client's note
283
+ * MANDATORY: NO
284
+ * @var string
285
+ */
286
+ private $_noteClient;
287
+
288
+ /**
289
+ * Card/Coupon/Voucher number for fixed discount
290
+ * MANDATORY: NO
291
+ * @var FixedDiscountCardId
292
+ */
293
+ private $_discCalc;
294
+
295
+ /**
296
+ * ID of the client who is to receive the return receipt and/or the return documents.
297
+ * If payer is "third party" then this client has to be payer's contract member.
298
+ * Otherwise the client has to be sender's contract member.
299
+ * MANDATORY: NO
300
+ * @var integer Signed 64-bit
301
+ */
302
+ private $_retToClientId;
303
+
304
+ /**
305
+ * An optional reference code.
306
+ * Maximum 30 symbols
307
+ * MANDATORY: NO
308
+ * @var string
309
+ */
310
+ private $_ref1;
311
+
312
+ /**
313
+ * An optional reference code.
314
+ * Maximum 30 symbols
315
+ * MANDATORY: NO
316
+ * @var string
317
+ */
318
+ private $_ref2;
319
+
320
+ /**
321
+ * An optional value used to identify user's client software.
322
+ * Please verify the allowed values with Speedy's IT Department.
323
+ * MANDATORY: NO
324
+ * @var integer Signed 64-bit
325
+ */
326
+ private $_clientSystemId;
327
+
328
+ /**
329
+ * Data for parcels with explicit/fixed IDs (from the second one onward)
330
+ * The list has maximum lenght 998
331
+ * MANDATORY: NO
332
+ * @var array List of ParamParcelInfo
333
+ */
334
+ private $_parcels;
335
+
336
+ /**
337
+ * When parcelsCount > 1 and no explicit data has been set in the parcels property during the creation,
338
+ * then parcels will be created automatically by default.
339
+ * This parameter allows users to control this behaviour.
340
+ * MANDATORY: NO
341
+ * @var boolean
342
+ */
343
+ private $_skipAutomaticParcelsCreation;
344
+
345
+ /**
346
+ * Specifies if the service/system should allow parcels to be added to the shipment at a later stage.
347
+ * MANDATORY: NO
348
+ * @var boolean
349
+ */
350
+ private $_pendingParcelsDescription;
351
+
352
+ /**
353
+ * Specifies if the service/system should allow BOL's modification at a later stage.
354
+ * MANDATORY: NO
355
+ * @var boolean
356
+ */
357
+ private $_pendingShipmentDescription;
358
+
359
+ /**
360
+ * Return service request
361
+ * MANDATORY: NO
362
+ * @var array of ParamReturnServiceRequest
363
+ * since 2.5.0
364
+ */
365
+ private $_retServicesRequest;
366
+
367
+ /**
368
+ * Return shipment request
369
+ * MANDATORY: NO
370
+ * @var ParamReturnShipmentRequest
371
+ * since 2.5.0
372
+ */
373
+ private $_retShipmentRequest;
374
+
375
+ /**
376
+ * Specifies details for return voucher
377
+ * MANDATORY: NO
378
+ * @var returnVoucher
379
+ * @since 2.9.0
380
+ */
381
+ private $_returnVoucher;
382
+
383
+ /**
384
+ * Specifies details for delivery to floor No (max 99)
385
+ * MANDATORY: NO
386
+ * @var returnVoucher
387
+ * @since 2.9.0
388
+ */
389
+ private $_deliveryToFloorNo;
390
+
391
+ /**
392
+ * Flag indicating whether the shipping price should be included into the cash on delivery price.
393
+ * MANDATORY: NO
394
+ * @var boolean
395
+ * @since 2.9.0
396
+ */
397
+ private $_includeShippingPriceInCod;
398
+
399
+ /**
400
+ * Set BOL number
401
+ * @param integer $billOfLading Signed 64-bit
402
+ */
403
+ public function setBillOfLading($billOfLading) {
404
+ $this->_billOfLading = $billOfLading;
405
+ }
406
+
407
+ /**
408
+ * Get BOL number
409
+ * @return integer Signed 64-bit
410
+ */
411
+ public function getBillOfLading() {
412
+ return $this->_billOfLading;
413
+ }
414
+
415
+ /**
416
+ * Set date for shipment pick-up (the "time" component is ignored).
417
+ * @param date $takingDate
418
+ */
419
+ public function setTakingDate($takingDate) {
420
+ $this->_takingDate = $takingDate;
421
+ }
422
+
423
+ /**
424
+ * Get BOL number
425
+ * @return date
426
+ */
427
+ public function getTakingDate() {
428
+ return $this->_takingDate;
429
+ }
430
+
431
+ /**
432
+ * Set courier service type ID
433
+ * @param integer $serviceTypeId Signed 64-bit
434
+ */
435
+ public function setServiceTypeId($serviceTypeId) {
436
+ $this->_serviceTypeId = $serviceTypeId;
437
+ }
438
+
439
+ /**
440
+ * Get courier service type ID
441
+ * @return integer Signed 64-bit
442
+ */
443
+ public function getServiceTypeId() {
444
+ return $this->_serviceTypeId;
445
+ }
446
+
447
+ /**
448
+ * Set ID of an office "to be called"
449
+ * @param integer $officeToBeCalledId Signed 64-bit
450
+ */
451
+ public function setOfficeToBeCalledId($officeToBeCalledId) {
452
+ $this->_officeToBeCalledId = $officeToBeCalledId;
453
+ }
454
+
455
+ /**
456
+ * Get ID of an office "to be called"
457
+ * @return integer Signed 64-bit
458
+ */
459
+ public function getOfficeToBeCalledId() {
460
+ return $this->_officeToBeCalledId;
461
+ }
462
+
463
+ /**
464
+ * Set options before payment
465
+ * @param ParamOptionsBeforePayment $optionsBeforePayment
466
+ */
467
+ public function setOptionsBeforePayment($optionsBeforePayment) {
468
+ $this->_optionsBeforePayment = $optionsBeforePayment;
469
+ }
470
+
471
+ /**
472
+ * Get options before payment
473
+ * @return integer Signed 64-bit
474
+ */
475
+ public function getOptionsBeforePayment() {
476
+ return $this->_optionsBeforePayment;
477
+ }
478
+
479
+ /**
480
+ * Set fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.)
481
+ * @param integer $fixedTimeDelivery Signed 16-bit
482
+ */
483
+ public function setFixedTimeDelivery($fixedTimeDelivery) {
484
+ $this->_fixedTimeDelivery = $fixedTimeDelivery;
485
+ }
486
+
487
+ /**
488
+ * Get fixed time for delivery
489
+ * @return integer Signed 16-bit
490
+ */
491
+ public function getFixedTimeDelivery() {
492
+ return $this->_fixedTimeDelivery;
493
+ }
494
+
495
+ /**
496
+ * Set working days to postpone the shipment delivery. Allowe values are 1 or 2
497
+ * @param integer $deferredDeliveryWorkDays Signed 32-bit
498
+ */
499
+ public function setDeferredDeliveryWorkDays($deferredDeliveryWorkDays) {
500
+ $this->_deferredDeliveryWorkDays = $deferredDeliveryWorkDays;
501
+ }
502
+
503
+ /**
504
+ * Get working days to postpone the shipment delivery
505
+ * @return integer Signed 32-bit
506
+ */
507
+ public function getDeferredDeliveryWorkDays() {
508
+ return $this->_deferredDeliveryWorkDays;
509
+ }
510
+
511
+ /**
512
+ * Set "request for return documents" flag for shipment
513
+ * @param boolean $backDocumentsRequest
514
+ */
515
+ public function setBackDocumentsRequest($backDocumentsRequest) {
516
+ $this->_backDocumentsRequest = $backDocumentsRequest;
517
+ }
518
+
519
+ /**
520
+ * Check "request for return documents" flag for shipment
521
+ * @return boolean
522
+ */
523
+ public function isBackDocumentsRequest() {
524
+ return $this->_backDocumentsRequest;
525
+ }
526
+
527
+ /**
528
+ * Set "request for return receipt" flag for shipment
529
+ * @param boolean $backReceiptRequest
530
+ */
531
+ public function setBackReceiptRequest($backReceiptRequest) {
532
+ $this->_backReceiptRequest = $backReceiptRequest;
533
+ }
534
+
535
+ /**
536
+ * Check "request for return receipt" flag for shipment
537
+ * @return boolean
538
+ */
539
+ public function isBackReceiptRequest() {
540
+ return $this->_backReceiptRequest;
541
+ }
542
+
543
+ /**
544
+ * Set "bring to office" flag for shipment
545
+ * @param boolean $willBringToOffice
546
+ */
547
+ public function setWillBringToOffice($willBringToOffice) {
548
+ $this->_willBringToOffice = $willBringToOffice;
549
+ }
550
+
551
+ /**
552
+ * Check "bring to office" flag for shipment
553
+ * @return boolean
554
+ */
555
+ public function getWillBringToOffice() {
556
+ return $this->_willBringToOffice;
557
+ }
558
+
559
+ /**
560
+ * Set "bring to office" id
561
+ * @since 1.3
562
+ * @param Signed 64-bit $willBringToOfficeId
563
+ */
564
+ public function setWillBringToOfficeId($willBringToOfficeId) {
565
+ $this->_willBringToOfficeId = $willBringToOfficeId;
566
+ }
567
+
568
+ /**
569
+ * Get "bring to office" id
570
+ * @since 1.3
571
+ * @return Signed 64-bit
572
+ */
573
+ public function getWillBringToOfficeId() {
574
+ return $this->_willBringToOfficeId;
575
+ }
576
+
577
+ /**
578
+ * Gets the special delivery id
579
+ * @return signed 32-bit integer special delivery id
580
+ */
581
+ public function getSpecialDeliveryId() {
582
+ return $this->_specialDeliveryId;
583
+ }
584
+
585
+ /**
586
+ * Sets the special delivery id
587
+ * @param signed 32-bit integer $specialDeliveryId Special delivery id
588
+ */
589
+ public function setSpecialDeliveryId($specialDeliveryId) {
590
+ $this->_specialDeliveryId = $specialDeliveryId;
591
+ }
592
+
593
+ /**
594
+ * Set shipment insurance value (if the shipment is insured).
595
+ * @param double $amountInsuranceBase Signed 64-bit
596
+ */
597
+ public function setAmountInsuranceBase($amountInsuranceBase) {
598
+ $this->_amountInsuranceBase = $amountInsuranceBase;
599
+ }
600
+
601
+ /**
602
+ * Get shipment insurance value
603
+ * @return double Signed 64-bit
604
+ */
605
+ public function getAmountInsuranceBase() {
606
+ return $this->_amountInsuranceBase;
607
+ }
608
+
609
+ /**
610
+ * Set cash-on-Delivery (COD) amount.
611
+ * @param double $amountCodBase Signed 64-bit
612
+ */
613
+ public function setAmountCodBase($amountCodBase) {
614
+ $this->_amountCodBase = $amountCodBase;
615
+ }
616
+
617
+ /**
618
+ * Get cash-on-Delivery (COD) amount.
619
+ * @return double Signed 64-bit
620
+ */
621
+ public function getAmountCodBase() {
622
+ return $this->_amountCodBase;
623
+ }
624
+
625
+ /**
626
+ * Set flag for COD value to be paid to a third party. Allowed only if the shipment has payerType = 2 (third party).
627
+ * @param boolean $payCodToThirdParty
628
+ */
629
+ public function setPayCodToThirdParty($payCodToThirdParty) {
630
+ $this->_payCodToThirdParty = $payCodToThirdParty;
631
+ }
632
+
633
+ /**
634
+ * Check flag for COD value to be paid to a third party
635
+ * @return boolean
636
+ */
637
+ public function isPayCodToThirdParty() {
638
+ return $this->_payCodToThirdParty;
639
+ }
640
+
641
+ /**
642
+ * Set return money-transfer request amount
643
+ * @param double $retMoneyTransferReqAmount Signed 64-bit
644
+ */
645
+ public function setRetMoneyTransferReqAmount($retMoneyTransferReqAmount) {
646
+ $this->_retMoneyTransferReqAmount = $retMoneyTransferReqAmount;
647
+ }
648
+
649
+ /**
650
+ * Get return money-transfer request amount
651
+ * @return double Signed 64-bit
652
+ */
653
+ public function getRetMoneyTransferReqAmount() {
654
+ return $this->_retMoneyTransferReqAmount;
655
+ }
656
+
657
+ /**
658
+ * Set return picking third party payer flag
659
+ * @param boolean $retThirdPartyPayer return picking third party payer flag
660
+ */
661
+ public function setRetThirdPartyPayer($retThirdPartyPayer) {
662
+ $this->_retThirdPartyPayer = $retThirdPartyPayer;
663
+ }
664
+
665
+ /**
666
+ * Gets return picking third party payer flag
667
+ * @return boolean Picking third party payer flag
668
+ */
669
+ public function isRetThirdPartyPayer() {
670
+ return $this->_retThirdPartyPayer;
671
+ }
672
+
673
+ /**
674
+ * Set parcels count. Maximum value is 999
675
+ * @param integer $parcelsCount Signed 32-bit
676
+ */
677
+ public function setParcelsCount($parcelsCount) {
678
+ $this->_parcelsCount = $parcelsCount;
679
+ }
680
+
681
+ /**
682
+ * Get parcels count
683
+ * @return integer Signed 32-bit
684
+ */
685
+ public function getParcelsCount() {
686
+ return $this->_parcelsCount;
687
+ }
688
+
689
+ /**
690
+ * Set size of shipment
691
+ * @param Size $size
692
+ */
693
+ public function setSize($size) {
694
+ $this->_size = $size;
695
+ }
696
+
697
+ /**
698
+ * Get size of shipment
699
+ * @return Size
700
+ */
701
+ public function getSize() {
702
+ return $this->_size;
703
+ }
704
+
705
+ /**
706
+ * Set declared weight (the greater of "volume" and "real" weight values). Maximum value is 100.00
707
+ * @param double $weightDeclared Signed 64-bit
708
+ */
709
+ public function setWeightDeclared($weightDeclared) {
710
+ $this->_weightDeclared = $weightDeclared;
711
+ }
712
+
713
+ /**
714
+ * Get declared weight
715
+ * @return double Signed 64-bit
716
+ */
717
+ public function getWeightDeclared() {
718
+ return $this->_weightDeclared;
719
+ }
720
+
721
+ /**
722
+ * Set contents. Max text size - 50 symbols
723
+ * @param string $contents
724
+ */
725
+ public function setContents($contents) {
726
+ $this->_contents = $contents;
727
+ }
728
+
729
+ /**
730
+ * Get contents.
731
+ * @return string
732
+ */
733
+ public function getContents() {
734
+ return $this->_contents;
735
+ }
736
+
737
+ /**
738
+ * Set contents. Max text size - 50 symbols
739
+ * @param string $packing
740
+ */
741
+ public function setPacking($packing) {
742
+ $this->_packing = $packing;
743
+ }
744
+
745
+ /**
746
+ * Get contents.
747
+ * @return string
748
+ */
749
+ public function getPacking() {
750
+ return $this->_packing;
751
+ }
752
+
753
+ /**
754
+ * Set packings
755
+ * @param Array of ParamPackings $packings
756
+ */
757
+ public function setPackings($packings) {
758
+ $this->_packings = $packings;
759
+ }
760
+
761
+ /**
762
+ * Get packings.
763
+ * @return Array of ParamPackings
764
+ */
765
+ public function getPackings() {
766
+ return $this->_packings;
767
+ }
768
+
769
+
770
+ /**
771
+ * Set packing ID (number)
772
+ * @param integer $packId Signed 64-bit
773
+ */
774
+ public function setPackId($packId) {
775
+ $this->_packId = $packId;
776
+ }
777
+
778
+ /**
779
+ * Get packing ID (number).
780
+ * @return integer Signed 64-bit
781
+ */
782
+ public function getPackId() {
783
+ return $this->_packId;
784
+ }
785
+
786
+ /**
787
+ * Set flag whether shipment consists of documents
788
+ * @param boolean $documents
789
+ */
790
+ public function setDocuments($documents) {
791
+ $this->_documents = $documents;
792
+ }
793
+
794
+ /**
795
+ * Check whether shipment consists if documents
796
+ * @return boolean
797
+ */
798
+ public function isDocuments() {
799
+ return $this->_documents;
800
+ }
801
+
802
+ /**
803
+ * Set flag whether shipment is fragile - necessary when the price of insurance is being calculated
804
+ * @param boolean $fragile
805
+ */
806
+ public function setFragile($fragile) {
807
+ $this->_fragile = $fragile;
808
+ }
809
+
810
+ /**
811
+ * Check whether shipment is fragile
812
+ * @return boolean
813
+ */
814
+ public function isFragile() {
815
+ return $this->_fragile;
816
+ }
817
+
818
+ /**
819
+ * Set flag whether shipment is palletized
820
+ * @param boolean $palletized
821
+ */
822
+ public function setPalletized($palletized) {
823
+ $this->_palletized = $palletized;
824
+ }
825
+
826
+ /**
827
+ * Check whether shipment is palletized
828
+ * @return boolean
829
+ */
830
+ public function isPalletized() {
831
+ return $this->_palletized;
832
+ }
833
+
834
+ /**
835
+ * Set data for the sender
836
+ * @param ParamClientData $sender
837
+ */
838
+ public function setSender($sender) {
839
+ $this->_sender = $sender;
840
+ }
841
+
842
+ /**
843
+ * Get data for the sender
844
+ * @return ParamClientData
845
+ */
846
+ public function getSender() {
847
+ return $this->_sender;
848
+ }
849
+
850
+ /**
851
+ * Set data for the receiver
852
+ * @param ParamClientData $receiver
853
+ */
854
+ public function setReceiver($receiver) {
855
+ $this->_receiver = $receiver;
856
+ }
857
+
858
+ /**
859
+ * Get data for the receiver
860
+ * @return ParamClientData
861
+ */
862
+ public function getReceiver() {
863
+ return $this->_receiver;
864
+ }
865
+
866
+ /**
867
+ * Set payer type (0=sender, 1=receiver or 2=third party)
868
+ * @param integer $payerType Signed 32-bit
869
+ */
870
+ public function setPayerType($payerType) {
871
+ $this->_payerType = $payerType;
872
+ }
873
+
874
+ /**
875
+ * Get payer type (0=sender, 1=receiver or 2=third party)
876
+ * @return integer Signed 32-bit
877
+ */
878
+ public function getPayerType() {
879
+ return $this->_payerType;
880
+ }
881
+
882
+ /**
883
+ * Set payer ID
884
+ * @param integer $payerRefId Signed 64-bit
885
+ */
886
+ public function setPayerRefId($payerRefId) {
887
+ $this->_payerRefId = $payerRefId;
888
+ }
889
+
890
+ /**
891
+ * Get payer ID
892
+ * @return integer Signed 64-bit
893
+ */
894
+ public function getPayerRefId() {
895
+ return $this->_payerRefId;
896
+ }
897
+
898
+ /**
899
+ * Set insurance payer type (0=sender, 1=reciever or 2=third party)
900
+ * @param integer $payerTypeInsurance Signed 32-bit
901
+ */
902
+ public function setPayerTypeInsurance($payerTypeInsurance) {
903
+ $this->_payerTypeInsurance = $payerTypeInsurance;
904
+ }
905
+
906
+ /**
907
+ * Get insurance payer type
908
+ * @return integer Signed 32-bit
909
+ */
910
+ public function getPayerTypeInsurance() {
911
+ return $this->_payerTypeInsurance;
912
+ }
913
+
914
+ /**
915
+ * Set packings payer type (0=sender, 1=reciever or 2=third party)
916
+ * @param integer $payerTypePackings Signed 32-bit
917
+ */
918
+ public function setPayerTypePackings($payerTypePackings) {
919
+ $this->_payerTypePackings = $payerTypePackings;
920
+ }
921
+
922
+ /**
923
+ * Get packings payer type
924
+ * @return integer Signed 32-bit
925
+ */
926
+ public function getPayerTypePackings() {
927
+ return $this->_payerTypePackings;
928
+ }
929
+
930
+ /**
931
+ * Set insurance payer ID
932
+ * @param integer $payerRefInsuranceId Signed 64-bit
933
+ */
934
+ public function setPayerRefInsuranceId($payerRefInsuranceId) {
935
+ $this->_payerRefInsuranceId = $payerRefInsuranceId;
936
+ }
937
+
938
+ /**
939
+ * Get insurance payer ID
940
+ * @return integer Signed 64-bit
941
+ */
942
+ public function getPayerRefInsuranceId() {
943
+ return $this->_payerRefInsuranceId;
944
+ }
945
+
946
+
947
+ /**
948
+ * Set packings payer ID
949
+ * @param integer $payerRefPackingsId Signed 64-bit
950
+ */
951
+ public function setPayerRefPackingsId($payerRefPackingsId) {
952
+ $this->_payerRefPackingsId = $payerRefPackingsId;
953
+ }
954
+
955
+ /**
956
+ * Get packings payer ID
957
+ * @return integer Signed 64-bit
958
+ */
959
+ public function getPayerRefPackingsId() {
960
+ return $this->_payerRefPackingsId;
961
+ }
962
+
963
+ /**
964
+ * Set client's note
965
+ * @param string $noteClient
966
+ */
967
+ public function setNoteClient($noteClient) {
968
+ $this->_noteClient = $noteClient;
969
+ }
970
+
971
+ /**
972
+ * Get client's note
973
+ * @return string
974
+ */
975
+ public function getNoteClient() {
976
+ return $this->_noteClient;
977
+ }
978
+
979
+ /**
980
+ * Set card/coupon/voucher number for fixed discount
981
+ * @param FixedDiscountCardId $discCalc
982
+ */
983
+ public function setDiscCalc($discCalc) {
984
+ $this->_discCalc = $discCalc;
985
+ }
986
+
987
+ /**
988
+ * Get card/coupon/voucher number for fixed discount
989
+ * @return FixedDiscountCardId
990
+ */
991
+ public function getDiscCalc() {
992
+ return $this->_discCalc;
993
+ }
994
+
995
+ /**
996
+ * Set ID of the client who is to receive the return receipt and/or the return documents.
997
+ * If payer is "third party" then this client has to be payer's contract member.
998
+ * Otherwise the client has to be sender's contract member.
999
+ * @param integer $retToClientId Signed 64-bit
1000
+ */
1001
+ public function setRetToClientId($retToClientId) {
1002
+ $this->_retToClientId = $retToClientId;
1003
+ }
1004
+
1005
+ /**
1006
+ * Get ID of the client who is to receive the return receipt and/or the return documents.
1007
+ * @return integer Signed 64-bit
1008
+ */
1009
+ public function getRetToClientId() {
1010
+ return $this->_retToClientId;
1011
+ }
1012
+
1013
+ /**
1014
+ * Set optional reference code. Maximum 30 symbols.
1015
+ * @param string $ref1
1016
+ */
1017
+ public function setRef1($ref1) {
1018
+ $this->_ref1 = $ref1;
1019
+ }
1020
+
1021
+ /**
1022
+ * Get optional reference code. Maximum 30 symbols.
1023
+ * @return string
1024
+ */
1025
+ public function getRef1() {
1026
+ return $this->_ref1;
1027
+ }
1028
+
1029
+ /**
1030
+ * Set optional reference code 2. Maximum 30 symbols.
1031
+ * @param string $ref2
1032
+ */
1033
+ public function setRef2($ref2) {
1034
+ $this->_ref2 = $ref2;
1035
+ }
1036
+
1037
+ /**
1038
+ * Get optional reference code 2. Maximum 30 symbols.
1039
+ * @return string
1040
+ */
1041
+ public function getRef2() {
1042
+ return $this->_ref2;
1043
+ }
1044
+
1045
+ /**
1046
+ * Set optional value used to identify user's client software.
1047
+ * @param integer $clientSystemId Signed 64-bit
1048
+ */
1049
+ public function setClientSystemId($clientSystemId) {
1050
+ $this->_clientSystemId = $clientSystemId;
1051
+ }
1052
+
1053
+ /**
1054
+ * Get optional value used to identify user's client software.
1055
+ * @return integer Signed 64-bit
1056
+ */
1057
+ public function getClientSystemId() {
1058
+ return $this->_clientSystemId;
1059
+ }
1060
+
1061
+ /**
1062
+ * Set data for parcels with explicit/fixed IDs (from the second one onward)
1063
+ * @param array $parcels List of ParamParcelInfo
1064
+ */
1065
+ public function setParcels($parcels) {
1066
+ $this->_parcels = $parcels;
1067
+ }
1068
+
1069
+ /**
1070
+ * Get data for parcels with explicit/fixed IDs (from the second one onward)
1071
+ * @return array List of ParamParcelInfo
1072
+ */
1073
+ public function getParcels() {
1074
+ return $this->_parcels;
1075
+ }
1076
+
1077
+ /**
1078
+ * Set flag to set or not explicit data on processing parcels with sequence number > 1
1079
+ * @param boolean $skipAutomaticParcelsCreation
1080
+ */
1081
+ public function setSkipAutomaticParcelsCreation($skipAutomaticParcelsCreation) {
1082
+ $this->_skipAutomaticParcelsCreation = $skipAutomaticParcelsCreation;
1083
+ }
1084
+
1085
+ /**
1086
+ * Check flag to set or not explicit data on processing parcels with sequence number > 1
1087
+ * @return boolean
1088
+ */
1089
+ public function isSkipAutomaticParcelsCreation() {
1090
+ return $this->_skipAutomaticParcelsCreation;
1091
+ }
1092
+
1093
+ /**
1094
+ * Set flag service/system to allow parcels to be added to the shipment at a later stage
1095
+ * @param boolean $pendingParcelsDescription
1096
+ */
1097
+ public function setPendingParcelsDescription($pendingParcelsDescription) {
1098
+ $this->_pendingParcelsDescription = $pendingParcelsDescription;
1099
+ }
1100
+
1101
+ /**
1102
+ * Check whether service/system to allow parcels to be added to the shipment at a later stage
1103
+ * @return boolean
1104
+ */
1105
+ public function isPendingParcelsDescription() {
1106
+ return $this->_pendingParcelsDescription;
1107
+ }
1108
+
1109
+ /**
1110
+ * Set flag the service/system to allow BOL's modification at a later stage.
1111
+ * @param boolean $pendingShipmentDescription
1112
+ */
1113
+ public function setPendingShipmentDescription($pendingShipmentDescription) {
1114
+ $this->_pendingShipmentDescription = $pendingShipmentDescription;
1115
+ }
1116
+
1117
+ /**
1118
+ * Check whether the service/system should allow BOL's modification at a later stage.
1119
+ * @return boolean
1120
+ */
1121
+ public function isPendingShipmentDescription() {
1122
+ return $this->_pendingShipmentDescription;
1123
+ }
1124
+
1125
+ /**
1126
+ * Get return service request list
1127
+ * @return array of ParamReturnServiceRequest
1128
+ */
1129
+ public function getRetServicesRequest() {
1130
+ return $this->_retServicesRequest;
1131
+ }
1132
+
1133
+ /**
1134
+ * Set return service request list
1135
+ * @param array of ParamReturnServiceRequest
1136
+ */
1137
+ public function setRetServicesRequest($retServicesRequest) {
1138
+ $this->_retServicesRequest = $retServicesRequest;
1139
+ }
1140
+
1141
+ /**
1142
+ * Get return service request list
1143
+ * @return ParamReturnShipmentRequest
1144
+ */
1145
+ public function getRetShipmentRequest() {
1146
+ return $this->_retShipmentRequest;
1147
+ }
1148
+
1149
+ /**
1150
+ * Set return shipment request
1151
+ * @param ParamReturnShipmentRequest $retShipmentRequest
1152
+ */
1153
+ public function setRetShipmentRequest($retShipmentRequest) {
1154
+ $this->_retShipmentRequest = $retShipmentRequest;
1155
+ }
1156
+
1157
+ /**
1158
+ * Set Specifies details for return voucher
1159
+ * @param returnVoucher $returnVoucher
1160
+ */
1161
+ public function setReturnVoucher($returnVoucher) {
1162
+ $this->_returnVoucher = $returnVoucher;
1163
+ }
1164
+
1165
+ /**
1166
+ * Get Specifies details for return voucher
1167
+ * @return returnVoucher
1168
+ */
1169
+ public function getReturnVoucher() {
1170
+ return $this->_returnVoucher;
1171
+ }
1172
+
1173
+
1174
+ /**
1175
+ * Set Specifies details for delivery to floor
1176
+ * @param deliveryToFloorNo $deliveryToFloorNo
1177
+ */
1178
+ public function setDeliveryToFloorNo($deliveryToFloorNo) {
1179
+ $this->_deliveryToFloorNo = $deliveryToFloorNo;
1180
+ }
1181
+
1182
+ /**
1183
+ * Get Specifies details for delivery to floor
1184
+ * @return deliveryToFloorNo
1185
+ */
1186
+ public function getDeliveryToFloorNo() {
1187
+ return $this->_deliveryToFloorNo;
1188
+ }
1189
+
1190
+ /**
1191
+ * Set Flag indicating whether the shipping price should be included into the cash on delivery price.
1192
+ * @param boolean
1193
+ */
1194
+ public function setIncludeShippingPriceInCod($includeShippingPriceInCod) {
1195
+ $this->_includeShippingPriceInCod = $includeShippingPriceInCod;
1196
+ }
1197
+
1198
+ /**
1199
+ * Get Flag indicating whether the shipping price should be included into the cash on delivery price.
1200
+ * @return boolean
1201
+ */
1202
+ public function getIncludeShippingPriceInCod() {
1203
+ return $this->_includeShippingPriceInCod;
1204
+ }
1205
+
1206
+
1207
+ /**
1208
+ * Return standard class from this class
1209
+ * @return stdClass
1210
+ */
1211
+ public function toStdClass() {
1212
+ $stdClass = new stdClass();
1213
+ $stdClass->billOfLading = $this->_billOfLading;
1214
+ $stdClass->takingDate = $this->_takingDate;
1215
+ $stdClass->serviceTypeId = $this->_serviceTypeId;
1216
+ $stdClass->officeToBeCalledId = $this->_officeToBeCalledId;
1217
+ if (isset($this->_optionsBeforePayment)) {
1218
+ $stdClass->optionsBeforePayment = $this->_optionsBeforePayment->toStdClass();
1219
+ }
1220
+
1221
+ $stdClass->fixedTimeDelivery = $this->_fixedTimeDelivery;
1222
+ $stdClass->deferredDeliveryWorkDays = $this->_deferredDeliveryWorkDays;
1223
+ $stdClass->backDocumentsRequest = $this->_backDocumentsRequest;
1224
+ $stdClass->backReceiptRequest = $this->_backReceiptRequest;
1225
+ $stdClass->willBringToOffice = $this->_willBringToOffice;
1226
+ $stdClass->willBringToOfficeId = $this->_willBringToOfficeId;
1227
+ $stdClass->specialDeliveryId = $this->_specialDeliveryId;
1228
+ $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;
1229
+ $stdClass->amountCodBase = $this->_amountCodBase;
1230
+ $stdClass->payCodToThirdParty = $this->_payCodToThirdParty;
1231
+ $stdClass->retMoneyTransferReqAmount = $this->_retMoneyTransferReqAmount;
1232
+ $stdClass->retThirdPartyPayer = $this->_retThirdPartyPayer;
1233
+ $stdClass->parcelsCount = $this->_parcelsCount;
1234
+ if (isset($this->_size)) {
1235
+ $stdClass->size = $this->_size->toStdClass();
1236
+ }
1237
+ $stdClass->weightDeclared = $this->_weightDeclared;
1238
+ $stdClass->contents = $this->_contents;
1239
+ $stdClass->packing = $this->_packing;
1240
+
1241
+ $arrStdClassParamPackings = array();
1242
+ if (isset($this->_packings)) {
1243
+ if (is_array($this->_packings)) {
1244
+ for($i = 0; $i < count($this->_packings); $i++) {
1245
+ $arrStdClassParamPackings[$i] = $this->_packings[$i]->toStdClass();
1246
+ }
1247
+ } else {
1248
+ $arrStdClassParamPackings[0] = $this->_packings->toStdClass();
1249
+ }
1250
+ }
1251
+ $stdClass->packings = $arrStdClassParamPackings;
1252
+
1253
+ $stdClass->packId = $this->_packId;
1254
+ $stdClass->documents = $this->_documents;
1255
+ $stdClass->fragile = $this->_fragile;
1256
+ $stdClass->palletized = $this->_palletized;
1257
+ if (isset($this->_sender)) {
1258
+ $stdClass->sender = $this->_sender->toStdClass();
1259
+ }
1260
+ if (isset($this->_receiver)) {
1261
+ $stdClass->receiver = $this->_receiver->toStdClass();
1262
+ }
1263
+ $stdClass->payerType = $this->_payerType;
1264
+ $stdClass->payerRefId = $this->_payerRefId;
1265
+ $stdClass->payerTypeInsurance = $this->_payerTypeInsurance;
1266
+ $stdClass->payerTypePackings = $this->_payerTypePackings;
1267
+ $stdClass->payerRefInsuranceId = $this->_payerRefInsuranceId;
1268
+ $stdClass->payerRefPackingsId = $this->_payerRefPackingsId;
1269
+ $stdClass->noteClient = $this->_noteClient;
1270
+ if (isset($this->_discCalc)) {
1271
+ $stdClass->discCalc = $this->_discCalc->toStdClass();
1272
+ }
1273
+ $stdClass->retToClientId = $this->_retToClientId;
1274
+ $stdClass->ref1 = $this->_ref1;
1275
+ $stdClass->ref2 = $this->_ref2;
1276
+ $stdClass->clientSystemId = $this->_clientSystemId;
1277
+ $arrStdClassParamParcelInfo = array();
1278
+ if (isset($this->_parcels)) {
1279
+ if (is_array($this->_parcels)) {
1280
+ for($i = 0; $i < count($this->_parcels); $i++) {
1281
+ $arrStdClassParamParcelInfo[$i] = $this->_parcels[$i]->toStdClass();
1282
+ }
1283
+ } else {
1284
+ $arrStdClassParamParcelInfo[0] = $this->_parcels->toStdClass();
1285
+ }
1286
+ }
1287
+ $stdClass->parcels = $arrStdClassParamParcelInfo;
1288
+ $stdClass->skipAutomaticParcelsCreation = $this->_skipAutomaticParcelsCreation;
1289
+ $stdClass->pendingParcelsDescription = $this->_pendingParcelsDescription;
1290
+ $stdClass->pendingShipmentDescription = $this->_pendingShipmentDescription;
1291
+ $arrStdClassParamReturnServiceRequest = array();
1292
+ if (isset($this->_retServicesRequest)) {
1293
+ if (is_array($this->_retServicesRequest)) {
1294
+ for($i = 0; $i < count($this->_retServicesRequest); $i++) {
1295
+ $arrStdClassParamReturnServiceRequest[$i] = $this->_retServicesRequest[$i]->toStdClass();
1296
+ }
1297
+ } else {
1298
+ $arrStdClassParamReturnServiceRequest[0] = $this->_retServicesRequest->toStdClass();
1299
+ }
1300
+ }
1301
+ $stdClass->retServicesRequest = $arrStdClassParamReturnServiceRequest;
1302
+ if (isset($this->_retShipmentRequest)) {
1303
+ $stdClass->retShipmentRequest = $this->_retShipmentRequest->toStdClass();
1304
+ }
1305
+
1306
+ if (isset($this->_returnVoucher)) {
1307
+ $stdClass->returnVoucher = $this->_returnVoucher->toStdClass();
1308
+ }
1309
+
1310
+ if (isset($this->_deliveryToFloorNo)) {
1311
+ $stdClass->deliveryToFloorNo = $this->_deliveryToFloorNo;
1312
+ }
1313
+
1314
+ if (isset($this->_includeShippingPriceInCod)) {
1315
+ $stdClass->includeShippingPriceInCod = $this->_includeShippingPriceInCod;
1316
+ }
1317
+
1318
+ return $stdClass;
1319
+ }
1320
+ }
1321
  ?>
lib/SpeedyEPS/ver01/ParamReturnVoucher.class.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Instances of this class are used as parameters in web service calls for picking creation
4
+ */
5
+ class ParamReturnVoucher {
6
+
7
+ /**
8
+ * Service type id ID
9
+ * MANDATORY: YES
10
+ * @var integer Signed 64-bit
11
+ */
12
+ private $serviceTypeId;
13
+
14
+ /**
15
+ * Payer type (0=sender, 1=receiver or 2=third party)
16
+ * MANDATORY: YES
17
+ * @var integer Signed 32-bit
18
+ */
19
+ private $_payerType;
20
+
21
+ /**
22
+ * Set serviceTypeId ID
23
+ * @param integer $serviceTypeId Signed 64-bit
24
+ */
25
+ public function setServiceTypeId($serviceTypeId) {
26
+ $this->_serviceTypeId = $serviceTypeId;
27
+ }
28
+
29
+ /**
30
+ * Get serviceTypeId ID
31
+ * @return integer Signed 64-bit
32
+ */
33
+ public function getServiceTypeId() {
34
+ return $this->_serviceTypeId;
35
+ }
36
+
37
+ /**
38
+ * Set payerType
39
+ * @param integer $payerType Signed 32-bit
40
+ */
41
+ public function setPayerType($payerType) {
42
+ $this->_payerType = $payerType;
43
+ }
44
+
45
+ /**
46
+ * Get payerType
47
+ * @return integer Signed 32-bit
48
+ */
49
+ public function getPayerType() {
50
+ return $this->_payerType;
51
+ }
52
+
53
+ /**
54
+ * Return standard class from this class
55
+ * @return stdClass
56
+ */
57
+ public function toStdClass() {
58
+ $stdClass = new stdClass();
59
+ $stdClass->serviceTypeId = $this->_serviceTypeId;
60
+ $stdClass->payerType = $this->_payerType;
61
+ return $stdClass;
62
+ }
63
+ }
64
+ ?>
lib/SpeedyEPS/ver01/ResultAddressInfo.class.php ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Instances of this class are returned as a result of web service method calls for clients
4
+ */
5
+ class ResultAddressInfo {
6
+
7
+ /**
8
+ * Site ID
9
+ * @var integer Signed 64-bit (nullable)
10
+ */
11
+ private $_siteId;
12
+
13
+ /**
14
+ * Site name
15
+ * @var string
16
+ */
17
+ private $_siteName;
18
+
19
+ /**
20
+ * Site type
21
+ * @var string
22
+ */
23
+ private $_siteType;
24
+
25
+ /**
26
+ * Municpality name
27
+ * @var string
28
+ */
29
+ private $_municipalityName;
30
+
31
+ /**
32
+ * Region name
33
+ * @var string
34
+ */
35
+ private $_regionName;
36
+
37
+ /**
38
+ * Post code
39
+ * @var string
40
+ */
41
+ private $_postCode;
42
+
43
+ /**
44
+ * Street name
45
+ * @var string
46
+ */
47
+ private $_streetName;
48
+
49
+ /**
50
+ * Street type
51
+ * @var string
52
+ */
53
+ private $_streetType;
54
+
55
+ /**
56
+ * Street ID
57
+ * @var integer Signed 64-bit (nullable)
58
+ */
59
+ private $_streetId;
60
+
61
+ /**
62
+ * Quarter name
63
+ * @var string
64
+ */
65
+ private $_quarterName;
66
+
67
+ /**
68
+ * Quarter type
69
+ * @var string
70
+ */
71
+ private $_quarterType;
72
+
73
+ /**
74
+ * Quarter ID
75
+ * @var long Signed 64-bit (nullable)
76
+ */
77
+ private $_quarterId;
78
+
79
+ /**
80
+ * Street No
81
+ * @var string
82
+ */
83
+ private $_streetNo;
84
+
85
+ /**
86
+ * Block No
87
+ * @var string
88
+ */
89
+ private $_blockNo;
90
+
91
+ /**
92
+ * Entrance No
93
+ * @var string
94
+ */
95
+ private $_entranceNo;
96
+
97
+ /**
98
+ * Floor No
99
+ * @var string
100
+ */
101
+ private $_floorNo;
102
+
103
+ /**
104
+ * Appartment No
105
+ * @var string
106
+ */
107
+ private $_apartmentNo;
108
+
109
+ /**
110
+ * Address note
111
+ * @var string
112
+ */
113
+ private $_addressNote;
114
+
115
+ /**
116
+ * Common object ID
117
+ * @var integer Signed 64-bit (nullable)
118
+ */
119
+ private $_commonObjectId;
120
+
121
+ /**
122
+ * Common object name
123
+ * @var string
124
+ */
125
+ private $_commonObjectName;
126
+
127
+ /**
128
+ * Country id
129
+ * @var integer signed 64-bit
130
+ * @since 2.5.0
131
+ */
132
+ private $_countryId;
133
+
134
+ /**
135
+ * Foreign address line 1
136
+ * @var string
137
+ * @since 2.5.0
138
+ */
139
+ private $_frnAddressLine1;
140
+
141
+ /**
142
+ * Foreign address line 2
143
+ * @var string
144
+ * @since 2.5.0
145
+ */
146
+ private $_frnAddressLine2;
147
+
148
+ /**
149
+ * State id
150
+ * @var string
151
+ * @since 2.5.0
152
+ */
153
+ private $_stateId;
154
+
155
+ /**
156
+ * Constructs new instance of ResultAddress
157
+ * @param stdClass $stdClassResultAddress
158
+ */
159
+ function __construct($stdClassResultAddress) {
160
+ $this->_siteId = isset($stdClassResultAddress->siteId) ? $stdClassResultAddress->siteId : null;
161
+ $this->_siteName = isset($stdClassResultAddress->siteName) ? $stdClassResultAddress->siteName : null;
162
+ $this->_siteType = isset($stdClassResultAddress->siteType) ? $stdClassResultAddress->siteType : null;
163
+ $this->_municipalityName = isset($stdClassResultAddress->municipalityName) ? $stdClassResultAddress->municipalityName : null;
164
+ $this->_regionName = isset($stdClassResultAddress->regionName) ? $stdClassResultAddress->regionName : null;
165
+ $this->_postCode = isset($stdClassResultAddress->postCode) ? $stdClassResultAddress->postCode : null;
166
+ $this->_streetName = isset($stdClassResultAddress->streetName) ? $stdClassResultAddress->streetName : null;
167
+ $this->_streetType = isset($stdClassResultAddress->streetType) ? $stdClassResultAddress->streetType : null;
168
+ $this->_streetId = isset($stdClassResultAddress->streetId) ? $stdClassResultAddress->streetId : null;
169
+ $this->_quarterName = isset($stdClassResultAddress->quarterName) ? $stdClassResultAddress->quarterName : null;
170
+ $this->_quarterType = isset($stdClassResultAddress->quarterType) ? $stdClassResultAddress->quarterType : null;
171
+ $this->_quarterId = isset($stdClassResultAddress->quarterId) ? $stdClassResultAddress->quarterId : null;
172
+ $this->_streetNo = isset($stdClassResultAddress->streetNo) ? $stdClassResultAddress->streetNo : null;
173
+ $this->_blockNo = isset($stdClassResultAddress->blockNo) ? $stdClassResultAddress->blockNo : null;
174
+ $this->_entranceNo = isset($stdClassResultAddress->entranceNo) ? $stdClassResultAddress->entranceNo : null;
175
+ $this->_floorNo = isset($stdClassResultAddress->floorNo) ? $stdClassResultAddress->floorNo : null;
176
+ $this->_apartmentNo = isset($stdClassResultAddress->apartmentNo) ? $stdClassResultAddress->apartmentNo : null;
177
+ $this->_addressNote = isset($stdClassResultAddress->addressNote) ? $stdClassResultAddress->addressNote : null;
178
+ $this->_commonObjectId = isset($stdClassResultAddress->commonObjectId) ? $stdClassResultAddress->commonObjectId : null;
179
+ $this->_commonObjectName = isset($stdClassResultAddress->commonObjectName) ? $stdClassResultAddress->commonObjectName : null;
180
+ $this->_countryId = isset($stdClassResultAddress->countryId) ? $stdClassResultAddress->countryId : null;
181
+ $this->_frnAddressLine1 = isset($stdClassResultAddress->frnAddressLine1) ? $stdClassResultAddress->frnAddressLine1 : null;
182
+ $this->_frnAddressLine2 = isset($stdClassResultAddress->frnAddressLine2) ? $stdClassResultAddress->frnAddressLine2 : null;
183
+ $this->_stateId = isset($stdClassResultAddress->stateId) ? $stdClassResultAddress->stateId : null;
184
+ }
185
+
186
+ /**
187
+ * Get site ID
188
+ * @return integer Signed 64-bit (nullable)
189
+ */
190
+ public function getSiteId() {
191
+ return $this->_siteId;
192
+ }
193
+
194
+ /**
195
+ * Get site name
196
+ * @return string
197
+ */
198
+ public function getSiteName() {
199
+ return $this->_siteName;
200
+ }
201
+
202
+ /**
203
+ * Get site type
204
+ * @return string
205
+ */
206
+ public function getSiteType() {
207
+ return $this->_siteType;
208
+ }
209
+
210
+ /**
211
+ * Get municipality name
212
+ * @return string
213
+ */
214
+ public function getMunicipalityName() {
215
+ return $this->_municipalityName;
216
+ }
217
+
218
+ /**
219
+ * Get region name
220
+ * @return string
221
+ */
222
+ public function getRegionName() {
223
+ return $this->_regionName;
224
+ }
225
+
226
+ /**
227
+ * Get post code
228
+ * @return string
229
+ */
230
+ public function getPostCode() {
231
+ return $this->_postCode;
232
+ }
233
+
234
+ /**
235
+ * Get street name
236
+ * @return string
237
+ */
238
+ public function getStreetName() {
239
+ return $this->_streetName;
240
+ }
241
+
242
+ /**
243
+ * Get street type
244
+ * @return string
245
+ */
246
+ public function getStreetType() {
247
+ return $this->_streetType;
248
+ }
249
+
250
+ /**
251
+ * Get street ID
252
+ * @return integer Signed 64-bit (nullable)
253
+ */
254
+ public function getStreetId() {
255
+ return $this->_streetId;
256
+ }
257
+
258
+ /**
259
+ * Get quarter name
260
+ * @return string
261
+ */
262
+ public function getQuarterName() {
263
+ return $this->_quarterName;
264
+ }
265
+
266
+ /**
267
+ * Get quarter type
268
+ * @return string
269
+ */
270
+ public function getQuarterType() {
271
+ return $this->_quarterType;
272
+ }
273
+
274
+ /**
275
+ * Get quarter ID
276
+ * @return integer Signed 64-bit (nullable)
277
+ */
278
+ public function getQuarterId() {
279
+ return $this->_quarterId;
280
+ }
281
+
282
+ /**
283
+ * Get street No
284
+ * @return string
285
+ */
286
+ public function getStreetNo() {
287
+ return $this->_streetNo;
288
+ }
289
+
290
+ /**
291
+ * Get block No
292
+ * @return string
293
+ */
294
+ public function getBlockNo() {
295
+ return $this->_blockNo;
296
+ }
297
+
298
+ /**
299
+ * Get entrance No
300
+ * @return string
301
+ */
302
+ public function getEntranceNo() {
303
+ return $this->_entranceNo;
304
+ }
305
+
306
+ /**
307
+ * Get floor No
308
+ * @return string
309
+ */
310
+ public function getFloorNo() {
311
+ return $this->_floorNo;
312
+ }
313
+
314
+ /**
315
+ * Get appartment No
316
+ * @return string
317
+ */
318
+ public function getApartmentNo() {
319
+ return $this->_apartmentNo;
320
+ }
321
+
322
+ /**
323
+ * Get address note
324
+ * @return string
325
+ */
326
+ public function getAddressNote() {
327
+ return $this->_addressNote;
328
+ }
329
+
330
+ /**
331
+ * Get common object ID
332
+ * @return integer Signed 64-bit (nullable) Common object id
333
+ */
334
+ public function getCommonObjectId() {
335
+ return $this->_commonObjectId;
336
+ }
337
+
338
+ /**
339
+ * Get common object name
340
+ * @return string Common object name
341
+ */
342
+ public function getCommonObjectName() {
343
+ return $this->_commonObjectName;
344
+ }
345
+
346
+ /**
347
+ * Get country id
348
+ * @return string Country id
349
+ */
350
+ public function getCountryId() {
351
+ return $this->_countryId;
352
+ }
353
+
354
+ /**
355
+ * Get foreign address line 1
356
+ * @return string Foreign address line 1
357
+ */
358
+ public function getFrnAddressLine1() {
359
+ return $this->_frnAddressLine1;
360
+ }
361
+
362
+ /**
363
+ * Get foreign address line 2
364
+ * @return string Foreign address line 2
365
+ */
366
+ public function getFrnAddressLine2() {
367
+ return $this->_frnAddressLine2;
368
+ }
369
+
370
+ /**
371
+ * Get state id
372
+ * @return string State id
373
+ */
374
+ public function getStateId() {
375
+ return $this->_stateId;
376
+ }
377
+ }
378
+ ?>
lib/SpeedyEPS/ver01/ResultClientInfo.class.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'ResultAddress.class.php';
4
+ require_once 'ResultPhoneNumber.class.php';
5
+
6
+ /**
7
+ * Instances of this class are returned as a result of Speedy web service method calls for client data info (from ResultPickingExtendedInfo)
8
+ */
9
+ class ResultClientInfo {
10
+
11
+ /**
12
+ * Client ID
13
+ * @var integer Signed 64-bit (nullable)
14
+ */
15
+ private $_clientId;
16
+
17
+ /**
18
+ * Name of the client (company or private person)
19
+ * @var string
20
+ */
21
+ private $_partnerName;
22
+
23
+ /**
24
+ * Company department/office
25
+ * @var string
26
+ */
27
+ private $_objectName;
28
+
29
+ /**
30
+ * Address
31
+ * @var ResultAddress
32
+ */
33
+ private $_address;
34
+
35
+ /**
36
+ * Contact name
37
+ * @var string
38
+ */
39
+ private $_contactName;
40
+
41
+ /**
42
+ * Phone numbers
43
+ * @var array ResultPhoneNumber
44
+ */
45
+ private $_phones;
46
+
47
+ /**
48
+ * Constructs new instance of ResultClientInfo
49
+ * @param stdClass $stdClassResultClientInfo
50
+ */
51
+ function __construct($stdClassResultClientInfo) {
52
+ $this->_clientId = isset($stdClassResultClientInfo->clientId) ? $stdClassResultClientInfo->clientId : null;
53
+ $this->_partnerName = isset($stdClassResultClientInfo->partnerName) ? $stdClassResultClientInfo->partnerName : null;
54
+ $this->_objectName = isset($stdClassResultClientInfo->objectName) ? $stdClassResultClientInfo->objectName : null;
55
+ $this->_address = isset($stdClassResultClientInfo->address) ? new ResultAddress($stdClassResultClientInfo->address) : null;
56
+ $this->_contactName = isset($stdClassResultClientInfo->contactName) ? $stdClassResultClientInfo->contactName : null;
57
+ $arrResultPhoneNumbers = array();
58
+ if (isset($stdClassResultClientInfo->phones)) {
59
+ if (is_array($stdClassResultClientInfo->phones)) {
60
+ for($i = 0; $i < count($stdClassResultClientInfo->phones); $i++) {
61
+ $arrResultPhoneNumbers[$i] = new ResultPhoneNumber($stdClassResultClientInfo->phones[$i]);
62
+ }
63
+ } else {
64
+ $arrResultPhoneNumbers[0] = new ResultPhoneNumber($stdClassResultClientInfo->phones);
65
+ }
66
+ }
67
+ $this->_phones = $arrResultPhoneNumbers;
68
+ }
69
+
70
+ /**
71
+ * Get client ID
72
+ * @return integer Signed 64-bit (nullable)
73
+ */
74
+ public function getClientId() {
75
+ return $this->_clientId;
76
+ }
77
+
78
+ /**
79
+ * Get name of the client (company or private person)
80
+ * @return string
81
+ */
82
+ public function getPartnerName() {
83
+ return $this->_partnerName;
84
+ }
85
+
86
+ /**
87
+ * Get company department/office
88
+ * @return string
89
+ */
90
+ public function getObjectName() {
91
+ return $this->_objectName;
92
+ }
93
+
94
+ /**
95
+ * Get address
96
+ * @return ResultAddress
97
+ */
98
+ public function getAddress() {
99
+ return $this->_address;
100
+ }
101
+
102
+ /**
103
+ * Get contact name
104
+ * @return string
105
+ */
106
+ public function getContactName() {
107
+ return $this->_contactName;
108
+ }
109
+
110
+ /**
111
+ * Get phone numbers
112
+ * @return array ResultPhoneNumber
113
+ */
114
+ public function getPhones() {
115
+ return $this->_phones;
116
+ }
117
+ }
118
+ ?>
lib/SpeedyEPS/ver01/ResultCourierService.class.php CHANGED
@@ -55,6 +55,12 @@ class ResultCourierService {
55
  */
56
  private $_allowanceToBeCalled;
57
 
 
 
 
 
 
 
58
  /**
59
  * Constructs new instance of ResultCourierService
60
  * @param stdClass $stdClassResultCourierService
@@ -68,6 +74,7 @@ class ResultCourierService {
68
  $this->_allowanceBackDocumentsRequest = isset($stdClassResultCourierService->allowanceBackDocumentsRequest) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceBackDocumentsRequest) : null;
69
  $this->_allowanceBackReceiptRequest = isset($stdClassResultCourierService->allowanceBackReceiptRequest) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceBackReceiptRequest) : null;
70
  $this->_allowanceToBeCalled = isset($stdClassResultCourierService->allowanceToBeCalled) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceToBeCalled) : null;
 
71
  }
72
 
73
  /**
@@ -133,5 +140,14 @@ class ResultCourierService {
133
  public function getAllowanceToBeCalled() {
134
  return $this->_allowanceToBeCalled;
135
  }
 
 
 
 
 
 
 
 
 
136
  }
137
  ?>
55
  */
56
  private $_allowanceToBeCalled;
57
 
58
+ /**
59
+ * Cargo type
60
+ * @var integer Signed 32-bit
61
+ */
62
+ private $_cargoType;
63
+
64
  /**
65
  * Constructs new instance of ResultCourierService
66
  * @param stdClass $stdClassResultCourierService
74
  $this->_allowanceBackDocumentsRequest = isset($stdClassResultCourierService->allowanceBackDocumentsRequest) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceBackDocumentsRequest) : null;
75
  $this->_allowanceBackReceiptRequest = isset($stdClassResultCourierService->allowanceBackReceiptRequest) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceBackReceiptRequest) : null;
76
  $this->_allowanceToBeCalled = isset($stdClassResultCourierService->allowanceToBeCalled) ? new ComplementaryServiceAllowance($stdClassResultCourierService->allowanceToBeCalled) : null;
77
+ $this->_cargoType = isset($stdClassResultCourierService->cargoType) ? $stdClassResultCourierService->cargoType : null;
78
  }
79
 
80
  /**
140
  public function getAllowanceToBeCalled() {
141
  return $this->_allowanceToBeCalled;
142
  }
143
+
144
+ /**
145
+ * Get service carto type
146
+ * @return integer Signed 32-bit
147
+ */
148
+ public function getCargoType() {
149
+ return $this->_cargoType;
150
+ }
151
+
152
  }
153
  ?>
lib/SpeedyEPS/ver01/ResultCourierServiceExt.class.php CHANGED
@@ -20,7 +20,7 @@ class ResultCourierServiceExt extends ResultCourierService {
20
  function __construct($stdClassResultCourierServiceExt) {
21
  parent::__construct($stdClassResultCourierServiceExt);
22
  $this->_deliveryDeadline = isset($stdClassResultCourierServiceExt->deliveryDeadline) ? $stdClassResultCourierServiceExt->deliveryDeadline : null;
23
- }
24
 
25
  /**
26
  * Get deadline for shipment delivery
@@ -29,5 +29,6 @@ class ResultCourierServiceExt extends ResultCourierService {
29
  public function getDeliveryDeadline() {
30
  return $this->_deliveryDeadline;
31
  }
 
32
  }
33
  ?>
20
  function __construct($stdClassResultCourierServiceExt) {
21
  parent::__construct($stdClassResultCourierServiceExt);
22
  $this->_deliveryDeadline = isset($stdClassResultCourierServiceExt->deliveryDeadline) ? $stdClassResultCourierServiceExt->deliveryDeadline : null;
23
+ }
24
 
25
  /**
26
  * Get deadline for shipment delivery
29
  public function getDeliveryDeadline() {
30
  return $this->_deliveryDeadline;
31
  }
32
+
33
  }
34
  ?>
lib/SpeedyEPS/ver01/ResultDeliveryInfo.class.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instances of this class are used as a result of make picking info methods
5
+ * @since 2.9.0
6
+ */
7
+ class ResultDeliveryInfo {
8
+
9
+ /**
10
+ * Delivery date.
11
+ * @var signed Date
12
+ */
13
+ protected $_deliveryDate;
14
+
15
+ /**
16
+ * The name of the person who received the shipment
17
+ * @var signed string
18
+ */
19
+ protected $_consignee;
20
+
21
+ /**
22
+ * Delivery Note
23
+ * @var signed string
24
+ */
25
+ protected $_deliveryNote;
26
+
27
+ /**
28
+ * Constructs new instance of this class
29
+ * @param $stdClassResultAddressString
30
+ */
31
+ function __construct($stdClassResultDeliveryInfo) {
32
+ $this->_deliveryDate = isset($stdClassResultDeliveryInfo->deliveryDate) ? $stdClassResultDeliveryInfo->deliveryDate : null;
33
+ $this->_consignee = isset($stdClassResultDeliveryInfo->consignee) ? $stdClassResultDeliveryInfo->consignee : null;
34
+ $this->_deliveryNote = isset($stdClassResultDeliveryInfo->deliveryNote) ? $stdClassResultDeliveryInfo->deliveryNote : null;
35
+ }
36
+
37
+ /**
38
+ * Get Delivery date.
39
+ * @return Date
40
+ */
41
+ public function getDeliveryDate() {
42
+ return $this->_deliveryDate;
43
+ }
44
+
45
+
46
+ /**
47
+ * Get The name of the person who received the shipment
48
+ * @return string
49
+ */
50
+ public function getConsignee() {
51
+ return $this->_consignee;
52
+ }
53
+
54
+ /**
55
+ * Get Delivery Note
56
+ * @return string
57
+ */
58
+ public function getDeliveryNote() {
59
+ return $this->_deliveryNote;
60
+ }
61
+
62
+ }
63
+ ?>
lib/SpeedyEPS/ver01/ResultOptionsBeforePayment.class.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instances of this class are used as a result of make picking info methods
5
+ * @since 2.9.0
6
+ */
7
+ class ResultOptionsBeforePayment {
8
+
9
+ /**
10
+ * Indicates if the client is allowed to open the package before payment.
11
+ * @var boolean (nullable)
12
+ */
13
+ protected $_open;
14
+
15
+ /**
16
+ * Indicates if the client is allowed to test the package before payment.
17
+ * @var boolean (nullable)
18
+ */
19
+ protected $_test;
20
+
21
+ /**
22
+ * Constructs new instance of this class
23
+ * @param unknown $stdClassResultAddressString
24
+ */
25
+ function __construct($stdClassResultOptionsBeforePayment) {
26
+ $this->_open = isset($stdClassResultOptionsBeforePayment->open) ? $stdClassResultOptionsBeforePayment->open : null;
27
+ $this->_test = isset($stdClassResultOptionsBeforePayment->test) ? $stdClassResultOptionsBeforePayment->test : null;
28
+ }
29
+
30
+ /**
31
+ * Gets Indicates if the client is allowed to open the package before payment.
32
+ * @return boolean (nullable)
33
+ */
34
+ public function getOpen() {
35
+ return $this->_open;
36
+ }
37
+
38
+
39
+ /**
40
+ * Gets Indicates if the client is allowed to test the package before payment.
41
+ * @return boolean (nullable)
42
+ */
43
+ public function getTest() {
44
+ return $this->_test;
45
+ }
46
+
47
+ }
48
+ ?>
lib/SpeedyEPS/ver01/ResultPackings.class.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instances of this class are used as a result of make picking info methods
5
+ * @since 2.9.0
6
+ */
7
+ class ResultPackings {
8
+
9
+ /**
10
+ * Service type id.
11
+ * @var signed 64-bit integer
12
+ */
13
+ protected $_serviceTypeId;
14
+
15
+ /**
16
+ * Number of parcels.
17
+ * @var signed 32-bit integer
18
+ */
19
+ protected $_parcelsCount;
20
+
21
+ /**
22
+ * Constructs new instance of this class
23
+ * @param $stdClassResultAddressString
24
+ */
25
+ function __construct($stdClassResultPackings) {
26
+ $this->_serviceTypeId = isset($stdClassResultPackings->serviceTypeId) ? $stdClassResultPackings->serviceTypeId : null;
27
+ $this->_parcelsCount = isset($stdClassResultPackings->parcelsCount) ? $stdClassResultPackings->parcelsCount : null;
28
+ }
29
+
30
+ /**
31
+ * Get Service type id.
32
+ * @return 64-bit integer
33
+ */
34
+ public function getServiceTypeId() {
35
+ return $this->_serviceTypeId;
36
+ }
37
+
38
+
39
+ /**
40
+ * Get Number of parcels.
41
+ * @return 32-bit integer
42
+ */
43
+ public function getParcelsCount() {
44
+ return $this->_parcelsCount;
45
+ }
46
+
47
+ }
48
+ ?>
lib/SpeedyEPS/ver01/ResultParcelInfoEx.class.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instances of this class are returned as a result of ResultPickingExtendedInfo
5
+ */
6
+ class ResultParcelInfoEx {
7
+
8
+ /**
9
+ * Parcel's serial number (1, 2, 3, ...)
10
+ * @var integer Signed 32-bit
11
+ */
12
+ private $_seqNo;
13
+
14
+ /**
15
+ * Parcel ID. First parcel's ID is always the same as the BOL number.
16
+ * @var integer Signed 64-bit
17
+ */
18
+ private $_parcelId;
19
+
20
+ /**
21
+ * Measured weight
22
+ * @var signed 64 bit real (nullable)
23
+ */
24
+ private $_weightMeasured;
25
+
26
+ /**
27
+ * Declared weight
28
+ * @var signed 64 bit real (nullable)
29
+ */
30
+ private $_weightDeclared;
31
+
32
+ /**
33
+ * Measured size
34
+ * @var signed Size
35
+ */
36
+ private $_sizeMeasured;
37
+
38
+ /**
39
+ * Declared size
40
+ * @var signed Size
41
+ */
42
+ private $_sizeDeclared;
43
+
44
+ /**
45
+ * Constructs new instance of stdClassResultParcelInfoEx from stdClass
46
+ * @param stdClass $stdClassResultParcelInfoEx
47
+ */
48
+ function __construct($stdClassResultParcelInfoEx) {
49
+ $this->_seqNo = isset($stdClassResultParcelInfoEx->seqNo) ? $stdClassResultParcelInfoEx->seqNo : null;
50
+ $this->_parcelId = isset($stdClassResultParcelInfoEx->parcelId) ? $stdClassResultParcelInfoEx->parcelId : null;
51
+ $this->_weightMeasured = isset($stdClassResultParcelInfoEx->weightMeasured) ? $stdClassResultParcelInfoEx->weightMeasured : null;
52
+ $this->_weightDeclared = isset($stdClassResultParcelInfoEx->weightDeclared) ? $stdClassResultParcelInfoEx->weightDeclared : null;
53
+ $this->_sizeMeasured = isset($stdClassResultParcelInfoEx->sizeMeasured) ? new Size($stdClassResultParcelInfoEx->sizeMeasured) : null;
54
+ $this->_sizeDeclared = isset($stdClassResultParcelInfoEx->sizeDeclared) ? new Size($stdClassResultParcelInfoEx->sizeDeclared) : null;
55
+ }
56
+
57
+ /**
58
+ * Get parcel's serial number (1, 2, 3, ...)
59
+ * @return integer Signed 32-bit
60
+ */
61
+ public function getSeqNo() {
62
+ return $this->_seqNo;
63
+ }
64
+
65
+ /**
66
+ * Get parcel ID. First parcel's ID is always the same as the BOL number.
67
+ * @return integer Signed 64-bit
68
+ */
69
+ public function getParcelId() {
70
+ return $this->_parcelId;
71
+ }
72
+
73
+ /**
74
+ * Get Measured weight
75
+ * @return 64 bit real (nullable)
76
+ */
77
+ public function getWeightMeasured() {
78
+ return $this->_weightMeasured;
79
+ }
80
+
81
+ /**
82
+ * Get Declared weight
83
+ * @return 64 bit real (nullable)
84
+ */
85
+ public function getWeightDeclared() {
86
+ return $this->_weightDeclared;
87
+ }
88
+
89
+ /**
90
+ * Get Measured size
91
+ * @return size
92
+ */
93
+ public function getSizeMeasured() {
94
+ return $this->_sizeMeasured;
95
+ }
96
+
97
+ /**
98
+ * Get Declared size
99
+ * @return size
100
+ */
101
+ public function getSizeDeclared() {
102
+ return $this->_sizeDeclared;
103
+ }
104
+
105
+
106
+ }
107
+ ?>
lib/SpeedyEPS/ver01/ResultPickingExtendedInfo.class.php ADDED
@@ -0,0 +1,850 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'ResultParcelInfoEx.class.php';
4
+ require_once 'ResultOptionsBeforePayment.class.php';
5
+ require_once 'ResultPackings.class.php';
6
+ require_once 'ResultReturnVoucher.class.php';
7
+ require_once 'ResultDeliveryInfo.class.php';
8
+
9
+ /**
10
+ * Instances of this class are returned as a result of getPickingExtendedInfo
11
+ */
12
+ class ResultPickingExtendedInfo {
13
+
14
+ /**
15
+ * BOL of the secondary shipment.
16
+ * @var integer Signed 64-bit
17
+ */
18
+ private $_billOfLading;
19
+
20
+ /**
21
+ * The date for shipment pick-up (the "time" component is ignored). Default value is "today".
22
+ * @var date Taking date
23
+ */
24
+ private $_takingDate;
25
+
26
+ /**
27
+ * Courier service type ID
28
+ * @var integer Signed 64-bit
29
+ */
30
+ private $_serviceTypeId;
31
+
32
+ /**
33
+ * ID of an office "to be called". Non-null and non-zero value indicates this picking as "to office". Otherwise "to address" is considered.
34
+ * var 64-bit integer (nullable)
35
+ */
36
+ private $_officeToBeCalledId;
37
+
38
+ /**
39
+ * Fixed time for delivery ("HHmm" format, i.e., the number "1315" means "13:15", "830" means "8:30" etc.).
40
+ * var signed 16-bit integer (nullable)
41
+ */
42
+ private $_fixedTimeDelivery;
43
+
44
+ /**
45
+ * Deferred delivery work days
46
+ * var signed 32-bit integer (nullable)
47
+ */
48
+ private $_deferredDeliveryWorkDays;
49
+
50
+ /**
51
+ * Indicates if the shipment has a "request for return documents"
52
+ * var signed boolean
53
+ */
54
+ private $_backDocumentsRequest;
55
+
56
+ /**
57
+ * Indicates if the shipment has a "request for return receipt"
58
+ * var signed boolean
59
+ */
60
+ private $_backReceiptRequest;
61
+
62
+ /**
63
+ * ID of an office where the sender intends to deliver the shipment by him/herself. Non-null and non-zero value indicates this picking as "to office". Otherwise "from address" is considered.
64
+ * var signed long
65
+ */
66
+ private $_willBringToOfficeId;
67
+
68
+ /**
69
+ * COD value is to be paid to a third party
70
+ * var signed boolean
71
+ */
72
+ private $_payCodToThirdParty;
73
+
74
+ /**
75
+ * Money-transfer request amount
76
+ * var signed 64-bit real (nullable)
77
+ */
78
+ private $_retMoneyTransferReqAmount;
79
+
80
+ /**
81
+ * Parcels count
82
+ * var signed 32-bit integer
83
+ */
84
+ private $_parcelsCount;
85
+
86
+ /**
87
+ * Declared weight (the greater of "volume" and "real" weight values)
88
+ * var signed 64-bit real
89
+ */
90
+ private $_weightDeclared;
91
+
92
+ /**
93
+ * Measured weight
94
+ * var signed 64-bit real (nullable)
95
+ */
96
+ private $_weightMeasured;
97
+
98
+ /**
99
+ * Calculation weight
100
+ * var signed 64-bit real (nullable)
101
+ */
102
+ private $_weightCalculation;
103
+
104
+ /**
105
+ * Contents
106
+ * var signed string
107
+ */
108
+ private $_contents;
109
+
110
+ /**
111
+ * Packing
112
+ * var signed string
113
+ */
114
+ private $_packing;
115
+
116
+ /**
117
+ * Indicates whether the shipment consists of documents
118
+ * var signed boolean
119
+ */
120
+ private $_documents;
121
+
122
+ /**
123
+ * Indicates whether the shipment is fragile
124
+ * var signed boolean
125
+ */
126
+ private $_fragile;
127
+
128
+ /**
129
+ * Indicates whether the shipment is palletized
130
+ * var signed boolean
131
+ */
132
+ private $_palletized;
133
+
134
+ /**
135
+ * Data for the sender
136
+ * var sender
137
+ */
138
+ private $_sender;
139
+
140
+ /**
141
+ * Data for the receiver
142
+ * var receiver
143
+ */
144
+ private $_receiver;
145
+
146
+ /**
147
+ * Payer type (0=sender, 1=receiver or 2=third party)
148
+ * var signed 32-bit integer
149
+ */
150
+ private $_payerType;
151
+
152
+ /**
153
+ * Payer ID
154
+ * var signed 64-bit integer (nullable)
155
+ */
156
+ private $_payerRefId;
157
+
158
+ /**
159
+ * Insurance payer type (0=sender, 1=reciever or 2=third party)
160
+ * var signed 64-bit integer (nullable)
161
+ */
162
+ private $_payerTypeInsurance;
163
+
164
+ /**
165
+ * Insurance payer ID
166
+ * var signed 64-bit integer (nullable)
167
+ */
168
+ private $_payerRefInsuranceId;
169
+
170
+ /**
171
+ * Packings payer type (0=sender, 1=reciever or 2=third party)
172
+ * var signed 32-bit integer (nullable)
173
+ */
174
+ private $_payerTypePackings;
175
+
176
+ /**
177
+ * Packings payer ID
178
+ * var signed 64-bit integer (nullable)
179
+ */
180
+ private $_payerRefPackingsId;
181
+
182
+ /**
183
+ * Client's note
184
+ * var signed string
185
+ */
186
+ private $_noteClient;
187
+
188
+ /**
189
+ * Card/Coupon/Voucher number for fixed discount
190
+ * var signed FixedDiscountCardId
191
+ */
192
+ private $_discCalc;
193
+
194
+ /**
195
+ * ID of the client who is to receive the return receipt and/or the return documents.
196
+ * var signed signed 64-bit integer (nullable)
197
+ */
198
+ private $_retToClientId;
199
+
200
+ /**
201
+ * ID of the office which is to receive the return receipt and/or the return documents.
202
+ * var signed signed 64-bit integer (nullable)
203
+ */
204
+ private $_retToOfficeId;
205
+
206
+ /**
207
+ * An optional reference code
208
+ * var signed string
209
+ */
210
+ private $_ref1;
211
+
212
+ /**
213
+ * An optional reference code
214
+ * var signed string
215
+ */
216
+ private $_ref2;
217
+
218
+ /**
219
+ * Data for parcels
220
+ * var signed List<ResultParcelInfoEx>
221
+ */
222
+ private $_parcels;
223
+
224
+ /**
225
+ * List of declared pallet details
226
+ * var signed string
227
+ */
228
+ private $_palletsListDeclared;
229
+
230
+ /**
231
+ * List of measured pallet details
232
+ * var signed string
233
+ */
234
+ private $_palletsListMeasured;
235
+
236
+ /**
237
+ * List of calculation pallet details
238
+ * var signed string
239
+ */
240
+ private $_palletsListCalculation;
241
+
242
+ /**
243
+ * A special delivery ID
244
+ * var signed 32-bit integer (nullable)
245
+ */
246
+ private $_specialDeliveryId;
247
+
248
+ /**
249
+ * Optional services, allowed before payment, when cash on delivery or money transfer is enabled for the picking.
250
+ * var ResultOptionsBeforePayment
251
+ */
252
+ private $_optionsBeforePayment;
253
+
254
+ /**
255
+ * List of return services request
256
+ * var List<ResultReturnServiceRequest>
257
+ */
258
+ private $_retServicesRequest;
259
+
260
+ /**
261
+ * List of return services request
262
+ * var List<ResultReturnServiceRequest>
263
+ */
264
+ private $_retShipmentRequest;
265
+
266
+ /**
267
+ * Specifies if the payer of the return receipt and/or the return documents is the same third party, which is also the payer of the courier service.
268
+ * var signed boolean
269
+ */
270
+ private $_retThirdPartyPayer;
271
+
272
+ /**
273
+ * Packings details.
274
+ * var List<ResultPackings>
275
+ */
276
+ private $_packings;
277
+
278
+ /**
279
+ * Details for return voucher.
280
+ * var ResultReturnVoucher
281
+ */
282
+ private $_returnVoucher;
283
+
284
+ /**
285
+ * Indicates the floor, which the shipment should be delivered to.
286
+ * var signed 32-bit integer (nullable)
287
+ */
288
+ private $_deliveryToFloorNo;
289
+
290
+ /**
291
+ * Amounts.
292
+ * var signed ResultAmounts
293
+ */
294
+ private $_amounts;
295
+
296
+ /**
297
+ * Deadline for delivery.
298
+ * var signed date
299
+ */
300
+ private $_deadlineDelivery;
301
+
302
+ /**
303
+ * Delivery information.
304
+ * var signed ResultDeliveryInfo
305
+ */
306
+ private $_deliveryInfo;
307
+
308
+ /**
309
+ * COD payment information.
310
+ * var signed CODPayment
311
+ */
312
+ private $_codPayment;
313
+
314
+ /**
315
+ * COD BOL number of return picking.
316
+ * var signed 64-bit integer (nullable)
317
+ */
318
+ private $_redirectBillOfLading;
319
+
320
+ /**
321
+ * COD BOL number of return picking.
322
+ * var signed 64-bit integer (nullable)
323
+ */
324
+ private $_returnBillOfLading;
325
+
326
+ /**
327
+ * Constructs new instance of ResultPickingInfo from stdClass
328
+ * @param stdClass $stdResultPickingExtendedInfo
329
+ */
330
+ function __construct($stdResultPickingExtendedInfo) {
331
+ $this->_billOfLading = isset($stdResultPickingExtendedInfo->billOfLading) ? $stdResultPickingExtendedInfo->billOfLading : null;
332
+ $this->_takingDate = isset($stdResultPickingExtendedInfo->takingDate) ? $stdResultPickingExtendedInfo->takingDate : null;
333
+ $this->_serviceTypeId = isset($stdResultPickingExtendedInfo->serviceTypeId) ? $stdResultPickingExtendedInfo->serviceTypeId : null;
334
+ $this->_officeToBeCalledId = isset($stdResultPickingExtendedInfo->officeToBeCalledId) ? $stdResultPickingExtendedInfo->officeToBeCalledId : null;
335
+ $this->_fixedTimeDelivery = isset($stdResultPickingExtendedInfo->fixedTimeDelivery) ? $stdResultPickingExtendedInfo->fixedTimeDelivery : null;
336
+ $this->_deferredDeliveryWorkDays = isset($stdResultPickingExtendedInfo->deferredDeliveryWorkDays) ? $stdResultPickingExtendedInfo->deferredDeliveryWorkDays : null;
337
+ $this->_backDocumentsRequest = isset($stdResultPickingExtendedInfo->backDocumentsRequest) ? $stdResultPickingExtendedInfo->backDocumentsRequest : null;
338
+ $this->_backReceiptRequest = isset($stdResultPickingExtendedInfo->backReceiptRequest) ? $stdResultPickingExtendedInfo->backReceiptRequest : null;
339
+ $this->_willBringToOfficeId = isset($stdResultPickingExtendedInfo->willBringToOfficeId) ? $stdResultPickingExtendedInfo->willBringToOfficeId : null;
340
+ $this->_payCodToThirdParty = isset($stdResultPickingExtendedInfo->payCodToThirdParty) ? $stdResultPickingExtendedInfo->payCodToThirdParty : null;
341
+ $this->_retMoneyTransferReqAmount = isset($stdResultPickingExtendedInfo->retMoneyTransferReqAmount) ? $stdResultPickingExtendedInfo->retMoneyTransferReqAmount : null;
342
+ $this->_parcelsCount = isset($stdResultPickingExtendedInfo->parcelsCount) ? $stdResultPickingExtendedInfo->parcelsCount : null;
343
+ $this->_weightDeclared = isset($stdResultPickingExtendedInfo->weightDeclared) ? $stdResultPickingExtendedInfo->weightDeclared : null;
344
+ $this->_weightMeasured = isset($stdResultPickingExtendedInfo->weightMeasured) ? $stdResultPickingExtendedInfo->weightMeasured : null;
345
+ $this->_weightCalculation = isset($stdResultPickingExtendedInfo->weightCalculation) ? $stdResultPickingExtendedInfo->weightCalculation : null;
346
+ $this->_contents = isset($stdResultPickingExtendedInfo->contents) ? $stdResultPickingExtendedInfo->contents : null;
347
+ $this->_packing = isset($stdResultPickingExtendedInfo->packing) ? $stdResultPickingExtendedInfo->packing : null;
348
+ $this->_documents = isset($stdResultPickingExtendedInfo->documents) ? $stdResultPickingExtendedInfo->documents : null;
349
+ $this->_fragile = isset($stdResultPickingExtendedInfo->fragile) ? $stdResultPickingExtendedInfo->fragile : null;
350
+ $this->_palletized = isset($stdResultPickingExtendedInfo->palletized) ? $stdResultPickingExtendedInfo->palletized : null;
351
+ $this->_sender = isset($stdResultPickingExtendedInfo->sender) ? new ResultClientInfo($stdResultPickingExtendedInfo->sender) : null;
352
+ $this->_receiver = isset($stdResultPickingExtendedInfo->receiver) ? new ResultClientInfo($stdResultPickingExtendedInfo->receiver) : null;
353
+ $this->_payerType = isset($stdResultPickingExtendedInfo->payerType) ? $stdResultPickingExtendedInfo->payerType : null;
354
+ $this->_payerRefId = isset($stdResultPickingExtendedInfo->payerRefId) ? $stdResultPickingExtendedInfo->payerRefId : null;
355
+ $this->_payerTypeInsurance = isset($stdResultPickingExtendedInfo->payerTypeInsurance) ? $stdResultPickingExtendedInfo->payerTypeInsurance : null;
356
+ $this->_payerRefInsuranceId = isset($stdResultPickingExtendedInfo->payerRefInsuranceId) ? $stdResultPickingExtendedInfo->payerRefInsuranceId : null;
357
+ $this->_payerTypePackings = isset($stdResultPickingExtendedInfo->payerTypePackings) ? $stdResultPickingExtendedInfo->payerTypePackings : null;
358
+ $this->_payerRefPackingsId = isset($stdResultPickingExtendedInfo->payerRefPackingsId) ? $stdResultPickingExtendedInfo->payerRefPackingsId : null;
359
+ $this->_noteClient = isset($stdResultPickingExtendedInfo->noteClient) ? $stdResultPickingExtendedInfo->noteClient : null;
360
+ $this->_discCalc = isset($stdResultPickingExtendedInfo->discCalc) ? $stdResultPickingExtendedInfo->discCalc : null;
361
+ $this->_retToClientId = isset($stdResultPickingExtendedInfo->retToClientId) ? $stdResultPickingExtendedInfo->retToClientId : null;
362
+ $this->_retToOfficeId = isset($stdResultPickingExtendedInfo->retToOfficeId) ? $stdResultPickingExtendedInfo->retToOfficeId : null;
363
+ $this->_ref1 = isset($stdResultPickingExtendedInfo->ref1) ? $stdResultPickingExtendedInfo->ref1 : null;
364
+ $this->_ref2 = isset($stdResultPickingExtendedInfo->ref2) ? $stdResultPickingExtendedInfo->ref2 : null;
365
+
366
+
367
+ $arrResultParcelInfoEx = array();
368
+ if (isset($stdResultPickingExtendedInfo->parcels))
369
+ {
370
+ if (is_array($stdResultPickingExtendedInfo->parcels))
371
+ {
372
+ for($i = 0; $i < count($stdResultPickingExtendedInfo->parcels); $i++)
373
+ {
374
+ $arrResultParcelInfoEx[$i] = new ResultParcelInfoEx($stdResultPickingExtendedInfo->parcels[$i]);
375
+ }
376
+ }
377
+ else
378
+ {
379
+ $arrResultParcelInfoEx[0] = new ResultParcelInfoEx($stdResultPickingExtendedInfo->parcels);
380
+ }
381
+ }
382
+ $this->_parcels = $arrResultParcelInfoEx;
383
+
384
+
385
+ $this->_palletsListDeclared = isset($stdResultPickingExtendedInfo->palletsListDeclared) ? $stdResultPickingExtendedInfo->palletsListDeclared : null;
386
+ $this->_palletsListMeasured = isset($stdResultPickingExtendedInfo->palletsListMeasured) ? $stdResultPickingExtendedInfo->palletsListMeasured : null;
387
+ $this->_palletsListCalculation = isset($stdResultPickingExtendedInfo->palletsListCalculation) ? $stdResultPickingExtendedInfo->palletsListCalculation : null;
388
+ $this->_specialDeliveryId = isset($stdResultPickingExtendedInfo->specialDeliveryId) ? $stdResultPickingExtendedInfo->specialDeliveryId : null;
389
+ $this->_optionsBeforePayment = isset($stdResultPickingExtendedInfo->optionsBeforePayment) ? new ResultOptionsBeforePayment($stdResultPickingExtendedInfo->optionsBeforePayment) : null;
390
+ $this->_specialDeliveryId = isset($stdResultPickingExtendedInfo->specialDeliveryId) ? $stdResultPickingExtendedInfo->specialDeliveryId : null;
391
+
392
+
393
+ $arrResultReturnServiceRequest = array();
394
+ if (isset($stdResultPickingExtendedInfo->retServicesRequest)) {
395
+ if (is_array($stdResultPickingExtendedInfo->retServicesRequest)) {
396
+ for($i = 0; $i < count($stdResultPickingExtendedInfo->retServicesRequest); $i++) {
397
+ $arrResultReturnServiceRequest[$i] = new ResultReturnServiceRequest($stdResultPickingExtendedInfo->retServicesRequest[$i]);
398
+ }
399
+ } else {
400
+ $arrResultReturnServiceRequest[0] = new ResultReturnServiceRequest($stdResultPickingExtendedInfo->retServicesRequest);
401
+ }
402
+ }
403
+ $this->_retServicesRequest = $arrResultReturnServiceRequest;
404
+
405
+
406
+ $this->_retShipmentRequest = isset($stdResultPickingExtendedInfo->retShipmentRequest) ? new ResultReturnShipmentRequest($stdResultPickingExtendedInfo->retShipmentRequest) : null;
407
+ $this->_retThirdPartyPayer = isset($stdResultPickingExtendedInfo->retThirdPartyPayer) ? $stdResultPickingExtendedInfo->retThirdPartyPayer : null;
408
+
409
+
410
+ $arrResultPackings = array();
411
+ if (isset($stdResultPickingExtendedInfo->packings)) {
412
+ if (is_array($stdResultPickingExtendedInfo->packings)) {
413
+ for($i = 0; $i < count($stdResultPickingExtendedInfo->packings); $i++) {
414
+ $arrResultPackings[$i] = new ResultPackings($stdResultPickingExtendedInfo->packings[$i]);
415
+ }
416
+ } else {
417
+ $arrResultPackings[0] = new ResultPackings($stdResultPickingExtendedInfo->packings);
418
+ }
419
+ }
420
+ $this->_packings = $arrResultPackings;
421
+
422
+
423
+ $this->_returnVoucher = isset($stdResultPickingExtendedInfo->returnVoucher) ? new ResultReturnVoucher($stdResultPickingExtendedInfo->returnVoucher) : null;
424
+ $this->_deliveryToFloorNo = isset($stdResultPickingExtendedInfo->deliveryToFloorNo) ? $stdResultPickingExtendedInfo->deliveryToFloorNo : null;
425
+ $this->_amounts = isset($stdResultPickingExtendedInfo->amounts) ? new ResultAmounts($stdResultPickingExtendedInfo->amounts) : null;
426
+ $this->_deadlineDelivery = isset($stdResultPickingExtendedInfo->deadlineDelivery) ? $stdResultPickingExtendedInfo->deadlineDelivery : null;
427
+ $this->_deliveryInfo = isset($stdResultPickingExtendedInfo->deliveryInfo) ? new ResultDeliveryInfo($stdResultPickingExtendedInfo->deliveryInfo) : null;
428
+ $this->_codPayment = isset($stdResultPickingExtendedInfo->codPayment) ? new CODPayment($stdResultPickingExtendedInfo->codPayment) : null;
429
+ $this->_redirectBillOfLading = isset($stdResultPickingExtendedInfo->redirectBillOfLading) ? $stdResultPickingExtendedInfo->redirectBillOfLading : null;
430
+ $this->_returnBillOfLading = isset($stdResultPickingExtendedInfo->returnBillOfLading) ? $stdResultPickingExtendedInfo->returnBillOfLading : null;
431
+ }
432
+
433
+ /**
434
+ * Get BOL of the secondary shipment.
435
+ * @return integer Signed 64-bit
436
+ */
437
+ public function getBillOfLading() {
438
+ return $this->_billOfLading;
439
+ }
440
+
441
+ /**
442
+ * Get taking date
443
+ * @return date Taking date
444
+ */
445
+ public function getTakingDate() {
446
+ return $this->_takingDate;
447
+ }
448
+
449
+ /**
450
+ * Get Courier service type ID
451
+ * @return signed integer 64-bit
452
+ */
453
+ public function getServiceTypeId() {
454
+ return $this->_serviceTypeId;
455
+ }
456
+
457
+ /**
458
+ * Get ID of an office "to be called"
459
+ * @return signed integer 64-bit
460
+ */
461
+ public function getOfficeToBeCalledId() {
462
+ return $this->_officeToBeCalledId;
463
+ }
464
+
465
+ /**
466
+ * Get Fixed time for delivery
467
+ * @return signed integer 16-bit
468
+ */
469
+ public function getFixedTimeDelivery() {
470
+ return $this->_fixedTimeDelivery;
471
+ }
472
+
473
+ /**
474
+ * Get Deferred delivery work days
475
+ * @return signed integer 32-bit
476
+ */
477
+ public function getDeferredDeliveryWorkDays() {
478
+ return $this->_deferredDeliveryWorkDays;
479
+ }
480
+
481
+ /**
482
+ * Get Indicates if the shipment has a "request for return documents"
483
+ * @return boolean
484
+ */
485
+ public function getBackDocumentsRequest() {
486
+ return $this->_backDocumentsRequest;
487
+ }
488
+
489
+ /**
490
+ * Get Indicates if the shipment has a "request for return receipt"
491
+ * @return boolean
492
+ */
493
+ public function getBackReceiptRequest() {
494
+ return $this->_backReceiptRequest;
495
+ }
496
+
497
+ /**
498
+ * Get ID of an office where the sender intends to deliver the shipment by him/herself. Non-null and non-zero value indicates this picking as "to office". Otherwise "from address" is considered.
499
+ * @return long
500
+ */
501
+ public function getWillBringToOfficeId() {
502
+ return $this->_willBringToOfficeId;
503
+ }
504
+
505
+ /**
506
+ * Get COD value is to be paid to a third party
507
+ * @return boolean
508
+ */
509
+ public function getPayCodToThirdParty() {
510
+ return $this->_payCodToThirdParty;
511
+ }
512
+
513
+ /**
514
+ * Get money-transfer request amount
515
+ * @return signed 64-bit real (nullable)
516
+ */
517
+ public function getRetMoneyTransferReqAmount() {
518
+ return $this->_retMoneyTransferReqAmount;
519
+ }
520
+
521
+ /**
522
+ * Get Parcels count
523
+ * @return signed integer 32-bit
524
+ */
525
+ public function getParcelsCount() {
526
+ return $this->_parcelsCount;
527
+ }
528
+
529
+ /**
530
+ * Get Declared weight
531
+ * @return signed 64-bit real
532
+ */
533
+ public function getWeightDeclared() {
534
+ return $this->_weightDeclared;
535
+ }
536
+
537
+ /**
538
+ * Get Measured weight
539
+ * @return signed 64-bit real (nullable)
540
+ */
541
+ public function getWeightMeasured() {
542
+ return $this->_weightMeasured;
543
+ }
544
+
545
+ /**
546
+ * Get Calculation weight
547
+ * @return signed 64-bit real (nullable)
548
+ */
549
+ public function getWeightCalculation() {
550
+ return $this->_weightCalculation;
551
+ }
552
+
553
+ /**
554
+ * Get Contents
555
+ * @return signed string
556
+ */
557
+ public function getContents() {
558
+ return $this->_contents;
559
+ }
560
+
561
+ /**
562
+ * Get Packing
563
+ * @return signed string
564
+ */
565
+ public function getPacking() {
566
+ return $this->_packing;
567
+ }
568
+
569
+ /**
570
+ * Get Indicates whether the shipment consists of documents
571
+ * @return signed boolean
572
+ */
573
+ public function getDocuments() {
574
+ return $this->_documents;
575
+ }
576
+
577
+ /**
578
+ * Get Indicates whether the shipment is fragile
579
+ * @return boolean
580
+ */
581
+ public function getFragile() {
582
+ return $this->_fragile;
583
+ }
584
+
585
+ /**
586
+ * Get Indicates whether the shipment is palletized
587
+ * @return boolean
588
+ */
589
+ public function getPalletized() {
590
+ return $this->_palletized;
591
+ }
592
+
593
+ /**
594
+ * Get Indicates whether the shipment is palletized
595
+ * @return boolean
596
+ */
597
+ public function getSender() {
598
+ return $this->_sender;
599
+ }
600
+
601
+ /**
602
+ * Get Indicates whether the shipment is palletized
603
+ * @return boolean
604
+ */
605
+ public function getReceiver() {
606
+ return $this->_receiver;
607
+ }
608
+
609
+ /**
610
+ * Get Payer type (0=sender, 1=receiver or 2=third party)
611
+ * @return 32-bit integer
612
+ */
613
+ public function getPayerType() {
614
+ return $this->_payerType;
615
+ }
616
+
617
+ /**
618
+ * Get Payer ID
619
+ * @return 64-bit integer (nullable)
620
+ */
621
+ public function getPayerRefId() {
622
+ return $this->_payerRefId;
623
+ }
624
+
625
+ /**
626
+ * Get Insurance payer type (0=sender, 1=reciever or 2=third party)
627
+ * @return 32-bit integer (nullable)
628
+ */
629
+ public function getPayerTypeInsurance() {
630
+ return $this->_payerTypeInsurance;
631
+ }
632
+
633
+ /**
634
+ * Get Insurance payer ID
635
+ * @return 64-bit integer (nullable)
636
+ */
637
+ public function getPayerRefInsuranceId() {
638
+ return $this->_payerRefInsuranceId;
639
+ }
640
+
641
+ /**
642
+ * Get Packings payer type (0=sender, 1=reciever or 2=third party)
643
+ * @return 32-bit integer (nullable)
644
+ */
645
+ public function getPayerTypePackings() {
646
+ return $this->_payerTypePackings;
647
+ }
648
+
649
+ /**
650
+ * Get Packings payer ID
651
+ * @return signed 64-bit integer (nullable)
652
+ */
653
+ public function getPayerRefPackingsId() {
654
+ return $this->_payerRefPackingsId;
655
+ }
656
+
657
+ /**
658
+ * Get Client's note
659
+ * @return string
660
+ */
661
+ public function getNoteClient() {
662
+ return $this->_noteClient;
663
+ }
664
+
665
+ /**
666
+ * Get Card/Coupon/Voucher number for fixed discount
667
+ * @return FixedDiscountCardId
668
+ */
669
+ public function getDiscCalc() {
670
+ return $this->_discCalc;
671
+ }
672
+
673
+ /**
674
+ * Get ID of the client who is to receive the return receipt and/or the return documents.
675
+ * @return signed 64-bit integer (nullable)
676
+ */
677
+ public function getRetToClientId() {
678
+ return $this->_retToClientId;
679
+ }
680
+
681
+ /**
682
+ * Get ID of the office which is to receive the return receipt and/or the return documents.
683
+ * @return signed 64-bit integer (nullable)
684
+ */
685
+ public function getRetToOfficeId() {
686
+ return $this->_retToOfficeId;
687
+ }
688
+
689
+ /**
690
+ * Get An optional reference code
691
+ * @return signed string
692
+ */
693
+ public function getRef1() {
694
+ return $this->_ref1;
695
+ }
696
+
697
+ /**
698
+ * Get An optional reference code
699
+ * @return signed string
700
+ */
701
+ public function getRef2() {
702
+ return $this->_ref2;
703
+ }
704
+
705
+ /**
706
+ * Get Data for parcels
707
+ * @return List<ResultParcelInfoEx>
708
+ */
709
+ public function getParcels() {
710
+ return $this->_parcels;
711
+ }
712
+
713
+ /**
714
+ * Get List of declared pallet details
715
+ * @return string
716
+ */
717
+ public function getPalletsListDeclared() {
718
+ return $this->_palletsListDeclared;
719
+ }
720
+
721
+ /**
722
+ * Get List of measured pallet details
723
+ * @return string
724
+ */
725
+ public function getPalletsListMeasured() {
726
+ return $this->_palletsListMeasured;
727
+ }
728
+
729
+ /**
730
+ * Get List of calculation pallet details
731
+ * @return string
732
+ */
733
+ public function getPalletsListCalculation() {
734
+ return $this->_palletsListCalculation;
735
+ }
736
+
737
+ /**
738
+ * Get a special delivery ID
739
+ * @return 32-bit integer (nullable)
740
+ */
741
+ public function getSpecialDeliveryId() {
742
+ return $this->_specialDeliveryId;
743
+ }
744
+
745
+ /**
746
+ * Get Optional services, allowed before payment, when cash on delivery or money transfer is enabled for the picking.
747
+ * @return ResultOptionsBeforePayment
748
+ */
749
+ public function getOptionsBeforePayment() {
750
+ return $this->_optionsBeforePayment;
751
+ }
752
+
753
+ /**
754
+ * Get List of return services request.
755
+ * @return List<ResultReturnServiceRequest>
756
+ */
757
+ public function getRetServicesRequest() {
758
+ return $this->_retServicesRequest;
759
+ }
760
+
761
+ /**
762
+ * Get Return shipment request
763
+ * @return ResultReturnShipmentRequest
764
+ */
765
+ public function getRetShipmentRequest() {
766
+ return $this->_retShipmentRequest;
767
+ }
768
+
769
+ /**
770
+ * Get Specifies if the payer of the return receipt and/or the return documents is the same third party, which is also the payer of the courier service.
771
+ * @return boolean
772
+ */
773
+ public function getRetThirdPartyPayer() {
774
+ return $this->_retThirdPartyPayer;
775
+ }
776
+
777
+ /**
778
+ * Get Packings details.
779
+ * @return List<ResultPackings>
780
+ */
781
+ public function getPackings() {
782
+ return $this->_packings;
783
+ }
784
+
785
+ /**
786
+ * Get Details for return voucher
787
+ * @return ResultReturnVoucher
788
+ */
789
+ public function getReturnVoucher() {
790
+ return $this->_returnVoucher;
791
+ }
792
+
793
+ /**
794
+ * Get Indicates the floor, which the shipment should be delivered to.
795
+ * @return 32-bit integer (nullable)
796
+ */
797
+ public function getDeliveryToFloorNo() {
798
+ return $this->_deliveryToFloorNo;
799
+ }
800
+
801
+ /**
802
+ * Get Amounts.
803
+ * @return ResultAmounts
804
+ */
805
+ public function getAmounts() {
806
+ return $this->_amounts;
807
+ }
808
+
809
+ /**
810
+ * Get Deadline for delivery.
811
+ * @return date
812
+ */
813
+ public function getDeadlineDelivery() {
814
+ return $this->_deadlineDelivery;
815
+ }
816
+
817
+ /**
818
+ * Get Delivery information.
819
+ * @return ResultDeliveryInfo
820
+ */
821
+ public function getDeliveryInfo() {
822
+ return $this->_deliveryInfo;
823
+ }
824
+
825
+ /**
826
+ * Get COD payment information.
827
+ * @return CODPayment
828
+ */
829
+ public function getCodPayment() {
830
+ return $this->_codPayment;
831
+ }
832
+
833
+ /**
834
+ * Get BOL number of redirect picking.
835
+ * @return 64-bit integer (nullable)
836
+ */
837
+ public function getRedirectBillOfLading() {
838
+ return $this->_redirectBillOfLading;
839
+ }
840
+
841
+ /**
842
+ * Get BOL number of return pickings.
843
+ * @return 64-bit integer (nullable)
844
+ */
845
+ public function getReturnBillOfLading() {
846
+ return $this->_returnBillOfLading;
847
+ }
848
+
849
+ }
850
+ ?>
lib/SpeedyEPS/ver01/ResultReturnVoucher.class.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instances of this class are used as a result of make picking info methods
5
+ * @since 2.9.0
6
+ */
7
+ class ResultReturnVoucher {
8
+
9
+ /**
10
+ * Service type id.
11
+ * @var signed 64-bit integer
12
+ */
13
+ protected $_serviceTypeId;
14
+
15
+ /**
16
+ * Payer type (0=sender, 1=receiver or 2=third party)
17
+ * @var signed 32-bit integer
18
+ */
19
+ protected $_payerType;
20
+
21
+ /**
22
+ * Constructs new instance of this class
23
+ * @param $stdClassResultAddressString
24
+ */
25
+ function __construct($stdClassResultReturnVoucher) {
26
+ $this->_serviceTypeId = isset($stdClassResultReturnVoucher->serviceTypeId) ? $stdClassResultReturnVoucher->serviceTypeId : null;
27
+ $this->_payerType = isset($stdClassResultReturnVoucher->payerType) ? $stdClassResultReturnVoucher->payerType : null;
28
+ }
29
+
30
+ /**
31
+ * Get Service type id.
32
+ * @return 64-bit integer
33
+ */
34
+ public function getServiceTypeId() {
35
+ return $this->_serviceTypeId;
36
+ }
37
+
38
+
39
+ /**
40
+ * Get Payer type (0=sender, 1=receiver or 2=third party).
41
+ * @return 32-bit integer
42
+ */
43
+ public function getPayerType() {
44
+ return $this->_payerType;
45
+ }
46
+
47
+ }
48
+ ?>
lib/SpeedyEPS/ver01/ResultTrackPicking.class.php CHANGED
@@ -60,20 +60,36 @@ class ResultTrackPicking {
60
  */
61
  private $_signatureImage;
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Constructs new instance of ResultTrackPicking
65
  * @param stdClass $stdClassResultTrackPicking
66
  */
67
  function __construct($stdClassResultTrackPicking) {
68
- $this->_barcode = isset($stdClassResultTrackPicking->barcode) ? $stdClassResultTrackPicking->barcode : null;
69
- $this->_moment = isset($stdClassResultTrackPicking->moment) ? $stdClassResultTrackPicking->moment : null;
70
- $this->_operationCode = isset($stdClassResultTrackPicking->operationCode) ? $stdClassResultTrackPicking->operationCode : null;
71
- $this->_operationDescription = isset($stdClassResultTrackPicking->operationDescription) ? $stdClassResultTrackPicking->operationDescription : null;
72
- $this->_operationComment = isset($stdClassResultTrackPicking->operationComment) ? $stdClassResultTrackPicking->operationComment : null;
73
- $this->_siteType = isset($stdClassResultTrackPicking->siteType) ? $stdClassResultTrackPicking->siteType : null;
74
- $this->_siteName = isset($stdClassResultTrackPicking->siteName) ? $stdClassResultTrackPicking->siteName : null;
75
- $this->_consignee = isset($stdClassResultTrackPicking->consignee) ? $stdClassResultTrackPicking->consignee : null;
76
- $this->_signatureImage = isset($stdClassResultTrackPicking->signatureImage) ? $stdClassResultTrackPicking->signatureImage : null;
 
 
77
  }
78
 
79
  /**
@@ -149,5 +165,24 @@ class ResultTrackPicking {
149
  public function getSignatureImage() {
150
  return $this->_signatureImage;
151
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  }
153
  ?>
60
  */
61
  private $_signatureImage;
62
 
63
+ /**
64
+ * Foreign parcel number associated with this parcel
65
+ * @var string
66
+ * @since 2.9.0
67
+ */
68
+ private $_foreignParcelNumber;
69
+
70
+ /**
71
+ * List of exception codes.
72
+ * @var List of signed 32-bit integer (nullable)
73
+ * @since 2.9.0
74
+ */
75
+ private $_exceptionCodes;
76
+
77
  /**
78
  * Constructs new instance of ResultTrackPicking
79
  * @param stdClass $stdClassResultTrackPicking
80
  */
81
  function __construct($stdClassResultTrackPicking) {
82
+ $this->_barcode = isset($stdClassResultTrackPicking->barcode) ? $stdClassResultTrackPicking->barcode : null;
83
+ $this->_moment = isset($stdClassResultTrackPicking->moment) ? $stdClassResultTrackPicking->moment : null;
84
+ $this->_operationCode = isset($stdClassResultTrackPicking->operationCode) ? $stdClassResultTrackPicking->operationCode : null;
85
+ $this->_operationDescription = isset($stdClassResultTrackPicking->operationDescription) ? $stdClassResultTrackPicking->operationDescription : null;
86
+ $this->_operationComment = isset($stdClassResultTrackPicking->operationComment) ? $stdClassResultTrackPicking->operationComment : null;
87
+ $this->_siteType = isset($stdClassResultTrackPicking->siteType) ? $stdClassResultTrackPicking->siteType : null;
88
+ $this->_siteName = isset($stdClassResultTrackPicking->siteName) ? $stdClassResultTrackPicking->siteName : null;
89
+ $this->_consignee = isset($stdClassResultTrackPicking->consignee) ? $stdClassResultTrackPicking->consignee : null;
90
+ $this->_signatureImage = isset($stdClassResultTrackPicking->signatureImage) ? $stdClassResultTrackPicking->signatureImage : null;
91
+ $this->_foreignParcelNumber = isset($stdClassResultTrackPickingEx->foreignParcelNumber)? $stdClassResultTrackPickingEx->foreignParcelNumber : null;
92
+ $this->_exceptionCodes = isset($stdClassResultTrackPickingEx->exceptionCodes) ? $stdClassResultTrackPickingEx->exceptionCodes : null;
93
  }
94
 
95
  /**
165
  public function getSignatureImage() {
166
  return $this->_signatureImage;
167
  }
168
+
169
+ /**
170
+ * Get foreignParcelNumber
171
+ * @return string
172
+ * @since 2.9.0
173
+ */
174
+ public function getForeignParcelNumber() {
175
+ return $this->_foreignParcelNumber;
176
+ }
177
+
178
+ /**
179
+ * Get list of exception codes.
180
+ * @return list of signed 32-bit integer (nullable)
181
+ * @since 2.9.0
182
+ */
183
+ public function getExceptionCodes() {
184
+ return $this->_exceptionCodes;
185
+ }
186
+
187
  }
188
  ?>
lib/SpeedyEPS/ver01/ResultTrackPickingEx.class.php CHANGED
@@ -73,12 +73,26 @@ class ResultTrackPickingEx {
73
  */
74
  private $_signatureImage;
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * Constructs new instance of ResultTrackPickingEx
78
  * @param stdClass $stdClassResultTrackPickingEx
79
  */
80
  function __construct($stdClassResultTrackPickingEx) {
81
- $this->_barcode = isset($stdClassResultTrackPickingEx->barcode) ? $stdClassResultTrackPickingEx->barcode : null;
82
  $this->_moment = isset($stdClassResultTrackPickingEx->moment) ? $stdClassResultTrackPickingEx->moment : null;
83
  $this->_operationCode = isset($stdClassResultTrackPickingEx->operationCode) ? $stdClassResultTrackPickingEx->operationCode : null;
84
  $this->_operationDescription = isset($stdClassResultTrackPickingEx->operationDescription) ? $stdClassResultTrackPickingEx->operationDescription : null;
@@ -89,6 +103,8 @@ class ResultTrackPickingEx {
89
  $this->_returnBillOfLading = isset($stdClassResultTrackPickingEx->returnBillOfLading) ? $stdClassResultTrackPickingEx->returnBillOfLading : null;
90
  $this->_redirectBillOfLading = isset($stdClassResultTrackPickingEx->redirectBillOfLading) ? $stdClassResultTrackPickingEx->redirectBillOfLading : null;
91
  $this->_signatureImage = isset($stdClassResultTrackPickingEx->signatureImage) ? $stdClassResultTrackPickingEx->signatureImage : null;
 
 
92
  }
93
 
94
  /**
@@ -180,5 +196,24 @@ class ResultTrackPickingEx {
180
  public function getSignatureImage() {
181
  return $this->_signatureImage;
182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
  ?>
73
  */
74
  private $_signatureImage;
75
 
76
+ /**
77
+ * Foreign parcel number associated with this parcel
78
+ * @var string
79
+ * @since 2.9.0
80
+ */
81
+ private $_foreignParcelNumber;
82
+
83
+ /**
84
+ * List of exception codes.
85
+ * @var List of signed 32-bit integer (nullable)
86
+ * @since 2.9.0
87
+ */
88
+ private $_exceptionCodes;
89
+
90
  /**
91
  * Constructs new instance of ResultTrackPickingEx
92
  * @param stdClass $stdClassResultTrackPickingEx
93
  */
94
  function __construct($stdClassResultTrackPickingEx) {
95
+ $this->_barcode = isset($stdClassResultTrackPickingEx->barcode) ? $stdClassResultTrackPickingEx->barcode : null;
96
  $this->_moment = isset($stdClassResultTrackPickingEx->moment) ? $stdClassResultTrackPickingEx->moment : null;
97
  $this->_operationCode = isset($stdClassResultTrackPickingEx->operationCode) ? $stdClassResultTrackPickingEx->operationCode : null;
98
  $this->_operationDescription = isset($stdClassResultTrackPickingEx->operationDescription) ? $stdClassResultTrackPickingEx->operationDescription : null;
103
  $this->_returnBillOfLading = isset($stdClassResultTrackPickingEx->returnBillOfLading) ? $stdClassResultTrackPickingEx->returnBillOfLading : null;
104
  $this->_redirectBillOfLading = isset($stdClassResultTrackPickingEx->redirectBillOfLading) ? $stdClassResultTrackPickingEx->redirectBillOfLading : null;
105
  $this->_signatureImage = isset($stdClassResultTrackPickingEx->signatureImage) ? $stdClassResultTrackPickingEx->signatureImage : null;
106
+ $this->_foreignParcelNumber = isset($stdClassResultTrackPickingEx->foreignParcelNumber) ? $stdClassResultTrackPickingEx->foreignParcelNumber : null;
107
+ $this->_exceptionCodes = isset($stdClassResultTrackPickingEx->exceptionCodes) ? $stdClassResultTrackPickingEx->exceptionCodes : null;
108
  }
109
 
110
  /**
196
  public function getSignatureImage() {
197
  return $this->_signatureImage;
198
  }
199
+
200
+ /**
201
+ * Get foreignParcelNumber
202
+ * @return string
203
+ * @since 2.9.0
204
+ */
205
+ public function getForeignParcelNumber() {
206
+ return $this->_foreignParcelNumber;
207
+ }
208
+
209
+ /**
210
+ * Get list of exception codes.
211
+ * @return list of signed 32-bit integer (nullable)
212
+ * @since 2.9.0
213
+ */
214
+ public function getExceptionCodes() {
215
+ return $this->_exceptionCodes;
216
+ }
217
+
218
  }
219
  ?>
lib/SpeedyEPS/ver01/soap/EPSSOAPInterfaceImpl.class.php CHANGED
@@ -1,1414 +1,1467 @@
1
- <?php
2
-
3
- require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'EPSInterface.class.php';
4
-
5
- /**
6
- * Speedy SOAP EPS ver01 Service Interface Implementation
7
- */
8
- class EPSSOAPInterfaceImpl extends SoapClient implements EPSInterface {
9
-
10
- /**
11
- * Speedy SOAP WSDL version 01 URL
12
- * @var string
13
- */
14
- const SPEEDY_SOAP_WSDL_V01_URL = 'https://www.speedy.bg/eps/main01.wsdl';
15
-
16
- /**
17
- * Constructs new instance of SOAP service
18
- * @param string $wsdlURL
19
- * @param options[optional]
20
- */
21
- function __construct($wsdlURL=self::SPEEDY_SOAP_WSDL_V01_URL, $options=null) {
22
- if (is_null($options)) {
23
- parent::SoapClient($wsdlURL);
24
- } else {
25
- parent::SoapClient($wsdlURL, $options);
26
- }
27
- // echo('<BR>Connected to '.$wsdlURL);
28
- }
29
-
30
- /**
31
- * @see EPSInterface::login()
32
- */
33
- public function login($username, $password) {
34
- try {
35
- $loginSdtClass = new stdClass();
36
- $loginSdtClass->username = $username;
37
- $loginSdtClass->password = $password;
38
- $response = parent::login($loginSdtClass);
39
- if (isset($response->return)) {
40
- $resultLogin = new ResultLogin($response->return);
41
- } else {
42
- $resultLogin = null;
43
- }
44
- return $resultLogin;
45
- } catch (SoapFault $sf) {
46
- throw new ServerException($sf);
47
- }
48
- }
49
-
50
- /**
51
- * @see EPSInterface::isSessionActive()
52
- */
53
- public function isSessionActive($sessionId, $refreshSession) {
54
- try {
55
- $isSessionActiveSdtClass = new stdClass();
56
- $isSessionActiveSdtClass->sessionId = $sessionId;
57
- $isSessionActiveSdtClass->refreshSession = $refreshSession;
58
- $response = parent::isSessionActive($isSessionActiveSdtClass);
59
- if (isset($response->return)) {
60
- $isSessionActiveFlag = $response->return;
61
- } else {
62
- $isSessionActiveFlag = false;
63
- }
64
- return $isSessionActiveFlag;
65
- } catch (SoapFault $sf) {
66
- throw new ServerException($sf);
67
- }
68
- }
69
-
70
- /**
71
- * @see EPSInterface::listServices()
72
- */
73
- public function listServices($sessionId, $date, $language) {
74
- try {
75
- $listServicesStdObject = new stdClass();
76
- $listServicesStdObject->sessionId = $sessionId;
77
- $listServicesStdObject->date = $date;
78
- $listServicesStdObject->language = $language;
79
- $response = parent::listServices($listServicesStdObject);
80
- $arrListServices = array();
81
- if (isset($response->return)) {
82
- $arrStdServices = $response->return;
83
- if (is_array($arrStdServices)) {
84
- for($i = 0; $i < count($arrStdServices); $i++) {
85
- $arrListServices[$i] = new ResultCourierService($arrStdServices[$i]);
86
- }
87
- } else {
88
- $arrListServices[0] = new ResultCourierService($arrStdServices);
89
- }
90
- }
91
- return $arrListServices;
92
- } catch (SoapFault $sf) {
93
- throw new ServerException($sf);
94
- }
95
- }
96
-
97
- /**
98
- * @see EPSInterface::listServicesForSites()
99
- */
100
- public function listServicesForSites(
101
- $sessionId, $date, $senderSiteId, $receiverSiteId,
102
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language
103
- ) {
104
- try {
105
- $listServicesForSitesStdObject = new stdClass();
106
- $listServicesForSitesStdObject->sessionId = $sessionId;
107
- $listServicesForSitesStdObject->date = $date;
108
- $listServicesForSitesStdObject->senderSiteId = $senderSiteId;
109
- $listServicesForSitesStdObject->receiverSiteId = $receiverSiteId;
110
- $listServicesForSitesStdObject->senderCountryId = $senderCountryId;
111
- $listServicesForSitesStdObject->senderPostCode = $senderPostCode;
112
- $listServicesForSitesStdObject->receiverCountryId = $receiverCountryId;
113
- $listServicesForSitesStdObject->receiverPostCode = $receiverPostCode;
114
- $listServicesForSitesStdObject->language = $language;
115
- $response = parent::listServicesForSites($listServicesForSitesStdObject);
116
- $arrServicesForSitesStdObject = array();
117
- if (isset($response->return)) {
118
- $arrStdServicesForSites = $response->return;
119
- if (is_array($arrStdServicesForSites)) {
120
- for($i = 0; $i < count($arrStdServicesForSites); $i++) {
121
- $arrServicesForSitesStdObject[$i] = new ResultCourierServiceExt($arrStdServicesForSites[$i]);
122
- }
123
- } else {
124
- $arrServicesForSitesStdObject[0] = new ResultCourierServiceExt($arrStdServicesForSites);
125
- }
126
- }
127
- return $arrServicesForSitesStdObject;
128
- } catch (SoapFault $sf) {
129
- throw new ServerException($sf);
130
- }
131
- }
132
-
133
- /**
134
- * @see EPSInterface::listSites()
135
- */
136
- public function listSites($sessionId, $type, $name, $language) {
137
- try {
138
- $listSitesStdObject = new stdClass();
139
- $listSitesStdObject->sessionId = $sessionId;
140
- $listSitesStdObject->type = $type;
141
- $listSitesStdObject->name = $name;
142
- $listSitesStdObject->language = $language;
143
- $response = parent::listSites($listSitesStdObject);
144
- $arrListSites = array();
145
- if (isset($response->return)) {
146
- $arrStdSites = $response->return;
147
- if (is_array($arrStdSites)) {
148
- for($i = 0; $i < count($arrStdSites); $i++) {
149
- $arrListSites[$i] = new ResultSite($arrStdSites[$i]);
150
- }
151
- } else {
152
- $arrListSites[0] = new ResultSite($arrStdSites);
153
- }
154
- }
155
- return $arrListSites;
156
- } catch (SoapFault $sf) {
157
- throw new ServerException($sf);
158
- }
159
- }
160
-
161
- /**
162
- * @see EPSInterface::listSites()
163
- */
164
- public function listSitesEx($sessionId, $paramFilterSite, $language) {
165
- try {
166
- $listSitesExStdObject = new stdClass();
167
- $listSitesExStdObject->sessionId = $sessionId;
168
- $listSitesExStdObject->filter = $paramFilterSite->toStdClass();
169
- $listSitesExStdObject->language = $language;
170
-
171
- $response = parent::listSitesEx($listSitesExStdObject);
172
- $arrListSitesEx = array();
173
- if (isset($response->return)) {
174
- $arrStdSitesEx = $response->return;
175
- if (is_array($arrStdSitesEx)) {
176
- for($i = 0; $i < count($arrStdSitesEx); $i++) {
177
- $arrListSitesEx[$i] = new ResultSiteEx($arrStdSitesEx[$i]);
178
- }
179
- } else {
180
- $arrListSitesEx[0] = new ResultSiteEx($arrStdSitesEx);
181
- }
182
- }
183
- return $arrListSitesEx;
184
- } catch (SoapFault $sf) {
185
- throw new ServerException($sf);
186
- }
187
- }
188
-
189
- /**
190
- * @see EPSInterface::getWeightInterval()
191
- */
192
- public function getWeightInterval(
193
- $sessionId, $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
194
- $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode
195
- ) {
196
- try {
197
- $getWeightIntervalStdObject = new stdClass();
198
- $getWeightIntervalStdObject->sessionId = $sessionId;
199
- $getWeightIntervalStdObject->serviceTypeId = $serviceTypeId;
200
- $getWeightIntervalStdObject->senderSiteId = $senderSiteId;
201
- $getWeightIntervalStdObject->receiverSiteId = $receiverSiteId;
202
- $getWeightIntervalStdObject->date = $date;
203
- $getWeightIntervalStdObject->documents = $documents;
204
- $getWeightIntervalStdObject->senderCountryId = $senderCountryId;
205
- $getWeightIntervalStdObject->senderPostCode = $senderPostCode;
206
- $getWeightIntervalStdObject->receiverCountryId = $receiverCountryId;
207
- $getWeightIntervalStdObject->receiverPostCode = $receiverPostCode;
208
-
209
- $response = parent::getWeightInterval($getWeightIntervalStdObject);
210
- if (isset($response->return)) {
211
- $resultMinMaxReal = new ResultMinMaxReal($response->return);
212
- } else {
213
- $resultMinMaxReal = null;
214
- }
215
- return $resultMinMaxReal;
216
- } catch (SoapFault $sf) {
217
- throw new ServerException($sf);
218
- }
219
- }
220
-
221
- /**
222
- * @see EPSInterface::getAddressNomenclature()
223
- */
224
- public function getAddressNomenclature($sessionId, $nomenType, $countryId) {
225
- try {
226
- $getAddressNomenclatureStdObject = new stdClass();
227
- $getAddressNomenclatureStdObject->sessionId = $sessionId;
228
- $getAddressNomenclatureStdObject->nomenType = $nomenType;
229
- $getAddressNomenclatureStdObject->countryId = $countryId;
230
-
231
- $response = parent::getAddressNomenclature($getAddressNomenclatureStdObject);
232
- if (isset($response->return)) {
233
- $getAddressNomenclature = $response->return;
234
- } else {
235
- $getAddressNomenclature = null;
236
- }
237
- return $getAddressNomenclature;
238
- } catch (SoapFault $sf) {
239
- throw new ServerException($sf);
240
- }
241
- }
242
-
243
- /**
244
- * @see EPSInterface::listAllSites()
245
- */
246
- public function listAllSites($sessionId, $language, $countryId) {
247
- try {
248
- $listAllSitesStdObject = new stdClass();
249
- $listAllSitesStdObject->sessionId = $sessionId;
250
- $listAllSitesStdObject->language = $language;
251
- $listAllSitesStdObject->countryId = $countryId;
252
-
253
- $response = parent::listAllSites($listAllSitesStdObject);
254
- $arrListAllSites = array();
255
- if (isset($response->return)) {
256
- $arrStdAllSites = $response->return;
257
- if (is_array($arrStdAllSites)) {
258
- for($i = 0; $i < count($arrStdAllSites); $i++) {
259
- $arrListAllSites[$i] = new ResultSite($arrStdAllSites[$i]);
260
- }
261
- } else {
262
- $arrListAllSites[0] = new ResultSite($arrStdAllSites);
263
- }
264
- }
265
- return $arrListAllSites;
266
- } catch (SoapFault $sf) {
267
- throw new ServerException($sf);
268
- }
269
- }
270
-
271
- /**
272
- * @see EPSInterface::getSiteById()
273
- */
274
- public function getSiteById($sessionId, $siteId) {
275
- try {
276
- $getSiteByIdStdObject = new stdClass();
277
- $getSiteByIdStdObject->sessionId = $sessionId;
278
- $getSiteByIdStdObject->siteId = $siteId;
279
- $response = parent::getSiteById($getSiteByIdStdObject);
280
- if (isset($response->return)) {
281
- $resultSite = new ResultSite($response->return);
282
- } else {
283
- $resultSite = null;
284
- }
285
- return $resultSite;
286
- } catch (SoapFault $sf) {
287
- throw new ServerException($sf);
288
- }
289
- }
290
-
291
- /**
292
- * @see EPSInterface::getSitesByAddrNomenType()
293
- */
294
- public function getSitesByAddrNomenType($sessionId, $addrNomen) {
295
- try {
296
- $getSitesByAddrNomenTypeStdObject = new stdClass();
297
- $getSitesByAddrNomenTypeStdObject->sessionId = $sessionId;
298
- $getSitesByAddrNomenTypeStdObject->addrNomen = $addrNomen;
299
- $response = parent::getSitesByAddrNomenType($getSitesByAddrNomenTypeStdObject);
300
- $arrListSitesByAddrNomenType = array();
301
- if (isset($response->return)) {
302
- $arrStdSitesByAddrNomenType = $response->return;
303
- if (is_array($arrStdSitesByAddrNomenType)) {
304
- for($i = 0; $i < count($arrStdSitesByAddrNomenType); $i++) {
305
- $arrListSitesByAddrNomenType[$i] = new ResultSite($arrStdSitesByAddrNomenType[$i]);
306
- }
307
- } else {
308
- $arrListSitesByAddrNomenType[0] = new ResultSite($arrStdSitesByAddrNomenType);
309
- }
310
- }
311
- return $arrListSitesByAddrNomenType;
312
- } catch (SoapFault $sf) {
313
- throw new ServerException($sf);
314
- }
315
- }
316
-
317
- /**
318
- * @see EPSInterface::listStreetTypes()
319
- */
320
- public function listStreetTypes($sessionId, $language) {
321
- try {
322
- $listStreetTypesStdObject = new stdClass();
323
- $listStreetTypesStdObject->sessionId = $sessionId;
324
- $listStreetTypesStdObject->language = $language;
325
-
326
- $response = parent::listStreetTypes($listStreetTypesStdObject);
327
- $arrListStreetTypes = array();
328
- if (isset($response->return)) {
329
- $arrStdListStreetTypes = $response->return;
330
- if (is_array($arrStdListStreetTypes)) {
331
- for($i = 0; $i < count($arrStdListStreetTypes); $i++) {
332
- $arrListStreetTypes[$i] = $arrStdListStreetTypes[$i];
333
- }
334
- } else {
335
- $arrListStreetTypes[0] = $arrStdListStreetTypes;
336
- }
337
- }
338
- return $arrListStreetTypes;
339
- } catch (SoapFault $sf) {
340
- throw new ServerException($sf);
341
- }
342
- }
343
-
344
- /**
345
- * @see EPSInterface::listQuarterTypes()
346
- */
347
- public function listQuarterTypes($sessionId, $language) {
348
- try {
349
- $listQuarterTypesStdObject = new stdClass();
350
- $listQuarterTypesStdObject->sessionId = $sessionId;
351
- $listQuarterTypesStdObject->language = $language;
352
-
353
- $response = parent::listQuarterTypes($listQuarterTypesStdObject);
354
- $arrListQuarterTypes = array();
355
- if (isset($response->return)) {
356
- $arrStdListQuarterTypes = $response->return;
357
- if (is_array($arrStdListQuarterTypes)) {
358
- for($i = 0; $i < count($arrStdListQuarterTypes); $i++) {
359
- $arrListQuarterTypes[$i] = $arrStdListQuarterTypes[$i];
360
- }
361
- } else {
362
- $arrListQuarterTypes[0] = $arrStdListQuarterTypes;
363
- }
364
- }
365
- return $arrListQuarterTypes;
366
- } catch (SoapFault $sf) {
367
- throw new ServerException($sf);
368
- }
369
- }
370
-
371
- /**
372
- * @see EPSInterface::listStreets()
373
- */
374
- public function listStreets($sessionId, $name, $siteId, $language) {
375
- try {
376
- $listStreetsStdObject = new stdClass();
377
- $listStreetsStdObject->sessionId = $sessionId;
378
- $listStreetsStdObject->name = $name;
379
- $listStreetsStdObject->siteId = $siteId;
380
- $listStreetsStdObject->language = $language;
381
-
382
- $response = parent::listStreets($listStreetsStdObject);
383
- $arrlistStreets = array();
384
- if (isset($response->return)) {
385
- $arrStdListStreets = $response->return;
386
- if (is_array($arrStdListStreets)) {
387
- for($i = 0; $i < count($arrStdListStreets); $i++) {
388
- $arrlistStreets[$i] = new ResultStreet($arrStdListStreets[$i]);
389
- }
390
- } else {
391
- $arrlistStreets[0] = new ResultStreet($arrStdListStreets);
392
- }
393
- }
394
- return $arrlistStreets;
395
- } catch (SoapFault $sf) {
396
- throw new ServerException($sf);
397
- }
398
- }
399
-
400
- /**
401
- * @see EPSInterface::listQuarters()
402
- */
403
- public function listQuarters($sessionId, $name, $siteId, $language) {
404
- try {
405
- $listQuartersStdObject = new stdClass();
406
- $listQuartersStdObject->sessionId = $sessionId;
407
- $listQuartersStdObject->name = $name;
408
- $listQuartersStdObject->siteId = $siteId;
409
- $listQuartersStdObject->language = $language;
410
-
411
- $response = parent::listQuarters($listQuartersStdObject);
412
- $arrListQuarters = array();
413
- if (isset($response->return)) {
414
- $arrStdListQuarters = $response->return;
415
- if (is_array($arrStdListQuarters)) {
416
- for($i = 0; $i < count($arrStdListQuarters); $i++) {
417
- $arrListQuarters[$i] = new ResultQuarter($arrStdListQuarters[$i]);
418
- }
419
- } else {
420
- $arrListQuarters[0] = new ResultQuarter($arrStdListQuarters);
421
- }
422
- }
423
- return $arrListQuarters;
424
- } catch (SoapFault $sf) {
425
- throw new ServerException($sf);
426
- }
427
- }
428
-
429
- /**
430
- * @see EPSInterface::listCommonObjects()
431
- */
432
- public function listCommonObjects($sessionId, $name, $siteId, $language) {
433
- try {
434
- $listCommonObjectsStdObject = new stdClass();
435
- $listCommonObjectsStdObject->sessionId = $sessionId;
436
- $listCommonObjectsStdObject->name = $name;
437
- $listCommonObjectsStdObject->siteId = $siteId;
438
- $listCommonObjectsStdObject->language = $language;
439
- $response = parent::listCommonObjects($listCommonObjectsStdObject);
440
- $arrListCommonObjects = array();
441
- if (isset($response->return)) {
442
- $arrStdListCommonObjects = $response->return;
443
- if (is_array($arrStdListCommonObjects)) {
444
- for($i = 0; $i < count($arrStdListCommonObjects); $i++) {
445
- $arrListCommonObjects[$i] = new ResultCommonObject($arrStdListCommonObjects[$i]);
446
- }
447
- } else {
448
- $arrListCommonObjects[0] = new ResultCommonObject($arrStdListCommonObjects);
449
- }
450
- }
451
- return $arrListCommonObjects;
452
- } catch (SoapFault $sf) {
453
- throw new ServerException($sf);
454
- }
455
- }
456
-
457
- /**
458
- * @see EPSInterface::listBlocks()
459
- */
460
- public function listBlocks($sessionId, $name, $siteId, $language) {
461
- try {
462
- $listBlocksStdObject = new stdClass();
463
- $listBlocksStdObject->sessionId = $sessionId;
464
- $listBlocksStdObject->name = $name;
465
- $listBlocksStdObject->siteId = $siteId;
466
- $listBlocksStdObject->language = $language;
467
- $response = parent::listBlocks($listBlocksStdObject);
468
- $arrListBlocks = array();
469
- if (isset($response->return)) {
470
- $arrStdListBlocks = $response->return;
471
- if (is_array($arrStdListBlocks)) {
472
- for($i = 0; $i < count($arrStdListBlocks); $i++) {
473
- $arrListBlocks[$i] = $arrStdListBlocks[$i];
474
- }
475
- } else {
476
- $arrListBlocks[0] = $arrStdListBlocks;
477
- }
478
- }
479
- return $arrListBlocks;
480
- } catch (SoapFault $sf) {
481
- throw new ServerException($sf);
482
- }
483
- }
484
-
485
- /**
486
- * @see EPSInterface::listOffices()
487
- */
488
- public function listOffices($sessionId, $name, $siteId) {
489
- try {
490
- $listOfficesStdObject = new stdClass();
491
- $listOfficesStdObject->sessionId = $sessionId;
492
- $listOfficesStdObject->name = $name;
493
- $listOfficesStdObject->siteId = $siteId;
494
- $response = parent::listOffices($listOfficesStdObject);
495
- $arrListOffices = array();
496
- if (isset($response->return)) {
497
- $arrStdListOffices = $response->return;
498
- if (is_array($arrStdListOffices)) {
499
- for($i = 0; $i < count($arrStdListOffices); $i++) {
500
- $arrListOffices[$i] = new ResultOffice($arrStdListOffices[$i]);
501
- }
502
- } else {
503
- $arrListOffices[0] = new ResultOffice($arrStdListOffices);
504
- }
505
- }
506
- return $arrListOffices;
507
- } catch (SoapFault $sf) {
508
- throw new ServerException($sf);
509
- }
510
- }
511
-
512
- /**
513
- * @see EPSInterface::getClientById($sessionId, $clientId)
514
- */
515
- public function getClientById($sessionId, $clientId) {
516
- try {
517
- $getClientByIdStdObject = new stdClass();
518
- $getClientByIdStdObject->sessionId = $sessionId;
519
- $getClientByIdStdObject->clientId = $clientId;
520
- $response = parent::getClientById($getClientByIdStdObject);
521
- if (isset($response->return)) {
522
- $resultClientData = new ResultClientData($response->return);
523
- } else {
524
- $resultClientData = null;
525
- }
526
- return $resultClientData;
527
- } catch (SoapFault $sf) {
528
- throw new ServerException($sf);
529
- }
530
- }
531
-
532
- /**
533
- * @see EPSInterface::getAllowedDaysForTaking()
534
- */
535
- public function getAllowedDaysForTaking(
536
- $sessionId, $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId, $senderPostCode
537
- ) {
538
- try {
539
- $getAllowedDaysForTakingStdObject = new stdClass();
540
- $getAllowedDaysForTakingStdObject->sessionId = $sessionId;
541
- $getAllowedDaysForTakingStdObject->serviceTypeId = $serviceTypeId;
542
- $getAllowedDaysForTakingStdObject->senderSiteId = $senderSiteId;
543
- $getAllowedDaysForTakingStdObject->senderOfficeId = $senderOfficeId;
544
- $getAllowedDaysForTakingStdObject->minDate = $minDate;
545
- $getAllowedDaysForTakingStdObject->senderCountryId = $senderCountryId;
546
- $getAllowedDaysForTakingStdObject->senderPostCode = $senderPostCode;
547
-
548
- $response = parent::getAllowedDaysForTaking($getAllowedDaysForTakingStdObject);
549
- $arrGetAllowedDaysForTaking = array();
550
- if (isset($response->return)) {
551
- $arrStdGetAllowedDaysForTaking = $response->return;
552
- if (is_array($arrStdGetAllowedDaysForTaking)) {
553
- for($i = 0; $i < count($arrStdGetAllowedDaysForTaking); $i++) {
554
- $arrGetAllowedDaysForTaking[$i] = $arrStdGetAllowedDaysForTaking[$i];
555
- }
556
- } else {
557
- $arrGetAllowedDaysForTaking[0] = $arrStdGetAllowedDaysForTaking;
558
- }
559
- }
560
- return $arrGetAllowedDaysForTaking;
561
- } catch (SoapFault $sf) {
562
- throw new ServerException($sf);
563
- }
564
- }
565
-
566
- /**
567
- * @see EPSInterface::addressSearch()
568
- */
569
- public function addressSearch($sessionId, $address) {
570
- try {
571
- $addressSearchStdObject = new stdClass();
572
- $addressSearchStdObject->sessionId = $sessionId;
573
- $addressSearchStdObject->address = $address->toStdClass();
574
- $response = parent::addressSearch($addressSearchStdObject);
575
- $arrAddressSearch = array();
576
- if (isset($response->return)) {
577
- $arrStdAddressSearch = $response->return;
578
- if (is_array($arrStdAddressSearch)) {
579
- for($i = 0; $i < count($arrStdAddressSearch); $i++) {
580
- $arrAddressSearch[$i] = new ResultAddressSearch($arrStdAddressSearch[$i]);
581
- }
582
- } else {
583
- $arrAddressSearch[0] = new ResultAddressSearch($arrStdAddressSearch);
584
- }
585
- }
586
- return $arrAddressSearch;
587
- } catch (SoapFault $sf) {
588
- throw new ServerException($sf);
589
- }
590
- }
591
-
592
- /**
593
- * @see EPSInterface::calculate()
594
- */
595
- public function calculate($sessionId, $calculation) {
596
- try {
597
- $calculateStdObject = new stdClass();
598
- $calculateStdObject->sessionId = $sessionId;
599
- $calculateStdObject->calculation = $calculation->toStdClass();
600
- $response = parent::calculate($calculateStdObject);
601
- if (isset($response->return)) {
602
- $resultCalculation = new ResultCalculation($response->return);
603
- } else {
604
- $resultCalculation = null;
605
- }
606
- return $resultCalculation;
607
- } catch (SoapFault $sf) {
608
- throw new ServerException($sf);
609
- }
610
- }
611
-
612
- /**
613
- * @see EPSInterface::calculateMultipleServices()
614
- */
615
- public function calculateMultipleServices($sessionId, $calculation, $serviceTypeIds) {
616
- try {
617
- $calculateMultipleServicesStdObject = new stdClass();
618
- $calculateMultipleServicesStdObject->sessionId = $sessionId;
619
- $calculateMultipleServicesStdObject->calculation = $calculation->toStdClass();
620
- $calculateMultipleServicesStdObject->serviceTypeIds = $serviceTypeIds;
621
- $calculateMultipleServicesStdObject->calculation->serviceTypeId = ParamCalculation::CALCULATE_MULTUPLE_SERVICES_SERVICE_TYPE_ID;
622
- $response = parent::calculateMultipleServices($calculateMultipleServicesStdObject);
623
- $arrCalculateMultipleServices = array();
624
- if (isset($response->return)) {
625
- $arrStdCalculateMultipleServices = $response->return;
626
- if (is_array($arrStdCalculateMultipleServices)) {
627
- for($i = 0; $i < count($arrStdCalculateMultipleServices); $i++) {
628
- $arrCalculateMultipleServices[$i] = new ResultCalculationMS($arrStdCalculateMultipleServices[$i]);
629
- }
630
- } else {
631
- $arrCalculateMultipleServices[0] = new ResultCalculationMS($arrStdCalculateMultipleServices);
632
- }
633
- }
634
- return $arrCalculateMultipleServices;
635
- } catch (SoapFault $sf) {
636
- throw new ServerException($sf);
637
- }
638
- }
639
-
640
- /**
641
- * @see EPSInterface::calculatePicking()
642
- */
643
- public function calculatePicking($sessionId, $picking) {
644
- try {
645
- $calculatePickingStdObject = new stdClass();
646
- $calculatePickingStdObject->sessionId = $sessionId;
647
- $calculatePickingStdObject->picking = $picking->toStdClass();
648
- $response = parent::calculatePicking($calculatePickingStdObject);
649
- if (isset($response->return)) {
650
- $resultCalculation = new ResultCalculation($response->return);
651
- } else {
652
- $resultCalculation = null;
653
- }
654
- return $resultCalculation;
655
- } catch (SoapFault $sf) {
656
- throw new ServerException($sf);
657
- }
658
- }
659
-
660
- /**
661
- * @see EPSInterface::createBillOfLading()
662
- */
663
- public function createBillOfLading($sessionId, $picking) {
664
- try {
665
- $createBillOfLadingStdObject = new stdClass();
666
- $createBillOfLadingStdObject->sessionId = $sessionId;
667
- $createBillOfLadingStdObject->picking = $picking->toStdClass();
668
- $response = parent::createBillOfLading($createBillOfLadingStdObject);
669
- if (isset($response->return)) {
670
- $resultBOL = new ResultBOL($response->return);
671
- } else {
672
- $resultBOL = null;
673
- }
674
- return $resultBOL;
675
- } catch (SoapFault $sf) {
676
- throw new ServerException($sf);
677
- }
678
- }
679
-
680
- /**
681
- * @see EPSInterface::createPDF()
682
- */
683
- public function createPDF($sessionId, $params) {
684
- try {
685
- $createPDFStdObject = new stdClass();
686
- $createPDFStdObject->sessionId = $sessionId;
687
- $createPDFStdObject->params = $params->toStdClass();
688
- $response = parent::createPDF($createPDFStdObject);
689
- if (isset($response->return)) {
690
- $resultPDF = $response->return;
691
- } else {
692
- $resultPDF = null;
693
- }
694
- return $resultPDF;
695
- } catch (SoapFault $sf) {
696
- throw new ServerException($sf);
697
- }
698
- }
699
-
700
- /**
701
- * @see EPSInterface::createBillOfLadingPDF()
702
- */
703
- public function createBillOfLadingPDF($sessionId, $billOfLading, $includeAutoPrintJS) {
704
- try {
705
- $createBillOfLadingPDFStdObject = new stdClass();
706
- $createBillOfLadingPDFStdObject->sessionId = $sessionId;
707
- $createBillOfLadingPDFStdObject->billOfLading = $billOfLading;
708
- $createBillOfLadingPDFStdObject->includeAutoPrintJS = $includeAutoPrintJS;
709
- $response = parent::createBillOfLadingPDF($createBillOfLadingPDFStdObject);
710
- if (isset($response->return)) {
711
- $resultPDF = $response->return;
712
- } else {
713
- $resultPDF = null;
714
- }
715
- return $resultPDF;
716
- } catch (SoapFault $sf) {
717
- throw new ServerException($sf);
718
- }
719
- }
720
-
721
- /**
722
- * @see EPSInterface::createCustomTravelLabelPDFType1()
723
- */
724
- public function createCustomTravelLabelPDFType1($sessionId, $parcelId) {
725
- try {
726
- $createCustomTravelLabelPDFType1StdObject = new stdClass();
727
- $createCustomTravelLabelPDFType1StdObject->sessionId = $sessionId;
728
- $createCustomTravelLabelPDFType1StdObject->parcelId = $parcelId;
729
- $response = parent::createCustomTravelLabelPDFType1($createCustomTravelLabelPDFType1StdObject);
730
- if (isset($response->return)) {
731
- $resultPDF = $response->return;
732
- } else {
733
- $resultPDF = null;
734
- }
735
- return $resultPDF;
736
- } catch (SoapFault $sf) {
737
- throw new ServerException($sf);
738
- }
739
- }
740
-
741
- /**
742
- * @see EPSInterface::invalidatePicking()
743
- */
744
- public function invalidatePicking($sessionId, $billOfLading, $cancelComment) {
745
- try {
746
- $invalidatePickingStdObject = new stdClass();
747
- $invalidatePickingStdObject->sessionId = $sessionId;
748
- $invalidatePickingStdObject->billOfLading = $billOfLading;
749
- $invalidatePickingStdObject->cancelComment = $cancelComment;
750
- parent::invalidatePicking($invalidatePickingStdObject);
751
- } catch (SoapFault $sf) {
752
- throw new ServerException($sf);
753
- }
754
- }
755
-
756
- /**
757
- * @see EPSInterface::updateBillOfLading()
758
- */
759
- public function updateBillOfLading($sessionId, $picking) {
760
- try {
761
- $updateBillOfLadingStdObject = new stdClass();
762
- $updateBillOfLadingStdObject->sessionId = $sessionId;
763
- $updateBillOfLadingStdObject->picking = $picking->toStdClass();
764
- $response = parent::updateBillOfLading($updateBillOfLadingStdObject);
765
- if (isset($response->return)) {
766
- $resultBOL = new ResultBOL($response->return);
767
- } else {
768
- $resultBOL = null;
769
- }
770
- return $resultBOL;
771
- } catch (SoapFault $sf) {
772
- throw new ServerException($sf);
773
- }
774
- }
775
-
776
- /**
777
- * @see EPSInterface::addParcel()
778
- */
779
- public function addParcel($sessionId, $parcel) {
780
- try {
781
- $addParcelStdObject = new stdClass();
782
- $addParcelStdObject->sessionId = $sessionId;
783
- $addParcelStdObject->parcel = $parcel->toStdClass();
784
- $response = parent::addParcel($addParcelStdObject);
785
- if (isset($response->return)) {
786
- $result = $response->return;
787
- } else {
788
- $result = null;
789
- }
790
- return $result;
791
- } catch (SoapFault $sf) {
792
- throw new ServerException($sf);
793
- }
794
- }
795
-
796
- /**
797
- * @see EPSInterface::finalizeBillOfLadingCreation()
798
- */
799
- public function finalizeBillOfLadingCreation($sessionId, $billOfLading) {
800
- try {
801
- $finalizeBillOfLadingCreationStdObject = new stdClass();
802
- $finalizeBillOfLadingCreationStdObject->sessionId = $sessionId;
803
- $finalizeBillOfLadingCreationStdObject->billOfLading = $billOfLading;
804
- $response = parent::finalizeBillOfLadingCreation($finalizeBillOfLadingCreationStdObject);
805
- if (isset($response->return)) {
806
- $resultBOL = new ResultBOL($response->return);
807
- } else {
808
- $resultBOL = null;
809
- }
810
- return $resultBOL;
811
- } catch (SoapFault $sf) {
812
- throw new ServerException($sf);
813
- }
814
- }
815
-
816
- /**
817
- * @see EPSInterface::createOrder()
818
- */
819
- public function createOrder($sessionId, $order) {
820
- try {
821
- $createOrderStdObject = new stdClass();
822
- $createOrderStdObject->sessionId = $sessionId;
823
- $createOrderStdObject->order = $order->toStdClass();
824
- $response = parent::createOrder($createOrderStdObject);
825
- $arrCreateOrder = array();
826
- if (isset($response->return)) {
827
- $arrStdCreateOrder = $response->return;
828
- if (is_array($arrStdCreateOrder)) {
829
- for($i = 0; $i < count($arrStdCreateOrder); $i++) {
830
- $arrCreateOrder[$i] = new ResultOrderPickingInfo($arrStdCreateOrder[$i]);
831
- }
832
- } else {
833
- $arrCreateOrder[0] = new ResultOrderPickingInfo($arrStdCreateOrder);
834
- }
835
- }
836
- return $arrCreateOrder;
837
- } catch (SoapFault $sf) {
838
- throw new ServerException($sf);
839
- }
840
- }
841
-
842
- /**
843
- * @see EPSInterface::getPickingParcels()
844
- */
845
- public function getPickingParcels($sessionId, $billOfLading) {
846
- try {
847
- $getPickingParcelsStdObject = new stdClass();
848
- $getPickingParcelsStdObject->sessionId = $sessionId;
849
- $getPickingParcelsStdObject->billOfLading = $billOfLading;
850
- $response = parent::getPickingParcels($getPickingParcelsStdObject);
851
- $arrResultParcelInfo = array();
852
- if (isset($response->return)) {
853
- $arrStdResultParcelInfo = $response->return;
854
- if (is_array($arrStdResultParcelInfo)) {
855
- for($i = 0; $i < count($arrStdResultParcelInfo); $i++) {
856
- $arrResultParcelInfo[$i] = new ResultParcelInfo($arrStdResultParcelInfo[$i]);
857
- }
858
- } else {
859
- $arrResultParcelInfo[0] = new ResultParcelInfo($arrStdResultParcelInfo);
860
- }
861
- }
862
- return $arrResultParcelInfo;
863
- } catch (SoapFault $sf) {
864
- throw new ServerException($sf);
865
- }
866
- }
867
-
868
- /**
869
- * @see EPSInterface::trackPicking()
870
- */
871
- public function trackPicking($sessionId, $billOfLading) {
872
- try {
873
- $trackPickingStdObject = new stdClass();
874
- $trackPickingStdObject->sessionId = $sessionId;
875
- $trackPickingStdObject->billOfLading = $billOfLading;
876
- $response = parent::trackPicking($trackPickingStdObject);
877
- $arrResultTrackPicking = array();
878
- if (isset($response->return)) {
879
- $arrStdResultTrackPicking = $response->return;
880
- if (is_array($arrStdResultTrackPicking)) {
881
- for($i = 0; $i < count($arrStdResultTrackPicking); $i++) {
882
- $arrResultTrackPicking[$i] = new ResultTrackPicking($arrStdResultTrackPicking[$i]);
883
- }
884
- } else {
885
- $arrResultTrackPicking[0] = new ResultTrackPicking($arrStdResultTrackPicking);
886
- }
887
- }
888
- return $arrResultTrackPicking;
889
- } catch (SoapFault $sf) {
890
- throw new ServerException($sf);
891
- }
892
- }
893
-
894
- /**
895
- * @see EPSInterface::trackPickingEx()
896
- */
897
- public function trackPickingEx($sessionId, $billOfLading, $language) {
898
- try {
899
- $trackPickingExStdObject = new stdClass();
900
- $trackPickingExStdObject->sessionId = $sessionId;
901
- $trackPickingExStdObject->billOfLading = $billOfLading;
902
- $trackPickingExStdObject->language = $language;
903
- $response = parent::trackPickingEx($trackPickingExStdObject);
904
- $arrResultTrackPickingEx = array();
905
-
906
- if (isset($response->return)) {
907
- $arrStdResultTrackPickingEx = $response->return;
908
- if (is_array($arrStdResultTrackPickingEx)) {
909
- for($i = 0; $i < count($arrStdResultTrackPickingEx); $i++) {
910
- $arrResultTrackPickingEx[$i] = new ResultTrackPickingEx($arrStdResultTrackPickingEx[$i]);
911
- }
912
- } else {
913
- $arrResultTrackPickingEx[0] = new ResultTrackPickingEx($arrStdResultTrackPickingEx);
914
- }
915
- }
916
- return $arrResultTrackPickingEx;
917
- } catch (SoapFault $sf) {
918
- throw new ServerException($sf);
919
- }
920
- }
921
-
922
- /**
923
- * @see EPSInterface::searchPickingsByRefNumber()
924
- */
925
- public function searchPickingsByRefNumber($sessionId, $params) {
926
- try {
927
- $searchPickingsByRefNumberStdObject = new stdClass();
928
- $searchPickingsByRefNumberStdObject->sessionId = $sessionId;
929
- $searchPickingsByRefNumberStdObject->params = $params->toStdClass();
930
- $response = parent::searchPickingsByRefNumber($searchPickingsByRefNumberStdObject);
931
- $arrSearchPickingsByRefNumber = array();
932
- if (isset($response->return)) {
933
- $arrStdSearchPickingsByRefNumber = $response->return;
934
- if (is_array($arrStdSearchPickingsByRefNumber)) {
935
- for($i = 0; $i < count($arrStdSearchPickingsByRefNumber); $i++) {
936
- $arrSearchPickingsByRefNumber[$i] = $arrStdSearchPickingsByRefNumber[$i];
937
- }
938
- } else {
939
- $arrSearchPickingsByRefNumber[0] = $arrStdSearchPickingsByRefNumber;
940
- }
941
- }
942
- return $arrSearchPickingsByRefNumber;
943
- } catch (SoapFault $sf) {
944
- throw new ServerException($sf);
945
- }
946
- }
947
-
948
- /**
949
- * @see EPSInterface::trackParcel()
950
- */
951
- public function trackParcel($sessionId, $parcelId, $language) {
952
- try {
953
- $trackParcelStdObject = new stdClass();
954
- $trackParcelStdObject->sessionId = $sessionId;
955
- $trackParcelStdObject->parcelId = $parcelId;
956
- $trackParcelStdObject->language = $language;
957
- $response = parent::trackParcel($trackParcelStdObject);
958
- $arrResultTrackParcel = array();
959
-
960
- if (isset($response->return)) {
961
- $arrStdResultTrackParcel = $response->return;
962
- if (is_array($arrStdResultTrackParcel)) {
963
- for($i = 0; $i < count($arrStdResultTrackParcel); $i++) {
964
- $arrResultTrackParcel[$i] = new ResultTrackPickingEx($arrStdResultTrackParcel[$i]);
965
- }
966
- } else {
967
- $arrResultTrackParcel[0] = new ResultTrackPickingEx($arrStdResultTrackParcel);
968
- }
969
- }
970
- return $arrResultTrackParcel;
971
- } catch (SoapFault $sf) {
972
- throw new ServerException($sf);
973
- }
974
- }
975
-
976
- /**
977
- * @see EPSInterface::trackParcelMultiple()
978
- */
979
- public function trackParcelMultiple($sessionId, $barcodes, $language) {
980
- try {
981
- $trackParcelMultipleStdObject = new stdClass();
982
- $trackParcelMultipleStdObject->sessionId = $sessionId;
983
- $trackParcelMultipleStdObject->barcodes = $barcodes;
984
- $trackParcelMultipleStdObject->language = $language;
985
- $response = parent::trackParcelMultiple($trackParcelMultipleStdObject);
986
- $arrResultTrackParcelMultiple = array();
987
-
988
- if (isset($response->return)) {
989
- $arrStdResultTrackParcelMultiple = $response->return;
990
- if (is_array($arrStdResultTrackParcelMultiple)) {
991
- for($i = 0; $i < count($arrStdResultTrackParcelMultiple); $i++) {
992
- $arrResultTrackParcelMultiple[$i] = new ResultTrackPickingEx($arrStdResultTrackParcelMultiple[$i]);
993
- }
994
- } else {
995
- $arrResultTrackParcelMultiple[0] = new ResultTrackPickingEx($arrStdResultTrackParcelMultiple);
996
- }
997
- }
998
- return $arrResultTrackParcelMultiple;
999
- } catch (SoapFault $sf) {
1000
- throw new ServerException($sf);
1001
- }
1002
- }
1003
-
1004
- /**
1005
- * @see EPSInterface::getMicroregionId
1006
- */
1007
- public function getMicroregionId($sessionId, $coordX, $coordY) {
1008
- try {
1009
- $getMicroregionIdSdtClass = new stdClass();
1010
- $getMicroregionIdSdtClass->sessionId = $sessionId;
1011
- $getMicroregionIdSdtClass->coordX = $coordX;
1012
- $getMicroregionIdSdtClass->coordY = $coordY;
1013
- $response = parent::getMicroregionId($getMicroregionIdSdtClass);
1014
- if (isset($response->return)) {
1015
- $microregionId = $response->return;
1016
- } else {
1017
- $microregionId = null;
1018
- }
1019
- return $microregionId;
1020
- } catch (SoapFault $sf) {
1021
- throw new ServerException($sf);
1022
- }
1023
- }
1024
-
1025
- /**
1026
- * @see EPSInterface::searchClients()
1027
- */
1028
- public function searchClients($sessionId, $clientQuery) {
1029
- try {
1030
- $searchClientsStdObject = new stdClass();
1031
- $searchClientsStdObject->sessionId = $sessionId;
1032
- $searchClientsStdObject->clientQuery = $clientQuery->toStdClass();
1033
- $response = parent::searchClients($searchClientsStdObject);
1034
- $arrResultClientData = array();
1035
-
1036
- if (isset($response->return)) {
1037
- $arrStdResultClientData = $response->return;
1038
- if (is_array($arrStdResultClientData)) {
1039
- for($i = 0; $i < count($arrStdResultClientData); $i++) {
1040
- $arrResultClientData[$i] = new ResultClientData($arrStdResultClientData[$i]);
1041
- }
1042
- } else {
1043
- $arrResultClientData[0] = new ResultClientData($arrStdResultClientData);
1044
- }
1045
- }
1046
- return $arrResultClientData;
1047
- } catch (SoapFault $sf) {
1048
- throw new ServerException($sf);
1049
- }
1050
- }
1051
-
1052
- /**
1053
- * @see EPSInterface::listSpecialDeliveryRequirements()
1054
- */
1055
- public function listSpecialDeliveryRequirements($sessionId) {
1056
- try {
1057
- $listSpecialDeliveryRequirementsStdObject = new stdClass();
1058
- $listSpecialDeliveryRequirementsStdObject->sessionId = $sessionId;
1059
- $response = parent::listSpecialDeliveryRequirements($listSpecialDeliveryRequirementsStdObject);
1060
- $arrResultSpecialDeliveryRequirement = array();
1061
-
1062
- if (isset($response->return)) {
1063
- $arrStdResultSpecialDeliveryRequirement = $response->return;
1064
- if (is_array($arrStdResultSpecialDeliveryRequirement)) {
1065
- for($i = 0; $i < count($arrStdResultSpecialDeliveryRequirement); $i++) {
1066
- $arrResultSpecialDeliveryRequirement[$i] = new ResultSpecialDeliveryRequirement($arrStdResultSpecialDeliveryRequirement[$i]);
1067
- }
1068
- } else {
1069
- $arrResultSpecialDeliveryRequirement[0] = new ResultSpecialDeliveryRequirement($arrStdResultSpecialDeliveryRequirement);
1070
- }
1071
- }
1072
- return $arrResultSpecialDeliveryRequirement;
1073
- } catch (SoapFault $sf) {
1074
- throw new ServerException($sf);
1075
- }
1076
- }
1077
-
1078
- /**
1079
- * @see EPSInterface::validateAddress()
1080
- */
1081
- public function validateAddress($sessionId, $address, $validationMode) {
1082
- try {
1083
- $validateAddressStdObject = new stdClass();
1084
- $validateAddressStdObject->sessionId = $sessionId;
1085
- $validateAddressStdObject->address = $address->toStdClass();
1086
- $validateAddressStdObject->validationMode = $validationMode;
1087
- $response = parent::validateAddress($validateAddressStdObject);
1088
- return $response->return;
1089
- } catch (SoapFault $sf) {
1090
- throw new ServerException($sf);
1091
- }
1092
- }
1093
-
1094
- /**
1095
- * @see EPSInterface::listContractClients()
1096
- */
1097
- public function listContractClients($sessionId) {
1098
- try {
1099
- $listContractClientsStdObject = new stdClass();
1100
- $listContractClientsStdObject->sessionId = $sessionId;
1101
- $response = parent::listContractClients($listContractClientsStdObject);
1102
- $arrResultContractClients = array();
1103
-
1104
- if (isset($response->return)) {
1105
- $arrStdResultContractClients = $response->return;
1106
- if (is_array($arrStdResultContractClients)) {
1107
- for($i = 0; $i < count($arrStdResultContractClients); $i++) {
1108
- $arrResultContractClients[$i] = new ResultClientData($arrStdResultContractClients[$i]);
1109
- }
1110
- } else {
1111
- $arrResultContractClients[0] = new ResultClientData($arrStdResultContractClients);
1112
- }
1113
- }
1114
- return $arrResultContractClients;
1115
- } catch (SoapFault $sf) {
1116
- throw new ServerException($sf);
1117
- }
1118
- }
1119
-
1120
- /**
1121
- * @see EPSInterface::listOfficesEx()
1122
- */
1123
- public function listOfficesEx($sessionId, $name, $siteId, $language) {
1124
- try {
1125
- $listOfficesExStdObject = new stdClass();
1126
- $listOfficesExStdObject->sessionId = $sessionId;
1127
- $listOfficesExStdObject->name = $name;
1128
- $listOfficesExStdObject->siteId = $siteId;
1129
- $listOfficesExStdObject->language = $language;
1130
- $response = parent::listOfficesEx($listOfficesExStdObject);
1131
- $arrListOfficesEx = array();
1132
- if (isset($response->return)) {
1133
- $arrStdListOfficesEx = $response->return;
1134
- if (is_array($arrStdListOfficesEx)) {
1135
- for($i = 0; $i < count($arrStdListOfficesEx); $i++) {
1136
- $arrListOfficesEx[$i] = new ResultOfficeEx($arrStdListOfficesEx[$i]);
1137
- }
1138
- } else {
1139
- $arrListOfficesEx[0] = new ResultOfficeEx($arrStdListOfficesEx);
1140
- }
1141
- }
1142
- return $arrListOfficesEx;
1143
- } catch (SoapFault $sf) {
1144
- throw new ServerException($sf);
1145
- }
1146
- }
1147
-
1148
- /**
1149
- * @see EPSInterface::deserializeAddress()
1150
- */
1151
- public function deserializeAddress($sessionId, $address) {
1152
- try {
1153
- $deserializeAddressStdObject = new stdClass();
1154
- $deserializeAddressStdObject->sessionId = $sessionId;
1155
- $deserializeAddressStdObject->address = $address;
1156
- $response = parent::deserializeAddress($deserializeAddressStdObject);
1157
- if (isset($response->return)) {
1158
- $paramAddress = new ParamAddress($response->return);
1159
- } else {
1160
- $paramAddress = null;
1161
- }
1162
- return $paramAddress;
1163
- } catch (SoapFault $sf) {
1164
- throw new ServerException($sf);
1165
- }
1166
- }
1167
-
1168
- /**
1169
- * @see EPSInterface::serializeAddress()
1170
- */
1171
- public function serializeAddress($sessionId, $address) {
1172
- try {
1173
- $serializeAddressStdObject = new stdClass();
1174
- $serializeAddressStdObject->sessionId = $sessionId;
1175
- $serializeAddressStdObject->address = $address->toStdClass();
1176
- $response = parent::serializeAddress($serializeAddressStdObject);
1177
- if (isset($response->return)) {
1178
- $serializedAddress = $response->return;
1179
- } else {
1180
- $serializedAddress = null;
1181
- }
1182
- return $serializedAddress;
1183
- } catch (SoapFault $sf) {
1184
- throw new ServerException($sf);
1185
- }
1186
- }
1187
-
1188
- /**
1189
- * @see EPSInterface::makeAddressString()
1190
- */
1191
- public function makeAddressString($sessionId, $address) {
1192
- try {
1193
- $makeAddressStringStdObject = new stdClass();
1194
- $makeAddressStringStdObject->sessionId = $sessionId;
1195
- $makeAddressStringStdObject->address = $address->toStdClass();;
1196
- $response = parent::makeAddressString($makeAddressStringStdObject);
1197
- if (isset($response->return)) {
1198
- $resultAddressString = new ResultAddressString($response->return);
1199
- } else {
1200
- $resultAddressString = null;
1201
- }
1202
- return $resultAddressString;
1203
- } catch (SoapFault $sf) {
1204
- throw new ServerException($sf);
1205
- }
1206
- }
1207
-
1208
- /**
1209
- * @see EPSInterface::getAdditionalUserParams()
1210
- */
1211
- public function getAdditionalUserParams($sessionId, $date) {
1212
- try {
1213
- $getAdditionalUserParamsStdObject = new stdClass();
1214
- $getAdditionalUserParamsStdObject->sessionId = $sessionId;
1215
- $getAdditionalUserParamsStdObject->date = $date;
1216
- $response = parent::getAdditionalUserParams($getAdditionalUserParamsStdObject);
1217
- $arrListAdditionalUserParams = array();
1218
- if (isset($response->return)) {
1219
- $arrStdListAdditionalUserParams = $response->return;
1220
- if (is_array($arrStdListAdditionalUserParams)) {
1221
- for($i = 0; $i < count($arrStdListAdditionalUserParams); $i++) {
1222
- $arrListAdditionalUserParams[$i] = $arrStdListAdditionalUserParams[$i];
1223
- }
1224
- } else {
1225
- $arrListAdditionalUserParams[0] = $arrStdListAdditionalUserParams;
1226
- }
1227
- }
1228
- return $arrListAdditionalUserParams;
1229
- } catch (SoapFault $sf) {
1230
- throw new ServerException($sf);
1231
- }
1232
- }
1233
-
1234
- /**
1235
- * @see EPSInterface::listCountries()
1236
- */
1237
- public function listCountries($sessionId, $name, $language) {
1238
- try {
1239
- $listCountriesStdObject = new stdClass();
1240
- $listCountriesStdObject->sessionId = $sessionId;
1241
- $listCountriesStdObject->name = $name;
1242
- $listCountriesStdObject->language = $language;
1243
-
1244
- $response = parent::listCountries($listCountriesStdObject);
1245
- $arrListCountriesStdObject = array();
1246
- if (isset($response->return)) {
1247
- $arrStdListCountriesStdObject = $response->return;
1248
- if (is_array($arrStdListCountriesStdObject)) {
1249
- for($i = 0; $i < count($arrStdListCountriesStdObject); $i++) {
1250
- $arrListCountriesStdObject[$i] = new ResultCountry($arrStdListCountriesStdObject[$i]);
1251
- }
1252
- } else {
1253
- $arrListCountriesStdObject[0] = new ResultCountry($arrStdListCountriesStdObject);
1254
- }
1255
- }
1256
- return $arrListCountriesStdObject;
1257
- } catch (SoapFault $sf) {
1258
- throw new ServerException($sf);
1259
- }
1260
- }
1261
-
1262
- /**
1263
- * @see EPSInterface::listCountriesEx()
1264
- */
1265
- public function listCountriesEx($sessionId, $filter, $language) {
1266
- try {
1267
- $listCountriesExStdObject = new stdClass();
1268
- $listCountriesExStdObject->sessionId = $sessionId;
1269
- $listCountriesExStdObject->filter = $filter->toStdClass();
1270
- $listCountriesExStdObject->language = $language;
1271
-
1272
- $response = parent::listCountriesEx($listCountriesExStdObject);
1273
- $arrListCountriesExStdObject = array();
1274
- if (isset($response->return)) {
1275
- $arrStdListCountriesExStdObject = $response->return;
1276
- if (is_array($arrStdListCountriesExStdObject)) {
1277
- for($i = 0; $i < count($arrStdListCountriesExStdObject); $i++) {
1278
- $arrListCountriesExStdObject[$i] = new ResultCountry($arrStdListCountriesExStdObject[$i]);
1279
- }
1280
- } else {
1281
- $arrListCountriesExStdObject[0] = new ResultCountry($arrStdListCountriesExStdObject);
1282
- }
1283
- }
1284
- return $arrListCountriesExStdObject;
1285
- } catch (SoapFault $sf) {
1286
- throw new ServerException($sf);
1287
- }
1288
- }
1289
-
1290
- /**
1291
- * @see EPSInterface::listStates()
1292
- */
1293
- public function listStates($sessionId, $countryId, $name) {
1294
- try {
1295
- $listStatesStdObject = new stdClass();
1296
- $listStatesStdObject->sessionId = $sessionId;
1297
- $listStatesStdObject->countryId = $countryId;
1298
- $listStatesStdObject->name = $name;
1299
-
1300
- $response = parent::listStates($listStatesStdObject);
1301
- $arrListStatesStdObject = array();
1302
- if (isset($response->return)) {
1303
- $arrStdListStatesStdObject = $response->return;
1304
- if (is_array($arrStdListStatesStdObject)) {
1305
- for($i = 0; $i < count($arrStdListStatesStdObject); $i++) {
1306
- $arrListStatesStdObject[$i] = new ResultState($arrStdListStatesStdObject[$i]);
1307
- }
1308
- } else {
1309
- $arrListStatesStdObject[0] = new ResultState($arrStdListStatesStdObject);
1310
- }
1311
- }
1312
- return $arrListStatesStdObject;
1313
- } catch (SoapFault $sf) {
1314
- throw new ServerException($sf);
1315
- }
1316
- }
1317
-
1318
- /**
1319
- * @see EPSInterface::getStateById()
1320
- */
1321
- public function getStateById($sessionId, $stateId) {
1322
- try {
1323
- $getStateByIdStdObject = new stdClass();
1324
- $getStateByIdStdObject->sessionId = $sessionId;
1325
- $getStateByIdStdObject->stateId = $stateId;
1326
- $response = parent::getStateById($getStateByIdStdObject);
1327
- if (isset($response->return)) {
1328
- $resultState = new ResultState($response->return);
1329
- } else {
1330
- $resultState = null;
1331
- }
1332
- return $resultState;
1333
- } catch (SoapFault $sf) {
1334
- throw new ServerException($sf);
1335
- }
1336
- }
1337
-
1338
- /**
1339
- * @see EPSInterface::getStateById()
1340
- */
1341
- public function validatePostCode($sessionId, $countryId, $postCode) {
1342
- try {
1343
- $validatePostCodeStdObject = new stdClass();
1344
- $validatePostCodeStdObject->sessionId = $sessionId;
1345
- $validatePostCodeStdObject->countryId = $countryId;
1346
- $validatePostCodeStdObject->postCode = $postCode;
1347
- $response = parent::validatePostCode($validatePostCodeStdObject);
1348
- if (isset($response->return)) {
1349
- $resultFlag = $response->return;
1350
- } else {
1351
- $resultFlag = null;
1352
- }
1353
- return $resultFlag;
1354
- } catch (SoapFault $sf) {
1355
- throw new ServerException($sf);
1356
- }
1357
- }
1358
-
1359
- /**
1360
- * @see EPSInterface::getStateById()
1361
- */
1362
- public function getPickingDeliveryInfo($sessionId, $billOfLading, $language) {
1363
- try {
1364
- $getPickingDeliveryInfoStdObject = new stdClass();
1365
- $getPickingDeliveryInfoStdObject->sessionId = $sessionId;
1366
- $getPickingDeliveryInfoStdObject->billOfLading = $billOfLading;
1367
- $getPickingDeliveryInfoStdObject->language = $language;
1368
-
1369
- $response = parent::getPickingDeliveryInfo($getPickingDeliveryInfoStdObject);
1370
- $arrResultTrackPickingExStdObject = array();
1371
- if (isset($response->return)) {
1372
- $arrStdResultTrackPickingExStdObject = $response->return;
1373
- if (is_array($arrStdResultTrackPickingExStdObject)) {
1374
- for($i = 0; $i < count($arrStdResultTrackPickingExStdObject); $i++) {
1375
- $arrResultTrackPickingExStdObject[$i] = new ResultTrackPickingEx($arrStdResultTrackPickingExStdObject[$i]);
1376
- }
1377
- } else {
1378
- $arrResultTrackPickingExStdObject[0] = new ResultTrackPickingEx($arrStdResultTrackPickingExStdObject);
1379
- }
1380
- }
1381
- return $arrResultTrackPickingExStdObject;
1382
- } catch (SoapFault $sf) {
1383
- throw new ServerException($sf);
1384
- }
1385
- }
1386
-
1387
- /**
1388
- * @see EPSInterface::searchSecondaryPickings()
1389
- */
1390
- public function searchSecondaryPickings($sessionId, $paramSearchSecondaryPickings) {
1391
- try {
1392
- $searchSecondaryPickingsStdObject = new stdClass();
1393
- $searchSecondaryPickingsStdObject->sessionId = $sessionId;
1394
- $searchSecondaryPickingsStdObject->paramSearchSecondaryPickings = $paramSearchSecondaryPickings->toStdClass();
1395
- $response = parent::searchSecondaryPickings($searchSecondaryPickingsStdObject);
1396
-
1397
- $arrResultPickingInfoStdObject = array();
1398
- if (isset($response->return)) {
1399
- $arrStdResultPickingInfoObject = $response->return;
1400
- if (is_array($arrStdResultPickingInfoObject)) {
1401
- for($i = 0; $i < count($arrStdResultPickingInfoObject); $i++) {
1402
- $arrResultPickingInfoStdObject[$i] = new ResultPickingInfo($arrStdResultPickingInfoObject[$i]);
1403
- }
1404
- } else {
1405
- $arrResultPickingInfoStdObject[0] = new ResultPickingInfo($arrStdResultPickingInfoObject);
1406
- }
1407
- }
1408
- return $arrResultPickingInfoStdObject;
1409
- } catch (SoapFault $sf) {
1410
- throw new ServerException($sf);
1411
- }
1412
- }
1413
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1414
  ?>
1
+ <?php
2
+
3
+ require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'EPSInterface.class.php';
4
+
5
+ /**
6
+ * Speedy SOAP EPS ver01 Service Interface Implementation
7
+ */
8
+ class EPSSOAPInterfaceImpl extends SoapClient implements EPSInterface {
9
+
10
+ /**
11
+ * Speedy SOAP WSDL version 01 URL
12
+ * @var string
13
+ */
14
+ const SPEEDY_SOAP_WSDL_V01_URL = 'https://www.speedy.bg/eps/main01.wsdl';
15
+
16
+ /**
17
+ * Constructs new instance of SOAP service
18
+ * @param string $wsdlURL
19
+ * @param options[optional]
20
+ */
21
+ function __construct($wsdlURL=self::SPEEDY_SOAP_WSDL_V01_URL, $options=null) {
22
+ if (is_null($options)) {
23
+ parent::SoapClient($wsdlURL);
24
+ } else {
25
+ parent::SoapClient($wsdlURL, $options);
26
+ }
27
+ // echo('<BR>Connected to '.$wsdlURL);
28
+ }
29
+
30
+ /**
31
+ * @see EPSInterface::login()
32
+ */
33
+ public function login($username, $password) {
34
+ try {
35
+ $loginSdtClass = new stdClass();
36
+ $loginSdtClass->username = $username;
37
+ $loginSdtClass->password = $password;
38
+ $response = parent::login($loginSdtClass);
39
+ if (isset($response->return)) {
40
+ $resultLogin = new ResultLogin($response->return);
41
+ } else {
42
+ $resultLogin = null;
43
+ }
44
+ return $resultLogin;
45
+ } catch (SoapFault $sf) {
46
+ throw new ServerException($sf);
47
+ }
48
+ }
49
+
50
+ /**
51
+ * @see EPSInterface::isSessionActive()
52
+ */
53
+ public function isSessionActive($sessionId, $refreshSession) {
54
+ try {
55
+ $isSessionActiveSdtClass = new stdClass();
56
+ $isSessionActiveSdtClass->sessionId = $sessionId;
57
+ $isSessionActiveSdtClass->refreshSession = $refreshSession;
58
+ $response = parent::isSessionActive($isSessionActiveSdtClass);
59
+ if (isset($response->return)) {
60
+ $isSessionActiveFlag = $response->return;
61
+ } else {
62
+ $isSessionActiveFlag = false;
63
+ }
64
+ return $isSessionActiveFlag;
65
+ } catch (SoapFault $sf) {
66
+ throw new ServerException($sf);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * @see EPSInterface::listServices()
72
+ */
73
+ public function listServices($sessionId, $date, $language) {
74
+ try {
75
+ $listServicesStdObject = new stdClass();
76
+ $listServicesStdObject->sessionId = $sessionId;
77
+ $listServicesStdObject->date = $date;
78
+ $listServicesStdObject->language = $language;
79
+ $response = parent::listServices($listServicesStdObject);
80
+ $arrListServices = array();
81
+ if (isset($response->return)) {
82
+ $arrStdServices = $response->return;
83
+ if (is_array($arrStdServices)) {
84
+ for($i = 0; $i < count($arrStdServices); $i++) {
85
+ $arrListServices[$i] = new ResultCourierService($arrStdServices[$i]);
86
+ }
87
+ } else {
88
+ $arrListServices[0] = new ResultCourierService($arrStdServices);
89
+ }
90
+ }
91
+ return $arrListServices;
92
+ } catch (SoapFault $sf) {
93
+ throw new ServerException($sf);
94
+ }
95
+ }
96
+
97
+ /**
98
+ * @see EPSInterface::listServicesForSites()
99
+ */
100
+ public function listServicesForSites(
101
+ $sessionId, $date, $senderSiteId, $receiverSiteId,
102
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode, $language,
103
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
104
+ ) {
105
+ try {
106
+ $listServicesForSitesStdObject = new stdClass();
107
+ $listServicesForSitesStdObject->sessionId = $sessionId;
108
+ $listServicesForSitesStdObject->date = $date;
109
+ $listServicesForSitesStdObject->senderSiteId = $senderSiteId;
110
+ $listServicesForSitesStdObject->receiverSiteId = $receiverSiteId;
111
+ $listServicesForSitesStdObject->senderCountryId = $senderCountryId;
112
+ $listServicesForSitesStdObject->senderPostCode = $senderPostCode;
113
+ $listServicesForSitesStdObject->receiverCountryId = $receiverCountryId;
114
+ $listServicesForSitesStdObject->receiverPostCode = $receiverPostCode;
115
+ $listServicesForSitesStdObject->language = $language;
116
+ $listServicesForSitesStdObject->senderId = $senderId;
117
+ $listServicesForSitesStdObject->receiverId = $receiverId;
118
+ $listServicesForSitesStdObject->senderOfficeId = $senderOfficeId;
119
+ $listServicesForSitesStdObject->receiverOfficeId = $receiverOfficeId;
120
+ $response = parent::listServicesForSites($listServicesForSitesStdObject);
121
+ $arrServicesForSitesStdObject = array();
122
+ if (isset($response->return)) {
123
+ $arrStdServicesForSites = $response->return;
124
+ if (is_array($arrStdServicesForSites)) {
125
+ for($i = 0; $i < count($arrStdServicesForSites); $i++) {
126
+ $arrServicesForSitesStdObject[$i] = new ResultCourierServiceExt($arrStdServicesForSites[$i]);
127
+ }
128
+ } else {
129
+ $arrServicesForSitesStdObject[0] = new ResultCourierServiceExt($arrStdServicesForSites);
130
+ }
131
+ }
132
+ return $arrServicesForSitesStdObject;
133
+ } catch (SoapFault $sf) {
134
+ throw new ServerException($sf);
135
+ }
136
+ }
137
+
138
+ /**
139
+ * @see EPSInterface::listSites()
140
+ */
141
+ public function listSites($sessionId, $type, $name, $language) {
142
+ try {
143
+ $listSitesStdObject = new stdClass();
144
+ $listSitesStdObject->sessionId = $sessionId;
145
+ $listSitesStdObject->type = $type;
146
+ $listSitesStdObject->name = $name;
147
+ $listSitesStdObject->language = $language;
148
+ $response = parent::listSites($listSitesStdObject);
149
+ $arrListSites = array();
150
+ if (isset($response->return)) {
151
+ $arrStdSites = $response->return;
152
+ if (is_array($arrStdSites)) {
153
+ for($i = 0; $i < count($arrStdSites); $i++) {
154
+ $arrListSites[$i] = new ResultSite($arrStdSites[$i]);
155
+ }
156
+ } else {
157
+ $arrListSites[0] = new ResultSite($arrStdSites);
158
+ }
159
+ }
160
+ return $arrListSites;
161
+ } catch (SoapFault $sf) {
162
+ throw new ServerException($sf);
163
+ }
164
+ }
165
+
166
+ /**
167
+ * @see EPSInterface::listSites()
168
+ */
169
+ public function listSitesEx($sessionId, $paramFilterSite, $language) {
170
+ try {
171
+ $listSitesExStdObject = new stdClass();
172
+ $listSitesExStdObject->sessionId = $sessionId;
173
+ $listSitesExStdObject->filter = $paramFilterSite->toStdClass();
174
+ $listSitesExStdObject->language = $language;
175
+
176
+ $response = parent::listSitesEx($listSitesExStdObject);
177
+ $arrListSitesEx = array();
178
+ if (isset($response->return)) {
179
+ $arrStdSitesEx = $response->return;
180
+ if (is_array($arrStdSitesEx)) {
181
+ for($i = 0; $i < count($arrStdSitesEx); $i++) {
182
+ $arrListSitesEx[$i] = new ResultSiteEx($arrStdSitesEx[$i]);
183
+ }
184
+ } else {
185
+ $arrListSitesEx[0] = new ResultSiteEx($arrStdSitesEx);
186
+ }
187
+ }
188
+ return $arrListSitesEx;
189
+ } catch (SoapFault $sf) {
190
+ throw new ServerException($sf);
191
+ }
192
+ }
193
+
194
+ /**
195
+ * @see EPSInterface::getWeightInterval()
196
+ */
197
+ public function getWeightInterval(
198
+ $sessionId, $serviceTypeId, $senderSiteId, $receiverSiteId, $date, $documents,
199
+ $senderCountryId, $senderPostCode, $receiverCountryId, $receiverPostCode,
200
+ $senderId, $receiverId, $senderOfficeId, $receiverOfficeId
201
+ ) {
202
+ try {
203
+ $getWeightIntervalStdObject = new stdClass();
204
+ $getWeightIntervalStdObject->sessionId = $sessionId;
205
+ $getWeightIntervalStdObject->serviceTypeId = $serviceTypeId;
206
+ $getWeightIntervalStdObject->senderSiteId = $senderSiteId;
207
+ $getWeightIntervalStdObject->receiverSiteId = $receiverSiteId;
208
+ $getWeightIntervalStdObject->date = $date;
209
+ $getWeightIntervalStdObject->documents = $documents;
210
+ $getWeightIntervalStdObject->senderCountryId = $senderCountryId;
211
+ $getWeightIntervalStdObject->senderPostCode = $senderPostCode;
212
+ $getWeightIntervalStdObject->receiverCountryId = $receiverCountryId;
213
+ $getWeightIntervalStdObject->receiverPostCode = $receiverPostCode;
214
+
215
+ $getWeightIntervalStdObject->senderId = $senderId;
216
+ $getWeightIntervalStdObject->receiverId = $receiverId;
217
+ $getWeightIntervalStdObject->senderOfficeId = $senderOfficeId;
218
+ $getWeightIntervalStdObject->receiverOfficeId = $receiverOfficeId;
219
+
220
+ $response = parent::getWeightInterval($getWeightIntervalStdObject);
221
+ if (isset($response->return)) {
222
+ $resultMinMaxReal = new ResultMinMaxReal($response->return);
223
+ } else {
224
+ $resultMinMaxReal = null;
225
+ }
226
+ return $resultMinMaxReal;
227
+ } catch (SoapFault $sf) {
228
+ throw new ServerException($sf);
229
+ }
230
+ }
231
+
232
+ /**
233
+ * @see EPSInterface::getAddressNomenclature()
234
+ */
235
+ public function getAddressNomenclature($sessionId, $nomenType, $countryId) {
236
+ try {
237
+ $getAddressNomenclatureStdObject = new stdClass();
238
+ $getAddressNomenclatureStdObject->sessionId = $sessionId;
239
+ $getAddressNomenclatureStdObject->nomenType = $nomenType;
240
+ $getAddressNomenclatureStdObject->countryId = $countryId;
241
+
242
+ $response = parent::getAddressNomenclature($getAddressNomenclatureStdObject);
243
+ if (isset($response->return)) {
244
+ $getAddressNomenclature = $response->return;
245
+ } else {
246
+ $getAddressNomenclature = null;
247
+ }
248
+ return $getAddressNomenclature;
249
+ } catch (SoapFault $sf) {
250
+ throw new ServerException($sf);
251
+ }
252
+ }
253
+
254
+ /**
255
+ * @see EPSInterface::listAllSites()
256
+ */
257
+ public function listAllSites($sessionId, $language, $countryId) {
258
+ try {
259
+ $listAllSitesStdObject = new stdClass();
260
+ $listAllSitesStdObject->sessionId = $sessionId;
261
+ $listAllSitesStdObject->language = $language;
262
+ $listAllSitesStdObject->countryId = $countryId;
263
+
264
+ $response = parent::listAllSites($listAllSitesStdObject);
265
+ $arrListAllSites = array();
266
+ if (isset($response->return)) {
267
+ $arrStdAllSites = $response->return;
268
+ if (is_array($arrStdAllSites)) {
269
+ for($i = 0; $i < count($arrStdAllSites); $i++) {
270
+ $arrListAllSites[$i] = new ResultSite($arrStdAllSites[$i]);
271
+ }
272
+ } else {
273
+ $arrListAllSites[0] = new ResultSite($arrStdAllSites);
274
+ }
275
+ }
276
+ return $arrListAllSites;
277
+ } catch (SoapFault $sf) {
278
+ throw new ServerException($sf);
279
+ }
280
+ }
281
+
282
+ /**
283
+ * @see EPSInterface::getSiteById()
284
+ */
285
+ public function getSiteById($sessionId, $siteId) {
286
+ try {
287
+ $getSiteByIdStdObject = new stdClass();
288
+ $getSiteByIdStdObject->sessionId = $sessionId;
289
+ $getSiteByIdStdObject->siteId = $siteId;
290
+ $response = parent::getSiteById($getSiteByIdStdObject);
291
+ if (isset($response->return)) {
292
+ $resultSite = new ResultSite($response->return);
293
+ } else {
294
+ $resultSite = null;
295
+ }
296
+ return $resultSite;
297
+ } catch (SoapFault $sf) {
298
+ throw new ServerException($sf);
299
+ }
300
+ }
301
+
302
+ /**
303
+ * @see EPSInterface::getSitesByAddrNomenType()
304
+ */
305
+ public function getSitesByAddrNomenType($sessionId, $addrNomen) {
306
+ try {
307
+ $getSitesByAddrNomenTypeStdObject = new stdClass();
308
+ $getSitesByAddrNomenTypeStdObject->sessionId = $sessionId;
309
+ $getSitesByAddrNomenTypeStdObject->addrNomen = $addrNomen;
310
+ $response = parent::getSitesByAddrNomenType($getSitesByAddrNomenTypeStdObject);
311
+ $arrListSitesByAddrNomenType = array();
312
+ if (isset($response->return)) {
313
+ $arrStdSitesByAddrNomenType = $response->return;
314
+ if (is_array($arrStdSitesByAddrNomenType)) {
315
+ for($i = 0; $i < count($arrStdSitesByAddrNomenType); $i++) {
316
+ $arrListSitesByAddrNomenType[$i] = new ResultSite($arrStdSitesByAddrNomenType[$i]);
317
+ }
318
+ } else {
319
+ $arrListSitesByAddrNomenType[0] = new ResultSite($arrStdSitesByAddrNomenType);
320
+ }
321
+ }
322
+ return $arrListSitesByAddrNomenType;
323
+ } catch (SoapFault $sf) {
324
+ throw new ServerException($sf);
325
+ }
326
+ }
327
+
328
+ /**
329
+ * @see EPSInterface::listStreetTypes()
330
+ */
331
+ public function listStreetTypes($sessionId, $language) {
332
+ try {
333
+ $listStreetTypesStdObject = new stdClass();
334
+ $listStreetTypesStdObject->sessionId = $sessionId;
335
+ $listStreetTypesStdObject->language = $language;
336
+
337
+ $response = parent::listStreetTypes($listStreetTypesStdObject);
338
+ $arrListStreetTypes = array();
339
+ if (isset($response->return)) {
340
+ $arrStdListStreetTypes = $response->return;
341
+ if (is_array($arrStdListStreetTypes)) {
342
+ for($i = 0; $i < count($arrStdListStreetTypes); $i++) {
343
+ $arrListStreetTypes[$i] = $arrStdListStreetTypes[$i];
344
+ }
345
+ } else {
346
+ $arrListStreetTypes[0] = $arrStdListStreetTypes;
347
+ }
348
+ }
349
+ return $arrListStreetTypes;
350
+ } catch (SoapFault $sf) {
351
+ throw new ServerException($sf);
352
+ }
353
+ }
354
+
355
+ /**
356
+ * @see EPSInterface::listQuarterTypes()
357
+ */
358
+ public function listQuarterTypes($sessionId, $language) {
359
+ try {
360
+ $listQuarterTypesStdObject = new stdClass();
361
+ $listQuarterTypesStdObject->sessionId = $sessionId;
362
+ $listQuarterTypesStdObject->language = $language;
363
+
364
+ $response = parent::listQuarterTypes($listQuarterTypesStdObject);
365
+ $arrListQuarterTypes = array();
366
+ if (isset($response->return)) {
367
+ $arrStdListQuarterTypes = $response->return;
368
+ if (is_array($arrStdListQuarterTypes)) {
369
+ for($i = 0; $i < count($arrStdListQuarterTypes); $i++) {
370
+ $arrListQuarterTypes[$i] = $arrStdListQuarterTypes[$i];
371
+ }
372
+ } else {
373
+ $arrListQuarterTypes[0] = $arrStdListQuarterTypes;
374
+ }
375
+ }
376
+ return $arrListQuarterTypes;
377
+ } catch (SoapFault $sf) {
378
+ throw new ServerException($sf);
379
+ }
380
+ }
381
+
382
+ /**
383
+ * @see EPSInterface::listStreets()
384
+ */
385
+ public function listStreets($sessionId, $name, $siteId, $language) {
386
+ try {
387
+ $listStreetsStdObject = new stdClass();
388
+ $listStreetsStdObject->sessionId = $sessionId;
389
+ $listStreetsStdObject->name = $name;
390
+ $listStreetsStdObject->siteId = $siteId;
391
+ $listStreetsStdObject->language = $language;
392
+
393
+ $response = parent::listStreets($listStreetsStdObject);
394
+ $arrlistStreets = array();
395
+ if (isset($response->return)) {
396
+ $arrStdListStreets = $response->return;
397
+ if (is_array($arrStdListStreets)) {
398
+ for($i = 0; $i < count($arrStdListStreets); $i++) {
399
+ $arrlistStreets[$i] = new ResultStreet($arrStdListStreets[$i]);
400
+ }
401
+ } else {
402
+ $arrlistStreets[0] = new ResultStreet($arrStdListStreets);
403
+ }
404
+ }
405
+ return $arrlistStreets;
406
+ } catch (SoapFault $sf) {
407
+ throw new ServerException($sf);
408
+ }
409
+ }
410
+
411
+ /**
412
+ * @see EPSInterface::listQuarters()
413
+ */
414
+ public function listQuarters($sessionId, $name, $siteId, $language) {
415
+ try {
416
+ $listQuartersStdObject = new stdClass();
417
+ $listQuartersStdObject->sessionId = $sessionId;
418
+ $listQuartersStdObject->name = $name;
419
+ $listQuartersStdObject->siteId = $siteId;
420
+ $listQuartersStdObject->language = $language;
421
+
422
+ $response = parent::listQuarters($listQuartersStdObject);
423
+ $arrListQuarters = array();
424
+ if (isset($response->return)) {
425
+ $arrStdListQuarters = $response->return;
426
+ if (is_array($arrStdListQuarters)) {
427
+ for($i = 0; $i < count($arrStdListQuarters); $i++) {
428
+ $arrListQuarters[$i] = new ResultQuarter($arrStdListQuarters[$i]);
429
+ }
430
+ } else {
431
+ $arrListQuarters[0] = new ResultQuarter($arrStdListQuarters);
432
+ }
433
+ }
434
+ return $arrListQuarters;
435
+ } catch (SoapFault $sf) {
436
+ throw new ServerException($sf);
437
+ }
438
+ }
439
+
440
+ /**
441
+ * @see EPSInterface::listCommonObjects()
442
+ */
443
+ public function listCommonObjects($sessionId, $name, $siteId, $language) {
444
+ try {
445
+ $listCommonObjectsStdObject = new stdClass();
446
+ $listCommonObjectsStdObject->sessionId = $sessionId;
447
+ $listCommonObjectsStdObject->name = $name;
448
+ $listCommonObjectsStdObject->siteId = $siteId;
449
+ $listCommonObjectsStdObject->language = $language;
450
+ $response = parent::listCommonObjects($listCommonObjectsStdObject);
451
+ $arrListCommonObjects = array();
452
+ if (isset($response->return)) {
453
+ $arrStdListCommonObjects = $response->return;
454
+ if (is_array($arrStdListCommonObjects)) {
455
+ for($i = 0; $i < count($arrStdListCommonObjects); $i++) {
456
+ $arrListCommonObjects[$i] = new ResultCommonObject($arrStdListCommonObjects[$i]);
457
+ }
458
+ } else {
459
+ $arrListCommonObjects[0] = new ResultCommonObject($arrStdListCommonObjects);
460
+ }
461
+ }
462
+ return $arrListCommonObjects;
463
+ } catch (SoapFault $sf) {
464
+ throw new ServerException($sf);
465
+ }
466
+ }
467
+
468
+ /**
469
+ * @see EPSInterface::listBlocks()
470
+ */
471
+ public function listBlocks($sessionId, $name, $siteId, $language) {
472
+ try {
473
+ $listBlocksStdObject = new stdClass();
474
+ $listBlocksStdObject->sessionId = $sessionId;
475
+ $listBlocksStdObject->name = $name;
476
+ $listBlocksStdObject->siteId = $siteId;
477
+ $listBlocksStdObject->language = $language;
478
+ $response = parent::listBlocks($listBlocksStdObject);
479
+ $arrListBlocks = array();
480
+ if (isset($response->return)) {
481
+ $arrStdListBlocks = $response->return;
482
+ if (is_array($arrStdListBlocks)) {
483
+ for($i = 0; $i < count($arrStdListBlocks); $i++) {
484
+ $arrListBlocks[$i] = $arrStdListBlocks[$i];
485
+ }
486
+ } else {
487
+ $arrListBlocks[0] = $arrStdListBlocks;
488
+ }
489
+ }
490
+ return $arrListBlocks;
491
+ } catch (SoapFault $sf) {
492
+ throw new ServerException($sf);
493
+ }
494
+ }
495
+
496
+ /**
497
+ * @see EPSInterface::listOffices()
498
+ */
499
+ public function listOffices($sessionId, $name, $siteId) {
500
+ try {
501
+ $listOfficesStdObject = new stdClass();
502
+ $listOfficesStdObject->sessionId = $sessionId;
503
+ $listOfficesStdObject->name = $name;
504
+ $listOfficesStdObject->siteId = $siteId;
505
+ $response = parent::listOffices($listOfficesStdObject);
506
+ $arrListOffices = array();
507
+ if (isset($response->return)) {
508
+ $arrStdListOffices = $response->return;
509
+ if (is_array($arrStdListOffices)) {
510
+ for($i = 0; $i < count($arrStdListOffices); $i++) {
511
+ $arrListOffices[$i] = new ResultOffice($arrStdListOffices[$i]);
512
+ }
513
+ } else {
514
+ $arrListOffices[0] = new ResultOffice($arrStdListOffices);
515
+ }
516
+ }
517
+ return $arrListOffices;
518
+ } catch (SoapFault $sf) {
519
+ throw new ServerException($sf);
520
+ }
521
+ }
522
+
523
+ /**
524
+ * @see EPSInterface::getClientById($sessionId, $clientId)
525
+ */
526
+ public function getClientById($sessionId, $clientId) {
527
+ try {
528
+ $getClientByIdStdObject = new stdClass();
529
+ $getClientByIdStdObject->sessionId = $sessionId;
530
+ $getClientByIdStdObject->clientId = $clientId;
531
+ $response = parent::getClientById($getClientByIdStdObject);
532
+ if (isset($response->return)) {
533
+ $resultClientData = new ResultClientData($response->return);
534
+ } else {
535
+ $resultClientData = null;
536
+ }
537
+ return $resultClientData;
538
+ } catch (SoapFault $sf) {
539
+ throw new ServerException($sf);
540
+ }
541
+ }
542
+
543
+ /**
544
+ * @see EPSInterface::getAllowedDaysForTaking()
545
+ */
546
+ public function getAllowedDaysForTaking(
547
+ $sessionId, $serviceTypeId, $senderSiteId, $senderOfficeId, $minDate, $senderCountryId, $senderPostCode, $senderId
548
+ ) {
549
+ try {
550
+ $getAllowedDaysForTakingStdObject = new stdClass();
551
+ $getAllowedDaysForTakingStdObject->sessionId = $sessionId;
552
+ $getAllowedDaysForTakingStdObject->serviceTypeId = $serviceTypeId;
553
+ $getAllowedDaysForTakingStdObject->senderSiteId = $senderSiteId;
554
+ $getAllowedDaysForTakingStdObject->senderOfficeId = $senderOfficeId;
555
+ $getAllowedDaysForTakingStdObject->minDate = $minDate;
556
+ $getAllowedDaysForTakingStdObject->senderCountryId = $senderCountryId;
557
+ $getAllowedDaysForTakingStdObject->senderPostCode = $senderPostCode;
558
+ $getAllowedDaysForTakingStdObject->senderId = $senderId;
559
+
560
+ $response = parent::getAllowedDaysForTaking($getAllowedDaysForTakingStdObject);
561
+ $arrGetAllowedDaysForTaking = array();
562
+ if (isset($response->return)) {
563
+ $arrStdGetAllowedDaysForTaking = $response->return;
564
+ if (is_array($arrStdGetAllowedDaysForTaking)) {
565
+ for($i = 0; $i < count($arrStdGetAllowedDaysForTaking); $i++) {
566
+ $arrGetAllowedDaysForTaking[$i] = $arrStdGetAllowedDaysForTaking[$i];
567
+ }
568
+ } else {
569
+ $arrGetAllowedDaysForTaking[0] = $arrStdGetAllowedDaysForTaking;
570
+ }
571
+ }
572
+ return $arrGetAllowedDaysForTaking;
573
+ } catch (SoapFault $sf) {
574
+ throw new ServerException($sf);
575
+ }
576
+ }
577
+
578
+ /**
579
+ * @see EPSInterface::addressSearch()
580
+ */
581
+ public function addressSearch($sessionId, $address) {
582
+ try {
583
+ $addressSearchStdObject = new stdClass();
584
+ $addressSearchStdObject->sessionId = $sessionId;
585
+ $addressSearchStdObject->address = $address->toStdClass();
586
+ $response = parent::addressSearch($addressSearchStdObject);
587
+ $arrAddressSearch = array();
588
+ if (isset($response->return)) {
589
+ $arrStdAddressSearch = $response->return;
590
+ if (is_array($arrStdAddressSearch)) {
591
+ for($i = 0; $i < count($arrStdAddressSearch); $i++) {
592
+ $arrAddressSearch[$i] = new ResultAddressSearch($arrStdAddressSearch[$i]);
593
+ }
594
+ } else {
595
+ $arrAddressSearch[0] = new ResultAddressSearch($arrStdAddressSearch);
596
+ }
597
+ }
598
+ return $arrAddressSearch;
599
+ } catch (SoapFault $sf) {
600
+ throw new ServerException($sf);
601
+ }
602
+ }
603
+
604
+ /**
605
+ * @see EPSInterface::calculate()
606
+ */
607
+ public function calculate($sessionId, $calculation) {
608
+ try {
609
+ $calculateStdObject = new stdClass();
610
+ $calculateStdObject->sessionId = $sessionId;
611
+ $calculateStdObject->calculation = $calculation->toStdClass();
612
+ $response = parent::calculate($calculateStdObject);
613
+ if (isset($response->return)) {
614
+ $resultCalculation = new ResultCalculation($response->return);
615
+ } else {
616
+ $resultCalculation = null;
617
+ }
618
+ return $resultCalculation;
619
+ } catch (SoapFault $sf) {
620
+ throw new ServerException($sf);
621
+ }
622
+ }
623
+
624
+ /**
625
+ * @see EPSInterface::calculateMultipleServices()
626
+ */
627
+ public function calculateMultipleServices($sessionId, $calculation, $serviceTypeIds) {
628
+ try {
629
+ $calculateMultipleServicesStdObject = new stdClass();
630
+ $calculateMultipleServicesStdObject->sessionId = $sessionId;
631
+ $calculateMultipleServicesStdObject->calculation = $calculation->toStdClass();
632
+ $calculateMultipleServicesStdObject->serviceTypeIds = $serviceTypeIds;
633
+ $calculateMultipleServicesStdObject->calculation->serviceTypeId = ParamCalculation::CALCULATE_MULTUPLE_SERVICES_SERVICE_TYPE_ID;
634
+ $response = parent::calculateMultipleServices($calculateMultipleServicesStdObject);
635
+ $arrCalculateMultipleServices = array();
636
+ if (isset($response->return)) {
637
+ $arrStdCalculateMultipleServices = $response->return;
638
+ if (is_array($arrStdCalculateMultipleServices)) {
639
+ for($i = 0; $i < count($arrStdCalculateMultipleServices); $i++) {
640
+ $arrCalculateMultipleServices[$i] = new ResultCalculationMS($arrStdCalculateMultipleServices[$i]);
641
+ }
642
+ } else {
643
+ $arrCalculateMultipleServices[0] = new ResultCalculationMS($arrStdCalculateMultipleServices);
644
+ }
645
+ }
646
+ return $arrCalculateMultipleServices;
647
+ } catch (SoapFault $sf) {
648
+ throw new ServerException($sf);
649
+ }
650
+ }
651
+
652
+ /**
653
+ * @see EPSInterface::calculatePicking()
654
+ */
655
+ public function calculatePicking($sessionId, $picking) {
656
+ try {
657
+ $calculatePickingStdObject = new stdClass();
658
+ $calculatePickingStdObject->sessionId = $sessionId;
659
+ $calculatePickingStdObject->picking = $picking->toStdClass();
660
+ $response = parent::calculatePicking($calculatePickingStdObject);
661
+ if (isset($response->return)) {
662
+ $resultCalculation = new ResultCalculation($response->return);
663
+ } else {
664
+ $resultCalculation = null;
665
+ }
666
+ return $resultCalculation;
667
+ } catch (SoapFault $sf) {
668
+ throw new ServerException($sf);
669
+ }
670
+ }
671
+
672
+ /**
673
+ * @see EPSInterface::createBillOfLading()
674
+ */
675
+ public function createBillOfLading($sessionId, $picking) {
676
+ try {
677
+ $createBillOfLadingStdObject = new stdClass();
678
+ $createBillOfLadingStdObject->sessionId = $sessionId;
679
+ $createBillOfLadingStdObject->picking = $picking->toStdClass();
680
+ $response = parent::createBillOfLading($createBillOfLadingStdObject);
681
+ if (isset($response->return)) {
682
+ $resultBOL = new ResultBOL($response->return);
683
+ } else {
684
+ $resultBOL = null;
685
+ }
686
+ return $resultBOL;
687
+ } catch (SoapFault $sf) {
688
+ throw new ServerException($sf);
689
+ }
690
+ }
691
+
692
+ /**
693
+ * @see EPSInterface::createPDF()
694
+ */
695
+ public function createPDF($sessionId, $params) {
696
+ try {
697
+ $createPDFStdObject = new stdClass();
698
+ $createPDFStdObject->sessionId = $sessionId;
699
+ $createPDFStdObject->params = $params->toStdClass();
700
+ $response = parent::createPDF($createPDFStdObject);
701
+ if (isset($response->return)) {
702
+ $resultPDF = $response->return;
703
+ } else {
704
+ $resultPDF = null;
705
+ }
706
+ return $resultPDF;
707
+ } catch (SoapFault $sf) {
708
+ throw new ServerException($sf);
709
+ }
710
+ }
711
+
712
+ /**
713
+ * @see EPSInterface::createBillOfLadingPDF()
714
+ */
715
+ public function createBillOfLadingPDF($sessionId, $billOfLading, $includeAutoPrintJS) {
716
+ try {
717
+ $createBillOfLadingPDFStdObject = new stdClass();
718
+ $createBillOfLadingPDFStdObject->sessionId = $sessionId;
719
+ $createBillOfLadingPDFStdObject->billOfLading = $billOfLading;
720
+ $createBillOfLadingPDFStdObject->includeAutoPrintJS = $includeAutoPrintJS;
721
+ $response = parent::createBillOfLadingPDF($createBillOfLadingPDFStdObject);
722
+ if (isset($response->return)) {
723
+ $resultPDF = $response->return;
724
+ } else {
725
+ $resultPDF = null;
726
+ }
727
+ return $resultPDF;
728
+ } catch (SoapFault $sf) {
729
+ throw new ServerException($sf);
730
+ }
731
+ }
732
+
733
+ /**
734
+ * @see EPSInterface::createCustomTravelLabelPDFType1()
735
+ */
736
+ public function createCustomTravelLabelPDFType1($sessionId, $parcelId) {
737
+ try {
738
+ $createCustomTravelLabelPDFType1StdObject = new stdClass();
739
+ $createCustomTravelLabelPDFType1StdObject->sessionId = $sessionId;
740
+ $createCustomTravelLabelPDFType1StdObject->parcelId = $parcelId;
741
+ $response = parent::createCustomTravelLabelPDFType1($createCustomTravelLabelPDFType1StdObject);
742
+ if (isset($response->return)) {
743
+ $resultPDF = $response->return;
744
+ } else {
745
+ $resultPDF = null;
746
+ }
747
+ return $resultPDF;
748
+ } catch (SoapFault $sf) {
749
+ throw new ServerException($sf);
750
+ }
751
+ }
752
+
753
+ /**
754
+ * @see EPSInterface::invalidatePicking()
755
+ */
756
+ public function invalidatePicking($sessionId, $billOfLading, $cancelComment) {
757
+ try {
758
+ $invalidatePickingStdObject = new stdClass();
759
+ $invalidatePickingStdObject->sessionId = $sessionId;
760
+ $invalidatePickingStdObject->billOfLading = $billOfLading;
761
+ $invalidatePickingStdObject->cancelComment = $cancelComment;
762
+ parent::invalidatePicking($invalidatePickingStdObject);
763
+ } catch (SoapFault $sf) {
764
+ throw new ServerException($sf);
765
+ }
766
+ }
767
+
768
+ /**
769
+ * @see EPSInterface::updateBillOfLading()
770
+ */
771
+ public function updateBillOfLading($sessionId, $picking) {
772
+ try {
773
+ $updateBillOfLadingStdObject = new stdClass();
774
+ $updateBillOfLadingStdObject->sessionId = $sessionId;
775
+ $updateBillOfLadingStdObject->picking = $picking->toStdClass();
776
+ $response = parent::updateBillOfLading($updateBillOfLadingStdObject);
777
+ if (isset($response->return)) {
778
+ $resultBOL = new ResultBOL($response->return);
779
+ } else {
780
+ $resultBOL = null;
781
+ }
782
+ return $resultBOL;
783
+ } catch (SoapFault $sf) {
784
+ throw new ServerException($sf);
785
+ }
786
+ }
787
+
788
+ /**
789
+ * @see EPSInterface::addParcel()
790
+ */
791
+ public function addParcel($sessionId, $parcel) {
792
+ try {
793
+ $addParcelStdObject = new stdClass();
794
+ $addParcelStdObject->sessionId = $sessionId;
795
+ $addParcelStdObject->parcel = $parcel->toStdClass();
796
+ $response = parent::addParcel($addParcelStdObject);
797
+ if (isset($response->return)) {
798
+ $result = $response->return;
799
+ } else {
800
+ $result = null;
801
+ }
802
+ return $result;
803
+ } catch (SoapFault $sf) {
804
+ throw new ServerException($sf);
805
+ }
806
+ }
807
+
808
+ /**
809
+ * @see EPSInterface::finalizeBillOfLadingCreation()
810
+ */
811
+ public function finalizeBillOfLadingCreation($sessionId, $billOfLading) {
812
+ try {
813
+ $finalizeBillOfLadingCreationStdObject = new stdClass();
814
+ $finalizeBillOfLadingCreationStdObject->sessionId = $sessionId;
815
+ $finalizeBillOfLadingCreationStdObject->billOfLading = $billOfLading;
816
+ $response = parent::finalizeBillOfLadingCreation($finalizeBillOfLadingCreationStdObject);
817
+ if (isset($response->return)) {
818
+ $resultBOL = new ResultBOL($response->return);
819
+ } else {
820
+ $resultBOL = null;
821
+ }
822
+ return $resultBOL;
823
+ } catch (SoapFault $sf) {
824
+ throw new ServerException($sf);
825
+ }
826
+ }
827
+
828
+ /**
829
+ * @see EPSInterface::createOrder()
830
+ */
831
+ public function createOrder($sessionId, $order) {
832
+ try {
833
+ $createOrderStdObject = new stdClass();
834
+ $createOrderStdObject->sessionId = $sessionId;
835
+ $createOrderStdObject->order = $order->toStdClass();
836
+ $response = parent::createOrder($createOrderStdObject);
837
+ $arrCreateOrder = array();
838
+ if (isset($response->return)) {
839
+ $arrStdCreateOrder = $response->return;
840
+ if (is_array($arrStdCreateOrder)) {
841
+ for($i = 0; $i < count($arrStdCreateOrder); $i++) {
842
+ $arrCreateOrder[$i] = new ResultOrderPickingInfo($arrStdCreateOrder[$i]);
843
+ }
844
+ } else {
845
+ $arrCreateOrder[0] = new ResultOrderPickingInfo($arrStdCreateOrder);
846
+ }
847
+ }
848
+ return $arrCreateOrder;
849
+ } catch (SoapFault $sf) {
850
+ throw new ServerException($sf);
851
+ }
852
+ }
853
+
854
+ /**
855
+ * @see EPSInterface::getPickingParcels()
856
+ */
857
+ public function getPickingParcels($sessionId, $billOfLading) {
858
+ try {
859
+ $getPickingParcelsStdObject = new stdClass();
860
+ $getPickingParcelsStdObject->sessionId = $sessionId;
861
+ $getPickingParcelsStdObject->billOfLading = $billOfLading;
862
+ $response = parent::getPickingParcels($getPickingParcelsStdObject);
863
+ $arrResultParcelInfo = array();
864
+ if (isset($response->return)) {
865
+ $arrStdResultParcelInfo = $response->return;
866
+ if (is_array($arrStdResultParcelInfo)) {
867
+ for($i = 0; $i < count($arrStdResultParcelInfo); $i++) {
868
+ $arrResultParcelInfo[$i] = new ResultParcelInfo($arrStdResultParcelInfo[$i]);
869
+ }
870
+ } else {
871
+ $arrResultParcelInfo[0] = new ResultParcelInfo($arrStdResultParcelInfo);
872
+ }
873
+ }
874
+ return $arrResultParcelInfo;
875
+ } catch (SoapFault $sf) {
876
+ throw new ServerException($sf);
877
+ }
878
+ }
879
+
880
+ /**
881
+ * @see EPSInterface::trackPicking()
882
+ */
883
+ public function trackPicking($sessionId, $billOfLading) {
884
+ try {
885
+ $trackPickingStdObject = new stdClass();
886
+ $trackPickingStdObject->sessionId = $sessionId;
887
+ $trackPickingStdObject->billOfLading = $billOfLading;
888
+ $response = parent::trackPicking($trackPickingStdObject);
889
+ $arrResultTrackPicking = array();
890
+ if (isset($response->return)) {
891
+ $arrStdResultTrackPicking = $response->return;
892
+ if (is_array($arrStdResultTrackPicking)) {
893
+ for($i = 0; $i < count($arrStdResultTrackPicking); $i++) {
894
+ $arrResultTrackPicking[$i] = new ResultTrackPicking($arrStdResultTrackPicking[$i]);
895
+ }
896
+ } else {
897
+ $arrResultTrackPicking[0] = new ResultTrackPicking($arrStdResultTrackPicking);
898
+ }
899
+ }
900
+ return $arrResultTrackPicking;
901
+ } catch (SoapFault $sf) {
902
+ throw new ServerException($sf);
903
+ }
904
+ }
905
+
906
+ /**
907
+ * @see EPSInterface::trackPickingEx()
908
+ */
909
+ public function trackPickingEx($sessionId, $billOfLading, $language, $returnOnlyLastOperation) {
910
+ try {
911
+ $trackPickingExStdObject = new stdClass();
912
+ $trackPickingExStdObject->sessionId = $sessionId;
913
+ $trackPickingExStdObject->billOfLading = $billOfLading;
914
+ $trackPickingExStdObject->language = $language;
915
+ $trackPickingExStdObject->returnOnlyLastOperation = $returnOnlyLastOperation;
916
+ $response = parent::trackPickingEx($trackPickingExStdObject);
917
+ $arrResultTrackPickingEx = array();
918
+
919
+ if (isset($response->return)) {
920
+ $arrStdResultTrackPickingEx = $response->return;
921
+ if (is_array($arrStdResultTrackPickingEx)) {
922
+ for($i = 0; $i < count($arrStdResultTrackPickingEx); $i++) {
923
+ $arrResultTrackPickingEx[$i] = new ResultTrackPickingEx($arrStdResultTrackPickingEx[$i]);
924
+ }
925
+ } else {
926
+ $arrResultTrackPickingEx[0] = new ResultTrackPickingEx($arrStdResultTrackPickingEx);
927
+ }
928
+ }
929
+ return $arrResultTrackPickingEx;
930
+ } catch (SoapFault $sf) {
931
+ throw new ServerException($sf);
932
+ }
933
+ }
934
+
935
+ /**
936
+ * @see EPSInterface::searchPickingsByRefNumber()
937
+ */
938
+ public function searchPickingsByRefNumber($sessionId, $params) {
939
+ try {
940
+ $searchPickingsByRefNumberStdObject = new stdClass();
941
+ $searchPickingsByRefNumberStdObject->sessionId = $sessionId;
942
+ $searchPickingsByRefNumberStdObject->params = $params->toStdClass();
943
+ $response = parent::searchPickingsByRefNumber($searchPickingsByRefNumberStdObject);
944
+ $arrSearchPickingsByRefNumber = array();
945
+ if (isset($response->return)) {
946
+ $arrStdSearchPickingsByRefNumber = $response->return;
947
+ if (is_array($arrStdSearchPickingsByRefNumber)) {
948
+ for($i = 0; $i < count($arrStdSearchPickingsByRefNumber); $i++) {
949
+ $arrSearchPickingsByRefNumber[$i] = $arrStdSearchPickingsByRefNumber[$i];
950
+ }
951
+ } else {
952
+ $arrSearchPickingsByRefNumber[0] = $arrStdSearchPickingsByRefNumber;
953
+ }
954
+ }
955
+ return $arrSearchPickingsByRefNumber;
956
+ } catch (SoapFault $sf) {
957
+ throw new ServerException($sf);
958
+ }
959
+ }
960
+
961
+ /**
962
+ * @see EPSInterface::trackParcel()
963
+ */
964
+ public function trackParcel($sessionId, $parcelId, $language, $returnOnlyLastOperation) {
965
+ try {
966
+ $trackParcelStdObject = new stdClass();
967
+ $trackParcelStdObject->sessionId = $sessionId;
968
+ $trackParcelStdObject->parcelId = $parcelId;
969
+ $trackParcelStdObject->language = $language;
970
+ $trackParcelStdObject->returnOnlyLastOperation = $returnOnlyLastOperation;
971
+ $response = parent::trackParcel($trackParcelStdObject);
972
+ $arrResultTrackParcel = array();
973
+
974
+ if (isset($response->return)) {
975
+ $arrStdResultTrackParcel = $response->return;
976
+ if (is_array($arrStdResultTrackParcel)) {
977
+ for($i = 0; $i < count($arrStdResultTrackParcel); $i++) {
978
+ $arrResultTrackParcel[$i] = new ResultTrackPickingEx($arrStdResultTrackParcel[$i]);
979
+ }
980
+ } else {
981
+ $arrResultTrackParcel[0] = new ResultTrackPickingEx($arrStdResultTrackParcel);
982
+ }
983
+ }
984
+ return $arrResultTrackParcel;
985
+ } catch (SoapFault $sf) {
986
+ throw new ServerException($sf);
987
+ }
988
+ }
989
+
990
+ /**
991
+ * @see EPSInterface::trackParcelMultiple()
992
+ */
993
+ public function trackParcelMultiple($sessionId, $barcodes, $language, $returnOnlyLastOperation) {
994
+ try {
995
+ $trackParcelMultipleStdObject = new stdClass();
996
+ $trackParcelMultipleStdObject->sessionId = $sessionId;
997
+ $trackParcelMultipleStdObject->barcodes = $barcodes;
998
+ $trackParcelMultipleStdObject->language = $language;
999
+ $trackParcelMultipleStdObject->returnOnlyLastOperation = $returnOnlyLastOperation;
1000
+ $response = parent::trackParcelMultiple($trackParcelMultipleStdObject);
1001
+ $arrResultTrackParcelMultiple = array();
1002
+
1003
+ if (isset($response->return)) {
1004
+ $arrStdResultTrackParcelMultiple = $response->return;
1005
+ if (is_array($arrStdResultTrackParcelMultiple)) {
1006
+ for($i = 0; $i < count($arrStdResultTrackParcelMultiple); $i++) {
1007
+ $arrResultTrackParcelMultiple[$i] = new ResultTrackPickingEx($arrStdResultTrackParcelMultiple[$i]);
1008
+ }
1009
+ } else {
1010
+ $arrResultTrackParcelMultiple[0] = new ResultTrackPickingEx($arrStdResultTrackParcelMultiple);
1011
+ }
1012
+ }
1013
+ return $arrResultTrackParcelMultiple;
1014
+ } catch (SoapFault $sf) {
1015
+ throw new ServerException($sf);
1016
+ }
1017
+ }
1018
+
1019
+ /**
1020
+ * @see EPSInterface::getMicroregionId
1021
+ */
1022
+ public function getMicroregionId($sessionId, $coordX, $coordY) {
1023
+ try {
1024
+ $getMicroregionIdSdtClass = new stdClass();
1025
+ $getMicroregionIdSdtClass->sessionId = $sessionId;
1026
+ $getMicroregionIdSdtClass->coordX = $coordX;
1027
+ $getMicroregionIdSdtClass->coordY = $coordY;
1028
+ $response = parent::getMicroregionId($getMicroregionIdSdtClass);
1029
+ if (isset($response->return)) {
1030
+ $microregionId = $response->return;
1031
+ } else {
1032
+ $microregionId = null;
1033
+ }
1034
+ return $microregionId;
1035
+ } catch (SoapFault $sf) {
1036
+ throw new ServerException($sf);
1037
+ }
1038
+ }
1039
+
1040
+ /**
1041
+ * @see EPSInterface::searchClients()
1042
+ */
1043
+ public function searchClients($sessionId, $clientQuery) {
1044
+ try {
1045
+ $searchClientsStdObject = new stdClass();
1046
+ $searchClientsStdObject->sessionId = $sessionId;
1047
+ $searchClientsStdObject->clientQuery = $clientQuery->toStdClass();
1048
+ $response = parent::searchClients($searchClientsStdObject);
1049
+ $arrResultClientData = array();
1050
+
1051
+ if (isset($response->return)) {
1052
+ $arrStdResultClientData = $response->return;
1053
+ if (is_array($arrStdResultClientData)) {
1054
+ for($i = 0; $i < count($arrStdResultClientData); $i++) {
1055
+ $arrResultClientData[$i] = new ResultClientData($arrStdResultClientData[$i]);
1056
+ }
1057
+ } else {
1058
+ $arrResultClientData[0] = new ResultClientData($arrStdResultClientData);
1059
+ }
1060
+ }
1061
+ return $arrResultClientData;
1062
+ } catch (SoapFault $sf) {
1063
+ throw new ServerException($sf);
1064
+ }
1065
+ }
1066
+
1067
+ /**
1068
+ * @see EPSInterface::listSpecialDeliveryRequirements()
1069
+ */
1070
+ public function listSpecialDeliveryRequirements($sessionId) {
1071
+ try {
1072
+ $listSpecialDeliveryRequirementsStdObject = new stdClass();
1073
+ $listSpecialDeliveryRequirementsStdObject->sessionId = $sessionId;
1074
+ $response = parent::listSpecialDeliveryRequirements($listSpecialDeliveryRequirementsStdObject);
1075
+ $arrResultSpecialDeliveryRequirement = array();
1076
+
1077
+ if (isset($response->return)) {
1078
+ $arrStdResultSpecialDeliveryRequirement = $response->return;
1079
+ if (is_array($arrStdResultSpecialDeliveryRequirement)) {
1080
+ for($i = 0; $i < count($arrStdResultSpecialDeliveryRequirement); $i++) {
1081
+ $arrResultSpecialDeliveryRequirement[$i] = new ResultSpecialDeliveryRequirement($arrStdResultSpecialDeliveryRequirement[$i]);
1082
+ }
1083
+ } else {
1084
+ $arrResultSpecialDeliveryRequirement[0] = new ResultSpecialDeliveryRequirement($arrStdResultSpecialDeliveryRequirement);
1085
+ }
1086
+ }
1087
+ return $arrResultSpecialDeliveryRequirement;
1088
+ } catch (SoapFault $sf) {
1089
+ throw new ServerException($sf);
1090
+ }
1091
+ }
1092
+
1093
+ /**
1094
+ * @see EPSInterface::validateAddress()
1095
+ */
1096
+ public function validateAddress($sessionId, $address, $validationMode) {
1097
+ try {
1098
+ $validateAddressStdObject = new stdClass();
1099
+ $validateAddressStdObject->sessionId = $sessionId;
1100
+ $validateAddressStdObject->address = $address->toStdClass();
1101
+ $validateAddressStdObject->validationMode = $validationMode;
1102
+ $response = parent::validateAddress($validateAddressStdObject);
1103
+ return $response->return;
1104
+ } catch (SoapFault $sf) {
1105
+ throw new ServerException($sf);
1106
+ }
1107
+ }
1108
+
1109
+ /**
1110
+ * @see EPSInterface::listContractClients()
1111
+ */
1112
+ public function listContractClients($sessionId) {
1113
+ try {
1114
+ $listContractClientsStdObject = new stdClass();
1115
+ $listContractClientsStdObject->sessionId = $sessionId;
1116
+ $response = parent::listContractClients($listContractClientsStdObject);
1117
+ $arrResultContractClients = array();
1118
+
1119
+ if (isset($response->return)) {
1120
+ $arrStdResultContractClients = $response->return;
1121
+ if (is_array($arrStdResultContractClients)) {
1122
+ for($i = 0; $i < count($arrStdResultContractClients); $i++) {
1123
+ $arrResultContractClients[$i] = new ResultClientData($arrStdResultContractClients[$i]);
1124
+ }
1125
+ } else {
1126
+ $arrResultContractClients[0] = new ResultClientData($arrStdResultContractClients);
1127
+ }
1128
+ }
1129
+ return $arrResultContractClients;
1130
+ } catch (SoapFault $sf) {
1131
+ throw new ServerException($sf);
1132
+ }
1133
+ }
1134
+
1135
+ /**
1136
+ * @see EPSInterface::listOfficesEx()
1137
+ */
1138
+ public function listOfficesEx($sessionId, $name, $siteId, $language) {
1139
+ try {
1140
+ $listOfficesExStdObject = new stdClass();
1141
+ $listOfficesExStdObject->sessionId = $sessionId;
1142
+ $listOfficesExStdObject->name = $name;
1143
+ $listOfficesExStdObject->siteId = $siteId;
1144
+ $listOfficesExStdObject->language = $language;
1145
+ $response = parent::listOfficesEx($listOfficesExStdObject);
1146
+ $arrListOfficesEx = array();
1147
+ if (isset($response->return)) {
1148
+ $arrStdListOfficesEx = $response->return;
1149
+ if (is_array($arrStdListOfficesEx)) {
1150
+ for($i = 0; $i < count($arrStdListOfficesEx); $i++) {
1151
+ $arrListOfficesEx[$i] = new ResultOfficeEx($arrStdListOfficesEx[$i]);
1152
+ }
1153
+ } else {
1154
+ $arrListOfficesEx[0] = new ResultOfficeEx($arrStdListOfficesEx);
1155
+ }
1156
+ }
1157
+ return $arrListOfficesEx;
1158
+ } catch (SoapFault $sf) {
1159
+ throw new ServerException($sf);
1160
+ }
1161
+ }
1162
+
1163
+ /**
1164
+ * @see EPSInterface::deserializeAddress()
1165
+ */
1166
+ public function deserializeAddress($sessionId, $address) {
1167
+ try {
1168
+ $deserializeAddressStdObject = new stdClass();
1169
+ $deserializeAddressStdObject->sessionId = $sessionId;
1170
+ $deserializeAddressStdObject->address = $address;
1171
+ $response = parent::deserializeAddress($deserializeAddressStdObject);
1172
+ if (isset($response->return)) {
1173
+ $paramAddress = new ParamAddress($response->return);
1174
+ } else {
1175
+ $paramAddress = null;
1176
+ }
1177
+ return $paramAddress;
1178
+ } catch (SoapFault $sf) {
1179
+ throw new ServerException($sf);
1180
+ }
1181
+ }
1182
+
1183
+ /**
1184
+ * @see EPSInterface::serializeAddress()
1185
+ */
1186
+ public function serializeAddress($sessionId, $address) {
1187
+ try {
1188
+ $serializeAddressStdObject = new stdClass();
1189
+ $serializeAddressStdObject->sessionId = $sessionId;
1190
+ $serializeAddressStdObject->address = $address->toStdClass();
1191
+ $response = parent::serializeAddress($serializeAddressStdObject);
1192
+ if (isset($response->return)) {
1193
+ $serializedAddress = $response->return;
1194
+ } else {
1195
+ $serializedAddress = null;
1196
+ }
1197
+ return $serializedAddress;
1198
+ } catch (SoapFault $sf) {
1199
+ throw new ServerException($sf);
1200
+ }
1201
+ }
1202
+
1203
+ /**
1204
+ * @see EPSInterface::makeAddressString()
1205
+ */
1206
+ public function makeAddressString($sessionId, $address) {
1207
+ try {
1208
+ $makeAddressStringStdObject = new stdClass();
1209
+ $makeAddressStringStdObject->sessionId = $sessionId;
1210
+ $makeAddressStringStdObject->address = $address->toStdClass();;
1211
+ $response = parent::makeAddressString($makeAddressStringStdObject);
1212
+ if (isset($response->return)) {
1213
+ $resultAddressString = new ResultAddressString($response->return);
1214
+ } else {
1215
+ $resultAddressString = null;
1216
+ }
1217
+ return $resultAddressString;
1218
+ } catch (SoapFault $sf) {
1219
+ throw new ServerException($sf);
1220
+ }
1221
+ }
1222
+
1223
+ /**
1224
+ * @see EPSInterface::getAdditionalUserParams()
1225
+ */
1226
+ public function getAdditionalUserParams($sessionId, $date) {
1227
+ try {
1228
+ $getAdditionalUserParamsStdObject = new stdClass();
1229
+ $getAdditionalUserParamsStdObject->sessionId = $sessionId;
1230
+ $getAdditionalUserParamsStdObject->date = $date;
1231
+ $response = parent::getAdditionalUserParams($getAdditionalUserParamsStdObject);
1232
+ $arrListAdditionalUserParams = array();
1233
+ if (isset($response->return)) {
1234
+ $arrStdListAdditionalUserParams = $response->return;
1235
+ if (is_array($arrStdListAdditionalUserParams)) {
1236
+ for($i = 0; $i < count($arrStdListAdditionalUserParams); $i++) {
1237
+ $arrListAdditionalUserParams[$i] = $arrStdListAdditionalUserParams[$i];
1238
+ }
1239
+ } else {
1240
+ $arrListAdditionalUserParams[0] = $arrStdListAdditionalUserParams;
1241
+ }
1242
+ }
1243
+ return $arrListAdditionalUserParams;
1244
+ } catch (SoapFault $sf) {
1245
+ throw new ServerException($sf);
1246
+ }
1247
+ }
1248
+
1249
+ /**
1250
+ * @see EPSInterface::listCountries()
1251
+ */
1252
+ public function listCountries($sessionId, $name, $language) {
1253
+ try {
1254
+ $listCountriesStdObject = new stdClass();
1255
+ $listCountriesStdObject->sessionId = $sessionId;
1256
+ $listCountriesStdObject->name = $name;
1257
+ $listCountriesStdObject->language = $language;
1258
+
1259
+ $response = parent::listCountries($listCountriesStdObject);
1260
+ $arrListCountriesStdObject = array();
1261
+ if (isset($response->return)) {
1262
+ $arrStdListCountriesStdObject = $response->return;
1263
+ if (is_array($arrStdListCountriesStdObject)) {
1264
+ for($i = 0; $i < count($arrStdListCountriesStdObject); $i++) {
1265
+ $arrListCountriesStdObject[$i] = new ResultCountry($arrStdListCountriesStdObject[$i]);
1266
+ }
1267
+ } else {
1268
+ $arrListCountriesStdObject[0] = new ResultCountry($arrStdListCountriesStdObject);
1269
+ }
1270
+ }
1271
+ return $arrListCountriesStdObject;
1272
+ } catch (SoapFault $sf) {
1273
+ throw new ServerException($sf);
1274
+ }
1275
+ }
1276
+
1277
+ /**
1278
+ * @see EPSInterface::listCountriesEx()
1279
+ */
1280
+ public function listCountriesEx($sessionId, $filter, $language) {
1281
+ try {
1282
+ $listCountriesExStdObject = new stdClass();
1283
+ $listCountriesExStdObject->sessionId = $sessionId;
1284
+ $listCountriesExStdObject->filter = $filter->toStdClass();
1285
+ $listCountriesExStdObject->language = $language;
1286
+
1287
+ $response = parent::listCountriesEx($listCountriesExStdObject);
1288
+ $arrListCountriesExStdObject = array();
1289
+ if (isset($response->return)) {
1290
+ $arrStdListCountriesExStdObject = $response->return;
1291
+ if (is_array($arrStdListCountriesExStdObject)) {
1292
+ for($i = 0; $i < count($arrStdListCountriesExStdObject); $i++) {
1293
+ $arrListCountriesExStdObject[$i] = new ResultCountry($arrStdListCountriesExStdObject[$i]);
1294
+ }
1295
+ } else {
1296
+ $arrListCountriesExStdObject[0] = new ResultCountry($arrStdListCountriesExStdObject);
1297
+ }
1298
+ }
1299
+ return $arrListCountriesExStdObject;
1300
+ } catch (SoapFault $sf) {
1301
+ throw new ServerException($sf);
1302
+ }
1303
+ }
1304
+
1305
+ /**
1306
+ * @see EPSInterface::listStates()
1307
+ */
1308
+ public function listStates($sessionId, $countryId, $name) {
1309
+ try {
1310
+ $listStatesStdObject = new stdClass();
1311
+ $listStatesStdObject->sessionId = $sessionId;
1312
+ $listStatesStdObject->countryId = $countryId;
1313
+ $listStatesStdObject->name = $name;
1314
+
1315
+ $response = parent::listStates($listStatesStdObject);
1316
+ $arrListStatesStdObject = array();
1317
+ if (isset($response->return)) {
1318
+ $arrStdListStatesStdObject = $response->return;
1319
+ if (is_array($arrStdListStatesStdObject)) {
1320
+ for($i = 0; $i < count($arrStdListStatesStdObject); $i++) {
1321
+ $arrListStatesStdObject[$i] = new ResultState($arrStdListStatesStdObject[$i]);
1322
+ }
1323
+ } else {
1324
+ $arrListStatesStdObject[0] = new ResultState($arrStdListStatesStdObject);
1325
+ }
1326
+ }
1327
+ return $arrListStatesStdObject;
1328
+ } catch (SoapFault $sf) {
1329
+ throw new ServerException($sf);
1330
+ }
1331
+ }
1332
+
1333
+ /**
1334
+ * @see EPSInterface::getStateById()
1335
+ */
1336
+ public function getStateById($sessionId, $stateId) {
1337
+ try {
1338
+ $getStateByIdStdObject = new stdClass();
1339
+ $getStateByIdStdObject->sessionId = $sessionId;
1340
+ $getStateByIdStdObject->stateId = $stateId;
1341
+ $response = parent::getStateById($getStateByIdStdObject);
1342
+ if (isset($response->return)) {
1343
+ $resultState = new ResultState($response->return);
1344
+ } else {
1345
+ $resultState = null;
1346
+ }
1347
+ return $resultState;
1348
+ } catch (SoapFault $sf) {
1349
+ throw new ServerException($sf);
1350
+ }
1351
+ }
1352
+
1353
+ /**
1354
+ * @see EPSInterface::getStateById()
1355
+ */
1356
+ public function validatePostCode($sessionId, $countryId, $postCode) {
1357
+ try {
1358
+ $validatePostCodeStdObject = new stdClass();
1359
+ $validatePostCodeStdObject->sessionId = $sessionId;
1360
+ $validatePostCodeStdObject->countryId = $countryId;
1361
+ $validatePostCodeStdObject->postCode = $postCode;
1362
+ $response = parent::validatePostCode($validatePostCodeStdObject);
1363
+ if (isset($response->return)) {
1364
+ $resultFlag = $response->return;
1365
+ } else {
1366
+ $resultFlag = null;
1367
+ }
1368
+ return $resultFlag;
1369
+ } catch (SoapFault $sf) {
1370
+ throw new ServerException($sf);
1371
+ }
1372
+ }
1373
+
1374
+ /**
1375
+ * @see EPSInterface::getStateById()
1376
+ */
1377
+ public function getPickingDeliveryInfo($sessionId, $billOfLading, $language) {
1378
+ try {
1379
+ $getPickingDeliveryInfoStdObject = new stdClass();
1380
+ $getPickingDeliveryInfoStdObject->sessionId = $sessionId;
1381
+ $getPickingDeliveryInfoStdObject->billOfLading = $billOfLading;
1382
+ $getPickingDeliveryInfoStdObject->language = $language;
1383
+
1384
+ $response = parent::getPickingDeliveryInfo($getPickingDeliveryInfoStdObject);
1385
+ $arrResultTrackPickingExStdObject = array();
1386
+ if (isset($response->return)) {
1387
+ $arrStdResultTrackPickingExStdObject = $response->return;
1388
+ if (is_array($arrStdResultTrackPickingExStdObject)) {
1389
+ for($i = 0; $i < count($arrStdResultTrackPickingExStdObject); $i++) {
1390
+ $arrResultTrackPickingExStdObject[$i] = new ResultTrackPickingEx($arrStdResultTrackPickingExStdObject[$i]);
1391
+ }
1392
+ } else {
1393
+ $arrResultTrackPickingExStdObject[0] = new ResultTrackPickingEx($arrStdResultTrackPickingExStdObject);
1394
+ }
1395
+ }
1396
+ return $arrResultTrackPickingExStdObject;
1397
+ } catch (SoapFault $sf) {
1398
+ throw new ServerException($sf);
1399
+ }
1400
+ }
1401
+
1402
+ /**
1403
+ * @see EPSInterface::searchSecondaryPickings()
1404
+ */
1405
+ public function searchSecondaryPickings($sessionId, $paramSearchSecondaryPickings) {
1406
+ try {
1407
+ $searchSecondaryPickingsStdObject = new stdClass();
1408
+ $searchSecondaryPickingsStdObject->sessionId = $sessionId;
1409
+ $searchSecondaryPickingsStdObject->paramSearchSecondaryPickings = $paramSearchSecondaryPickings->toStdClass();
1410
+ $response = parent::searchSecondaryPickings($searchSecondaryPickingsStdObject);
1411
+
1412
+ $arrResultPickingInfoStdObject = array();
1413
+ if (isset($response->return)) {
1414
+ $arrStdResultPickingInfoObject = $response->return;
1415
+ if (is_array($arrStdResultPickingInfoObject)) {
1416
+ for($i = 0; $i < count($arrStdResultPickingInfoObject); $i++) {
1417
+ $arrResultPickingInfoStdObject[$i] = new ResultPickingInfo($arrStdResultPickingInfoObject[$i]);
1418
+ }
1419
+ } else {
1420
+ $arrResultPickingInfoStdObject[0] = new ResultPickingInfo($arrStdResultPickingInfoObject);
1421
+ }
1422
+ }
1423
+ return $arrResultPickingInfoStdObject;
1424
+ } catch (SoapFault $sf) {
1425
+ throw new ServerException($sf);
1426
+ }
1427
+ }
1428
+
1429
+
1430
+ /**
1431
+ * @see EPSInterface::getPickingExtendedInfo()
1432
+ */
1433
+ public function getPickingExtendedInfo($sessionId, $billOfLading) {
1434
+ try {
1435
+ $getPickingExtendedInfoStdObject = new stdClass();
1436
+ $getPickingExtendedInfoStdObject->sessionId = $sessionId;
1437
+ $getPickingExtendedInfoStdObject->billOfLading = $billOfLading;
1438
+ $response = parent::getPickingExtendedInfo($getPickingExtendedInfoStdObject);
1439
+
1440
+ if (isset($response->return)) {
1441
+ $ResultPickingExtendedInfo = new ResultPickingExtendedInfo($response->return);
1442
+ } else {
1443
+ $ResultPickingExtendedInfo = null;
1444
+ }
1445
+ return $ResultPickingExtendedInfo;
1446
+ /*
1447
+ $arrResultPickingExtendedInfoStdObject = array();
1448
+ if (isset($response->return)) {
1449
+ $arrStdResultPickingExtendedInfoObject = $response->return;
1450
+ if (is_array($arrStdResultPickingExtendedInfoObject)) {
1451
+ for($i = 0; $i < count($arrStdResultPickingExtendedInfoObject); $i++) {
1452
+ $arrResultPickingExtendedInfoStdObject[$i] = new ResultPickingExtendedInfo($arrStdResultPickingExtendedInfoObject[$i]);
1453
+ }
1454
+ } else {
1455
+ $arrResultPickingExtendedInfoStdObject[0] = new ResultPickingExtendedInfo($arrStdResultPickingExtendedInfoObject);
1456
+ }
1457
+ }
1458
+ return $arrResultPickingExtendedInfoStdObject;
1459
+ */
1460
+
1461
+ } catch (SoapFault $sf) {
1462
+ throw new ServerException($sf);
1463
+ }
1464
+ }
1465
+
1466
+ }
1467
  ?>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Speedy_Shipping</name>
4
- <version>1.3.4</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Version 1.3.4</summary>
10
- <description>Version 1.3.4</description>
11
- <notes>Version 1.3.4</notes>
12
  <authors><author><name>Speedy JSC</name><user>evgeni</user><email>magento@speedy.bg</email></author></authors>
13
- <date>2016-09-08</date>
14
- <time>12:07:55</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Speedyshipping.xml" hash="a597ad6e81bb153bafe437f2869ede69"/></dir></target><target name="magecommunity"><dir name="Speedy"><dir name="Speedyshipping"><dir name="Block"><dir name="Adminhtml"><file name="Billoflading.php" hash="55757a4477588daa54ec3b9699dab979"/><dir name="Requestcourier"><file name="Grid.php" hash="2284de6c2d2ef6029c8a84bd86f8bc53"/><dir name="Renderer"><file name="Cancelbutton.php" hash="062d962aed0a14896558dd59e03775c9"/><file name="Created.php" hash="3ab6eba87f8986ce55c823327ec60e79"/><file name="Datecreated.php" hash="36ca56ed37cb572c19bcb7e7e7dff081"/><file name="Requestbutton.php" hash="7d8daf6dfebec289f58d035bfc4d9c6d"/><file name="Viewbol.php" hash="728a9cd399df38532a8136adc618b28e"/><file name="Vieworder.php" hash="fb6c0ac4134d26a705f2c7bdc658f035"/></dir><file name="Requestcontainer.php" hash="5529d32f1698e12dc2cf078c68a53797"/></dir><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Billing"><file name="Address.php" hash="575ebbda49b25e95f37bca49cfba623d"/></dir><dir name="Shipping"><file name="Address.php" hash="14c1dc61fcfa00a7f685e2c025f31901"/><file name="Form.php" hash="90112a2a3ed59b021d8fcd347e7b5292"/></dir><dir name="Speedy"><file name="Form.php" hash="5d33815cc6bf12e2bb77bdb7aa7b8468"/></dir><file name="Totals.php" hash="da5b3fe05aca0194f12dcc239be47d45"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Testbutton.php" hash="09aaa0674763be7a3d18fa476decd110"/></dir></dir></dir></dir><dir name="Customer"><dir name="Address"><file name="Edit.php" hash="29852467e29ecd706303e0ffc85ed009"/></dir></dir><dir name="Onepage"><dir name="Billing"><file name="Billing.php" hash="d9e3d433518bfd225b4774389eaa6507"/></dir><file name="Paymentinfo.php" hash="ce4784716a4db7acb32dc96c1220581c"/><file name="Pickupform.php" hash="6185b390e0438a3c588d3bf8362c54cc"/><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="72f3789bb35612be09bb50f6f9f1b443"/></dir><file name="Shipping.php" hash="8f27033a68264f2f2f45fa808cbe7751"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f87f9903ff7b03630377b9a5e0def6a6"/><file name="Exceptionmap.php" hash="5efa0d9221546f4a3b29f98d260998a8"/><file name="Transliterate.php" hash="3f3550a010e08e0b5968645ce6fea5ff"/><dir name="Validate"><file name="Address.php" hash="ad1aea0ca237b264d066f82028e832b2"/></dir></dir><dir name="Model"><dir name="Autocomplete"><file name="Address.php" hash="54fddbb28365e4e3b6ed19f146f23b41"/></dir><dir name="Carrier"><dir name="Receiverdata"><file name="Receiverdata.php" hash="fc9e1cef902f8126705493ef62698975"/></dir><dir name="Senderdata"><file name="Senderdata.php" hash="a29434d47a760d0b26c05da5ce5a8053"/></dir><file name="Shippingmethod.php" hash="5694e65decb911bcfea11ec111c22c4c"/><dir name="Source"><file name="Calculation.php" hash="8feb245ada9a659cc87f1450cba3ca69"/><file name="Deferreddays.php" hash="c0b4154d31d5080a5970eab4ba5f9315"/><file name="Method.php" hash="3a27c91b9c707dd9204baf7ffa814a12"/><file name="Office.php" hash="38d718531131f17dc452a72370d7e5f6"/><file name="Takingoffset.php" hash="a707c9ecb45d1ae6886770264d7c850d"/></dir></dir><file name="Observer.php" hash="d27fbda76fbd7a23760aa534c6528aae"/><dir name="Rate"><file name="Result.php" hash="9e57224fe86a696a8c51e47c1808226f"/></dir><dir name="Resource"><dir name="Saveorder"><file name="Collection.php" hash="45cbc13c07ab7ac7e495bdead549c655"/></dir><file name="Saveorder.php" hash="ebb22be5c4334a201bd6b09d72e96cbe"/><file name="Setup.php" hash="f4fd4f27ba10a9fc68e272a475ff2156"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><file name="Rate.php" hash="82282b54b161255665c888ff9cd7fc6d"/></dir></dir></dir><file name="Saveorder.php" hash="4bbd01470d9ffa1d305fcf7210f88726"/></dir><dir name="controllers"><file name="AddressController.php" hash="42edea2936784d3f00d4780dc2a640ed"/><dir name="Adminhtml"><file name="AddressController.php" hash="adbc2db67d5bc7702d8c33361fdcbfd1"/><file name="CheckcredentialsController.php" hash="6ea877b98919d725a566282de47bce21"/><file name="PrintController.php" hash="40c7fac703c4210607f4c7ad4d7052c8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f270b82c36813ec5022237774dc3208e"/><file name="config.xml" hash="5e9ab559f021daf31c59d77f3df7a55e"/><file name="jstranslator.xml" hash="3adf187b44e3ffc2c43e7508a8d62c9c"/><file name="system.xml" hash="5c99f22e2438bdae00c24fbdfb8e82d8"/></dir><dir name="sql"><dir name="speedyshippingmodule_setup"><file name="mysql4-install-1.0.3.php" hash="4b1bc73ff91011b3c41a2b7adf107f3d"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="d12a72ecbd7d8e31a0e3c6c300d8f09c"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="31093fa1c0114c1ff7a9ae994a6a39bb"/></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="bg_BG"><file name="speedyTranslate.csv" hash="7235761f3c8d4a3b3ebdde5c1b558a19"/></dir><dir name="en_US"><file name="speedyTranslate.csv" hash="f4b166bd54e477fe2a1f0e3e178b3b78"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="speedy_shipping.xml" hash="3a428ae6bde62813449b9fdf805b6b1b"/></dir><dir name="template"><dir name="speedy_speedyshipping"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="81ede54e65af1ce6bb41ba3241018b57"/><dir name="payment_method"><file name="paymentInfo.phtml" hash="8bc351fab67fe3e89d6da86b9ce6812b"/></dir><file name="shipping.phtml" hash="1ceb91bb34a05a1cabaa7168457c8e1f"/><dir name="shipping_method"><file name="available.phtml" hash="2ed1524d3a3c2aa9edb04af1e9abe034"/><file name="pickupform.phtml" hash="12e0630599eca90fbf4352a20657577c"/><file name="shipping_method.phtml" hash="8683ed86bd37ca7de4ce2305f92b4aea"/></dir></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="7a1ca55b250f43addc6155c5df687917"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="speedy_shipping.xml" hash="93bad292fed577e9c79c830aa47ebd61"/></dir><dir name="template"><dir name="speedy_speedyshipping"><file name="billoflading.phtml" hash="92ba243a2d9f7815db619778d78fc980"/><dir name="customer"><dir name="edit"><dir name="tab"><file name="addresses.phtml" hash="d30d71600b33872075dc0bc2b7bc3137"/></dir></dir></dir><file name="pickupform.phtml" hash="fc21509fc8f6ddccf055c2fb840f4c74"/><dir name="sales"><dir name="order"><dir name="create"><dir name="billing"><dir name="method"><file name="paymentInfo.phtml" hash="3dd1f746585216f952958c710924ae46"/></dir></dir><dir name="form"><file name="address.phtml" hash="042fb74a054bd096fbd7d2aedb80503c"/></dir><dir name="shipping"><dir name="method"><file name="form.phtml" hash="715d060632af0c3ad4287f46fd4e69c6"/></dir></dir><file name="totals.phtml" hash="cada285fd005956398d6d1d18d437892"/></dir></dir></dir><dir name="system"><dir name="config"><file name="testbutton.phtml" hash="561902225c1227b220cf2caa4d20fa33"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="SpeedyEPS"><dir name="util"><file name="Util.class.php" hash="e384756acbad8853c999e0435e833c19"/></dir><dir name="ver01"><file name="AddrNomen.class.php" hash="bba4d58eca6ffda35d1c07d93bfd84be"/><file name="ClientException.class.php" hash="67265022fa5937ae84f20d9f7a3e99cc"/><file name="ComplementaryServiceAllowance.class.php" hash="58e1d0e355943629ff80d53db973a9a9"/><file name="EPSFacade.class.php" hash="2813aa75ba73d7e5d306d7cb69774e6e"/><file name="EPSInterface.class.php" hash="3d6309aa96ce44add385e73a39d374d3"/><file name="FixedDiscountCardId.class.php" hash="4a1467f2013014d509141f1f5f1b9566"/><file name="ParamAddress.class.php" hash="4b73bf8d5696034d5d405c5e407f82b7"/><file name="ParamAddressSearch.class.php" hash="c600829b3035b352a4946ae71c9f546d"/><file name="ParamBarcodeInfo.class.php" hash="fd17f2426934f53ec9617a96bdb096c0"/><file name="ParamCalculation.class.php" hash="a9ab0afb2ac9d83720ee80ab583885d9"/><file name="ParamClientData.class.php" hash="e3f7bc2062f9e3e71ef4b4032ae10537"/><file name="ParamClientSearch.class.php" hash="51c779373bd3494254be8279139b9826"/><file name="ParamFilterCountry.class.php" hash="601f4366e2172fd9ad3ada116b9070fb"/><file name="ParamFilterSite.class.php" hash="1b5a66002441b6fa571f4ede91a8a292"/><file name="ParamLanguage.class.php" hash="fcfb607cbdb1c4edd0ff2e4b3818510d"/><file name="ParamOptionsBeforePayment.class.php" hash="41ac69a394ff45f5fcc3d82a35dfd192"/><file name="ParamOrder.class.php" hash="eb177c74d52d9e6a69ce1fd34535ea82"/><file name="ParamPDF.class.php" hash="28248201e71d34368bb2b76c58a16da9"/><file name="ParamPackings.class.php" hash="dd844732634fd0a52d3ea7f900ca47a4"/><file name="ParamParcel.class.php" hash="b322bbc0858eba9b3d7bb2fe11f5fdfd"/><file name="ParamParcelInfo.class.php" hash="c474263378eea17b4163ac3e9842dd3a"/><file name="ParamPhoneNumber.class.php" hash="53e20f2f8354d2caaac519abcfd81187"/><file name="ParamPicking.class.php" hash="4fde22add96509e687b9f55d98983d87"/><file name="ParamReturnServiceRequest.class.php" hash="b666cd7407e7cc66df58739975797e55"/><file name="ParamReturnShipmentRequest.class.php" hash="0fd2247493eb17980688c96afdeca4a0"/><file name="ParamSearchByRefNum.class.php" hash="14544cd4c6f6718bc68e2f4f2c6fe5f5"/><file name="ParamSearchSecondaryPickings.class.php" hash="8b2ee17a96200fbe17a43eadaca2c7df"/><file name="ResultAddress.class.php" hash="bd68573c83ee0aacbfd3cf645ecbb772"/><file name="ResultAddressEx.class.php" hash="22281f39fd2e6ced687ed847ba2be3a9"/><file name="ResultAddressSearch.class.php" hash="c9b8a3aba12bed01b37245c4a2303907"/><file name="ResultAddressString.class.php" hash="1356a0948908d49c203f546631d970a3"/><file name="ResultAmounts.class.php" hash="1ad02dbdc6eecc62f29f5e3ee0ffc854"/><file name="ResultBOL.class.php" hash="e095318e59be096cb949309834a863ba"/><file name="ResultCalculation.class.php" hash="90710f9860d920d763b423c77ffdc88a"/><file name="ResultCalculationMS.class.php" hash="f991bc662dba556c7c7bc749d09ecb12"/><file name="ResultClientData.class.php" hash="3e1ea047f22ee3cfa02a128e9ce1d65e"/><file name="ResultCommonObject.class.php" hash="2e8a719333466499dbef0102c7858a23"/><file name="ResultCountry.class.php" hash="2894daa35d5228f8a5ce7a5dcfcefa92"/><file name="ResultCourierService.class.php" hash="aaf63c267a548cc82b1784f5d41c9924"/><file name="ResultCourierServiceExt.class.php" hash="2f26760369b55d00a827577d573f7e5f"/><file name="ResultLogin.class.php" hash="6d9507e82eb5af820665480f83d8bec9"/><file name="ResultMinMaxReal.class.php" hash="681aa4bbc9f580f7551a1820f9186fad"/><file name="ResultOffice.class.php" hash="4f911e40d8aaaf95761c63bb79d12e17"/><file name="ResultOfficeEx.class.php" hash="c0b7d1ad73a7b64d9a90066efb1ccb5a"/><file name="ResultOrderPickingInfo.class.php" hash="72dcf1587374afe319cebd49e8a30fa3"/><file name="ResultParcelInfo.class.php" hash="cfd36bbf6b4c93e80e713c85f127a027"/><file name="ResultPhoneNumber.class.php" hash="e8484071762d91059097dc9d98755090"/><file name="ResultPickingInfo.class.php" hash="ec5b59388bc49d54e58cca7d46712c6c"/><file name="ResultQuarter.class.php" hash="9bc9d441128e5edc551c2c52ef473f57"/><file name="ResultSite.class.php" hash="3995a885228576c7852dfae43e2c0c15"/><file name="ResultSiteEx.class.php" hash="ecdbf452151030e8d1d35300b7f4f76b"/><file name="ResultSpecialDeliveryRequirement.class.php" hash="24a874c667c47ebead043150b2ddf44e"/><file name="ResultState.class.php" hash="97b102417faa3b766d66aec41cab3603"/><file name="ResultStreet.class.php" hash="7d625402e05cfcf205b31ba32650bcb4"/><file name="ResultTrackPicking.class.php" hash="a7b62fd4e8ca2dcf385e9ff5240850a1"/><file name="ResultTrackPickingEx.class.php" hash="f14f340c7706cd2c484dc9edca2a6356"/><file name="ResultWorkingTime.class.php" hash="2e28a17ad516dd8bd4bed02ef23338f5"/><file name="ServerException.class.php" hash="b11fc48eb537992e8c506807e7edd9d2"/><file name="Size.class.php" hash="8bcf5f8a026e8948bd68c02965002ed2"/><file name="ValueAddress.class.php" hash="668e57a1351d549b7b6fb49afe154a94"/><dir name="soap"><file name="EPSSOAPInterfaceImpl.class.php" hash="b8e5b9f2604a55cc889d1b6166673430"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="speedy"><dir name="css"><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="8bede029bbc5dfdc51c03c31c42c69b6"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="0e22f1e0b51bab992d835373d8687aff"/><file name="ui-bg_flat_10_000000_40x100.png" hash="f1d874a7f2f98005ef41142e7c529afb"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="0239611116cbcf93c7cd902997df0c2b"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="e08a0b044bc2699a3dd6ac4d081736d4"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="d985d3e1f3980efaa8a9482da6282a6a"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="22d6e00af67ff329b00e70164acbfa6e"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="148fa5a4d59240f3b1322e52c0b42646"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="8a5e1b98c9b8a758fb45e982724cc1d0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="adffefb9419589d6b897a81877e85e42"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="5a6524e1e6c434435238b5c93e583b6f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="3d978d04a04f319ce2412b1c11afa926"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="bb29642d42ead99b3f719a1c7c838026"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="dc52f3b6718f318deb7813c5115137c5"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e25e9547ddaa4fad97741b252ba9f800"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="661db0dc3da9538d25ffd010dc514751"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="d78652f40e0c1f0281988aacd8269833"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="3d9bb8f4d52f22fd5d494e87518766c0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="jquery-ui-1.10.2.custom.min.css" hash="b14e6e4dfddacb48689578a9f9b69837"/><file name="jquery-ui-1.10.3.custom.min.css" hash="61770a422674ed451871ecdcf75ea67d"/><file name="jquery.autocomplete.css" hash="e1efb0a6e3da2b6ac201dc98c585aec8"/></dir><dir name="images"><file name="indicator.gif" hash="14c56c5a40e61aea738e46b66d4d8c90"/></dir><dir name="js"><file name="jquery-1.9.1.min.js" hash="663628f795cb62444143fde1ebdf2b5b"/><file name="jquery-ui-1.10.3.custom.min.js" hash="ca78f74e4ebf73b646c14f7803031e48"/><file name="noconflict.js" hash="b7acb127eceaaa67ac1597fafdd85000"/><file name="office_pickup.js" hash="fb0e225b5e03e192670c0c0a62b4aa54"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="speedy"><dir name="css"><file name="hideEditAddress.css" hash="1b03b3bf871c23565428454442c88cad"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="adffefb9419589d6b897a81877e85e42"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="5a6524e1e6c434435238b5c93e583b6f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="3d978d04a04f319ce2412b1c11afa926"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="bb29642d42ead99b3f719a1c7c838026"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="dc52f3b6718f318deb7813c5115137c5"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e25e9547ddaa4fad97741b252ba9f800"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="661db0dc3da9538d25ffd010dc514751"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="d78652f40e0c1f0281988aacd8269833"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="3d9bb8f4d52f22fd5d494e87518766c0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="jquery-ui-1.10.2.custom.min.css" hash="63a7972fe14211955df1b5631d2bfba1"/><file name="jquery.autocomplete.css" hash="e1efb0a6e3da2b6ac201dc98c585aec8"/></dir><dir name="images"><file name="indicator.gif" hash="03ce3dcc84af110e9da8699a841e5200"/></dir><dir name="js"><file name="jquery-1.9.1.min.js" hash="ba714fde311a118967b9d8cb017c81f6"/><file name="jquery-ui-1.10.2.custom.min.js" hash="34f617d6fa9771c9cec61e9f6b729cf4"/><file name="noconflict.js" hash="e2060c4e5e5955c824723b13a212d3ec"/><file name="office_pickup.js" hash="dfbb5d0f546be2d7c64fa3393ab4a898"/><file name="validateAddress.js" hash="ebe9feaa11ee5a976254c83defecbbb7"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.9.2.1</max></package><extension><name>soap</name><min></min><max></max></extension><extension><name>curl</name><min></min><max></max></extension><extension><name>openssl</name><min></min><max></max></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Speedy_Shipping</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Version 2.0.0</summary>
10
+ <description>Version 2.0.0</description>
11
+ <notes>Version 2.0.0</notes>
12
  <authors><author><name>Speedy JSC</name><user>evgeni</user><email>magento@speedy.bg</email></author></authors>
13
+ <date>2016-09-13</date>
14
+ <time>15:02:06</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Speedyshipping.xml" hash="a597ad6e81bb153bafe437f2869ede69"/></dir></target><target name="magecommunity"><dir name="Speedy"><dir name="Speedyshipping"><dir name="Block"><dir name="Adminhtml"><file name="Billoflading.php" hash="621d3fe4370baea19cef8eab28311e7d"/><dir name="Requestcourier"><file name="Grid.php" hash="2284de6c2d2ef6029c8a84bd86f8bc53"/><dir name="Renderer"><file name="Cancelbutton.php" hash="062d962aed0a14896558dd59e03775c9"/><file name="Created.php" hash="3ab6eba87f8986ce55c823327ec60e79"/><file name="Datecreated.php" hash="36ca56ed37cb572c19bcb7e7e7dff081"/><file name="Requestbutton.php" hash="7d8daf6dfebec289f58d035bfc4d9c6d"/><file name="Viewbol.php" hash="728a9cd399df38532a8136adc618b28e"/><file name="Vieworder.php" hash="fb6c0ac4134d26a705f2c7bdc658f035"/></dir><file name="Requestcontainer.php" hash="5529d32f1698e12dc2cf078c68a53797"/></dir><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Billing"><file name="Address.php" hash="3e3ce63a089eee5d94dca41a0cfa9525"/></dir><dir name="Shipping"><file name="Address.php" hash="47ead01e856927c8ac6362b84ff39f31"/><file name="Form.php" hash="90112a2a3ed59b021d8fcd347e7b5292"/></dir><dir name="Speedy"><file name="Form.php" hash="5d33815cc6bf12e2bb77bdb7aa7b8468"/></dir><file name="Totals.php" hash="da5b3fe05aca0194f12dcc239be47d45"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Moneytransfer.php" hash="db4333dd1f36ec11beadfb64f0596320"/><file name="Testbutton.php" hash="09aaa0674763be7a3d18fa476decd110"/></dir></dir></dir></dir><dir name="Customer"><dir name="Address"><file name="Edit.php" hash="29852467e29ecd706303e0ffc85ed009"/></dir></dir><dir name="Onepage"><dir name="Billing"><file name="Billing.php" hash="0a2ee273b12e8cc86e91e65f0a7c1cd9"/></dir><file name="Paymentinfo.php" hash="37b23f4cec78407c080821e7a4977fdd"/><file name="Pickupform.php" hash="6185b390e0438a3c588d3bf8362c54cc"/><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="72f3789bb35612be09bb50f6f9f1b443"/></dir><file name="Shipping.php" hash="bf9a606103c2c769fd93240167ae3b50"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ea891afb31df4924edb51c659a700905"/><file name="Exceptionmap.php" hash="5efa0d9221546f4a3b29f98d260998a8"/><file name="Transliterate.php" hash="3f3550a010e08e0b5968645ce6fea5ff"/><dir name="Validate"><file name="Address.php" hash="ad1aea0ca237b264d066f82028e832b2"/><file name="Validate.php" hash="7bee329f2d1f3021c27311f6b674015a"/></dir></dir><dir name="Model"><dir name="Autocomplete"><file name="Address.php" hash="719ce807a2be702c0e62ed4af775f94f"/></dir><dir name="Carrier"><dir name="Receiverdata"><file name="Receiverdata.php" hash="6dbd7852a462efa8522af1f4c45be21b"/></dir><dir name="Senderdata"><file name="Senderdata.php" hash="a29434d47a760d0b26c05da5ce5a8053"/></dir><file name="Shippingmethod.php" hash="8b8949888948d6bf0b5174900f5891c5"/><dir name="Source"><file name="Beforepayment.php" hash="d5f748b0a3f34e93783954f401122eca"/><file name="Calculation.php" hash="1b26134f759ce6b1233268e12cded07b"/><file name="Deferreddays.php" hash="c0b4154d31d5080a5970eab4ba5f9315"/><file name="Method.php" hash="7511ed2296880851463cd38096c307ae"/><file name="Moneytransfer.php" hash="391b7987d5e36e2e1e75bca9fb07d09d"/><file name="Office.php" hash="38d718531131f17dc452a72370d7e5f6"/><file name="Tablerate.php" hash="ca78fcedb9b8dc153e98dcda01d68387"/><file name="Takingoffset.php" hash="a707c9ecb45d1ae6886770264d7c850d"/></dir><file name="Tablerate.php" hash="cb14ab3cfbbaa433bc3502502da2d34d"/></dir><file name="Observer.php" hash="39fb0513a418f0a142b47ef60e1fa27d"/><dir name="Rate"><file name="Result.php" hash="9e57224fe86a696a8c51e47c1808226f"/></dir><dir name="Resource"><dir name="Carrier"><dir name="Tablerate"><file name="Collection.php" hash="17758bfc8c1adfe8d3e10b98bc44d8ea"/></dir><file name="Tablerate.php" hash="abc161abdfed7cdc4524a3ad84341c68"/></dir><dir name="Saveorder"><file name="Collection.php" hash="45cbc13c07ab7ac7e495bdead549c655"/></dir><file name="Saveorder.php" hash="ebb22be5c4334a201bd6b09d72e96cbe"/><file name="Setup.php" hash="f4fd4f27ba10a9fc68e272a475ff2156"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><file name="Rate.php" hash="82282b54b161255665c888ff9cd7fc6d"/></dir></dir></dir><file name="Saveorder.php" hash="4bbd01470d9ffa1d305fcf7210f88726"/></dir><dir name="controllers"><file name="AddressController.php" hash="0bb8fd38ec39fd04272cddd0d38b2808"/><dir name="Adminhtml"><file name="AddressController.php" hash="4e3b83925ff3eef839674e3cac9e29aa"/><file name="CheckcredentialsController.php" hash="6ea877b98919d725a566282de47bce21"/><file name="PrintController.php" hash="d94d1ba7a2b4edd1f2ad46e174206c9d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f270b82c36813ec5022237774dc3208e"/><file name="config.xml" hash="3f28f9d6609a5db4968f9be9b81f772c"/><file name="jstranslator.xml" hash="3adf187b44e3ffc2c43e7508a8d62c9c"/><file name="system.xml" hash="915e4462a8e837b34a27096c2cdf25d1"/></dir><dir name="sql"><dir name="speedyshippingmodule_setup"><file name="mysql4-install-1.0.3.php" hash="4b1bc73ff91011b3c41a2b7adf107f3d"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="d12a72ecbd7d8e31a0e3c6c300d8f09c"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="31093fa1c0114c1ff7a9ae994a6a39bb"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="740d53e911328a20b22b0bf63630171a"/></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="bg_BG"><file name="speedyTranslate.csv" hash="e3d0f76e6c0e9d41f6f65717c59ee2a7"/></dir><dir name="en_US"><file name="speedyTranslate.csv" hash="a4d2a0052cda5bc8cce783255fba4182"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="speedy_shipping.xml" hash="3a428ae6bde62813449b9fdf805b6b1b"/></dir><dir name="template"><dir name="speedy_speedyshipping"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="46642f90e16e1389a9f56c9f0c80b91a"/><dir name="payment_method"><file name="paymentInfo.phtml" hash="8bc351fab67fe3e89d6da86b9ce6812b"/></dir><file name="shipping.phtml" hash="57057febf3a2c8e69869ff92c55281c0"/><dir name="shipping_method"><file name="available.phtml" hash="d7055317ae97ead479375b5832c5c5ba"/><file name="pickupform.phtml" hash="12e0630599eca90fbf4352a20657577c"/><file name="shipping_method.phtml" hash="8683ed86bd37ca7de4ce2305f92b4aea"/></dir></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="7a1ca55b250f43addc6155c5df687917"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="speedy_shipping.xml" hash="93bad292fed577e9c79c830aa47ebd61"/></dir><dir name="template"><dir name="speedy_speedyshipping"><file name="billoflading.phtml" hash="bdde5c95df22cebda75cda6852031905"/><dir name="customer"><dir name="edit"><dir name="tab"><file name="addresses.phtml" hash="d30d71600b33872075dc0bc2b7bc3137"/></dir></dir></dir><file name="pickupform.phtml" hash="47925f1d7aa5be306db7bbdc054c3978"/><dir name="sales"><dir name="order"><dir name="create"><dir name="billing"><dir name="method"><file name="paymentInfo.phtml" hash="3dd1f746585216f952958c710924ae46"/></dir></dir><dir name="form"><file name="address.phtml" hash="973fa052e660a6352511aff51be6299a"/></dir><dir name="shipping"><dir name="method"><file name="form.phtml" hash="715d060632af0c3ad4287f46fd4e69c6"/></dir></dir><file name="totals.phtml" hash="cada285fd005956398d6d1d18d437892"/></dir></dir></dir><dir name="system"><dir name="config"><file name="testbutton.phtml" hash="561902225c1227b220cf2caa4d20fa33"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="SpeedyEPS"><dir name="util"><file name="Util.class.php" hash="e384756acbad8853c999e0435e833c19"/></dir><dir name="ver01"><file name="AddrNomen.class.php" hash="bba4d58eca6ffda35d1c07d93bfd84be"/><file name="ClientException.class.php" hash="67265022fa5937ae84f20d9f7a3e99cc"/><file name="ComplementaryServiceAllowance.class.php" hash="58e1d0e355943629ff80d53db973a9a9"/><file name="EPSFacade.class.php" hash="e6e4c476e62a974552ab43916673ba98"/><file name="EPSInterface.class.php" hash="750d19cf6224d724f8ca8f3b6e1b4e2d"/><file name="FixedDiscountCardId.class.php" hash="4a1467f2013014d509141f1f5f1b9566"/><file name="ParamAddress.class.php" hash="4b73bf8d5696034d5d405c5e407f82b7"/><file name="ParamAddressSearch.class.php" hash="c600829b3035b352a4946ae71c9f546d"/><file name="ParamBarcodeInfo.class.php" hash="fd17f2426934f53ec9617a96bdb096c0"/><file name="ParamCalculation.class.php" hash="54988bc664b1543061ad926928d3c36b"/><file name="ParamClientData.class.php" hash="e3f7bc2062f9e3e71ef4b4032ae10537"/><file name="ParamClientSearch.class.php" hash="51c779373bd3494254be8279139b9826"/><file name="ParamFilterCountry.class.php" hash="601f4366e2172fd9ad3ada116b9070fb"/><file name="ParamFilterSite.class.php" hash="1b5a66002441b6fa571f4ede91a8a292"/><file name="ParamLanguage.class.php" hash="fcfb607cbdb1c4edd0ff2e4b3818510d"/><file name="ParamOptionsBeforePayment.class.php" hash="41ac69a394ff45f5fcc3d82a35dfd192"/><file name="ParamOrder.class.php" hash="eb177c74d52d9e6a69ce1fd34535ea82"/><file name="ParamPDF.class.php" hash="28248201e71d34368bb2b76c58a16da9"/><file name="ParamPackings.class.php" hash="dd844732634fd0a52d3ea7f900ca47a4"/><file name="ParamParcel.class.php" hash="b322bbc0858eba9b3d7bb2fe11f5fdfd"/><file name="ParamParcelInfo.class.php" hash="c474263378eea17b4163ac3e9842dd3a"/><file name="ParamPhoneNumber.class.php" hash="53e20f2f8354d2caaac519abcfd81187"/><file name="ParamPicking.class.php" hash="82f1fae6006babee5ef64ab018936d3b"/><file name="ParamReturnServiceRequest.class.php" hash="b666cd7407e7cc66df58739975797e55"/><file name="ParamReturnShipmentRequest.class.php" hash="0fd2247493eb17980688c96afdeca4a0"/><file name="ParamReturnVoucher.class.php" hash="428adf3ea54b95d3801ac2b8dc619cef"/><file name="ParamSearchByRefNum.class.php" hash="14544cd4c6f6718bc68e2f4f2c6fe5f5"/><file name="ParamSearchSecondaryPickings.class.php" hash="8b2ee17a96200fbe17a43eadaca2c7df"/><file name="ResultAddress.class.php" hash="bd68573c83ee0aacbfd3cf645ecbb772"/><file name="ResultAddressEx.class.php" hash="22281f39fd2e6ced687ed847ba2be3a9"/><file name="ResultAddressInfo.class.php" hash="404c036a9c0043610b2eb98f2ec132d6"/><file name="ResultAddressSearch.class.php" hash="c9b8a3aba12bed01b37245c4a2303907"/><file name="ResultAddressString.class.php" hash="1356a0948908d49c203f546631d970a3"/><file name="ResultAmounts.class.php" hash="1ad02dbdc6eecc62f29f5e3ee0ffc854"/><file name="ResultBOL.class.php" hash="e095318e59be096cb949309834a863ba"/><file name="ResultCalculation.class.php" hash="90710f9860d920d763b423c77ffdc88a"/><file name="ResultCalculationMS.class.php" hash="f991bc662dba556c7c7bc749d09ecb12"/><file name="ResultClientData.class.php" hash="3e1ea047f22ee3cfa02a128e9ce1d65e"/><file name="ResultClientInfo.class.php" hash="0dba92401ba80c16c6daf05498fbf8b1"/><file name="ResultCommonObject.class.php" hash="2e8a719333466499dbef0102c7858a23"/><file name="ResultCountry.class.php" hash="2894daa35d5228f8a5ce7a5dcfcefa92"/><file name="ResultCourierService.class.php" hash="7181607ffd985726f732c6848a48feee"/><file name="ResultCourierServiceExt.class.php" hash="3dd8037809379588adcc17e8e82e06f4"/><file name="ResultDeliveryInfo.class.php" hash="62819fcdd2a3e2e31412f013f85345c9"/><file name="ResultLogin.class.php" hash="6d9507e82eb5af820665480f83d8bec9"/><file name="ResultMinMaxReal.class.php" hash="681aa4bbc9f580f7551a1820f9186fad"/><file name="ResultOffice.class.php" hash="4f911e40d8aaaf95761c63bb79d12e17"/><file name="ResultOfficeEx.class.php" hash="c0b7d1ad73a7b64d9a90066efb1ccb5a"/><file name="ResultOptionsBeforePayment.class.php" hash="ff5fd41d8b04c8eedebd6232f5073cb2"/><file name="ResultOrderPickingInfo.class.php" hash="72dcf1587374afe319cebd49e8a30fa3"/><file name="ResultPackings.class.php" hash="db4974a07d8ae42223c53df8cbfc217e"/><file name="ResultParcelInfo.class.php" hash="cfd36bbf6b4c93e80e713c85f127a027"/><file name="ResultParcelInfoEx.class.php" hash="2866b92f3a33b633e691fd211051c28e"/><file name="ResultPhoneNumber.class.php" hash="e8484071762d91059097dc9d98755090"/><file name="ResultPickingExtendedInfo.class.php" hash="1105e9d8748acff5c42538ea57d9bb70"/><file name="ResultPickingInfo.class.php" hash="ec5b59388bc49d54e58cca7d46712c6c"/><file name="ResultQuarter.class.php" hash="9bc9d441128e5edc551c2c52ef473f57"/><file name="ResultReturnVoucher.class.php" hash="32121e1181856b33874c5dfc78b8afff"/><file name="ResultSite.class.php" hash="3995a885228576c7852dfae43e2c0c15"/><file name="ResultSiteEx.class.php" hash="ecdbf452151030e8d1d35300b7f4f76b"/><file name="ResultSpecialDeliveryRequirement.class.php" hash="24a874c667c47ebead043150b2ddf44e"/><file name="ResultState.class.php" hash="97b102417faa3b766d66aec41cab3603"/><file name="ResultStreet.class.php" hash="7d625402e05cfcf205b31ba32650bcb4"/><file name="ResultTrackPicking.class.php" hash="4794801930fa674ec2f4f2b2c5d5e4fc"/><file name="ResultTrackPickingEx.class.php" hash="66b4c4f73381ee794455da0dd560c738"/><file name="ResultWorkingTime.class.php" hash="2e28a17ad516dd8bd4bed02ef23338f5"/><file name="ServerException.class.php" hash="b11fc48eb537992e8c506807e7edd9d2"/><file name="Size.class.php" hash="8bcf5f8a026e8948bd68c02965002ed2"/><file name="ValueAddress.class.php" hash="668e57a1351d549b7b6fb49afe154a94"/><dir name="soap"><file name="EPSSOAPInterfaceImpl.class.php" hash="fde222f84978111d8cb58bcbc9d23f88"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="speedy"><dir name="css"><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="8bede029bbc5dfdc51c03c31c42c69b6"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="0e22f1e0b51bab992d835373d8687aff"/><file name="ui-bg_flat_10_000000_40x100.png" hash="f1d874a7f2f98005ef41142e7c529afb"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="0239611116cbcf93c7cd902997df0c2b"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="e08a0b044bc2699a3dd6ac4d081736d4"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="d985d3e1f3980efaa8a9482da6282a6a"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="22d6e00af67ff329b00e70164acbfa6e"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="148fa5a4d59240f3b1322e52c0b42646"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="8a5e1b98c9b8a758fb45e982724cc1d0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="adffefb9419589d6b897a81877e85e42"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="5a6524e1e6c434435238b5c93e583b6f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="3d978d04a04f319ce2412b1c11afa926"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="bb29642d42ead99b3f719a1c7c838026"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="dc52f3b6718f318deb7813c5115137c5"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e25e9547ddaa4fad97741b252ba9f800"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="661db0dc3da9538d25ffd010dc514751"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="d78652f40e0c1f0281988aacd8269833"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="3d9bb8f4d52f22fd5d494e87518766c0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="jquery-ui-1.10.2.custom.min.css" hash="b14e6e4dfddacb48689578a9f9b69837"/><file name="jquery-ui-1.10.3.custom.min.css" hash="61770a422674ed451871ecdcf75ea67d"/><file name="jquery.autocomplete.css" hash="e1efb0a6e3da2b6ac201dc98c585aec8"/></dir><dir name="images"><file name="indicator.gif" hash="14c56c5a40e61aea738e46b66d4d8c90"/></dir><dir name="js"><file name="jquery-1.9.1.min.js" hash="663628f795cb62444143fde1ebdf2b5b"/><file name="jquery-ui-1.10.3.custom.min.js" hash="ca78f74e4ebf73b646c14f7803031e48"/><file name="noconflict.js" hash="b7acb127eceaaa67ac1597fafdd85000"/><file name="office_pickup.js" hash="fb0e225b5e03e192670c0c0a62b4aa54"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="speedy"><dir name="css"><file name="hideEditAddress.css" hash="1b03b3bf871c23565428454442c88cad"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="adffefb9419589d6b897a81877e85e42"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="5a6524e1e6c434435238b5c93e583b6f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="3d978d04a04f319ce2412b1c11afa926"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="bb29642d42ead99b3f719a1c7c838026"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="dc52f3b6718f318deb7813c5115137c5"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e25e9547ddaa4fad97741b252ba9f800"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="661db0dc3da9538d25ffd010dc514751"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="d78652f40e0c1f0281988aacd8269833"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="3d9bb8f4d52f22fd5d494e87518766c0"/><file name="ui-icons_222222_256x240.png" hash="a1b3887a86cf1791f23c0b53b4d3585f"/><file name="ui-icons_228ef1_256x240.png" hash="73044fed6bab2c5ed02eed93b7d3adaa"/><file name="ui-icons_ef8c08_256x240.png" hash="1eec256e4f7b8324e619aae36ecfbfbd"/><file name="ui-icons_ffd27a_256x240.png" hash="c1a79bd65be08aa2be391cba2321f448"/><file name="ui-icons_ffffff_256x240.png" hash="e3f4748b19b87aadaa924d85f0882432"/></dir><file name="jquery-ui-1.10.2.custom.min.css" hash="63a7972fe14211955df1b5631d2bfba1"/><file name="jquery.autocomplete.css" hash="e1efb0a6e3da2b6ac201dc98c585aec8"/></dir><dir name="images"><file name="indicator.gif" hash="03ce3dcc84af110e9da8699a841e5200"/></dir><dir name="js"><file name="jquery-1.9.1.min.js" hash="ba714fde311a118967b9d8cb017c81f6"/><file name="jquery-ui-1.10.2.custom.min.js" hash="34f617d6fa9771c9cec61e9f6b729cf4"/><file name="noconflict.js" hash="e2060c4e5e5955c824723b13a212d3ec"/><file name="office_pickup.js" hash="dfbb5d0f546be2d7c64fa3393ab4a898"/><file name="validateAddress.js" hash="59a74c07abb149a42038bc16573074ef"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.9.2.1</max></package><extension><name>soap</name><min></min><max></max></extension><extension><name>curl</name><min></min><max></max></extension><extension><name>openssl</name><min></min><max></max></extension></required></dependencies>
18
  </package>
skin/adminhtml/default/default/speedy/js/validateAddress.js CHANGED
@@ -53,12 +53,51 @@ $j(document).ready(function(evt){
53
  var speedy_pick_from_office = $j('#'+baseFieldSelector + 'speedy_office_chooser').val();
54
  var speedy_office_name = $j('#'+baseFieldSelector + 'speedy_office_name').val();
55
  var speedy_office_id = $j('#'+baseFieldSelector + 'speedy_office_id').val();
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
-
58
 
 
59
  var isValid = 0;
60
 
61
- if (quarter || (quarter_id !="0" && quarter_id !="")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  if ((street && number || street_id && number) || blockNo || number) {
63
  isValid = 1;
64
  }
53
  var speedy_pick_from_office = $j('#'+baseFieldSelector + 'speedy_office_chooser').val();
54
  var speedy_office_name = $j('#'+baseFieldSelector + 'speedy_office_name').val();
55
  var speedy_office_id = $j('#'+baseFieldSelector + 'speedy_office_id').val();
56
+ var country_id = $j('#'+baseFieldSelector + 'country_id').val();
57
+ var state_id = $j('#'+baseFieldSelector + 'state_id').val();
58
+ var city = $j('#'+baseFieldSelector + 'city').val();
59
+ var speedy_site_id = $j('#'+baseFieldSelector + 'speedy_site_id').val();
60
+ var speedy_country_id = $j('#'+baseFieldSelector + 'speedy_country_id').val();
61
+ var postcode = $j('#'+baseFieldSelector + 'postcode').val();
62
+ var address_1 = $j('#'+baseFieldSelector + 'street0').val();
63
+ if ($j('#'+baseFieldSelector + 'street1').length != 0) {
64
+ var address_2 = $j('#'+baseFieldSelector + 'street1').val();
65
+ } else {
66
+ var address_2 = '';
67
+ }
68
 
 
69
 
70
+
71
  var isValid = 0;
72
 
73
+ $j('.cod_error_address').remove();
74
+
75
+ if (country_id != 'BG' && typeof validate_abroud_address != 'undefined') {
76
+ $j.ajax({
77
+ url: validate_abroud_address,
78
+ dataType: "json",
79
+ async: false,
80
+ data: {
81
+ speedy_site_id: speedy_site_id,
82
+ city: city,
83
+ postcode: postcode,
84
+ address_1: address_1,
85
+ address_2: address_2,
86
+ speedy_country_id: speedy_country_id,
87
+ state_id: state_id,
88
+ },
89
+ success: function(addres_valid) {
90
+ if (addres_valid === 1) {
91
+ isValid = 1;
92
+ }
93
+ },
94
+ error: function(addres_valid) {
95
+ if (addres_valid !== 1 && addres_valid.responseText) {
96
+ $j('#'+baseFieldSelector+'fields .content').append('<ul class="cod_error_address messages"><li class="error-msg">'+addres_valid.responseText+'</li></ul>');
97
+ }
98
+ }
99
+ });
100
+ } else if (quarter || (quarter_id !="0" && quarter_id !="")) {
101
  if ((street && number || street_id && number) || blockNo || number) {
102
  isValid = 1;
103
  }