Swipezoom_InternationalShipping - Version 1.0.0

Version Notes

International Shipping & Payment Module Initial Release

Download this release

Release Info

Developer SwipezoomUK
Extension Swipezoom_InternationalShipping
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (141) hide show
  1. app/code/local/Mage/Customer/Model/Address/Abstract.php +364 -0
  2. app/code/local/Swipezoom/CardPayment/Block/Form/Ccsave.php +16 -0
  3. app/code/local/Swipezoom/CardPayment/Block/Info/Ccsave.php +40 -0
  4. app/code/local/Swipezoom/CardPayment/Helper/Data.php +12 -0
  5. app/code/local/Swipezoom/CardPayment/Model/Standard.php +45 -0
  6. app/code/local/Swipezoom/CardPayment/controllers/PaymentController.php +91 -0
  7. app/code/local/Swipezoom/CardPayment/etc/config.xml +67 -0
  8. app/code/local/Swipezoom/CardPayment/etc/system.xml +45 -0
  9. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Creditmemo/Grid.php +162 -0
  10. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid.php +160 -0
  11. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorder.php +18 -0
  12. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderchild.php +37 -0
  13. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderinvoice.php +28 -0
  14. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderparent.php +34 -0
  15. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Invoice/Grid.php +153 -0
  16. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/Customreorder.php +38 -0
  17. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/Reorder.php +38 -0
  18. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/_Reorder.php +36 -0
  19. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php +34 -0
  20. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Creditmemo/View.php +218 -0
  21. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Invoice/Totals.php +34 -0
  22. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Invoice/View.php +195 -0
  23. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Shipment/View.php +108 -0
  24. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Totals.php +33 -0
  25. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/View.php +88 -0
  26. app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Shipment/Grid.php +176 -0
  27. app/code/local/Swipezoom/InternationalShipping/Block/Checkout/Onepage/Shipping/Method/Available.php +28 -0
  28. app/code/local/Swipezoom/InternationalShipping/Helper/Data.php +74 -0
  29. app/code/local/Swipezoom/InternationalShipping/Model/Carrier/Swipezoom.php +968 -0
  30. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Packingdetail.php +15 -0
  31. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Packingdetail/Collection.php +13 -0
  32. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreq.php +15 -0
  33. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreq/Collection.php +15 -0
  34. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreqitems.php +15 -0
  35. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreqitems/Collection.php +15 -0
  36. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Shipmentdetail.php +14 -0
  37. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Shipmentdetail/Collection.php +15 -0
  38. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Swipezoomcreditmemo.php +14 -0
  39. app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Swipezoomcreditmemo/Collection.php +15 -0
  40. app/code/local/Swipezoom/InternationalShipping/Model/Observer.php +446 -0
  41. app/code/local/Swipezoom/InternationalShipping/Model/Order.php +516 -0
  42. app/code/local/Swipezoom/InternationalShipping/Model/Packingdetail.php +18 -0
  43. app/code/local/Swipezoom/InternationalShipping/Model/Partshipreq.php +18 -0
  44. app/code/local/Swipezoom/InternationalShipping/Model/Partshipreqitems.php +18 -0
  45. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Invoice.php +533 -0
  46. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Invoice/Amasty/Pure.php +3 -0
  47. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Items/Invoice/Default.php +177 -0
  48. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Items/Shipment/Default.php +128 -0
  49. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Shipment.php +486 -0
  50. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Shipment/Amasty/Pure.php +3 -0
  51. app/code/local/Swipezoom/InternationalShipping/Model/Sales/Quote/Address/Total/Vat.php +51 -0
  52. app/code/local/Swipezoom/InternationalShipping/Model/Shipmentdetail.php +18 -0
  53. app/code/local/Swipezoom/InternationalShipping/Model/Swipezoomcreditmemo.php +18 -0
  54. app/code/local/Swipezoom/InternationalShipping/Model/System/Config/Source/Extmode.php +31 -0
  55. app/code/local/Swipezoom/InternationalShipping/Model/Total/Vat/Creditmemo.php +24 -0
  56. app/code/local/Swipezoom/InternationalShipping/Model/Total/Vat/Invoice.php +24 -0
  57. app/code/local/Swipezoom/InternationalShipping/Model/Validation/Abstract.php +59 -0
  58. app/code/local/Swipezoom/InternationalShipping/Model/Validation/Address.php +59 -0
  59. app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/CreateController.php +257 -0
  60. app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/CreditmemoController.php +702 -0
  61. app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/EditController.php +409 -0
  62. app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/InvoiceController.php +317 -0
  63. app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/ShipmentController.php +197 -0
  64. app/code/local/Swipezoom/InternationalShipping/controllers/CartController.php +31 -0
  65. app/code/local/Swipezoom/InternationalShipping/controllers/IndexController.php +205 -0
  66. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/GecaWs.wsdl +616 -0
  67. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/_GecaWs.wsdl +615 -0
  68. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/transaction_binding_root_element.xml +9 -0
  69. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/transaction_binding_wsdl_port.xml +16 -0
  70. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding.xml +25 -0
  71. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding_root_element.xml +9 -0
  72. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding_wsdl_port.xml +16 -0
  73. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/common_schema.xsd +485 -0
  74. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/request/GecaWsRequestSchema.xsd +754 -0
  75. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/request/transaction_request_schema.xsd +127 -0
  76. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/response/GecaWsResponseSchema.xsd +936 -0
  77. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/response/transaction_response_schema.xsd +144 -0
  78. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/transaction_ws.wsdl +172 -0
  79. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding.xml +25 -0
  80. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_root.xjb +17 -0
  81. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_root_element.xml +9 -0
  82. app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_wsdl_port.xml +16 -0
  83. app/code/local/Swipezoom/InternationalShipping/etc/config.xml +345 -0
  84. app/code/local/Swipezoom/InternationalShipping/etc/system.xml +160 -0
  85. app/code/local/Swipezoom/InternationalShipping/sql/internationalshipping_setup/mysql4-install-1.0.0.php +118 -0
  86. app/design/adminhtml/default/default/layout/internationalshipping.xml +284 -0
  87. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/form.phtml +147 -0
  88. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/grid.phtml +45 -0
  89. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/index.phtml +0 -0
  90. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/items.phtml +213 -0
  91. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/total/adjustments.phtml +159 -0
  92. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/total/totals.phtml +64 -0
  93. app/design/adminhtml/default/default/template/internationalshipping/creditmemo/view/form.phtml +174 -0
  94. app/design/adminhtml/default/default/template/internationalshipping/info.phtml +280 -0
  95. app/design/adminhtml/default/default/template/internationalshipping/invoice/form.phtml +177 -0
  96. app/design/adminhtml/default/default/template/internationalshipping/invoice/grid.phtml +61 -0
  97. app/design/adminhtml/default/default/template/internationalshipping/invoice/info.phtml +183 -0
  98. app/design/adminhtml/default/default/template/internationalshipping/invoice/items.phtml +180 -0
  99. app/design/adminhtml/default/default/template/internationalshipping/invoice/rederer/default.phtml +216 -0
  100. app/design/adminhtml/default/default/template/internationalshipping/invoice/view/form.phtml +199 -0
  101. app/design/adminhtml/default/default/template/internationalshipping/invoice/view/items.phtml +37 -0
  102. app/design/adminhtml/default/default/template/internationalshipping/order/comment.phtml +50 -0
  103. app/design/adminhtml/default/default/template/internationalshipping/order/history.phtml +56 -0
  104. app/design/adminhtml/default/default/template/internationalshipping/order/info.phtml +315 -0
  105. app/design/adminhtml/default/default/template/internationalshipping/order/items.phtml +107 -0
  106. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/data.phtml +115 -0
  107. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/form.phtml +47 -0
  108. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/items.phtml +14 -0
  109. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/items/sz_grid.phtml +888 -0
  110. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/sidebar.phtml +48 -0
  111. app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/sidebar/items.phtml +91 -0
  112. app/design/adminhtml/default/default/template/internationalshipping/shipment/form.phtml +180 -0
  113. app/design/adminhtml/default/default/template/internationalshipping/shipment/grid.phtml +49 -0
  114. app/design/adminhtml/default/default/template/internationalshipping/shipment/info.phtml +185 -0
  115. app/design/adminhtml/default/default/template/internationalshipping/shipment/items.phtml +118 -0
  116. app/design/adminhtml/default/default/template/internationalshipping/shipment/view/form.phtml +179 -0
  117. app/design/adminhtml/default/default/template/internationalshipping/shipment/view/grid.phtml +64 -0
  118. app/design/adminhtml/default/default/template/internationalshipping/shipment/view/items.phtml +26 -0
  119. app/design/frontend/base/default/layout/cardpayment.xml +13 -0
  120. app/design/frontend/base/default/layout/internationalshipping.xml +110 -0
  121. app/design/frontend/base/default/template/cardpayment/ccsave.phtml +197 -0
  122. app/design/frontend/base/default/template/cardpayment/onepage/payment/methods.phtml +93 -0
  123. app/design/frontend/base/default/template/cardpayment/redirect.phtml +42 -0
  124. app/design/frontend/base/default/template/internationalshipping/cancel.phtml +67 -0
  125. app/design/frontend/base/default/template/internationalshipping/checkout/onepage/billing.phtml +499 -0
  126. app/design/frontend/base/default/template/internationalshipping/checkout/onepage/login.phtml +122 -0
  127. app/design/frontend/base/default/template/internationalshipping/checkout/onepage/shipping.phtml +175 -0
  128. app/design/frontend/base/default/template/internationalshipping/onepage/progress.phtml +211 -0
  129. app/design/frontend/base/default/template/internationalshipping/onepage/shipping_method/available.phtml +315 -0
  130. app/design/frontend/base/default/template/internationalshipping/openpdf.phtml +20 -0
  131. app/design/frontend/base/default/template/internationalshipping/order/info.phtml +75 -0
  132. app/design/frontend/base/default/template/internationalshipping/order/invoice/rederer/default.phtml +300 -0
  133. app/design/frontend/base/default/template/internationalshipping/printall.phtml +106 -0
  134. app/design/frontend/base/default/template/internationalshipping/printpack.phtml +11 -0
  135. app/design/frontend/base/default/template/internationalshipping/processformat.phtml +291 -0
  136. app/design/frontend/base/default/template/internationalshipping/sales/order/print.phtml +118 -0
  137. app/design/frontend/base/default/template/internationalshipping/shipping/tracking/popup.phtml +320 -0
  138. app/design/frontend/base/default/template/internationalshipping/success.phtml +61 -0
  139. app/etc/modules/Swipezoom_CardPayment.xml +12 -0
  140. app/etc/modules/Swipezoom_InternationalShipping.xml +17 -0
  141. js/swipezoom/autocomplete/jquery-1.8.2.min.js +2 -0
app/code/local/Mage/Customer/Model/Address/Abstract.php ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Mage_Customer_Model_Address_Abstract
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract
10
+ {
11
+ /**
12
+ * Possible customer address types
13
+ */
14
+ const TYPE_BILLING = 'billing';
15
+ const TYPE_SHIPPING = 'shipping';
16
+
17
+ /**
18
+ * Prefix of model events
19
+ *
20
+ * @var string
21
+ */
22
+ protected $_eventPrefix = 'customer_address';
23
+
24
+ /**
25
+ * Name of event object
26
+ *
27
+ * @var string
28
+ */
29
+ protected $_eventObject = 'customer_address';
30
+
31
+ /**
32
+ * Directory country models
33
+ *
34
+ * @var array
35
+ */
36
+ static protected $_countryModels = array();
37
+
38
+ /**
39
+ * Directory region models
40
+ *
41
+ * @var array
42
+ */
43
+ static protected $_regionModels = array();
44
+
45
+ /**
46
+ * Get full customer name
47
+ *
48
+ * @return string
49
+ */
50
+ public function getName()
51
+ {
52
+ $name = '';
53
+ $config = Mage::getSingleton('eav/config');
54
+ if ($config->getAttribute('customer_address', 'prefix')->getIsVisible() && $this->getPrefix()) {
55
+ $name .= $this->getPrefix() . ' ';
56
+ }
57
+ $name .= $this->getFirstname();
58
+ if ($config->getAttribute('customer_address', 'middlename')->getIsVisible() && $this->getMiddlename()) {
59
+ $name .= ' ' . $this->getMiddlename();
60
+ }
61
+ $name .= ' ' . $this->getLastname();
62
+ if ($config->getAttribute('customer_address', 'suffix')->getIsVisible() && $this->getSuffix()) {
63
+ $name .= ' ' . $this->getSuffix();
64
+ }
65
+ return $name;
66
+ }
67
+
68
+ /**
69
+ * get address street
70
+ *
71
+ * @param int $line address line index
72
+ * @return string
73
+ */
74
+ public function getStreet($line=0)
75
+ {
76
+ $street = parent::getData('street');
77
+ if (-1 === $line) {
78
+ return $street;
79
+ } else {
80
+ $arr = is_array($street) ? $street : explode("\n", $street);
81
+ if (0 === $line || $line === null) {
82
+ return $arr;
83
+ } elseif (isset($arr[$line-1])) {
84
+ return $arr[$line-1];
85
+ } else {
86
+ return '';
87
+ }
88
+ }
89
+ }
90
+
91
+ public function getStreet1()
92
+ {
93
+ return $this->getStreet(1);
94
+ }
95
+
96
+ public function getStreet2()
97
+ {
98
+ return $this->getStreet(2);
99
+ }
100
+
101
+ public function getStreet3()
102
+ {
103
+ return $this->getStreet(3);
104
+ }
105
+
106
+ public function getStreet4()
107
+ {
108
+ return $this->getStreet(4);
109
+ }
110
+
111
+ public function getStreetFull()
112
+ {
113
+ return $this->getData('street');
114
+ }
115
+
116
+ public function setStreetFull($street)
117
+ {
118
+ return $this->setStreet($street);
119
+ }
120
+
121
+ /**
122
+ * set address street informa
123
+ *
124
+ * @param unknown_type $street
125
+ * @return unknown
126
+ */
127
+ public function setStreet($street)
128
+ {
129
+ if (is_array($street)) {
130
+ $street = trim(implode("\n", $street));
131
+ }
132
+ $this->setData('street', $street);
133
+ return $this;
134
+ }
135
+
136
+ /**
137
+ * Create fields street1, street2, etc.
138
+ *
139
+ * To be used in controllers for views data
140
+ *
141
+ */
142
+ public function explodeStreetAddress()
143
+ {
144
+ $streetLines = $this->getStreet();
145
+ foreach ($streetLines as $i=>$line) {
146
+ $this->setData('street'.($i+1), $line);
147
+ }
148
+ return $this;
149
+ }
150
+
151
+ /**
152
+ * To be used when processing _POST
153
+ */
154
+ public function implodeStreetAddress()
155
+ {
156
+ $this->setStreet($this->getData('street'));
157
+ return $this;
158
+ }
159
+
160
+ /**
161
+ * Retrieve region name
162
+ *
163
+ * @return string
164
+ */
165
+ public function getRegion()
166
+ {
167
+ $regionId = $this->getData('region_id');
168
+ $region = $this->getData('region');
169
+
170
+ if ($regionId) {
171
+ if ($this->getRegionModel($regionId)->getCountryId() == $this->getCountryId()) {
172
+ $region = $this->getRegionModel($regionId)->getName();
173
+ $this->setData('region', $region);
174
+ }
175
+ }
176
+
177
+ if (!empty($region) && is_string($region)) {
178
+ $this->setData('region', $region);
179
+ }
180
+ elseif (!$regionId && is_numeric($region)) {
181
+ if ($this->getRegionModel($region)->getCountryId() == $this->getCountryId()) {
182
+ $this->setData('region', $this->getRegionModel($region)->getName());
183
+ $this->setData('region_id', $region);
184
+ }
185
+ }
186
+ elseif ($regionId && !$region) {
187
+ if ($this->getRegionModel($regionId)->getCountryId() == $this->getCountryId()) {
188
+ $this->setData('region', $this->getRegionModel($regionId)->getName());
189
+ }
190
+ }
191
+
192
+ return $this->getData('region');
193
+ }
194
+
195
+ /**
196
+ * Return 2 letter state code if available, otherwise full region name
197
+ *
198
+ */
199
+ public function getRegionCode()
200
+ {
201
+ $regionId = $this->getData('region_id');
202
+ $region = $this->getData('region');
203
+
204
+ if (!$regionId && is_numeric($region)) {
205
+ if ($this->getRegionModel($region)->getCountryId() == $this->getCountryId()) {
206
+ $this->setData('region_code', $this->getRegionModel($region)->getCode());
207
+ }
208
+ }
209
+ elseif ($regionId) {
210
+ if ($this->getRegionModel($regionId)->getCountryId() == $this->getCountryId()) {
211
+ $this->setData('region_code', $this->getRegionModel($regionId)->getCode());
212
+ }
213
+ }
214
+ elseif (is_string($region)) {
215
+ $this->setData('region_code', $region);
216
+ }
217
+ return $this->getData('region_code');
218
+ }
219
+
220
+ public function getRegionId()
221
+ {
222
+ $regionId = $this->getData('region_id');
223
+ $region = $this->getData('region');
224
+ if (!$regionId) {
225
+ if (is_numeric($region)) {
226
+ $this->setData('region_id', $region);
227
+ $this->unsRegion();
228
+ } else {
229
+ $regionModel = Mage::getModel('directory/region')
230
+ ->loadByCode($this->getRegionCode(), $this->getCountryId());
231
+ $this->setData('region_id', $regionModel->getId());
232
+ }
233
+ }
234
+ return $this->getData('region_id');
235
+ }
236
+
237
+ public function getCountry()
238
+ {
239
+ $country = $this->getCountryId();
240
+ return $country ? $country : $this->getData('country');
241
+ }
242
+
243
+ /**
244
+ * Retrive country model
245
+ *
246
+ * @return Mage_Directory_Model_Country
247
+ */
248
+ public function getCountryModel()
249
+ {
250
+ if(!isset(self::$_countryModels[$this->getCountryId()])) {
251
+ self::$_countryModels[$this->getCountryId()] = Mage::getModel('directory/country')
252
+ ->load($this->getCountryId());
253
+ }
254
+
255
+ return self::$_countryModels[$this->getCountryId()];
256
+ }
257
+
258
+ /**
259
+ * Retrive country model
260
+ *
261
+ * @return Mage_Directory_Model_Country
262
+ */
263
+ public function getRegionModel($region=null)
264
+ {
265
+ if(is_null($region)) {
266
+ $region = $this->getRegionId();
267
+ }
268
+
269
+ if(!isset(self::$_regionModels[$region])) {
270
+ self::$_regionModels[$region] = Mage::getModel('directory/region')->load($region);
271
+ }
272
+
273
+ return self::$_regionModels[$region];
274
+ }
275
+
276
+ /**
277
+ * @deprecated for public function format
278
+ */
279
+ public function getHtmlFormat()
280
+ {
281
+ return $this->getConfig()->getFormatByCode('html');
282
+ }
283
+
284
+ /**
285
+ * @deprecated for public function format
286
+ */
287
+ public function getFormated($html=false)
288
+ {
289
+ return $this->format($html ? 'html' : 'text');
290
+ }
291
+
292
+ public function format($type)
293
+ {
294
+ if(!($formatType = $this->getConfig()->getFormatByCode($type))
295
+ || !$formatType->getRenderer()) {
296
+ return null;
297
+ }
298
+ Mage::dispatchEvent('customer_address_format', array('type' => $formatType, 'address' => $this));
299
+ return $formatType->getRenderer()->render($this);
300
+ }
301
+
302
+ /**
303
+ * Retrive address config object
304
+ *
305
+ * @return Mage_Customer_Model_Address_Config
306
+ */
307
+ public function getConfig()
308
+ {
309
+ return Mage::getSingleton('customer/address_config');
310
+ }
311
+
312
+ protected function _beforeSave()
313
+ {
314
+ parent::_beforeSave();
315
+ $this->getRegion();
316
+ return $this;
317
+ }
318
+
319
+ /**
320
+ * Validate address attribute values
321
+ *
322
+ * @return bool
323
+ */
324
+ public function validate()
325
+ {
326
+ $errors = array();
327
+ $this->implodeStreetAddress();
328
+ if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
329
+ $errors[] = Mage::helper('customer')->__('Please enter the first name.');
330
+ }
331
+
332
+ if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
333
+ $errors[] = Mage::helper('customer')->__('Please enter the last name.');
334
+ }
335
+
336
+ if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
337
+ $errors[] = Mage::helper('customer')->__('Please enter the telephone number.');
338
+ }
339
+
340
+ $_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
341
+ if (!in_array($this->getCountryId(), $_havingOptionalZip)
342
+ && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')
343
+ ) {
344
+ //$errors[] = Mage::helper('customer')->__('Please enter the zip/postal code.');
345
+ }
346
+
347
+ if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
348
+ $errors[] = Mage::helper('customer')->__('Please enter the country.');
349
+ }
350
+
351
+ if ($this->getCountryModel()->getRegionCollection()->getSize()
352
+ && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')
353
+ && Mage::helper('directory')->isRegionRequired($this->getCountryId())
354
+ ) {
355
+ // $errors[] = Mage::helper('customer')->__('Please enter the state/province.');
356
+ }
357
+
358
+ if (empty($errors) || $this->getShouldIgnoreValidation()) {
359
+ return true;
360
+ }
361
+ return $errors;
362
+ }
363
+ }
364
+
app/code/local/Swipezoom/CardPayment/Block/Form/Ccsave.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_CardPayment_Block_Form_Ccsave
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_CardPayment_Block_Form_Ccsave extends Mage_Payment_Block_Form_Cc
10
+ {
11
+ protected function _construct()
12
+ {
13
+ parent::_construct();
14
+ $this->setTemplate('cardpayment/ccsave.phtml');
15
+ }
16
+ }
app/code/local/Swipezoom/CardPayment/Block/Info/Ccsave.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_CardPayment_Block_Info_Ccsave
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_CardPayment_Block_Info_Ccsave extends Mage_Payment_Block_Info_Cc
10
+ {
11
+ protected function _prepareSpecificInformation($transport = null)
12
+ {
13
+ $info = $this->getInfo();
14
+ $additionalinfo = $extra_details = array();
15
+
16
+ $transport = new Varien_Object();
17
+
18
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
19
+ if($paymentmode == 1 && $info->getMethodInstance()->getCode() == 'cardpayment') {
20
+
21
+ $additionalinfo = unserialize($info->getAdditionalData());
22
+
23
+ if(!empty($additionalinfo)) {
24
+ if(!empty($info->getCcOwner()))
25
+ $extra_details = array(Mage::helper('payment')->__('Name on the Card') => $info->getCcOwner(),
26
+ Mage::helper('payment')->__('Expiration Date') => $this->_formatCardDate($info->getCcExpYear(), $this->getCcExpMonth())
27
+ );
28
+
29
+ if(!empty($extra_details))
30
+ $additionalinfo = array_merge($additionalinfo,$extra_details);
31
+ }
32
+
33
+ if(!empty($additionalinfo))
34
+ $transport->addData($additionalinfo);
35
+ }
36
+
37
+ return $transport;
38
+ }
39
+
40
+ }
app/code/local/Swipezoom/CardPayment/Helper/Data.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_CardPayment_Helper_Data
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+
10
+ class Swipezoom_CardPayment_Helper_Data extends Mage_Core_Helper_Abstract {
11
+
12
+ }
app/code/local/Swipezoom/CardPayment/Model/Standard.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_CardPayment_Model_Standard
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_CardPayment_Model_Standard extends Mage_Payment_Model_Method_Abstract {
10
+
11
+ protected $_code = 'cardpayment';
12
+ protected $_canSaveCc = false;
13
+ protected $_formBlockType = 'cardpayment/form_ccsave';
14
+ protected $_infoBlockType = 'cardpayment/info_ccsave';
15
+
16
+ protected $_isInitializeNeeded = true;
17
+ protected $_canUseInternal = true;
18
+ protected $_canUseForMultishipping = false;
19
+
20
+ public function getOrderPlaceRedirectUrl() {
21
+ return Mage::getUrl('cardpayment/payment/redirect', array('_secure' => true));
22
+ }
23
+
24
+ public function isAvailable($quote = null){
25
+
26
+ //define array with method codes that will enable this payment methods
27
+ $enableOnMethods = array(
28
+ 'swipezoom'
29
+ );
30
+
31
+ //get the current shipping method from quote
32
+ $shippingMethod = $quote->getShippingAddress()->getShippingMethod();
33
+ $shippingMethod = explode('_',$shippingMethod);
34
+
35
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
36
+
37
+ if(!in_array($shippingMethod[0],$enableOnMethods) || $paymentmode != 1){
38
+ // swipezoom card payment not available
39
+ return false;
40
+ }
41
+
42
+ return parent::isAvailable($quote);
43
+ }
44
+ }
45
+ ?>
app/code/local/Swipezoom/CardPayment/controllers/PaymentController.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_CardPayment_PaymentController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_CardPayment_PaymentController extends Mage_Core_Controller_Front_Action {
10
+
11
+ // The redirect action is triggered when someone places an order
12
+ public function redirectAction() {
13
+ $this->loadLayout();
14
+ $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','cardpayment',array('template' => 'cardpayment/redirect.phtml'));
15
+ $this->getLayout()->getBlock('content')->append($block);
16
+ $this->renderLayout();
17
+ }
18
+
19
+ // The response action is triggered when your gateway sends back a response after processing the customer's payment
20
+ public function responseAction() {
21
+
22
+ $responseParams = $this->getRequest()->getParams();
23
+
24
+ if(!empty($responseParams['orderid'])) {
25
+ $orderId = $responseParams['orderid'];
26
+ $status = $responseParams['status'];
27
+
28
+ if($status == 'success') {
29
+ // Payment was successful, so update the order's state, send order email and move to the success page
30
+ $order = Mage::getModel('sales/order');
31
+ $order->loadByIncrementId($orderId);
32
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Payment Processed Successfully');
33
+ $order->setEmailSent(true); // email already sent by swipezoom
34
+ $order->save();
35
+
36
+ Mage::getSingleton('checkout/session')->unsQuoteId();
37
+
38
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
39
+
40
+ } else if($status == 'cancel') {
41
+ // cancel status returned by wirecard
42
+ $this->cancelAction();
43
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
44
+
45
+ } else {
46
+ // failure status returned by wirecard
47
+ $this->failureAction();
48
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
49
+ }
50
+ }
51
+ }
52
+
53
+ // generate parent window url
54
+ public function processAction() {
55
+
56
+ $processParams = $this->getRequest()->getParams();
57
+
58
+ if(!empty($processParams['status']) && !empty($processParams['orderid'])) {
59
+ $url = Mage::getBaseUrl().'/cardpayment/payment/response?status='.$processParams['status'].'&orderid='.$processParams['orderid'];
60
+ ?>
61
+
62
+ <script type="text/javascript">
63
+ window.top.location.href = "<?php echo $url ?>";
64
+ </script>
65
+
66
+ <?php
67
+ }
68
+ }
69
+
70
+ // The failure action is triggered when an order has failed
71
+ public function failureAction() {
72
+ if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
73
+ $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
74
+ if($order->getId()) {
75
+ $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, 'Payment Processing Failed')->save();
76
+ Mage::getModel("Swipezoom_InternationalShipping_Model_Carrier_Swipezoom")->setPaymentAdditionalData(Mage::getSingleton('sales/quote')->load($order->getQuoteId())->getSwipezoomOrderNumber(),Mage::getSingleton('checkout/session')->getLastRealOrderId(),'F');
77
+ }
78
+ }
79
+ }
80
+
81
+ // The cancel action is triggered when an order is cancelled
82
+ public function cancelAction() {
83
+ if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
84
+ $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
85
+ if($order->getId()) {
86
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Payment Processing Cancelled')->save();
87
+ Mage::getModel("Swipezoom_InternationalShipping_Model_Carrier_Swipezoom")->setPaymentAdditionalData(Mage::getSingleton('sales/quote')->load($order->getQuoteId())->getSwipezoomOrderNumber(),Mage::getSingleton('checkout/session')->getLastRealOrderId(),'C');
88
+ }
89
+ }
90
+ }
91
+ }
app/code/local/Swipezoom/CardPayment/etc/config.xml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Swipezoom_cardpayment>
5
+ <version>1.0.0</version>
6
+ </Swipezoom_cardpayment>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <cardpayment>
11
+ <class>Swipezoom_CardPayment_Model</class>
12
+ </cardpayment>
13
+ </models>
14
+ <helpers>
15
+ <cardpayment>
16
+ <class>Swipezoom_CardPayment_Helper</class>
17
+ </cardpayment>
18
+ </helpers>
19
+ <blocks>
20
+ <cardpayment>
21
+ <class>Swipezoom_CardPayment_Block</class>
22
+ </cardpayment>
23
+ </blocks>
24
+ </global>
25
+ <default>
26
+ <payment>
27
+ <cardpayment>
28
+ <model>cardpayment/standard</model>
29
+ <active>1</active>
30
+ <order_status>pending</order_status>
31
+ <title>Card Payment</title>
32
+ <payment_action>sale</payment_action>
33
+ <allowspecific>0</allowspecific>
34
+ <sort_order>1</sort_order>
35
+ </cardpayment>
36
+ </payment>
37
+ </default>
38
+ <frontend>
39
+ <layout>
40
+ <updates>
41
+ <cardpayment>
42
+ <file>cardpayment.xml</file>
43
+ </cardpayment>
44
+ </updates>
45
+ </layout>
46
+ <routers>
47
+ <cardpayment>
48
+ <use>standard</use>
49
+ <args>
50
+ <module>Swipezoom_CardPayment</module>
51
+ <frontName>cardpayment</frontName>
52
+ </args>
53
+ </cardpayment>
54
+ </routers>
55
+ </frontend>
56
+
57
+ <default>
58
+ <payment>
59
+ <cardpayment>
60
+ <active>1</active>
61
+ <title>Card Payment</title>
62
+ <order_status>pending</order_status>
63
+ </cardpayment>
64
+ </payment>
65
+ </default>
66
+
67
+ </config>
app/code/local/Swipezoom/CardPayment/etc/system.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <cardpayment translate="label comment" module="paygate">
7
+ <label>Card Payment</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>50</sort_order>
10
+ <show_in_default>0</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>20</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <order_status translate="label">
32
+ <label>New Order Status</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>adminhtml/system_config_source_order_status</source_model>
35
+ <sort_order>50</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>0</show_in_store>
39
+ </order_status>
40
+ </fields>
41
+ </cardpayment>
42
+ </groups>
43
+ </payment>
44
+ </sections>
45
+ </config>
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Creditmemo/Grid.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Creditmemo_Grid
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Creditmemo_Grid extends Mage_Adminhtml_Block_Widget_Grid
8
+ {
9
+
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->setId('sales_creditmemo_grid');
14
+ $this->setDefaultSort('created_at');
15
+ $this->setDefaultDir('DESC');
16
+ }
17
+
18
+ /**
19
+ * Retrieve collection class
20
+ *
21
+ * @return string
22
+ */
23
+ protected function _getCollectionClass()
24
+ {
25
+ return 'sales/order_creditmemo_grid_collection';
26
+ }
27
+
28
+ protected function _prepareCollection()
29
+ {
30
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
31
+ $this->setCollection($collection);
32
+ return parent::_prepareCollection();
33
+ }
34
+
35
+
36
+ protected function _prepareColumns()
37
+ {
38
+ $this->addColumn('increment_id', array(
39
+ 'header' => Mage::helper('sales')->__('Credit Memo #'),
40
+ 'index' => 'increment_id',
41
+ 'type' => 'text',
42
+ ));
43
+
44
+ $this->addColumn('swipezoomorder', array(
45
+ 'header' => Mage::helper('sales')->__('Swipezoom ID'),
46
+ 'header_css_class' => 'a-center',
47
+ 'index' => 'order_increment_id',
48
+ 'width' => '80px',
49
+ 'renderer' => 'Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderinvoice',
50
+ 'filter' => false,
51
+ 'sortable' => false,
52
+ 'type' => 'text'
53
+ ));
54
+
55
+ /*$this->addColumn('swipezoomorderchild', array(
56
+ 'header' => Mage::helper('sales')->__('Child Swipezoom ID'),
57
+ 'header_css_class' => 'a-center',
58
+ 'index' => 'order_increment_id',
59
+ 'width' => '80px',
60
+ 'renderer' => 'Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderchild',
61
+ 'filter' => false,
62
+ 'sortable' => false,
63
+ 'type' => 'text'
64
+ ));*/
65
+
66
+ $this->addColumn('created_at', array(
67
+ 'header' => Mage::helper('sales')->__('Created At'),
68
+ 'index' => 'created_at',
69
+ 'type' => 'datetime',
70
+ ));
71
+
72
+ $this->addColumn('order_increment_id', array(
73
+ 'header' => Mage::helper('sales')->__('Order #'),
74
+ 'index' => 'order_increment_id',
75
+ 'type' => 'text',
76
+ ));
77
+
78
+ $this->addColumn('order_created_at', array(
79
+ 'header' => Mage::helper('sales')->__('Order Date'),
80
+ 'index' => 'order_created_at',
81
+ 'type' => 'datetime',
82
+ ));
83
+
84
+ $this->addColumn('billing_name', array(
85
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
86
+ 'index' => 'billing_name',
87
+ ));
88
+
89
+ $this->addColumn('state', array(
90
+ 'header' => Mage::helper('sales')->__('Status'),
91
+ 'index' => 'state',
92
+ 'type' => 'options',
93
+ 'options' => Mage::getModel('sales/order_creditmemo')->getStates(),
94
+ ));
95
+
96
+ $this->addColumn('grand_total', array(
97
+ 'header' => Mage::helper('customer')->__('Refunded'),
98
+ 'index' => 'grand_total',
99
+ 'type' => 'currency',
100
+ 'align' => 'right',
101
+ 'currency' => 'order_currency_code',
102
+ ));
103
+
104
+ $this->addColumn('action',
105
+ array(
106
+ 'header' => Mage::helper('sales')->__('Action'),
107
+ 'width' => '50px',
108
+ 'type' => 'action',
109
+ 'getter' => 'getId',
110
+ 'actions' => array(
111
+ array(
112
+ 'caption' => Mage::helper('sales')->__('View'),
113
+ 'url' => array('base'=>'*/sales_creditmemo/view'),
114
+ 'field' => 'creditmemo_id'
115
+ )
116
+ ),
117
+ 'filter' => false,
118
+ 'sortable' => false,
119
+ 'is_system' => true
120
+ ));
121
+
122
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
123
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
124
+
125
+ return parent::_prepareColumns();
126
+ }
127
+
128
+ protected function _prepareMassaction()
129
+ {
130
+ $this->setMassactionIdField('entity_id');
131
+ $this->getMassactionBlock()->setFormFieldName('creditmemo_ids');
132
+ $this->getMassactionBlock()->setUseSelectAll(false);
133
+
134
+ $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
135
+ 'label'=> Mage::helper('sales')->__('PDF Credit Memos'),
136
+ 'url' => $this->getUrl('*/sales_creditmemo/pdfcreditmemos'),
137
+ ));
138
+
139
+ return $this;
140
+ }
141
+
142
+ public function getRowUrl($row)
143
+ {
144
+ if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/creditmemo')) {
145
+ return false;
146
+ }
147
+
148
+ return $this->getUrl('*/sales_creditmemo/view',
149
+ array(
150
+ 'creditmemo_id'=> $row->getId(),
151
+ )
152
+ );
153
+ }
154
+
155
+ public function getGridUrl()
156
+ {
157
+ return $this->getUrl('*/*/*', array('_current' => true));
158
+ }
159
+
160
+
161
+
162
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+ $this->setId('sales_order_grid');
15
+ $this->setUseAjax(true);
16
+ $this->setDefaultSort('created_at');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+
21
+ /**
22
+ * Retrieve collection class
23
+ *
24
+ * @return string
25
+ */
26
+ protected function _getCollectionClass()
27
+ {
28
+ return 'sales/order_grid_collection';
29
+ }
30
+
31
+ protected function _prepareCollection()
32
+ {
33
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
34
+ $collection->getSelect()->join('sales_flat_order', 'main_table.entity_id = sales_flat_order.entity_id',array('swipezoom_order_number_temp'));
35
+ $this->setCollection($collection);
36
+ return parent::_prepareCollection();
37
+ }
38
+
39
+ protected function _prepareColumns()
40
+ {
41
+ $this->addColumn('real_order_id', array(
42
+ 'header'=> Mage::helper('sales')->__('Order #'),
43
+ 'width' => '80px',
44
+ 'type' => 'text',
45
+ 'index' => 'increment_id',
46
+ 'filter_index' => 'main_table.increment_id'
47
+ ));
48
+ $this->addColumn('swipezoom_order_number_temp', array(
49
+ 'header' => Mage::helper('catalog')->__('Swipezoom ID'),
50
+ 'header_css_class' => 'a-center',
51
+ 'index' => 'swipezoom_order_number_temp',
52
+ 'width' => '80px',
53
+ 'filter_index'=>'sales_flat_order.swipezoom_order_number_temp',
54
+ 'renderer' => 'Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorder',
55
+ 'type' => 'text'
56
+ ));
57
+ if (!Mage::app()->isSingleStoreMode()) {
58
+ $this->addColumn('store_id', array(
59
+ 'header' => Mage::helper('sales')->__('Purchased from (store)'),
60
+ 'index' => 'store_id',
61
+ 'type' => 'store',
62
+ 'store_view'=> true,
63
+ 'display_deleted' => true,
64
+ 'filter_index' => 'main_table.store_id'
65
+ ));
66
+ }
67
+ $this->addColumn('created_at', array(
68
+ 'header' => Mage::helper('sales')->__('Purchased On'),
69
+ 'index' => 'created_at',
70
+ 'type' => 'datetime',
71
+ 'width' => '100px',
72
+ 'filter_index' => 'main_table.created_at'
73
+ ));
74
+ $this->addColumn('billing_name', array(
75
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
76
+ 'index' => 'billing_name',
77
+ 'filter_index' => 'main_table.billing_name'
78
+ ));
79
+
80
+ $this->addColumn('base_grand_total', array(
81
+ 'header' => Mage::helper('sales')->__('G.T. (Base)'),
82
+ 'index' => 'base_grand_total',
83
+ 'type' => 'currency',
84
+ 'currency' => 'base_currency_code',
85
+ 'filter_index' => 'main_table.base_grand_total'
86
+ ));
87
+ $this->addColumn('grand_total', array(
88
+ 'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
89
+ 'index' => 'grand_total',
90
+ 'type' => 'currency',
91
+ 'currency' => 'order_currency_code',
92
+ 'filter_index' => 'main_table.grand_total'
93
+ ));
94
+ $this->addColumn('status', array(
95
+ 'header' => Mage::helper('sales')->__('Status'),
96
+ 'index' => 'status',
97
+ 'type' => 'options',
98
+ 'width' => '130px',
99
+ 'filter_index' => 'main_table.status',
100
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses()
101
+ ));
102
+ return $this;
103
+ }
104
+
105
+ protected function _prepareMassaction()
106
+ {
107
+ $this->setMassactionIdField('entity_id');
108
+ $this->getMassactionBlock()->setFormFieldName('order_ids');
109
+ $this->getMassactionBlock()->setUseSelectAll(false);
110
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
111
+ $this->getMassactionBlock()->addItem('cancel_order', array(
112
+ 'label'=> Mage::helper('sales')->__('Cancel'),
113
+ 'url' => $this->getUrl('*/sales_order/massCancel'),
114
+ ));
115
+ }
116
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/hold')) {
117
+ $this->getMassactionBlock()->addItem('hold_order', array(
118
+ 'label'=> Mage::helper('sales')->__('Hold'),
119
+ 'url' => $this->getUrl('*/sales_order/massHold'),
120
+ ));
121
+ }
122
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/unhold')) {
123
+ $this->getMassactionBlock()->addItem('unhold_order', array(
124
+ 'label'=> Mage::helper('sales')->__('Unhold'),
125
+ 'url' => $this->getUrl('*/sales_order/massUnhold'),
126
+ ));
127
+ }
128
+ $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
129
+ 'label'=> Mage::helper('sales')->__('Print Invoices'),
130
+ 'url' => $this->getUrl('/sales_order/pdfinvoices'),
131
+ ));
132
+ $this->getMassactionBlock()->addItem('pdfshipments_order', array(
133
+ 'label'=> Mage::helper('sales')->__('Print Packingslips'),
134
+ 'url' => $this->getUrl('/sales_order/pdfshipments'),
135
+ ));
136
+ $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
137
+ 'label'=> Mage::helper('sales')->__('Print Credit Memos'),
138
+ 'url' => $this->getUrl('/sales_order/pdfcreditmemos'),
139
+ ));
140
+ $this->getMassactionBlock()->addItem('pdfdocs_order', array(
141
+ 'label'=> Mage::helper('sales')->__('Print All'),
142
+ 'url' => $this->getUrl('/sales_order/pdfdocs'),
143
+ ));
144
+ return $this;
145
+ }
146
+
147
+ public function getRowUrl($row)
148
+ {
149
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
150
+ return $this->getUrl('*/sales_order/view', array('order_id' => $row->getId()));
151
+ }
152
+ return false;
153
+ }
154
+
155
+ public function getGridUrl()
156
+ {
157
+ return $this->getUrl('*/*/grid', array('_current'=>true));
158
+ }
159
+
160
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorder.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorder
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorder extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
9
+ {
10
+ public function render(Varien_Object $row)
11
+ {
12
+ $value = $row->getData($this->getColumn()->getIndex());
13
+ if(!empty($value)){
14
+ return '<span class="swipezoomorder"> #'.$value.' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span><style ="text/css">.sdwipezoom{padding-left:4px;}</style>';
15
+ }
16
+
17
+ }
18
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderchild.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderchild
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderchild extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
10
+ {
11
+ public function render(Varien_Object $row)
12
+ {
13
+ $value = $row->getData($this->getColumn()->getIndex());
14
+ $order = Mage::getModel('sales/order')->loadByIncrementId($value);
15
+
16
+
17
+ $swipezoomcreditmemo1 = Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('refswipezoomorderid',$order->getSwipezoomOrderNumberTemp());
18
+ foreach($swipezoomcreditmemo1 as $ss){
19
+ $sorder = $ss->getRefswipezoomorderid();
20
+ }
21
+ if($sorder){
22
+ return '<span class="swipezoomorder1"> #'.$sorder.' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span>';
23
+ }
24
+
25
+
26
+ $swipezoomcreditmemo= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('swipezoomorderid',$order->getSwipezoomOrderNumberTemp());
27
+ foreach($swipezoomcreditmemo as $ss){
28
+ $sorder = $ss->getRefswipezoomorderid();
29
+ }
30
+ if(count($swipezoomcreditmemo)){
31
+ return '<span class="swipezoomorder1"> #'.$sorder.' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span>';
32
+ }
33
+
34
+ return;
35
+
36
+ }
37
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderinvoice.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderinvoice
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderinvoice extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
10
+ {
11
+ public function render(Varien_Object $row)
12
+ {
13
+ $value = $row->getData($this->getColumn()->getIndex());
14
+ $order = Mage::getModel('sales/order')->loadByIncrementId($value);
15
+ if($order->getSwipezoomOrderNumberTemp()){
16
+
17
+ return '<span class="swipezoomorder"> #'.$order->getSwipezoomOrderNumberTemp().' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span><script type="text/javascript">
18
+ Event.observe(document,"dom:loaded",function(){
19
+ $$(".swipezoomorder").each(function(ele){
20
+ ele.up().previous().previous().down().remove();
21
+ ele.up().previous().up().addClassName("swipezoom-row");
22
+ });
23
+ });
24
+ </script><style ="text/css">.sdwipezoom{padding-left:4px;}</style>';
25
+ }
26
+
27
+ }
28
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Grid/Swipezoomorderparent.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderparent
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderparent extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
10
+ {
11
+ public function render(Varien_Object $row)
12
+ {
13
+ $value = $row->getData($this->getColumn()->getIndex());
14
+ $order = Mage::getModel('sales/order')->loadByIncrementId($value);
15
+
16
+ $swipezoomcreditmemo= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('swipezoomorderid',$order->getSwipezoomOrderNumberTemp());
17
+ foreach($swipezoomcreditmemo as $ss){
18
+ $sorder = $ss->getSwipezoomorderid();
19
+ }
20
+ if(count($swipezoomcreditmemo)){
21
+ return '<span class="swipezoomorder del'.$order->getId().'"> #'.$sorder.' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span><style ="text/css">.sdwipezoom{padding-left:4px;}</style>';
22
+ }
23
+
24
+ $swipezoomcreditmemo1 = Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('refswipezoomorderid',$order->getSwipezoomOrderNumberTemp());
25
+ foreach($swipezoomcreditmemo1 as $ss){
26
+ $sorder = $ss->getSwipezoomorderid();
27
+ }
28
+ if($sorder){
29
+ return '<span class="swipezoomorder del'.$order->getId().'"> #'.$sorder.' <img src="'.$this->getSkinUrl("internationalshipping/images/logo.jpg").'" height="20px;" title="Powered by Swipezoom" style="float:right;" /></span><style ="text/css">.sdwipezoom{padding-left:4px;}</style>';
30
+ }
31
+
32
+ return;
33
+ }
34
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Invoice/Grid.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Invoice_Grid
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Invoice_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('sales_invoice_grid');
16
+ $this->setUseAjax(true);
17
+ $this->setDefaultSort('created_at');
18
+ $this->setDefaultDir('DESC');
19
+ $this->setSaveParametersInSession(true);
20
+ }
21
+
22
+ /**
23
+ * Retrieve collection class
24
+ *
25
+ * @return string
26
+ */
27
+ protected function _getCollectionClass()
28
+ {
29
+ return 'sales/order_invoice_grid_collection';
30
+ }
31
+
32
+ protected function _prepareCollection()
33
+ {
34
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
35
+ $this->setCollection($collection);
36
+ return parent::_prepareCollection();
37
+ }
38
+
39
+ protected function _prepareColumns()
40
+ {
41
+ $this->addColumn('increment_id', array(
42
+ 'header' => Mage::helper('sales')->__('Invoice #'),
43
+ 'index' => 'increment_id',
44
+ 'type' => 'text',
45
+ ));
46
+
47
+ $this->addColumn('swipezoomorder', array(
48
+ 'header' => Mage::helper('sales')->__('Swipezoom ID'),
49
+ 'header_css_class' => 'a-center',
50
+ 'index' => 'order_increment_id',
51
+ 'width' => '80px',
52
+ 'renderer' => 'Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderinvoice',
53
+ 'filter' => false,
54
+ 'sortable' => false,
55
+ 'type' => 'text'
56
+ ));
57
+
58
+ $this->addColumn('created_at', array(
59
+ 'header' => Mage::helper('sales')->__('Invoice Date'),
60
+ 'index' => 'created_at',
61
+ 'type' => 'datetime',
62
+ ));
63
+
64
+ $this->addColumn('order_increment_id', array(
65
+ 'header' => Mage::helper('sales')->__('Order #'),
66
+ 'index' => 'order_increment_id',
67
+ 'type' => 'text',
68
+ ));
69
+
70
+
71
+ $this->addColumn('order_created_at', array(
72
+ 'header' => Mage::helper('sales')->__('Order Date'),
73
+ 'index' => 'order_created_at',
74
+ 'type' => 'datetime',
75
+ ));
76
+
77
+ $this->addColumn('billing_name', array(
78
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
79
+ 'index' => 'billing_name',
80
+ ));
81
+
82
+ $this->addColumn('state', array(
83
+ 'header' => Mage::helper('sales')->__('Status'),
84
+ 'index' => 'state',
85
+ 'type' => 'options',
86
+ 'options' => Mage::getModel('sales/order_invoice')->getStates(),
87
+ ));
88
+
89
+ $this->addColumn('grand_total', array(
90
+ 'header' => Mage::helper('customer')->__('Amount'),
91
+ 'index' => 'grand_total',
92
+ 'type' => 'currency',
93
+ 'align' => 'right',
94
+ 'currency' => 'order_currency_code',
95
+ ));
96
+
97
+ $this->addColumn('action',
98
+ array(
99
+ 'header' => Mage::helper('sales')->__('Action'),
100
+ 'width' => '50px',
101
+ 'type' => 'action',
102
+ 'getter' => 'getId',
103
+ 'actions' => array(
104
+ array(
105
+ 'caption' => Mage::helper('sales')->__('View'),
106
+ 'url' => array('base'=>'*/sales_invoice/view'),
107
+ 'field' => 'invoice_id'
108
+ )
109
+ ),
110
+ 'filter' => false,
111
+ 'sortable' => false,
112
+ 'is_system' => true
113
+ ));
114
+
115
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
116
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
117
+
118
+ return parent::_prepareColumns();
119
+ }
120
+
121
+ protected function _prepareMassaction()
122
+ {
123
+ $this->setMassactionIdField('entity_id');
124
+ $this->getMassactionBlock()->setFormFieldName('invoice_ids');
125
+ $this->getMassactionBlock()->setUseSelectAll(false);
126
+
127
+ $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
128
+ 'label'=> Mage::helper('sales')->__('PDF Invoices'),
129
+ 'url' => $this->getUrl('/sales_invoice/pdfinvoices'),
130
+ ));
131
+
132
+ return $this;
133
+ }
134
+
135
+ public function getRowUrl($row)
136
+ {
137
+ if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/invoice')) {
138
+ return false;
139
+ }
140
+
141
+ return $this->getUrl('*/sales_invoice/view',
142
+ array(
143
+ 'invoice_id'=> $row->getId(),
144
+ )
145
+ );
146
+ }
147
+
148
+ public function getGridUrl()
149
+ {
150
+ return $this->getUrl('*/*/grid', array('_current' => true));
151
+ }
152
+
153
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/Customreorder.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Customreorder
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Customreorder extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder
10
+ {
11
+ /**
12
+ * Retrieve item collection
13
+ *
14
+ * @return mixed
15
+ */
16
+ public function getItemCollection()
17
+ {
18
+
19
+ $current = Mage::getSingleton('adminhtml/sales_order_create')->getQuote()->getAllItems();
20
+ $ar = array();
21
+ foreach ($current as $item1) { $ar[] = $item1->getSku(); }
22
+
23
+
24
+ if ($order = Mage::getModel('sales/order')->load(Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId())) {
25
+ $items = array();
26
+
27
+ foreach ($order->getItemsCollection() as $item) {
28
+ if (!$item->getParentItem() && !in_array($item->getSku(),$ar)) {
29
+ $items[] = $item;
30
+ }
31
+ }
32
+ // echo "1";
33
+ return $items;
34
+ }
35
+ return false;
36
+ }
37
+ }
38
+
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/Reorder.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Reorder
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Reorder extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder
10
+ {
11
+ /**
12
+ * Retrieve item collection
13
+ *
14
+ * @return mixed
15
+ */
16
+ public function getItemCollection()
17
+ {
18
+
19
+ $current = Mage::getSingleton('adminhtml/sales_order_create')->getQuote()->getAllItems();
20
+ $ar = array();
21
+ foreach ($current as $item1) { $ar[] = $item1->getSku(); }
22
+
23
+
24
+ if ($order = Mage::getModel('sales/order')->load(Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId())) {
25
+ $items = array();
26
+
27
+ foreach ($order->getItemsCollection() as $item) {
28
+ if (!$item->getParentItem() && !in_array($item->getSku(),$ar)) {
29
+ $items[] = $item;
30
+ }
31
+ }
32
+ // echo "1";
33
+ return $items;
34
+ }
35
+ return false;
36
+ }
37
+ }
38
+
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Create/Sidebar/_Reorder.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Reorder
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Reorder extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder
10
+ {
11
+ /**
12
+ * Retrieve item collection
13
+ *
14
+ * @return mixed
15
+ */
16
+ public function getItemCollection()
17
+ {
18
+
19
+ $current = Mage::getSingleton('adminhtml/sales_order_create')->getQuote()->getAllItems();
20
+ $ar = array();
21
+ foreach ($current as $item1) { $ar[] = $item1->getSku(); }
22
+
23
+ if ($order = $this->getLastOrder()) {
24
+ $items = array();
25
+ foreach ($order->getItemsCollection() as $item) {
26
+
27
+ if (!$item->getParentItem() && !in_array($item->getSku(),$ar)) {
28
+ $items[] = $item;
29
+ }
30
+ }
31
+ return $items;
32
+ }
33
+ return false;
34
+ }
35
+ }
36
+
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_Totals
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_Totals extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals
10
+ {
11
+ /**
12
+ * Initialize order totals array
13
+ *
14
+ * @return Mage_Sales_Block_Order_Totals
15
+ */
16
+ protected function _initTotals()
17
+ {
18
+ parent::_initTotals();
19
+ $amount = $this->getSource()->getVatAmount();
20
+ $amount = floatval($amount);
21
+
22
+ if (!empty($amount)) {
23
+ $this->addTotalBefore(new Varien_Object(array(
24
+ 'code' => 'VAT',
25
+ 'value' => $amount,
26
+ 'base_value'=> $amount,
27
+ 'label' => 'VAT',
28
+ ), array('shipping', 'tax')));
29
+ }
30
+
31
+ return $this;
32
+ }
33
+
34
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Creditmemo/View.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_View
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_View extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+
12
+ /**
13
+ * Add & remove control buttons
14
+ *
15
+ */
16
+ public function __construct()
17
+ {
18
+ $this->_objectId = 'creditmemo_id';
19
+ $this->_controller = 'sales_order_creditmemo';
20
+ $this->_mode = 'view';
21
+
22
+ parent::__construct();
23
+
24
+ $this->_removeButton('save');
25
+ $this->_removeButton('reset');
26
+ $this->_removeButton('delete');
27
+
28
+ if ($this->getCreditmemo()->canCancel()) {
29
+ $this->_addButton('cancel', array(
30
+ 'label' => Mage::helper('sales')->__('Cancel'),
31
+ 'class' => 'delete',
32
+ 'onclick' => 'setLocation(\''.$this->getCancelUrl().'\')'
33
+ )
34
+ );
35
+ }
36
+
37
+ if ($this->_isAllowedAction('emails')) {
38
+ $this->addButton('send_notification', array(
39
+ 'label' => Mage::helper('sales')->__('Send Email'),
40
+ 'onclick' => 'confirmSetLocation(\''
41
+ . Mage::helper('sales')->__('Are you sure you want to send Creditmemo email to customer?')
42
+ . '\', \'' . $this->getEmailUrl() . '\')'
43
+ ));
44
+ }
45
+
46
+ if ($this->getCreditmemo()->canRefund()) {
47
+ $this->_addButton('refund', array(
48
+ 'label' => Mage::helper('sales')->__('Refund'),
49
+ 'class' => 'save',
50
+ 'onclick' => 'setLocation(\''.$this->getRefundUrl().'\')'
51
+ )
52
+ );
53
+ }
54
+
55
+ if ($this->getCreditmemo()->canVoid()) {
56
+ $this->_addButton('void', array(
57
+ 'label' => Mage::helper('sales')->__('Void'),
58
+ 'class' => 'save',
59
+ 'onclick' => 'setLocation(\''.$this->getVoidUrl().'\')'
60
+ )
61
+ );
62
+ }
63
+
64
+ if ($this->getCreditmemo()->getId()) {
65
+ $this->_addButton('print', array(
66
+ 'label' => Mage::helper('sales')->__('Print'),
67
+ 'class' => 'save',
68
+ 'onclick' => 'setLocation(\''.$this->getPrintUrl().'\')'
69
+ )
70
+ );
71
+ }
72
+
73
+ $order = $this->getCreditmemo()->getOrder();
74
+ if($order->getSwipezoomOrderNumberTemp()){
75
+ $this->_removeButton('send_notification');
76
+ $this->_removeButton('order_reorder');
77
+ }
78
+
79
+ }
80
+
81
+ /**
82
+ * Retrieve creditmemo model instance
83
+ *
84
+ * @return Mage_Sales_Model_Order_Creditmemo
85
+ */
86
+ public function getCreditmemo()
87
+ {
88
+ return Mage::registry('current_creditmemo');
89
+ }
90
+
91
+ /**
92
+ * Retrieve text for header
93
+ *
94
+ * @return string
95
+ */
96
+ public function getHeaderText()
97
+ {
98
+ if ($this->getCreditmemo()->getEmailSent()) {
99
+ $emailSent = Mage::helper('sales')->__('the credit memo email was sent');
100
+ }
101
+ else {
102
+ $emailSent = Mage::helper('sales')->__('the credit memo email is not sent');
103
+ }
104
+ $order = $this->getCreditmemo()->getOrder();
105
+ if($order->getSwipezoomOrderNumberTemp()){
106
+
107
+ return Mage::helper('sales')->__('Credit Memo #%1$s | %3$s | %2$s', $this->getCreditmemo()->getIncrementId(), $this->formatDate($this->getCreditmemo()->getCreatedAtDate(), 'medium', true), $this->getCreditmemo()->getStateName(), $emailSent);
108
+ }
109
+
110
+ return Mage::helper('sales')->__('Credit Memo #%1$s | %3$s | %2$s (%4$s)', $this->getCreditmemo()->getIncrementId(), $this->formatDate($this->getCreditmemo()->getCreatedAtDate(), 'medium', true), $this->getCreditmemo()->getStateName(), $emailSent);
111
+ }
112
+
113
+ /**
114
+ * Retrieve back url
115
+ *
116
+ * @return string
117
+ */
118
+ public function getBackUrl()
119
+ {
120
+ return $this->getUrl(
121
+ '*/sales_order/view',
122
+ array(
123
+ 'order_id' => $this->getCreditmemo()->getOrderId(),
124
+ 'active_tab'=> 'order_creditmemos'
125
+ ));
126
+ }
127
+
128
+ /**
129
+ * Retrieve capture url
130
+ *
131
+ * @return string
132
+ */
133
+ public function getCaptureUrl()
134
+ {
135
+ return $this->getUrl('*/*/capture', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
136
+ }
137
+
138
+ /**
139
+ * Retrieve void url
140
+ *
141
+ * @return string
142
+ */
143
+ public function getVoidUrl()
144
+ {
145
+ return $this->getUrl('*/*/void', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
146
+ }
147
+
148
+ /**
149
+ * Retrieve cancel url
150
+ *
151
+ * @return string
152
+ */
153
+ public function getCancelUrl()
154
+ {
155
+ return $this->getUrl('*/*/cancel', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
156
+ }
157
+
158
+ /**
159
+ * Retrieve email url
160
+ *
161
+ * @return string
162
+ */
163
+ public function getEmailUrl()
164
+ {
165
+ return $this->getUrl('*/*/email', array(
166
+ 'creditmemo_id' => $this->getCreditmemo()->getId(),
167
+ 'order_id' => $this->getCreditmemo()->getOrderId()
168
+ ));
169
+ }
170
+
171
+ /**
172
+ * Retrieve print url
173
+ *
174
+ * @return string
175
+ */
176
+ public function getPrintUrl()
177
+ {
178
+ return $this->getUrl('*/*/print', array(
179
+ 'creditmemo_id' => $this->getCreditmemo()->getId()
180
+ ));
181
+ }
182
+
183
+ /**
184
+ * Update 'back' button url
185
+ *
186
+ * @return Mage_Adminhtml_Block_Widget_Container | Mage_Adminhtml_Block_Sales_Order_Creditmemo_View
187
+ */
188
+ public function updateBackButtonUrl($flag)
189
+ {
190
+ if ($flag) {
191
+ if ($this->getCreditmemo()->getBackUrl()) {
192
+ return $this->_updateButton(
193
+ 'back',
194
+ 'onclick',
195
+ 'setLocation(\'' . $this->getCreditmemo()->getBackUrl() . '\')'
196
+ );
197
+ }
198
+
199
+ return $this->_updateButton(
200
+ 'back',
201
+ 'onclick',
202
+ 'setLocation(\'' . $this->getUrl('*/sales_creditmemo/') . '\')'
203
+ );
204
+ }
205
+ return $this;
206
+ }
207
+
208
+ /**
209
+ * Check whether action is allowed
210
+ *
211
+ * @param string $action
212
+ * @return bool
213
+ */
214
+ public function _isAllowedAction($action)
215
+ {
216
+ return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/' . $action);
217
+ }
218
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Invoice/Totals.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_Totals
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_Totals extends Mage_Adminhtml_Block_Sales_Order_Invoice_Totals
10
+ {
11
+ /**
12
+ * Initialize order totals array
13
+ *
14
+ * @return Mage_Sales_Block_Order_Totals
15
+ */
16
+ protected function _initTotals()
17
+ {
18
+ parent::_initTotals();
19
+ $amount = $this->getSource()->getVatAmount();
20
+ $amount = floatval($amount);
21
+
22
+ if (!empty($amount)) {
23
+ $this->addTotalBefore(new Varien_Object(array(
24
+ 'code' => 'VAT',
25
+ 'value' => $amount,
26
+ 'base_value'=> $amount,
27
+ 'label' => 'VAT',
28
+ ), array('shipping', 'tax')));
29
+ }
30
+
31
+ return $this;
32
+ }
33
+
34
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Invoice/View.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_View
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_View extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+ /**
12
+ * Admin session
13
+ *
14
+ * @var Mage_Admin_Model_Session
15
+ */
16
+ protected $_session;
17
+
18
+ public function __construct()
19
+ {
20
+ $this->_objectId = 'invoice_id';
21
+ $this->_controller = 'sales_order_invoice';
22
+ $this->_mode = 'view';
23
+ $this->_session = Mage::getSingleton('admin/session');
24
+
25
+ parent::__construct();
26
+
27
+ $this->_removeButton('save');
28
+ $this->_removeButton('reset');
29
+ $this->_removeButton('delete');
30
+
31
+ if ($this->_isAllowedAction('cancel') && $this->getInvoice()->canCancel()) {
32
+ $this->_addButton('cancel', array(
33
+ 'label' => Mage::helper('sales')->__('Cancel'),
34
+ 'class' => 'delete',
35
+ 'onclick' => 'setLocation(\''.$this->getCancelUrl().'\')'
36
+ )
37
+ );
38
+ }
39
+
40
+ if ($this->_isAllowedAction('emails')) {
41
+ $this->addButton('send_notification', array(
42
+ 'label' => Mage::helper('sales')->__('Send Email'),
43
+ 'onclick' => 'confirmSetLocation(\''
44
+ . Mage::helper('sales')->__('Are you sure you want to send Invoice email to customer?')
45
+ . '\', \'' . $this->getEmailUrl() . '\')'
46
+ ));
47
+ }
48
+
49
+ $orderPayment = $this->getInvoice()->getOrder()->getPayment();
50
+
51
+ if ($this->_isAllowedAction('creditmemo') && $this->getInvoice()->getOrder()->canCreditmemo()) {
52
+ if (($orderPayment->canRefundPartialPerInvoice()
53
+ && $this->getInvoice()->canRefund()
54
+ && $orderPayment->getAmountPaid() > $orderPayment->getAmountRefunded())
55
+ || ($orderPayment->canRefund() && !$this->getInvoice()->getIsUsedForRefund())) {
56
+ $this->_addButton('capture', array( // capture?
57
+ 'label' => Mage::helper('sales')->__('Credit Memo'),
58
+ 'class' => 'go',
59
+ 'onclick' => 'setLocation(\''.$this->getCreditMemoUrl().'\')'
60
+ )
61
+ );
62
+ }
63
+ }
64
+
65
+ if ($this->_isAllowedAction('capture') && $this->getInvoice()->canCapture()) {
66
+ $this->_addButton('capture', array(
67
+ 'label' => Mage::helper('sales')->__('Capture'),
68
+ 'class' => 'save',
69
+ 'onclick' => 'setLocation(\''.$this->getCaptureUrl().'\')'
70
+ )
71
+ );
72
+ }
73
+
74
+ if ($this->getInvoice()->canVoid()) {
75
+ $this->_addButton('void', array(
76
+ 'label' => Mage::helper('sales')->__('Void'),
77
+ 'class' => 'save',
78
+ 'onclick' => 'setLocation(\''.$this->getVoidUrl().'\')'
79
+ )
80
+ );
81
+ }
82
+
83
+ if ($this->getInvoice()->getId()) {
84
+ $this->_addButton('print', array(
85
+ 'label' => Mage::helper('sales')->__('Print'),
86
+ 'class' => 'save',
87
+ 'onclick' => 'setLocation(\''.$this->getPrintUrl().'\')'
88
+ )
89
+ );
90
+ }
91
+
92
+ $order = $this->getInvoice()->getOrder();
93
+ if($order->getSwipezoomOrderNumberTemp()){
94
+ $this->_removeButton('send_notification');
95
+ $this->_removeButton('order_reorder');
96
+ }
97
+
98
+ }
99
+
100
+ /**
101
+ * Retrieve invoice model instance
102
+ *
103
+ * @return Mage_Sales_Model_Order_Invoice
104
+ */
105
+ public function getInvoice()
106
+ {
107
+ return Mage::registry('current_invoice');
108
+ }
109
+
110
+ public function getHeaderText()
111
+ {
112
+ if ($this->getInvoice()->getEmailSent()) {
113
+ $emailSent = Mage::helper('sales')->__('the invoice email was sent');
114
+ }
115
+ else {
116
+ $emailSent = Mage::helper('sales')->__('the invoice email is not sent');
117
+ }
118
+ $order = $this->getInvoice()->getOrder();
119
+ if($order->getSwipezoomOrderNumberTemp()){
120
+ $emailSent = '';
121
+ return Mage::helper('sales')->__('Invoice #%1$s | %2$s | %4$s', $this->getInvoice()->getIncrementId(), $this->getInvoice()->getStateName(), $emailSent, $this->formatDate($this->getInvoice()->getCreatedAtDate(), 'medium', true));
122
+ }
123
+ return Mage::helper('sales')->__('Invoice #%1$s | %2$s | %4$s (%3$s)', $this->getInvoice()->getIncrementId(), $this->getInvoice()->getStateName(), $emailSent, $this->formatDate($this->getInvoice()->getCreatedAtDate(), 'medium', true));
124
+ }
125
+
126
+ public function getBackUrl()
127
+ {
128
+ return $this->getUrl(
129
+ '*/sales_order/view',
130
+ array(
131
+ 'order_id' => $this->getInvoice()->getOrderId(),
132
+ 'active_tab'=> 'order_invoices'
133
+ ));
134
+ }
135
+
136
+ public function getCaptureUrl()
137
+ {
138
+ return $this->getUrl('*/*/capture', array('invoice_id'=>$this->getInvoice()->getId()));
139
+ }
140
+
141
+ public function getVoidUrl()
142
+ {
143
+ return $this->getUrl('*/*/void', array('invoice_id'=>$this->getInvoice()->getId()));
144
+ }
145
+
146
+ public function getCancelUrl()
147
+ {
148
+ return $this->getUrl('*/*/cancel', array('invoice_id'=>$this->getInvoice()->getId()));
149
+ }
150
+
151
+ public function getEmailUrl()
152
+ {
153
+ return $this->getUrl('*/*/email', array(
154
+ 'order_id' => $this->getInvoice()->getOrder()->getId(),
155
+ 'invoice_id'=> $this->getInvoice()->getId(),
156
+ ));
157
+ }
158
+
159
+ public function getCreditMemoUrl()
160
+ {
161
+ return $this->getUrl('*/sales_order_creditmemo/start', array(
162
+ 'order_id' => $this->getInvoice()->getOrder()->getId(),
163
+ 'invoice_id'=> $this->getInvoice()->getId(),
164
+ ));
165
+ }
166
+
167
+ public function getPrintUrl()
168
+ {
169
+ return $this->getUrl('*/*/print', array(
170
+ 'invoice_id' => $this->getInvoice()->getId()
171
+ ));
172
+ }
173
+
174
+ public function updateBackButtonUrl($flag)
175
+ {
176
+ if ($flag) {
177
+ if ($this->getInvoice()->getBackUrl()) {
178
+ return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getInvoice()->getBackUrl() . '\')');
179
+ }
180
+ return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/sales_invoice/') . '\')');
181
+ }
182
+ return $this;
183
+ }
184
+
185
+ /**
186
+ * Check whether is allowed action
187
+ *
188
+ * @param string $action
189
+ * @return bool
190
+ */
191
+ protected function _isAllowedAction($action)
192
+ {
193
+ return $this->_session->isAllowed('sales/order/actions/' . $action);
194
+ }
195
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Shipment/View.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Shipment_View
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Shipment_View extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ $this->_objectId = 'shipment_id';
15
+ $this->_controller = 'sales_order_shipment';
16
+ $this->_mode = 'view';
17
+
18
+ parent::__construct();
19
+
20
+ $this->_removeButton('reset');
21
+ $this->_removeButton('delete');
22
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/emails')) {
23
+ $this->_updateButton('save', 'label', Mage::helper('sales')->__('Send Tracking Information'));
24
+ $this->_updateButton('save',
25
+ 'onclick', "deleteConfirm('"
26
+ . Mage::helper('sales')->__('Are you sure you want to send Shipment email to customer?')
27
+ . "', '" . $this->getEmailUrl() . "')"
28
+ );
29
+ }
30
+
31
+ if ($this->getShipment()->getId()) {
32
+ $this->_addButton('print', array(
33
+ 'label' => Mage::helper('sales')->__('Print'),
34
+ 'class' => 'save',
35
+ 'onclick' => 'setLocation(\''.$this->getPrintUrl().'\')'
36
+ )
37
+ );
38
+ }
39
+
40
+ $order = $this->getShipment()->getOrder();
41
+ if($order->getSwipezoomOrderNumberTemp()){
42
+ $this->_removeButton('send_notification');
43
+ $this->_removeButton('order_reorder');
44
+ $this->_removeButton('save');
45
+
46
+ }
47
+
48
+ }
49
+
50
+ /**
51
+ * Retrieve shipment model instance
52
+ *
53
+ * @return Mage_Sales_Model_Order_Shipment
54
+ */
55
+ public function getShipment()
56
+ {
57
+ return Mage::registry('current_shipment');
58
+ }
59
+
60
+ public function getHeaderText()
61
+ {
62
+ if ($this->getShipment()->getEmailSent()) {
63
+ $emailSent = Mage::helper('sales')->__('the shipment email was sent');
64
+ }
65
+ else {
66
+ $emailSent = Mage::helper('sales')->__('the shipment email is not sent');
67
+ }
68
+ $order = $this->getShipment()->getOrder();
69
+ if($order->getSwipezoomOrderNumberTemp()){
70
+ $emailSent = '';
71
+ return Mage::helper('sales')->__('Shipment #%1$s | %3$s', $this->getShipment()->getIncrementId(), $emailSent, $this->formatDate($this->getShipment()->getCreatedAtDate(), 'medium', true));
72
+ }
73
+ return Mage::helper('sales')->__('Shipment #%1$s | %3$s (%2$s)', $this->getShipment()->getIncrementId(), $emailSent, $this->formatDate($this->getShipment()->getCreatedAtDate(), 'medium', true));
74
+ }
75
+
76
+ public function getBackUrl()
77
+ {
78
+ return $this->getUrl(
79
+ '*/sales_order/view',
80
+ array(
81
+ 'order_id' => $this->getShipment()->getOrderId(),
82
+ 'active_tab'=> 'order_shipments'
83
+ ));
84
+ }
85
+
86
+ public function getEmailUrl()
87
+ {
88
+ return $this->getUrl('*/sales_order_shipment/email', array('shipment_id' => $this->getShipment()->getId()));
89
+ }
90
+
91
+ public function getPrintUrl()
92
+ {
93
+ return $this->getUrl('*/*/print', array(
94
+ 'invoice_id' => $this->getShipment()->getId()
95
+ ));
96
+ }
97
+
98
+ public function updateBackButtonUrl($flag)
99
+ {
100
+ if ($flag) {
101
+ if ($this->getShipment()->getBackUrl()) {
102
+ return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getShipment()->getBackUrl() . '\')');
103
+ }
104
+ return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/sales_shipment/') . '\')');
105
+ }
106
+ return $this;
107
+ }
108
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/Totals.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Totals
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Totals extends Mage_Adminhtml_Block_Sales_Order_Totals
9
+ {
10
+ /**
11
+ * Initialize order totals array
12
+ *
13
+ * @return Mage_Sales_Block_Order_Totals
14
+ */
15
+ protected function _initTotals()
16
+ {
17
+ parent::_initTotals();
18
+ $amount = $this->getSource()->getVatAmount();
19
+ $amount = floatval($amount);
20
+
21
+ if (!empty($amount)) {
22
+ $this->addTotalBefore(new Varien_Object(array(
23
+ 'code' => 'VAT',
24
+ 'value' => $amount,
25
+ 'base_value'=> $amount,
26
+ 'label' => 'VAT',
27
+ ), array('shipping', 'tax')));
28
+ }
29
+
30
+ return $this;
31
+ }
32
+
33
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Order/View.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_View
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+
15
+ parent::__construct();
16
+ $order = $this->getOrder();
17
+
18
+ if ($swipwzoomorder = $order->getSwipezoomOrderNumberTemp() && $order->hasInvoices() && $order->getSwipezoomOrderCreditmemo()<3) {
19
+ $this->_addButton('print', array(
20
+ 'label' => Mage::helper('sales')->__('Print Packing Instruction'),
21
+ 'class' => 'save',
22
+ 'onclick' => 'setLocation(\''.$this->getPrintUrl($order).'\')'
23
+ )
24
+ );
25
+ }
26
+ if ($swipwzoomorder = $order->getSwipezoomOrderNumberTemp()) {
27
+ // $this->_removeButton('order_edit');
28
+ }
29
+
30
+
31
+
32
+ if ($swipwzoomorder = $order->getSwipezoomOrderNumberTemp() && $order->hasShipments()) {
33
+ $this->_addButton('printdocumetns', array(
34
+ 'label' => Mage::helper('sales')->__('Print All Documents'),
35
+ 'class' => 'save',
36
+ 'onclick' => 'openMyPopup(\''.$this->getPrintallUrl($order).'\', 300,650)'
37
+ )
38
+ );
39
+ }
40
+
41
+ /*if ($swipwzoomorder = $order->getSwipezoomOrderNumberTemp() && !$order->hasShipments()) {
42
+ $this->_removeButton('order_cancel');
43
+ $message = Mage::helper('sales')->__('Are you sure you want to cancel this order?');
44
+ $this->_addButton('ordercancel', array(
45
+ 'label' => Mage::helper('sales')->__('Cancel'),
46
+ 'onclick' => 'deleteConfirm(\''.$message.'\', \'' . $this->getCancelUrl() . '\')',
47
+ ));
48
+ }*/
49
+
50
+ if($order->getSwipezoomOrderCreditmemo() ==2){
51
+ $this->_removeButton('order_creditmemo');
52
+ }
53
+ if($order->getSwipezoomOrderNumberTemp()){
54
+ $this->_removeButton('send_notification');
55
+ $this->_removeButton('order_reorder');
56
+ }
57
+
58
+
59
+ }
60
+
61
+ public function getPrintUrl($order)
62
+ {
63
+
64
+ $invoicid = Mage::getResourceModel('sales/order_invoice_collection')
65
+ ->setOrderFilter($order->getId());
66
+
67
+ if ($order->getId()) {
68
+ foreach ($invoicid as $invoice) {
69
+ $invoice->setOrder($order);
70
+ $invoice_id = $invoice->getId();
71
+ }
72
+ }
73
+
74
+ return $this->getUrl('adminhtml/sales_order_invoice/print', array(
75
+ 'invoice_id' => $invoice_id
76
+ ));
77
+ }
78
+
79
+ public function getPrintallUrl($order)
80
+ {
81
+ return $this->getUrl('internationalshipping/index/printall', array(
82
+ 'order_id' => $order->getId(),
83
+ 'szoomorder' => $order->getSwipezoomOrderNumberTemp()
84
+ ));
85
+ }
86
+
87
+ }
88
+
app/code/local/Swipezoom/InternationalShipping/Block/Adminhtml/Sales/Shipment/Grid.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Shipment_Grid
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+
12
+ /**
13
+ * Initialization
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+ $this->setId('sales_shipment_grid');
19
+ $this->setDefaultSort('created_at');
20
+ $this->setDefaultDir('DESC');
21
+ }
22
+
23
+ /**
24
+ * Retrieve collection class
25
+ *
26
+ * @return string
27
+ */
28
+ protected function _getCollectionClass()
29
+ {
30
+ return 'sales/order_shipment_grid_collection';
31
+ }
32
+
33
+ /**
34
+ * Prepare and set collection of grid
35
+ *
36
+ * @return Mage_Adminhtml_Block_Widget_Grid
37
+ */
38
+ protected function _prepareCollection()
39
+ {
40
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
41
+ $this->setCollection($collection);
42
+ return parent::_prepareCollection();
43
+ }
44
+
45
+ /**
46
+ * Prepare and add columns to grid
47
+ *
48
+ * @return Mage_Adminhtml_Block_Widget_Grid
49
+ */
50
+ protected function _prepareColumns()
51
+ {
52
+ $this->addColumn('increment_id', array(
53
+ 'header' => Mage::helper('sales')->__('Shipment #'),
54
+ 'index' => 'increment_id',
55
+ 'type' => 'text',
56
+ ));
57
+
58
+ $this->addColumn('swipezoomorder', array(
59
+ 'header' => Mage::helper('sales')->__('Swipezoom ID'),
60
+ 'header_css_class' => 'a-center',
61
+ 'index' => 'order_increment_id',
62
+ 'width' => '80px',
63
+ 'renderer' => 'Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid_Swipezoomorderinvoice',
64
+ 'filter' => false,
65
+ 'sortable' => false,
66
+ 'type' => 'text'
67
+ ));
68
+
69
+
70
+ $this->addColumn('created_at', array(
71
+ 'header' => Mage::helper('sales')->__('Date Shipped'),
72
+ 'index' => 'created_at',
73
+ 'type' => 'datetime',
74
+ ));
75
+
76
+ $this->addColumn('order_increment_id', array(
77
+ 'header' => Mage::helper('sales')->__('Order #'),
78
+ 'index' => 'order_increment_id',
79
+ 'type' => 'text',
80
+ ));
81
+
82
+ $this->addColumn('order_created_at', array(
83
+ 'header' => Mage::helper('sales')->__('Order Date'),
84
+ 'index' => 'order_created_at',
85
+ 'type' => 'datetime',
86
+ ));
87
+
88
+ $this->addColumn('shipping_name', array(
89
+ 'header' => Mage::helper('sales')->__('Ship to Name'),
90
+ 'index' => 'shipping_name',
91
+ ));
92
+
93
+ $this->addColumn('total_qty', array(
94
+ 'header' => Mage::helper('sales')->__('Total Qty'),
95
+ 'index' => 'total_qty',
96
+ 'type' => 'number',
97
+ ));
98
+
99
+ $this->addColumn('action',
100
+ array(
101
+ 'header' => Mage::helper('sales')->__('Action'),
102
+ 'width' => '50px',
103
+ 'type' => 'action',
104
+ 'getter' => 'getId',
105
+ 'actions' => array(
106
+ array(
107
+ 'caption' => Mage::helper('sales')->__('View'),
108
+ 'url' => array('base'=>'*/sales_shipment/view'),
109
+ 'field' => 'shipment_id'
110
+ )
111
+ ),
112
+ 'filter' => false,
113
+ 'sortable' => false,
114
+ 'is_system' => true
115
+ ));
116
+
117
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
118
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
119
+
120
+ return parent::_prepareColumns();
121
+ }
122
+
123
+ /**
124
+ * Get url for row
125
+ *
126
+ * @param string $row
127
+ * @return string
128
+ */
129
+ public function getRowUrl($row)
130
+ {
131
+ if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
132
+ return false;
133
+ }
134
+
135
+ return $this->getUrl('*/sales_shipment/view',
136
+ array(
137
+ 'shipment_id'=> $row->getId(),
138
+ )
139
+ );
140
+ }
141
+
142
+ /**
143
+ * Prepare and set options for massaction
144
+ *
145
+ * @return Mage_Adminhtml_Block_Sales_Shipment_Grid
146
+ */
147
+ protected function _prepareMassaction()
148
+ {
149
+ $this->setMassactionIdField('entity_id');
150
+ $this->getMassactionBlock()->setFormFieldName('shipment_ids');
151
+ $this->getMassactionBlock()->setUseSelectAll(false);
152
+
153
+ $this->getMassactionBlock()->addItem('pdfshipments_order', array(
154
+ 'label'=> Mage::helper('sales')->__('PDF Packingslips'),
155
+ 'url' => $this->getUrl('*/sales_shipment/pdfshipments'),
156
+ ));
157
+
158
+ $this->getMassactionBlock()->addItem('print_shipping_label', array(
159
+ 'label'=> Mage::helper('sales')->__('Print Shipping Labels'),
160
+ 'url' => $this->getUrl('*/sales_order_shipment/massPrintShippingLabel'),
161
+ ));
162
+
163
+ return $this;
164
+ }
165
+
166
+ /**
167
+ * Get url of grid
168
+ *
169
+ * @return string
170
+ */
171
+ public function getGridUrl()
172
+ {
173
+ return $this->getUrl('*/*/*', array('_current' => true));
174
+ }
175
+
176
+ }
app/code/local/Swipezoom/InternationalShipping/Block/Checkout/Onepage/Shipping/Method/Available.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Block_Checkout_Onepage_Shipping_Method_Available
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Block_Checkout_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Shipping_Method_Available {
10
+
11
+ public function getShippingRates() {
12
+ $groups = parent::getShippingRates();
13
+ $free = array();
14
+
15
+ foreach ($groups as $code => $_rates) {
16
+ foreach ($_rates as $_rate) {
17
+ if (!$_rate->getPrice() > 0) {
18
+ $free[$code] = $_rates;
19
+ }
20
+ }
21
+ }
22
+ if (!empty($free)) {
23
+ return $this->_rates = $free;
24
+ }
25
+ return $groups;
26
+ }
27
+
28
+ }
app/code/local/Swipezoom/InternationalShipping/Helper/Data.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_IndexController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Helper_Data extends Mage_Core_Helper_Abstract
10
+ {
11
+ public function _createSoapClient($type = "admin") {
12
+
13
+ if(Mage::getStoreConfig('carriers/swipezoom/mode') == 0) {
14
+ // dev mode
15
+ $adminurl = Mage::getStoreConfig('carriers/swipezoom/devadminurl',Mage::app()->getStore());
16
+ $clienturl = Mage::getStoreConfig('carriers/swipezoom/devurl',Mage::app()->getStore());
17
+ } else {
18
+ //prod mode
19
+ $adminurl = Mage::getStoreConfig('carriers/swipezoom/adminurl',Mage::app()->getStore());
20
+ $clienturl = Mage::getStoreConfig('carriers/swipezoom/url',Mage::app()->getStore());
21
+ }
22
+
23
+ if($type=="admin") { // if admin side
24
+ $wsdl = Mage::getModuleDir('etc', 'Swipezoom_InternationalShipping') . DS . 'WsWsdl' .DS. "GecaWs.wsdl";
25
+ $client = new SoapClient($wsdl, array('trace' => $trace, "exceptions" => 0, "cache_wsdl" => 0));
26
+ $client->__setLocation($adminurl);
27
+ } else { // if client side
28
+ $client = new SoapClient($clienturl,
29
+ array("trace" => 1, "exceptions" => 1, "cache_wsdl" => 0));
30
+ }
31
+
32
+ return $client;
33
+ }
34
+
35
+ public function sendServiceFailureAlert($ratesRequest = array(), $response = "", $event = "", $extra = "") {
36
+
37
+ if(!empty($ratesRequest['Caller']['MerchantKey'])) {
38
+ $ratesRequest['Caller']['MerchantKey'] = str_repeat("*", strlen($ratesRequest['Caller']['MerchantKey']));
39
+ }
40
+
41
+ $date_time = Mage::getModel('core/date')->date('Y-m-d H:i:s');
42
+ $timezone = Mage::getStoreConfig('general/locale/timezone');
43
+
44
+ $timezone_n = new DateTimeZone($timezone);
45
+ $timenow = new DateTime('now', $timezone_n);
46
+ $offset = $timezone_n->getOffset( $timenow ) / 3600;
47
+ $timezone = "GMT" . ($offset < 0 ? $offset : "+".$offset);
48
+
49
+ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
50
+
51
+ $storeName = Mage::getStoreConfig(Mage_Core_Model_Store::XML_PATH_STORE_STORE_NAME);
52
+
53
+ $to = "level2support@swipezoom.com";
54
+ $subject = "[ALERT] [LEVEL-2] [MAGENTO] Application Report";
55
+
56
+ $body = "Event: ".$event."\nStore: ".$storeName."\nDate: ".$date_time." ".$timezone."\nURL: ".$currentUrl."\n\n";
57
+ $body .= "Request: \n".print_r($ratesRequest, true);
58
+
59
+ $body .= "\nResponse: \n";
60
+ if(empty($response))
61
+ $body .= "Empty Response";
62
+ else
63
+ $body .= print_r($response, true);
64
+
65
+ if(!empty($extra)) {
66
+ $body .= "\n\nExtra: \n";
67
+ $body .= $extra;
68
+ }
69
+
70
+
71
+ mail($to, $subject, $body);
72
+
73
+ }
74
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Carrier/Swipezoom.php ADDED
@@ -0,0 +1,968 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Carrier_Swipezoom
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Carrier_Swipezoom
10
+ extends Mage_Shipping_Model_Carrier_Abstract
11
+ {
12
+ protected $_code = 'swipezoom';
13
+ protected $_isFixed = true;
14
+ protected $_request = null;
15
+ protected $_revised;
16
+ protected $_customSelection;
17
+ protected $_quoteobj;
18
+
19
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
20
+ {
21
+ if (!$this->getConfigFlag('active')) {
22
+ return false;
23
+ }
24
+
25
+ $this->setRequest($request);
26
+ $this->_getQuotes();
27
+ return $this->getResult();;
28
+ }
29
+
30
+ /*
31
+ * Config setup with admin params
32
+ */
33
+ public function setRequest(Mage_Shipping_Model_Rate_Request $request)
34
+ {
35
+ $this->_request = $request;
36
+
37
+ $r = new Varien_Object();
38
+
39
+ $r->setMerchantId($this->getConfigData('merchantid'));
40
+ $r->setMerchantKey($this->getConfigData('merchantkey'));
41
+ $r->setUrl($this->getConfigData('url'));
42
+ $r->setPackageDescritpion($this->getConfigData('package_descritpion'));
43
+ $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax());
44
+ $r->setOrderTotal($request->getGrandTotal());
45
+
46
+ if ($request->getDestCountryId()) {
47
+ $destCountry = $request->getDestCountryId();
48
+ } else {
49
+ $destCountry = self::USA_COUNTRY_ID;
50
+ }
51
+ $r->setDestCountry(Mage::getModel('directory/country')->load($destCountry)->getIso2Code());
52
+
53
+
54
+ $this->_rawRequest = $r;
55
+
56
+ return $this;
57
+ }
58
+
59
+ public function getResult()
60
+ {
61
+ return $this->_result;
62
+ }
63
+ /*
64
+ * Returns Current Quote Object
65
+ */
66
+ public function getQuoteObj(){
67
+ if(isset($_quoteobj)){
68
+ return $_quoteobj;
69
+ }else{
70
+ if (Mage::app()->getStore()->isAdmin()) {
71
+ $session = Mage::getSingleton('adminhtml/session_quote')->getQuote();
72
+ return Mage::getModel("sales/quote")->load($session->getId());
73
+ }else{
74
+ $session = Mage::getSingleton('checkout/session');
75
+ return Mage::getModel("sales/quote")->load($session->getQuote()->getEntityId());
76
+ }
77
+
78
+ }
79
+ }
80
+
81
+ protected function __convertFormateAmount($amountToBeFormat){
82
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
83
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
84
+ $amountToBeFormat = Mage::helper('directory')->currencyConvert($amountToBeFormat, $baseCurrencyCode, $currentCurrencyCode);
85
+ return $amountToBeFormat;
86
+ }
87
+
88
+ /*
89
+ * PREPARE TRANS_LOGISTICS_REQUEST
90
+ */
91
+ protected function _formRateRequest(){
92
+
93
+ if (Mage::app()->getStore()->isAdmin()) {
94
+ $session = Mage::getSingleton('adminhtml/session_quote');
95
+
96
+ }else{
97
+ $session = Mage::getSingleton('checkout/session');
98
+ }
99
+ /*
100
+ * PREPARE Billing Address Section
101
+ */
102
+ $r = $this->_rawRequest;
103
+ $sameasShipping = "Y";
104
+ $shippingQuote = Mage::getSingleton('checkout/session')->getQuote();
105
+ /*
106
+ * PREPARE Billing Address Section
107
+ */
108
+ $regionId = $shippingQuote->getBillingAddress()->getRegionId();
109
+ $bState = (!empty($regionId))?Mage::getModel('directory/region')->load($regionId)->getCode():$shippingQuote->getShippingAddress()->getRegion();
110
+ $bstreetArray = $shippingQuote->getBillingAddress()->getStreet();
111
+ $billingArray = array(
112
+ "Country"=>Mage::getModel('directory/country')->load($shippingQuote->getBillingAddress()->getCountryId())->getIso3Code(),
113
+ "FirstName"=>$shippingQuote->getBillingAddress()->getFirstname(),
114
+ "LastName"=>$shippingQuote->getBillingAddress()->getLastname(),
115
+ "AddressLine1"=>$bstreetArray[0],
116
+ "AddressLine2"=>$bstreetArray[1],
117
+ "City"=>ucfirst($shippingQuote->getBillingAddress()->getCity()),
118
+ "StateDivision"=>$bState,
119
+ "PostalCode"=>$shippingQuote->getBillingAddress()->getPostcode(),
120
+ "PhoneNumber"=>$shippingQuote->getBillingAddress()->getTelephone(),
121
+ "Email"=>$shippingQuote->getBillingAddress()->getEmail()
122
+ );
123
+ if(empty($bstreetArray[1])) unset($billingArray["AddressLine2"]);
124
+
125
+ /*
126
+ * PREPARE Shipping Address Section
127
+ * CONDITIONAL : SameAddForShipping = 0
128
+ */
129
+ if(!$shippingQuote->getShippingAddress()->getData("same_as_billing")){
130
+
131
+ $sameasShipping = "N";
132
+ $sstreetArray = $shippingQuote->getShippingAddress()->getStreet();
133
+ $regionId = $shippingQuote->getShippingAddress()->getRegionId();
134
+ $sState = (!empty($regionId))?Mage::getModel('directory/region')->load($regionId)->getCode():$shippingQuote->getShippingAddress()->getRegion();
135
+ $shippingArray = array(
136
+ "Country"=>Mage::getModel('directory/country')->load($shippingQuote->getShippingAddress()->getCountryId())->getIso3Code(),
137
+ "FirstName"=>$shippingQuote->getShippingAddress()->getFirstname(),
138
+ "LastName"=>$shippingQuote->getShippingAddress()->getLastname(),
139
+ "AddressLine1"=>$sstreetArray[0],
140
+ "AddressLine2"=>$sstreetArray[1],
141
+ "City"=>$shippingQuote->getShippingAddress()->getCity(),
142
+ "StateDivision"=>$sState,
143
+ "PostalCode"=>$shippingQuote->getShippingAddress()->getPostcode(),
144
+ "PhoneNumber"=>$shippingQuote->getShippingAddress()->getTelephone(),
145
+ "Email"=>$shippingQuote->getBillingAddress()->getEmail()
146
+ );
147
+ if(empty($sstreetArray[1])) unset($shippingArray["AddressLine2"]);
148
+ }
149
+ /* END */
150
+
151
+ /*
152
+ * PREPARE Merchandise Line Items Section
153
+ */
154
+ $QuoteItems = $shippingQuote->getAllItems();
155
+ $currentCustomer = Mage::getSingleton('customer/session')->getCustomer();
156
+ $listItems = array();
157
+ $count = 0;
158
+ $skipProduct = false;
159
+ $finalAllProductAmountTotal = 0;
160
+ foreach($QuoteItems as $key => $quoteItem){
161
+ //load the product - this may not be needed if you get the product from a collection with the prices loaded.
162
+ $product = Mage::getModel("catalog/product")->load($quoteItem->getProductId());
163
+ if (!$skipProduct) {
164
+ if ($product->isConfigurable()) {
165
+ // use this and next product.
166
+ $productquoteItem_next = $QuoteItems[$key+1];
167
+ $product_next = Mage::getModel("catalog/product")->load($productquoteItem_next->getProductId());
168
+
169
+ // Get add add Product Tax Amount
170
+ $currentStore = Mage::app()->getStore($shippingQuote->getStoreId());
171
+ $current_customer = Mage::getSingleton('customer/session')->getCustomer();
172
+ /*$taxCalc = Mage::getSingleton('tax/calculation');
173
+ $taxClassId = $product_next->getData("tax_class_id");
174
+ $tax_rate_req = $taxCalc->getRateRequest($shippingQuote->getShippingAddress(),$shippingQuote->getBillingAddress(),$current_customer->getTaxClassId(),$currentStore);
175
+ $percent = $taxCalc->getRate($tax_rate_req->setProductClassId($taxClassId));
176
+ $tax = Mage::getModel('tax/calculation')->calcTaxAmount($quoteItem->getPrice(),$percent,false,true );
177
+ $discuntAmount = (float)$quoteItem->getData('discount_amount');
178
+ $finalProductAmount = ($quoteItem->getPrice()-$discuntAmount) + $tax;*/
179
+ $finalProductAmount = $quoteItem->getPrice();
180
+ $finalProductAmountTotal = $finalProductAmount * $quoteItem->getQty();
181
+ $finalAllProductAmountTotal = $finalAllProductAmountTotal + $finalProductAmountTotal;
182
+
183
+ $currentFinalProductAmount = $this->__convertFormateAmount($finalProductAmount);
184
+ $currentFinalProductAmountTotal = $this->__convertFormateAmount($finalProductAmountTotal);
185
+
186
+ $listItems[$count] = array( "ItemId"=> $product_next->getSku(),
187
+ "ItemDescription"=>$product->getName(),
188
+ "ItemQuantity"=>$quoteItem->getQty(),
189
+ "ItemPrice"=>$currentFinalProductAmount,
190
+ "ItemTotalAmount"=>$currentFinalProductAmountTotal,
191
+ "ItemImageURL"=>Mage::helper('catalog/product')->getImageUrl($product),
192
+ );
193
+ // DEFFAULT WEIGHT ATTRIBUTE
194
+ if($weight = $product_next->getWeight()){
195
+ $listItems[$count]["ItemWeightUnit"] = "LB";
196
+ $listItems[$count]["ItemWeight"] = number_format($product_next->getWeight(),0) ;
197
+ }
198
+ // DEFAULT COLOR ATTRIBUTE
199
+ if($color = $product_next->getColor()){
200
+ $listItems[$count]["ItemColor"] = $product_next->getColor();
201
+ }
202
+ $count++;
203
+ $skipProduct = true;
204
+
205
+ } else {
206
+
207
+ // Get add add Product Tax Amount
208
+ $currentStore = Mage::app()->getStore($shippingQuote->getStoreId());
209
+ $current_customer = Mage::getSingleton('customer/session')->getCustomer();
210
+ /*$taxCalc = Mage::getSingleton('tax/calculation');
211
+ $taxClassId = $product->getData("tax_class_id");
212
+ $tax_rate_req = $taxCalc->getRateRequest($shippingQuote->getShippingAddress(),$shippingQuote->getBillingAddress(),$current_customer->getTaxClassId(),$currentStore);
213
+ $percent = $taxCalc->getRate($tax_rate_req->setProductClassId($taxClassId));
214
+ $tax = Mage::getModel('tax/calculation')->calcTaxAmount($quoteItem->getPrice(),$percent,false,true );
215
+ $discuntAmount = (float)$quoteItem->getData('discount_amount');
216
+ $finalProductAmount = ($quoteItem->getPrice()-$discuntAmount) + $tax;*/
217
+ $finalProductAmount = $quoteItem->getPrice();
218
+ $finalProductAmountTotal = $finalProductAmount * $quoteItem->getQty();
219
+ $finalAllProductAmountTotal = $finalAllProductAmountTotal + $finalProductAmountTotal;
220
+ $currentFinalProductAmount = $this->__convertFormateAmount($finalProductAmount);
221
+ $currentFinalProductAmountTotal = $this->__convertFormateAmount($finalProductAmountTotal);
222
+
223
+ $listItems[$count] = array( "ItemId"=> $product->getSku(),
224
+ "ItemDescription"=>$product->getName(),
225
+ "ItemQuantity"=>$quoteItem->getQty(),
226
+ "ItemPrice"=>$currentFinalProductAmount,
227
+ "ItemTotalAmount"=>$currentFinalProductAmountTotal,
228
+ "ItemImageURL"=>Mage::helper('catalog/product')->getImageUrl($product),
229
+ );
230
+
231
+ // DEFFAULT WEIGHT ATTRIBUTE
232
+ if($weight = $product->getWeight()){
233
+ $listItems[$count]["ItemWeightUnit"] = "LB";
234
+ $listItems[$count]["ItemWeight"] = number_format($product->getWeight(),0) ;
235
+ }
236
+
237
+ // DEFAULT COLOR ATTRIBUTE
238
+ if($color = $product->getColor()){
239
+ $listItems[$count]["ItemColor"] = $product->getColor();
240
+ }
241
+
242
+ $count++;
243
+ $skipProduct = false;
244
+ }
245
+
246
+ } else {
247
+ $skipProduct = false;
248
+ }
249
+ }
250
+ $listItems = array("LineItem"=>$listItems);
251
+
252
+ $languageCode = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId());
253
+ $languageCode = substr($languageCode, 0,2);
254
+
255
+ // GENERATE FINGUREPRINT FOR REQUEST
256
+ $fingurePrint = $this->generateFingurePrint($r->getMerchantId(),$r->getMerchantKey(),$this->__convertFormateAmount($finalAllProductAmountTotal),$this->getQuoteObj()->getItemsQty(),$merchantRefKey);
257
+ /* GENEREATE REQUEST PARAMS WITH DYNAMIC ORDER DETAILS*/
258
+ $ratesRequest = array("Caller" => $this->getCallerArray() ,
259
+ "RequestFingerprint" => $fingurePrint,
260
+ "Order"=>array("OrderAmount"=>$this->__convertFormateAmount($finalAllProductAmountTotal),
261
+ "OrderLineItemCount"=>number_format($this->getQuoteObj()->getItemsQty(),0),
262
+ "OrderDescription"=>$r->getMerchantId().' MAG',
263
+ "TransactionCurrency"=>Mage::app()->getStore()->getCurrentCurrencyCode(),
264
+ "CustomerLanguage"=>$languageCode),
265
+ "LineItems"=> $listItems,
266
+ "Customer"=> array("SameAddForShipping"=>$sameasShipping,
267
+ "BillingAddress"=>$billingArray
268
+ )
269
+ );
270
+
271
+ if($sameasShipping == "N"){
272
+ $ratesRequest["Customer"]["ShippingAddress"] = $shippingArray;
273
+ }
274
+ return $ratesRequest;
275
+
276
+ }
277
+
278
+ /**
279
+ * Merchant Caller Array
280
+ */
281
+ public function getCallerArray(){
282
+ $merchantRefNo = "";
283
+
284
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
285
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
286
+ "Version"=> "SW0101",
287
+ "Datetime" => date("Y-m-d h:i:s"),
288
+ "MerchantRefNo" => $merchantRefNo);
289
+ return $callerObj;
290
+ }
291
+
292
+ /*
293
+ * GENERATE FINGUREPRINT SIGN
294
+ */
295
+ public function generateFingurePrint($merchantId,$merchantKey,$subTotal,$qty,$merchantRefNo=""){
296
+
297
+ $fPrintToEncript = $merchantId.$merchantKey.Mage::app()->getStore()->getCurrentCurrencyCode().$subTotal.number_format($qty,0).((!empty($merchantRefNo))?$merchantRefNo:"");
298
+ return (md5($fPrintToEncript));;
299
+ }
300
+
301
+ /*
302
+ * EXECUTE SOAP TRANS_LOGISTICS_REQ
303
+ */
304
+ protected function _doRatesRequest()
305
+ {
306
+ $ratesRequest = $this->_formRateRequest();
307
+
308
+ $checkerString = $ratesRequest;
309
+ unset($checkerString["Caller"]["Datetime"]);
310
+
311
+ $requestString = serialize($ratesRequest);
312
+ $uniqueString = md5(serialize($checkerString));
313
+
314
+ $a = $checkerString;
315
+ $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($a));
316
+ foreach($it as $v) {
317
+ $reqString .= $v;
318
+ }
319
+
320
+ $currentTime = strtotime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
321
+ if(Mage::getSingleton('core/session')->getSzRequestedTime())
322
+ $requiredDuration = (($currentTime - Mage::getSingleton('core/session')->getSzRequestedTime()) / 60);
323
+ else
324
+ $requiredDuration = 0;
325
+
326
+ $uniqueString = md5($reqString);
327
+
328
+ $debugData = array('request' => $ratesRequest);
329
+ if ($response === null && (Mage::getSingleton('core/session')->getRequestedString() != $uniqueString || $requiredDuration > 25)
330
+ && Mage::app()->getFrontController()->getRequest()->getControllerName() != "cart") {
331
+ try {
332
+ $requestedTime = strtotime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
333
+ Mage::getSingleton('core/session')->setSzRequestedTime($requestedTime);
334
+
335
+ Mage::getSingleton('core/session')->setRequestedString($uniqueString);
336
+ Mage::log($ratesRequest,null,'SW_TransLogisticRequest.log');
337
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
338
+ $response = $client->TransLogisticsReq($ratesRequest);
339
+ if($response->ResponseStatusCode != '000' ){
340
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsReq');
341
+ $response = $client->TransLogisticsReq($ratesRequest);
342
+ }
343
+ Mage::log($response,null,'SW_TransLogisticRequest.log');
344
+ $debugData['result'] = $response;
345
+ Mage::getSingleton('core/session')->setTransRequestData(serialize($response));
346
+ } catch (Exception $e) {
347
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsReq',$e->getMessage());
348
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
349
+ Mage::logException($e);
350
+ }
351
+ } else {
352
+ $response = unserialize(Mage::getSingleton('core/session')->getTransRequestData());
353
+ $debugData['result'] = $response;
354
+ }
355
+ $this->_debug($debugData);
356
+ return $response;
357
+ }
358
+
359
+ protected function _getQuotes()
360
+ {
361
+
362
+ $this->_result = Mage::getModel('shipping/rate_result');
363
+ $response = $this->_doRatesRequest();
364
+ $preparedGeneral = $this->_prepareRateResponse($response);
365
+ $this->_result->append($preparedGeneral);
366
+ return $this->_result;
367
+ }
368
+
369
+
370
+ /**
371
+ * TransLogistic Response
372
+ */
373
+ protected function _prepareRateResponse($response)
374
+ {
375
+ $costArr = array();
376
+ $priceArr = array();
377
+ $errorTitle = 'Unable to Process Request. Try again Later.';
378
+
379
+
380
+ if (is_object($response)) {
381
+ if ($response->ResponseStatusCode != '000') {
382
+
383
+ // IF DEBUG TRUE , ERROR MESSAGE FROM SWIPEZOOM WILL BE DISPLAY ON SHIPPING METHOD STEP
384
+ ($this->getConfigData('debug'))?$errorTitle = (string)$response->ResponseStatusDesc : $errorTitle = (string)$this->getConfigData('specificerrmsg');
385
+
386
+ $flag = 0;
387
+ } elseif ($response->ResponseStatusCode == "000") {
388
+ $flag = 1;
389
+
390
+ $shippingcharges = $response->OrderCustomerDetails->CustShippingcharges;
391
+ $duties = $response->OrderCustomerDetails->CustCourierDuties;
392
+ $insurance = $response->OrderCustomerDetails->CustInsuranceCharges;
393
+
394
+ $priceArr["custshippingcharges_noduties_noinsurance"] = $this->getMethodPrice($shippingcharges, "custshippingcharges_noduties_noinsurance") ;
395
+ $priceArr["custshippingcharges_withduties_withinsurance"] = $this->getMethodPrice($shippingcharges+$duties+$insurance, "custshippingcharges_withduties_withinsurance") ;
396
+ $priceArr["custshippingcharges_noduties_withinsurance"] = $this->getMethodPrice($shippingcharges+$insurance, "custshippingcharges_noduties_withinsurance") ;
397
+ $priceArr["custshippingcharges_withduties_noinsurance"] = $this->getMethodPrice($shippingcharges+$duties, "custshippingcharges_withduties_noinsurance") ;
398
+ $priceArr["CustCourierDuties"] = $this->getMethodPrice($response->OrderCustomerDetails->CustCourierDuties, "CustCourierDuties");
399
+ $priceArr["CustCourierDuties_with_CustInsurance_Duties"] = $this->getMethodPrice($response->OrderCustomerDetails->CustInsuranceCharges, "CustCourierDuties_with_Insurance_Duties") ;
400
+
401
+ $extraCharges["DataStorageUrl"] = "";
402
+ $extraCharges["CustVatAmount"] = 0;
403
+ $extraCharges["CustItemSubtotal"] = $response->OrderCustomerDetails->CustItemSubtotal;
404
+ $extraCharges["CustTotalTransAmount"] = $response->OrderCustomerDetails->CustTotalTransAmount;
405
+ $extraCharges["PrepaidDutiesAllowed"] = $response->LogisticDetails->PrepaidDutiesAllowed;
406
+ $extraCharges["shipping"] = $response->OrderCustomerDetails->CustShippingcharges;
407
+ $extraCharges["CustCourierDuties"] = $response->OrderCustomerDetails->CustCourierDuties;
408
+ $extraCharges["CustInsuranceCharges"] = $response->OrderCustomerDetails->CustInsuranceCharges;
409
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
410
+
411
+ if(!empty($response->OrderPaymentDetails->StorageUrl) && $paymentmode == 1)
412
+ $extraCharges["DataStorageUrl"] = $response->OrderPaymentDetails->StorageUrl;
413
+
414
+ if(!empty($response->OrderCustomerDetails->CustVatAmount))
415
+ $extraCharges["CustVatAmount"] = $response->OrderCustomerDetails->CustVatAmount;
416
+
417
+ /*Set Swipezoom order number in Quote tables*/
418
+ Mage::getSingleton('checkout/session')->getQuote()->setSwipezoomOrderNumber($response->OrderDetails->OrderNo);
419
+ Mage::getSingleton('checkout/session')->setSwipezoomExtraRates($extraCharges);
420
+ Mage::getSingleton('core/session')->setSwipezoomExtraRates($extraCharges);
421
+
422
+
423
+ if (Mage::app()->getStore()->isAdmin()) {
424
+
425
+ Mage::getSingleton('adminhtml/session_quote')->getQuote()->setSwipezoomOrderNumber($response->OrderDetails->OrderNo);
426
+ }
427
+
428
+ }
429
+ }
430
+
431
+ $result = Mage::getModel('shipping/rate_result');
432
+ if (!($flag)) {
433
+ $error = Mage::getModel('shipping/rate_result_error');
434
+ $error->setCarrier($this->_code);
435
+ $error->setCarrierTitle($this->getConfigData('title'));
436
+ $error->setErrorMessage($errorTitle);
437
+ $result->append($error);
438
+ } else {
439
+ foreach ($priceArr as $method=>$price) {
440
+ $rate = Mage::getModel('shipping/rate_result_method');
441
+ $rate->setCarrier($this->_code);
442
+ $rate->setCarrierTitle($this->getConfigData('title'));
443
+ $rate->setMethod($method);
444
+ $rate->setMethodTitle("DHL Express - ".$response->OrderCustomerDetails->TransitDays.(($response->OrderCustomerDetails->TransitDays > 1)?" Days":" Day"));
445
+ $rate->setMethodDescription($extraCharges);
446
+ $rate->setCost($costArr[$method]);
447
+ $rate->setPrice($price);
448
+
449
+ $result->append($rate);
450
+ }
451
+ }
452
+
453
+ return $result;
454
+ }
455
+ public function getAllowedMethods()
456
+ {
457
+ return array('echo'=>$this->getConfigData('name'));
458
+ }
459
+
460
+ /*
461
+ * PREPARE (TRANS_LOGISTICS_CONFIRMAION) REQUEST
462
+ * ON SUCCESSFUL ORDER
463
+ */
464
+ public function confirmOrderInvoiceRequest($shippingMethod,$szOrderNumber,$localOrderNumber,$orderRetry = 0){
465
+
466
+ (strpos($shippingMethod,"withduties") !== FALSE)?$PrepaidDuties="Y":$PrepaidDuties="N";
467
+ (strpos($shippingMethod,"withinsurance") !== FALSE)?$PrepaidInsurance="Y":$PrepaidInsurance="N";
468
+
469
+ // $merchantRefKey = $this->getQuoteObj()->getEntityId();
470
+ $userAgent = Mage::helper('core/http')->getHttpUserAgent();
471
+ $remoteAddr = Mage::helper('core/http')->getRemoteAddr();
472
+
473
+ $fingurePrint = $this->generateFingurePrint($this->getConfigData('merchantid'),$this->getConfigData('merchantkey'),$this->getQuoteObj()->getSubtotal(),$this->getQuoteObj()->getItemsQty(),$this->getQuoteObj()->getEntityId());
474
+ $ratesRequest = array("Caller" => array("MerchantID" => $this->getConfigData('merchantid'),
475
+ "MerchantKey" => $this->getConfigData('merchantkey'),
476
+ "Version"=> "SW0101",
477
+ "Datetime" => date("Y-m-d h:i:s"),
478
+ "MerchantRefNo" => $localOrderNumber,
479
+ "RequestFingerprint" => $fingurePrint),
480
+ "OrderNo"=>$szOrderNumber,
481
+ "PrepaidDuties"=>$PrepaidDuties,
482
+ "PrepaidInsurance"=>$PrepaidInsurance,
483
+ );
484
+
485
+ // making sure payment is enabled
486
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
487
+ if($paymentmode == 1) {
488
+ $ratesRequest["Payment"] = array(
489
+ "PaymentType" => 'ccard',
490
+ "SuccessURL" => Mage::getBaseUrl().'cardpayment/payment/process?status=success&orderid='.$localOrderNumber,
491
+ "CancelURL" => Mage::getBaseUrl().'cardpayment/payment/process?status=cancel&orderid='.$localOrderNumber,
492
+ "FailureURL" => Mage::getBaseUrl().'cardpayment/payment/process?status=failure&orderid='.$localOrderNumber,
493
+ "ServiceURL" => Mage::getBaseUrl(),
494
+ "CustomerUserAgent" => $_SERVER['HTTP_USER_AGENT'],
495
+ "CustomerIpAddress" => $_SERVER['REMOTE_ADDR']
496
+ );
497
+ }
498
+
499
+ $response = $this->_doConfirmOrderRequest($ratesRequest,$orderRetry);
500
+
501
+ if (is_object($response)) {
502
+
503
+ if($paymentmode == 1)
504
+ $confirmation_response = array(array($response->ResponseStatusCode,$response->ResponseStatusDesc),$response);
505
+ else
506
+ $confirmation_response = array($response->ResponseStatusCode,$response->ResponseStatusDesc);
507
+ return $confirmation_response;
508
+ }
509
+
510
+ return false;
511
+ }
512
+
513
+
514
+ /**
515
+ * Set Payment Data For Order
516
+ */
517
+ public function setPaymentAdditionalData($sz_orderid, $orderid, $status = 'F') {
518
+
519
+ $additionalInformation = Array();
520
+ $additionalInformationString = '';
521
+
522
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderid);
523
+ $payment = $order->getPayment();
524
+
525
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
526
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$sz_orderid );
527
+
528
+ $response = $client->OrderDetails($params);
529
+
530
+ $statuscheck=$response->ResponseStatusCode;
531
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
532
+
533
+ if($statuscheck == "000") {
534
+ $payment_details = $response->Order->PaymentGateway;
535
+ $payment_details = (array) $payment_details;
536
+
537
+ if(!empty($payment_details)) {
538
+
539
+ if($status == "S")
540
+ $payment_details = array_merge(array('Status' => 'Successfully Processed'),$payment_details);
541
+ else if($status == "F")
542
+ $payment_details = array_merge(array('Status' => 'Failed'),$payment_details);
543
+ else
544
+ $payment_details = array_merge(array('Status' => 'Cancelled'),$payment_details);
545
+
546
+ foreach ($payment_details as $key => $value) {
547
+ $additionalInformation[htmlentities($key)] = htmlentities($value);
548
+ }
549
+
550
+ if (count($additionalInformation) != 0) {
551
+ $payment->setAdditionalInformation($additionalInformation);
552
+ $payment->setAdditionalData(serialize($additionalInformation));
553
+ $payment->save();
554
+ }
555
+ }
556
+ }
557
+
558
+ }
559
+
560
+ /*
561
+ * EXECUTE (TRANS_LOGISTICS_CONFIRMAION) REQUEST
562
+ */
563
+ protected function _doConfirmOrderRequest($ratesRequest, $retry = 0)
564
+ {
565
+ $service_error = false;
566
+ if ($response === null) {
567
+ try {
568
+ Mage::log($ratesRequest,null,'SW_TransLogisticConfirm.log');
569
+
570
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
571
+ $response = $client->TransLogisticsConfirm($ratesRequest);
572
+
573
+ if (is_object($response)) {
574
+ $confirmation_response = array($response->ResponseStatusCode,$response->ResponseStatusDesc);
575
+ if(is_array($confirmation_response) && $confirmation_response[0] != "000"){ // failure
576
+ // send email alert
577
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsConfirm');
578
+ }
579
+ } else {
580
+ $service_error = true;
581
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsConfirm');
582
+ }
583
+
584
+ Mage::log($response,null,'SW_TransLogisticConfirm.log');
585
+ } catch (Exception $e) {
586
+ // sends an alert if php related issue occured
587
+ $service_error = true;
588
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsConfirm',$e->getMessage());
589
+ Mage::logException($e);
590
+ } catch (SoapFault $e) {
591
+ // timeout case will catch the exception here
592
+ $service_error = true;
593
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransLogisticsConfirm',$e->faultstring);
594
+ }
595
+
596
+ if($service_error == true && $retry < 4) {
597
+
598
+ if($retry != 0) {
599
+ sleep(5); // sleep for 5 seconds
600
+ }
601
+
602
+ $retry++;
603
+ $this->_doConfirmOrderRequest($ratesRequest, $retry);
604
+ }
605
+
606
+ } else {
607
+ $response = unserialize($response);
608
+ }
609
+ return $response;
610
+ }
611
+
612
+ /**
613
+ * Address Validation
614
+ */
615
+ public function AddressVerifacation()
616
+ {
617
+
618
+ $country1 = Mage::app()->getRequest()->getParam("country");
619
+
620
+ $type = Mage::app()->getRequest()->getParam("type");
621
+
622
+ $city = Mage::app()->getRequest()->getParam("city");
623
+ $zipcode = Mage::app()->getRequest()->getParam("postcode");
624
+ $street1 = Mage::app()->getRequest()->getParam("street1");
625
+ $street2 = Mage::app()->getRequest()->getParam("street2");
626
+
627
+ $regionid=Mage::app()->getRequest()->getParam("region");
628
+ $regionname=Mage::app()->getRequest()->getParam("regionname");
629
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country1)->getData();
630
+ $country = $country[0]["iso3_code"];
631
+ $region = (empty($regionname))?Mage::getModel('directory/region')->load($regionid)->getCode():$regionname;
632
+
633
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
634
+ $params = array("Caller" => $this->getCallerArray(),
635
+ "CountryCode" => "$country" ,
636
+ "FieldValues" => array(array("FieldType"=>1,"FieldValue"=>"$street1"),
637
+ array("FieldType"=>2,"FieldValue"=>"$street2"),
638
+ array("FieldType"=>"C","FieldValue"=>"$city"),
639
+ array("FieldType"=>"D","FieldValue"=>"$region"),
640
+ array("FieldType"=>"P","FieldValue"=>"$zipcode")),);
641
+
642
+ Mage::log($params,null,'SW_AddressValidation.log');
643
+ $response = $client->TransAddressValidation($params);
644
+ Mage::log($response,null,'SW_AddressValidation.log');
645
+ $statuscheck=$response->ResponseStatusCode;
646
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
647
+ if($statuscheck=="000")
648
+ {
649
+ $error["success"]=1;
650
+ $addressString = $response->FormatedAddress;
651
+ $sameAs = Mage::app()->getRequest()->getParam("sameasshipping");
652
+ if($type == "billing"){
653
+ Mage::getSingleton('checkout/session')->getQuote()->setSwipezoomAddressBillingString($addressString);
654
+ if($sameAs == "true"){
655
+ Mage::getSingleton('checkout/session')->getQuote()->setSwipezoomAddressShippingString($addressString);
656
+ }
657
+ }
658
+
659
+ else if($type == "shipping"){
660
+ Mage::getSingleton('checkout/session')->getQuote()->setSwipezoomAddressShippingString($addressString);
661
+ }
662
+
663
+ Mage::getSingleton('checkout/session')->getQuote()->save();
664
+ echo json_encode($error);
665
+ }
666
+ else
667
+ {
668
+ $response1=json_decode(json_encode($response), true);
669
+ $errormessage1=$response1['AddressValidationErrors']['AddressValidationError'];
670
+ if($errormessage1['ErrorDescription']==NULL)
671
+ {
672
+ for($i=0;$i<count($errormessage1);$i++)
673
+ {
674
+ if($errormessage1[$i]["AddressLabelType"] == "C")
675
+ {
676
+ $error[$i]["name"] = "city";
677
+ $error[$i]["error"] = $errormessage1[$i]['ErrorDescription'];
678
+ }
679
+
680
+ if($errormessage1[$i]["AddressLabelType"] == "D"){
681
+ $error[$i]["name"] = "region";
682
+ $error[$i]["error"] = $errormessage1[$i]['ErrorDescription'];
683
+ }
684
+ if($errormessage1[$i]["AddressLabelType"] == "P"){
685
+ $error[$i]["name"] = "postcode";
686
+ $error[$i]["error"] = $errormessage1[$i]['ErrorDescription'];
687
+ }
688
+ if($errormessage1[$i]["AddressLabelType"] == "1"){
689
+ $error[$i]["name"] = "street1";
690
+ $error[$i]["error"] = $errormessage1[$i]['ErrorDescription'];
691
+ }
692
+ }
693
+ }
694
+ else
695
+ {
696
+ if($errormessage1["AddressLabelType"] == "C")
697
+ {
698
+ $error[0]["name"] = "city";
699
+ $error[0]["error"] = $errormessage1['ErrorDescription'];
700
+ }
701
+
702
+ if($errormessage1["AddressLabelType"] == "D"){
703
+ $error[0]["name"] = "region";
704
+ $error[0]["error"] = $errormessage1['ErrorDescription'];
705
+ }
706
+ if($errormessage1["AddressLabelType"] == "P"){
707
+ $error[0]["name"] = "postcode";
708
+ $error[0]["error"] = $errormessage1['ErrorDescription'];
709
+ }
710
+ if($errormessage1["AddressLabelType"] == "1"){
711
+ $error[0]["name"] = "street1";
712
+ $error[0]["error"] = $errormessage1['ErrorDescription'];
713
+ }
714
+ }
715
+ echo json_encode($error);
716
+ }
717
+ }
718
+
719
+ /**
720
+ * Address Request Data
721
+ */
722
+ protected function prepareAddressFormatRequest(){
723
+
724
+ $country2= Mage::app()->getRequest()->getParam("countrycode");
725
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country2)->getData();
726
+ $country = $country[0]["iso3_code"];
727
+ $languageCode = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId());
728
+ $languageCode = substr($languageCode, 0,2);
729
+
730
+ $params = array("Caller" => $this->getCallerArray(),
731
+ "LanguageCode" => "$languageCode",
732
+ "CountryCode" => "$country"
733
+ );
734
+ return $params;
735
+
736
+ }
737
+
738
+ /**
739
+ * Address Labeling
740
+ */
741
+ public function doAddressFormatRequest()
742
+ {
743
+ $ratesRequest = $this->prepareAddressFormatRequest();
744
+
745
+ $requestString = serialize($ratesRequest);
746
+ $debugData = array('request' => $ratesRequest);
747
+ if ($response === null) {
748
+ try {
749
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
750
+ $response = $client->TransAddressLabeling($ratesRequest);
751
+
752
+ if($response->ResponseStatusCode != "000") {
753
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransAddressLabeling');
754
+ $response = $client->TransAddressLabeling($ratesRequest);
755
+ }
756
+ if($response->ResponseStatusCode != "000") {
757
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransAddressLabeling');
758
+ $response = $client->TransAddressLabeling($ratesRequest);
759
+ }
760
+ if($response->ResponseStatusCode != "000") {
761
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransAddressLabeling');
762
+ $response = $client->TransAddressLabeling($ratesRequest);
763
+ }
764
+
765
+ $chk=json_decode(json_encode($response), true);
766
+ $chk1=$chk['AddressFormats'];
767
+ $chk2=$chk1['AddressFormat'];
768
+ for($i=0;$i<count($chk2);$i++)
769
+ {
770
+ $labelcol[]=$chk2[$i];
771
+ }
772
+ return $labelcol;
773
+ echo json_encode($labelcol);
774
+ $debugData['result'] = $response;
775
+ } catch (Exception $e) {
776
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
777
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'TransAddressLabeling',$e->getMessage());
778
+ Mage::logException($e);
779
+ }
780
+ } else {
781
+ $response = unserialize($response);
782
+ $debugData['result'] = $response;
783
+ }
784
+ $this->_debug($debugData);
785
+ return $response;
786
+ }
787
+
788
+ /**
789
+ * Get Cities AutoComplete
790
+ */
791
+ public function getCitiesForAutoComplete() {
792
+ $responseAutoComplete = '';
793
+ try {
794
+ // $billing=Mage::app()->getRequest()->getParam("billing");
795
+ $city = Mage::app()->getRequest()->getParam('city');
796
+ $country2= Mage::app()->getRequest()->getParam("countrycode");
797
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country2)->getData();
798
+ $country = $country[0]["iso3_code"];
799
+
800
+ $params = array("Caller" => $this->getCallerArray(),
801
+ "CityName" => $city,
802
+ "CountryCode" => $country,
803
+ "ResponseSize" => 200
804
+ );
805
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
806
+ $response = $response = $client->GlobalCityLookup($params);
807
+
808
+ $statuscheck=$response->ResponseStatusCode;
809
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
810
+ $cityNamesCol = array();
811
+
812
+ if($statuscheck=="000") {
813
+
814
+ if (1 < sizeof($response->Cities->City) ) {
815
+ foreach ($response->Cities->City as &$city) {
816
+ // if city name already not added up
817
+ if(!in_array(trim($city->CityName),$cityNamesCol)) {
818
+ $responseAutoComplete = $responseAutoComplete.$city->CityName."\n";
819
+ $cityNamesCol[] = trim($city->CityName);
820
+ }
821
+ }
822
+ } else if (0 < sizeof($response->Cities->City) ) {
823
+ $responseAutoComplete = $responseAutoComplete.$response->Cities->City->CityName."\n";
824
+ }
825
+
826
+ }
827
+ } catch (Exception $e) {
828
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'GlobalCityLookup',$e->getMessage());
829
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
830
+ Mage::logException($e);
831
+ }
832
+ return $responseAutoComplete ;
833
+ }
834
+
835
+ /**
836
+ * Get States AutoComplete
837
+ */
838
+ public function getStatesForAutoComplete (){
839
+ $responseAutoComplete = '';
840
+ try {
841
+ // $billing=Mage::app()->getRequest()->getParam("billing");
842
+ $city = Mage::app()->getRequest()->getParam('city');
843
+ $state_id = Mage::app()->getRequest()->getParam('state');
844
+ $country2= Mage::app()->getRequest()->getParam("countrycode");
845
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country2)->getData();
846
+ $country = $country[0]["iso3_code"];
847
+ $state_id = (!empty($state_id))?Mage::getModel('directory/region')->load($state_id)->getCode():$state_id;
848
+ $params = array("Caller" => $this->getCallerArray(),
849
+ "CityName" => $city,
850
+ "CountryCode" => $country,
851
+ "StateCode" => $state_id,
852
+ "ResponseSize" => 200
853
+ );
854
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
855
+ $response = $response = $client->GlobalStateLookup($params);
856
+ $statuscheck=$response->ResponseStatusCode;
857
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
858
+ if($statuscheck=="000") {
859
+ foreach ($response->States->State as &$state) {
860
+ $responseAutoComplete = $responseAutoComplete.$state->StateName.'\n';
861
+ }
862
+ }
863
+ } catch (Exception $e) {
864
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'GlobalStateLookup',$e->getMessage());
865
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
866
+ Mage::logException($e);
867
+ }
868
+ return $responseAutoComplete ;
869
+
870
+
871
+ }
872
+
873
+ /**
874
+ * Get City States
875
+ */
876
+ public function getCityStates() {
877
+ $responseAutoComplete = '';
878
+ try {
879
+ // $billing=Mage::app()->getRequest()->getParam("billing");
880
+ $city = Mage::app()->getRequest()->getParam('city');
881
+ $state_id = Mage::app()->getRequest()->getParam('state');
882
+ $country2= Mage::app()->getRequest()->getParam("countrycode");
883
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country2)->getData();
884
+ $country = $country[0]["iso3_code"];
885
+ $params = array("Caller" => $this->getCallerArray(),
886
+ //"CityName" => $city,
887
+ "CountryCode" => $country,
888
+ "StateCode" => $state_id,
889
+ "ResponseSize" => 200
890
+ );
891
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
892
+ $response = $response = $client->GlobalStateLookup($params);
893
+ $statuscheck=$response->ResponseStatusCode;
894
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
895
+ $states = array();
896
+ if($statuscheck=="000") {
897
+ foreach ($response->States->State as &$state) {
898
+ $region = Mage::getModel('directory/region')->loadByCode($state->StateCode, $country2);
899
+ $state_id_m = $region->getId();
900
+ $state_id_m = (!empty($state_id_m))?$state_id_m: $state->StateCode;
901
+ $currentState = array('stateCode'=>$state_id_m,'stateName'=>$state->StateName);
902
+ array_push($states,$currentState);
903
+ }
904
+ }
905
+ $responseAutoComplete = json_encode($states);
906
+ } catch (Exception $e) {
907
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'GlobalStateLookup',$e->getMessage());
908
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
909
+ Mage::logException($e);
910
+ }
911
+ return $responseAutoComplete ;
912
+ }
913
+
914
+ /**
915
+ * Postal Code Autocomplete
916
+ *
917
+ */
918
+ public function getPostCodesForAutoComplete () {
919
+ $responseAutoComplete = '';
920
+ try {
921
+ $city = Mage::app()->getRequest()->getParam('city');
922
+ $state_id = Mage::app()->getRequest()->getParam('state');
923
+ $country2= Mage::app()->getRequest()->getParam("countrycode");
924
+ $country = Mage::getResourceModel('directory/country_collection')->addFieldToFilter("country_id",$country2)->getData();
925
+ $country = $country[0]["iso3_code"];
926
+ $state_id = (!empty($state_id))?Mage::getModel('directory/region')->load($state_id)->getCode():$state_id;
927
+ $postCode = Mage::app()->getRequest()->getParam('q');
928
+
929
+ $params = array("Caller" => $this->getCallerArray(),
930
+ "CountryCode" => $country,
931
+ "PostCode" => $postCode,
932
+ "ResponseSize" => 200
933
+ );
934
+ Mage::log($params,null,'SW_PostCodeAutoComplete.log');
935
+ $client = Mage::helper('internationalshipping')->_createSoapClient("frontend");
936
+ $response = $client->GlobalPostCodeLookup($params);
937
+ Mage::log($response,null,'SW_PostCodeAutoComplete.log');
938
+ $statuscheck=$response->ResponseStatusCode;
939
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
940
+ $ZipCodesCol = array();
941
+
942
+ if($statuscheck=="000") {
943
+ if (1 < sizeof($response->PostCodes->PostCode) ) {
944
+ foreach ($response->PostCodes->PostCode as &$postCodeResp) {
945
+ // if city name already not added up
946
+ if(!in_array(trim($postCodeResp->PostCode),$ZipCodesCol)) {
947
+ $responseAutoComplete = $responseAutoComplete.$postCodeResp->PostCode."\n";
948
+ $ZipCodesCol[] = trim($postCodeResp->PostCode);
949
+ }
950
+ }
951
+ } else if (0 < sizeof($response->PostCodes->PostCode) ) {
952
+ $responseAutoComplete = $responseAutoComplete.$response->PostCodes->PostCode->PostCode."\n";
953
+ }
954
+
955
+ }
956
+
957
+ } catch (Exception $e) {
958
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'GlobalPostCodeLookup',$e->getMessage());
959
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
960
+ Mage::logException($e);
961
+ }
962
+ return $responseAutoComplete;
963
+
964
+ }
965
+
966
+
967
+
968
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Packingdetail.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Packingdetail
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Packingdetail extends Mage_Core_Model_Mysql4_Abstract
10
+ {
11
+ protected function _construct()
12
+ {
13
+ $this->_init("internationalshipping/packingdetail", "id");
14
+ }
15
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Packingdetail/Collection.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Mysql4_Packingdetail_Collection
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+ class Swipezoom_InternationalShipping_Model_Mysql4_Packingdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
8
+ {
9
+ public function _construct(){
10
+ $this->_init("internationalshipping/packingdetail");
11
+ }
12
+ }
13
+
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreq.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Partshipreq
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Partshipreq extends Mage_Core_Model_Mysql4_Abstract
10
+ {
11
+ protected function _construct()
12
+ {
13
+ $this->_init("internationalshipping/partshipreq", "id");
14
+ }
15
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreq/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Partshipreq_Collection
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Partshipreq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
10
+ {
11
+ public function _construct(){
12
+ $this->_init("internationalshipping/partshipreq");
13
+ }
14
+ }
15
+
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreqitems.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Partshipreqitems
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Partshipreqitems extends Mage_Core_Model_Mysql4_Abstract
10
+ {
11
+ protected function _construct()
12
+ {
13
+ $this->_init("internationalshipping/partshipreqitems", "id");
14
+ }
15
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Partshipreqitems/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Partshipreqitems_Collection
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Partshipreqitems_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
10
+ {
11
+ public function _construct(){
12
+ $this->_init("internationalshipping/partshipreqitems");
13
+ }
14
+ }
15
+
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Shipmentdetail.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Mysql4_Shipmentdetail
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Mysql4_Shipmentdetail extends Mage_Core_Model_Mysql4_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init("internationalshipping/shipmentdetail", "id");
13
+ }
14
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Shipmentdetail/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Shipmentdetail_Collection
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Shipmentdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
10
+ {
11
+ public function _construct(){
12
+ $this->_init("internationalshipping/shipmentdetail");
13
+ }
14
+ }
15
+
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Swipezoomcreditmemo.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Mysql4_Swipezoomcreditmemo
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Mysql4_Swipezoomcreditmemo extends Mage_Core_Model_Mysql4_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init("internationalshipping/swipezoomcreditmemo", "id");
13
+ }
14
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Mysql4/Swipezoomcreditmemo/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Mysql4_Swipezoomcreditmemo_Collection
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Mysql4_Swipezoomcreditmemo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
10
+ {
11
+ public function _construct(){
12
+ $this->_init("internationalshipping/swipezoomcreditmemo");
13
+ }
14
+ }
15
+
app/code/local/Swipezoom/InternationalShipping/Model/Observer.php ADDED
@@ -0,0 +1,446 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Observer
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Observer
10
+ {
11
+ public function salesOrderGridCollectionLoadBefore($observer)
12
+ {
13
+ $collection = $observer->getOrderGridCollection();
14
+ $select = $collection->getSelect();
15
+ $select->joinLeft(array('swipezoom' => $collection->getTable('sales/order')), 'swipezoom.entity_id=main_table.entity_id', array('swipezoom_order_number_temp' => 'swipezoom_order_number_temp'));
16
+ }
17
+
18
+
19
+ public function saveSZorderNumber($observer){
20
+
21
+ Mage::getSingleton('core/session')->setRequestedString("");
22
+ $order = $observer->getEvent()->getOrder();
23
+ $shippingMethod = $order->getData("shipping_method") ;
24
+ $temp1 = $order->getSwipezoomOrderConfirmed();
25
+ if(strpos($shippingMethod,"swipezoom") !== FALSE && !$temp = $order->getSwipezoomOrderNumberTemp() && Mage::getSingleton('checkout/session')->getQuote()->getSwipezoomOrderNumber() && Mage::app()->getRequest()->getActionName() == "saveOrder" && !empty($temp1) ){
26
+ $extraRates = Mage::getSingleton('checkout/session')->getSwipezoomExtraRates();
27
+
28
+ $order->setSwipezoomOrderNumberTemp(Mage::getSingleton('checkout/session')->getQuote()->getSwipezoomOrderNumber());
29
+ $order->setSwipezoomOrderShippingCharges($extraRates["shipping"]);
30
+ $order->setSwipezoomOrderDutiesTaxes($extraRates["CustCourierDuties"]);
31
+ $order->setSwipezoomOrderInsuranceCharges($extraRates["CustInsuranceCharges"]);
32
+ (strpos($shippingMethod,"withduties") !== FALSE)? $order->setSwipezoomOrderDutiesTaxPrepaid("Y"): $order->setSwipezoomOrderDutiesTaxPrepaid("N");
33
+ (strpos($shippingMethod,"withinsurance") !== FALSE)? $order->setSwipezoomOrderInsurancePaid("Y"): $order->setSwipezoomOrderInsurancePaid("N");
34
+
35
+ $order->setEmailSent(true);
36
+ }
37
+ }
38
+
39
+ public function orderplaced(Varien_Event_Observer $observer){
40
+ $order = $observer->getEvent()->getOrder();
41
+ $quote = $observer->getEvent()->getQuote();
42
+ $shippingMethod = $order->getData("shipping_method") ;
43
+ if(strpos($shippingMethod,"swipezoom") !== FALSE && $quote->getSwipezoomOrderNumber()){
44
+ $extraRates = Mage::getSingleton('core/session')->getSwipezoomExtraRates();
45
+ $order->setSwipezoomOrderNumberTemp($quote->getSwipezoomOrderNumber());
46
+ $order->setSwipezoomOrderShippingCharges($extraRates["shipping"]);
47
+ $order->setSwipezoomOrderDutiesTaxes($extraRates["CustCourierDuties"]);
48
+ $order->setSwipezoomOrderInsuranceCharges($extraRates["CustInsuranceCharges"]);
49
+ (strpos($shippingMethod,"withduties") !== FALSE)? $order->setSwipezoomOrderDutiesTaxPrepaid("Y"): $order->setSwipezoomOrderDutiesTaxPrepaid("N");
50
+ (strpos($shippingMethod,"withinsurance") !== FALSE)? $order->setSwipezoomOrderInsurancePaid("Y"): $order->setSwipezoomOrderInsurancePaid("N");
51
+
52
+ $order->setEmailSent(true);
53
+ }
54
+ }
55
+
56
+ public function modifySubtotal(Varien_Event_Observer $observer)
57
+ {
58
+ $quote=$observer->getEvent()->getQuote();
59
+
60
+ $fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
61
+ $currentShip = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod();
62
+
63
+ if ('checkout_cart_index' != $fullActionName && strpos($currentShip,"swipezoom") !== FALSE) {
64
+ $extraRates = Mage::getSingleton('core/session')->getSwipezoomExtraRates();
65
+ $extraRates['CustItemSubtotal'] = floatval($extraRates['CustItemSubtotal']);
66
+ $extraRates['CustTotalTransAmount'] = floatval($extraRates['CustTotalTransAmount']);
67
+ $extraRates["CustCourierDuties"] = floatval($extraRates["CustCourierDuties"]);
68
+ $extraRates["CustInsuranceCharges"] = floatval($extraRates["CustInsuranceCharges"]);
69
+
70
+ $quote=$observer->getEvent()->getQuote();
71
+ $quoteid=$quote->getId();
72
+ //check condition here if need to apply Discount
73
+
74
+ if($quoteid) {
75
+ if(!empty($extraRates['CustItemSubtotal'])) {
76
+ $total=$quote->getBaseSubtotal();
77
+ $quote->setSubtotal(0);
78
+ $quote->setBaseSubtotal(0);
79
+
80
+ $quote->setSubtotalWithDiscount(0);
81
+ $quote->setBaseSubtotalWithDiscount(0);
82
+
83
+ $quote->setGrandTotal(0);
84
+ $quote->setBaseGrandTotal(0);
85
+
86
+ $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');
87
+
88
+ foreach ($quote->getAllAddresses() as $address) {
89
+
90
+ $address->setSubtotal(0);
91
+ $address->setBaseSubtotal(0);
92
+
93
+ $address->setGrandTotal(0);
94
+ $address->setBaseGrandTotal(0);
95
+
96
+ $address->collectTotals();
97
+
98
+ if($address->getAddressType()==$canAddItems) {
99
+ $address->setSubtotal($extraRates['CustItemSubtotal']);
100
+ $address->setBaseSubtotal($extraRates['CustItemSubtotal']);
101
+
102
+ (strpos($currentShip,"noduties") !== FALSE)?$PrepaidDuties=$extraRates["CustCourierDuties"]:$PrepaidDuties=0;
103
+ (strpos($currentShip,"noinsurance") !== FALSE)?$PrepaidInsurance=$extraRates["CustInsuranceCharges"]:$PrepaidInsurance=0;
104
+ $address->setGrandTotal($extraRates['CustTotalTransAmount'] - $PrepaidDuties - $PrepaidInsurance);
105
+ $address->setBaseGrandTotal($extraRates['CustTotalTransAmount'] - $PrepaidDuties - $PrepaidInsurance);
106
+ }
107
+
108
+ $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());
109
+ $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());
110
+
111
+ $quote->setSubtotalWithDiscount(
112
+ (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()
113
+ );
114
+ $quote->setBaseSubtotalWithDiscount(
115
+ (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()
116
+ );
117
+
118
+ $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());
119
+ $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());
120
+
121
+ $quote ->save();
122
+
123
+ $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)
124
+ ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)
125
+ ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
126
+ ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
127
+ ->save();
128
+
129
+ } //end: foreach
130
+
131
+ }
132
+ }
133
+ } else {
134
+
135
+ $quote=$observer->getEvent()->getQuote();
136
+ $quoteid=$quote->getId();
137
+ if($quoteid) {
138
+ $total=$quote->getBaseSubtotal();
139
+ $quote->setSubtotal(0);
140
+ $quote->setBaseSubtotal(0);
141
+
142
+ $quote->setSubtotalWithDiscount(0);
143
+ $quote->setBaseSubtotalWithDiscount(0);
144
+
145
+ $quote->setGrandTotal(0);
146
+ $quote->setBaseGrandTotal(0);
147
+
148
+ $canAddItems = $quote->isVirtual()? ('billing') : ('shipping');
149
+
150
+ foreach ($quote->getAllAddresses() as $address) {
151
+
152
+ $address->setSubtotal(0);
153
+ $address->setBaseSubtotal(0);
154
+
155
+ $address->setGrandTotal(0);
156
+ $address->setBaseGrandTotal(0);
157
+
158
+ $address->collectTotals();
159
+
160
+ $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());
161
+ $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());
162
+
163
+ $quote->setSubtotalWithDiscount(
164
+ (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()
165
+ );
166
+ $quote->setBaseSubtotalWithDiscount(
167
+ (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()
168
+ );
169
+
170
+ $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());
171
+ $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());
172
+
173
+ $quote ->save();
174
+
175
+ $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)
176
+ ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)
177
+ ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
178
+ ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
179
+ ->save();
180
+
181
+ } //end: foreach
182
+
183
+
184
+ }
185
+ }
186
+
187
+ }
188
+
189
+ public function AddressVerifacation()
190
+ {
191
+ }
192
+
193
+ public function editorderdeleteentry(Varien_Event_Observer $observer){
194
+ $order = Mage::app()->getRequest()->getParam('order_id');
195
+
196
+ $newcoll = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid', Mage::app()->getRequest()->getParam('order_id'));
197
+ foreach ($newcoll as $ccitem) {
198
+ $ccitem->delete();
199
+ }
200
+
201
+
202
+ $newcoll1 = Mage::getModel('internationalshipping/partshipreqitems')->getCollection()
203
+ ->addFieldToFilter('swipezoomorderid',Mage::app()->getRequest()->getParam('order_id'));
204
+ foreach ($newcoll1 as $ccitem) {
205
+ $ccitem->delete();
206
+ }
207
+
208
+
209
+ }
210
+
211
+ public function editordersave($proitems,$swipwzoomorder,$realorderid){
212
+
213
+ if($swipwzoomorder){
214
+ try {
215
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
216
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder,"ProductLineItems"=>$proitems );
217
+ Mage::log($params,null,'PartShipReq'.$swipwzoomorder.'.log');
218
+ $response = $client->PartShipReq($params);
219
+ Mage::log($response,null,'PartShipReq'.$swipwzoomorder.'.log');
220
+
221
+ if($response->ResponseStatusCode == '000'){
222
+
223
+ $OrderNo = $response->Order->OrderNo;
224
+ $OrderNoRef = $response->Order->TransDetail->OrderNoRef;
225
+ $ProductPrice = $response->Order->Merchant->ProductPrice;
226
+ $ProductPriceCurrency = $response->Order->Merchant->ProductPriceCurrency;
227
+ $CustCurrency = $response->Order->TransDetail->CustCurrency;
228
+ $CustExcRate = $response->Order->TransDetail->CustExcRate;
229
+ $CustTotalValue = $response->Order->TransDetail->CustTotalValue;
230
+ $CourierCharges = $response->Order->TransDetail->CourierCharges;
231
+ $InsuranceCharges = $response->Order->TransDetail->InsuranceCharges;
232
+ $SZMarkup = $response->Order->TransDetail->SZMarkup;
233
+ $newcoll = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$realorderid); ////
234
+ foreach ($newcoll as $ccitem) {
235
+ $ccitem->delete();
236
+ }
237
+ $colection = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$realorderid);
238
+
239
+ $model = Mage::getModel('internationalshipping/partshipreq')->setId()
240
+ ->setSwipezoomorderid($OrderNoRef)
241
+ ->setNewszorderid($OrderNo)
242
+ ->setProductprice($ProductPrice)
243
+ ->setPricecurrency($ProductPriceCurrency)
244
+ ->setSalecurrency($CustCurrency)
245
+ ->setExcrate($CustExcRate)
246
+ ->setOrdertotal($CustTotalValue)
247
+ ->setCouriercharges($CourierCharges)
248
+ ->setInsurancecharges($InsuranceCharges)
249
+ ->setSzmarkup($SZMarkup)
250
+ ->setRealorderid($realorderid) //Mage::app()->getRequest()->getParam('order_id')
251
+ ->save();
252
+
253
+
254
+ $newcoll1 = Mage::getModel('internationalshipping/partshipreqitems')->getCollection()
255
+ ->addFieldToFilter('swipezoomorderid',$realorderid);
256
+
257
+ foreach ($newcoll1 as $ccitem) {
258
+ $ccitem->delete();
259
+ }
260
+ if(is_array( $response->Order->ProductLineItems->ProductLineItem)){
261
+ foreach($response->Order->ProductLineItems->ProductLineItem as $proitem){
262
+ $LineItemNo = $proitem->LineItemNo;
263
+ $ProductCode = $proitem->ProductCode;
264
+ $Description = $proitem->Description;
265
+ $Price = $proitem->Price;
266
+ $Quantity = $proitem->Quantity;
267
+ $SaleValue = $proitem->SaleValue;
268
+
269
+
270
+ $model = Mage::getModel('internationalshipping/partshipreqitems')->setId()
271
+ ->setSwipezoomorderid($realorderid)
272
+ ->setLineitemno($LineItemNo)
273
+ ->setProductcode($ProductCode)
274
+ ->setDescription($Description)
275
+ ->setPrice($Price)
276
+ ->setQty($Quantity)
277
+ ->setSalevalue($SaleValue)
278
+ ->save();
279
+
280
+
281
+ }
282
+
283
+
284
+ }else{
285
+
286
+ $LineItemNo = $response->Order->ProductLineItems->ProductLineItem>LineItemNo;
287
+ $ProductCode = $response->Order->ProductLineItems->ProductLineItem->ProductCode;
288
+ $Description = $response->Order->ProductLineItems->ProductLineItem->Description;
289
+ $Price = $response->Order->ProductLineItems->ProductLineItem->Price;
290
+ $Quantity = $response->Order->ProductLineItems->ProductLineItem->Quantity;
291
+ $SaleValue = $response->Order->ProductLineItems->ProductLineItem->SaleValue;
292
+
293
+ $model = Mage::getModel('internationalshipping/partshipreqitems')->setId()
294
+ ->setSwipezoomorderid($realorderid)
295
+ ->setLineitemno($LineItemNo)
296
+ ->setProductcode($ProductCode)
297
+ ->setDescription($Description)
298
+ ->setPrice($Price)
299
+ ->setQty($Quantity)
300
+ ->setSalevalue($SaleValue)
301
+ ->save();
302
+
303
+
304
+ }
305
+
306
+
307
+
308
+
309
+ } else {
310
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'PartShipReq');
311
+ }
312
+
313
+ } catch (Exception $e) {
314
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
315
+ Mage::log($debugData,null,'debug.log');
316
+ Mage::logException($e);
317
+ }
318
+ }
319
+
320
+
321
+ }
322
+
323
+ public function trackingfetch()
324
+ {
325
+
326
+ $shippingInfoModel = Mage::getModel('shipping/info')->loadByHash(Mage::app()->getRequest()->getParam('hash'));
327
+ foreach($shippingInfoModel->getTrackingInfo() as $shipid => $_result){
328
+ $shipment = Mage::getModel('sales/order_shipment');
329
+ $shipment->load($shipid);
330
+ $shipmentorder = Mage::getModel('sales/order_shipment')->getCollection()
331
+ ->addFieldToFilter('increment_id', $shipid)
332
+ ->getFirstItem();
333
+
334
+
335
+ foreach($_result as $trackingdata){
336
+ $trackingnumber = $trackingdata['number'];
337
+ break;
338
+ }
339
+ $orderid = $shipmentorder->getOrderId();
340
+
341
+ $order = Mage::getModel('sales/order')->load($orderid);
342
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
343
+ if($swipwzoomorder){
344
+ try {
345
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
346
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder,"TrackingNumber"=>$trackingnumber );
347
+ Mage::log($params,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
348
+ $response = $client->Track($params);
349
+ if($response->ResponseStatusCode != '000' ){
350
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'Track');
351
+ }
352
+ Mage::log($response,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
353
+ } catch (Exception $e) {
354
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
355
+ Mage::log($debugData,null,'debug.log');
356
+ Mage::logException($e);
357
+ }
358
+ }
359
+
360
+ }
361
+
362
+ }
363
+
364
+ public function salesordershipmentnew1(Varien_Event_Observer $observer){
365
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
366
+ $order= Mage::getModel('sales/order')->load($orderid);
367
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
368
+ if($swipwzoomorder){
369
+ $count = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
370
+ if(!count($count)){
371
+ try {
372
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
373
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
374
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder );
375
+ $response = $client->Ship($params);
376
+ $statuscheck=$response->ResponseStatusCode;
377
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
378
+ if($statuscheck=="000"){
379
+ $CourierName = $response->ShipmentBooking->CourierName;
380
+ $CourierServiceName = $response->ShipmentBooking->CourierServiceName;
381
+ $CourierWaybillNo = $response->ShipmentBooking->CourierWaybillNo;
382
+ $PickupDue = $response->ShipmentBooking->PickupDue;
383
+
384
+ $ship = Mage::getModel('internationalshipping/shipmentdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setCouriername($CourierName)->setCourierservicename($CourierServiceName)->setCourierwaybillno($CourierWaybillNo)->setPickupdue($PickupDue)->save();
385
+ }else{
386
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'Ship');
387
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
388
+ if($debugmode){
389
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($statuscheck.' : '.$ResponseStatusDesc));
390
+ }else{
391
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Shipment Swipezoom'));
392
+ }
393
+ return;
394
+ }
395
+
396
+
397
+ } catch (Exception $e) {
398
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
399
+ Mage::log($debugData,null,'debug.log');
400
+ Mage::logException($e);
401
+ }
402
+ }
403
+ }
404
+
405
+ }
406
+
407
+
408
+ public function cancelorder(Varien_Event_Observer $observer){
409
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
410
+ $order = Mage::getModel('sales/order')->load($orderid);
411
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
412
+ if($swipwzoomorder){
413
+ try {
414
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
415
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder,"ReasonCode"=>$trackingnumber );
416
+ Mage::log($params,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
417
+ $response = $client->CancelOrder($params);
418
+ if($response->ResponseStatusCode != '000' ){
419
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($ratesRequest,$response,'CancelOrder');
420
+ }
421
+ Mage::log($response,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
422
+ } catch (Exception $e) {
423
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
424
+ Mage::log($debugData,null,'debug.log');
425
+ Mage::logException($e);
426
+ }
427
+ }
428
+
429
+
430
+
431
+
432
+ }
433
+
434
+
435
+ public function getCallerArray(){
436
+ $merchantRefNo = "123";
437
+
438
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
439
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
440
+ "Version"=> "SW0101",
441
+ "Datetime" => date("Y-m-d h:i:s"),
442
+ "MerchantRefNo" => $merchantRefNo);
443
+ return $callerObj;
444
+ }
445
+
446
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Order.php ADDED
@@ -0,0 +1,516 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Order
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Order extends Mage_Sales_Model_Order
9
+ {
10
+ const ENTITY = 'order';
11
+ /**
12
+ * XML configuration paths
13
+ */
14
+ const XML_PATH_EMAIL_TEMPLATE = 'sales_email/order/template';
15
+ const XML_PATH_EMAIL_GUEST_TEMPLATE = 'sales_email/order/guest_template';
16
+ const XML_PATH_EMAIL_IDENTITY = 'sales_email/order/identity';
17
+ const XML_PATH_EMAIL_COPY_TO = 'sales_email/order/copy_to';
18
+ const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/order/copy_method';
19
+ const XML_PATH_EMAIL_ENABLED = 'sales_email/order/enabled';
20
+
21
+ const XML_PATH_UPDATE_EMAIL_TEMPLATE = 'sales_email/order_comment/template';
22
+ const XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE = 'sales_email/order_comment/guest_template';
23
+ const XML_PATH_UPDATE_EMAIL_IDENTITY = 'sales_email/order_comment/identity';
24
+ const XML_PATH_UPDATE_EMAIL_COPY_TO = 'sales_email/order_comment/copy_to';
25
+ const XML_PATH_UPDATE_EMAIL_COPY_METHOD = 'sales_email/order_comment/copy_method';
26
+ const XML_PATH_UPDATE_EMAIL_ENABLED = 'sales_email/order_comment/enabled';
27
+
28
+ /**
29
+ * Order states
30
+ */
31
+ const STATE_NEW = 'new';
32
+ const STATE_PENDING_PAYMENT = 'pending_payment';
33
+ const STATE_PROCESSING = 'processing';
34
+ const STATE_COMPLETE = 'complete';
35
+ const STATE_CLOSED = 'closed';
36
+ const STATE_CANCELED = 'canceled';
37
+ const STATE_HOLDED = 'holded';
38
+ const STATE_PAYMENT_REVIEW = 'payment_review';
39
+
40
+ /**
41
+ * Order statuses
42
+ */
43
+ const STATUS_FRAUD = 'fraud';
44
+
45
+ /**
46
+ * Order flags
47
+ */
48
+ const ACTION_FLAG_CANCEL = 'cancel';
49
+ const ACTION_FLAG_HOLD = 'hold';
50
+ const ACTION_FLAG_UNHOLD = 'unhold';
51
+ const ACTION_FLAG_EDIT = 'edit';
52
+ const ACTION_FLAG_CREDITMEMO= 'creditmemo';
53
+ const ACTION_FLAG_INVOICE = 'invoice';
54
+ const ACTION_FLAG_REORDER = 'reorder';
55
+ const ACTION_FLAG_SHIP = 'ship';
56
+ const ACTION_FLAG_COMMENT = 'comment';
57
+
58
+ /**
59
+ * Report date types
60
+ */
61
+ const REPORT_DATE_TYPE_CREATED = 'created';
62
+ const REPORT_DATE_TYPE_UPDATED = 'updated';
63
+ /*
64
+ * Identifier for history item
65
+ */
66
+ const HISTORY_ENTITY_NAME = 'order';
67
+
68
+ protected $_eventPrefix = 'sales_order';
69
+ protected $_eventObject = 'order';
70
+
71
+ protected $_addresses = null;
72
+ protected $_items = null;
73
+ protected $_payments = null;
74
+ protected $_statusHistory = null;
75
+ protected $_invoices;
76
+ protected $_tracks;
77
+ protected $_shipments;
78
+ protected $_creditmemos;
79
+
80
+ protected $_relatedObjects = array();
81
+ protected $_orderCurrency = null;
82
+ protected $_baseCurrency = null;
83
+
84
+ /**
85
+ * Array of action flags for canUnhold, canEdit, etc.
86
+ *
87
+ * @var array
88
+ */
89
+ protected $_actionFlag = array();
90
+
91
+ /**
92
+ * Flag: if after order placing we can send new email to the customer.
93
+ *
94
+ * @var bool
95
+ */
96
+ protected $_canSendNewEmailFlag = true;
97
+
98
+ /*
99
+ * Identifier for history item
100
+ *
101
+ * @var string
102
+ */
103
+ protected $_historyEntityName = self::HISTORY_ENTITY_NAME;
104
+
105
+ /**
106
+ * Initialize resource model
107
+ */
108
+
109
+ /**
110
+ * Send email with order data
111
+ *
112
+ * @return Mage_Sales_Model_Order
113
+ */
114
+ public function sendNewOrderEmail()
115
+ {
116
+ /* Changes BY SB on 23082013 */
117
+ $swpchk=Mage::getModel('checkout/cart')->getQuote()->getShippingAddress()->getShippingMethod();
118
+ if((strpos($swpchk,'swipezoom_custshippingcharges')) !== FALSE)
119
+ {
120
+ return $this;
121
+ }
122
+ /* Changes end by Sb */
123
+ $storeId = $this->getStore()->getId();
124
+
125
+ if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
126
+ return $this;
127
+ }
128
+ // Get the destination email addresses to send copies to
129
+ $copyTo = $this->_getEmails(self::XML_PATH_EMAIL_COPY_TO);
130
+ $copyMethod = Mage::getStoreConfig(self::XML_PATH_EMAIL_COPY_METHOD, $storeId);
131
+
132
+ // Start store emulation process
133
+ $appEmulation = Mage::getSingleton('core/app_emulation');
134
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
135
+
136
+ try {
137
+ // Retrieve specified view block from appropriate design package (depends on emulated store)
138
+ $paymentBlock = Mage::helper('payment')->getInfoBlock($this->getPayment())
139
+ ->setIsSecureMode(true);
140
+ $paymentBlock->getMethod()->setStore($storeId);
141
+ $paymentBlockHtml = $paymentBlock->toHtml();
142
+ } catch (Exception $exception) {
143
+ // Stop store emulation process
144
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
145
+ throw $exception;
146
+ }
147
+
148
+ // Stop store emulation process
149
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
150
+
151
+ // Retrieve corresponding email template id and customer name
152
+ if ($this->getCustomerIsGuest()) {
153
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
154
+ $customerName = $this->getBillingAddress()->getName();
155
+ } else {
156
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
157
+ $customerName = $this->getCustomerName();
158
+ }
159
+
160
+ $mailer = Mage::getModel('core/email_template_mailer');
161
+ $emailInfo = Mage::getModel('core/email_info');
162
+ $emailInfo->addTo($this->getCustomerEmail(), $customerName);
163
+ if ($copyTo && $copyMethod == 'bcc') {
164
+ // Add bcc to customer email
165
+ foreach ($copyTo as $email) {
166
+ $emailInfo->addBcc($email);
167
+ }
168
+ }
169
+ $mailer->addEmailInfo($emailInfo);
170
+
171
+ // Email copies are sent as separated emails if their copy method is 'copy'
172
+ if ($copyTo && $copyMethod == 'copy') {
173
+ foreach ($copyTo as $email) {
174
+ $emailInfo = Mage::getModel('core/email_info');
175
+ $emailInfo->addTo($email);
176
+ $mailer->addEmailInfo($emailInfo);
177
+ }
178
+ }
179
+
180
+ // Set all required params and send emails
181
+ $mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
182
+ $mailer->setStoreId($storeId);
183
+ $mailer->setTemplateId($templateId);
184
+ $mailer->setTemplateParams(array(
185
+ 'order' => $this,
186
+ 'billing' => $this->getBillingAddress(),
187
+ 'payment_html' => $paymentBlockHtml
188
+ )
189
+ );
190
+
191
+ $mailer->send();
192
+
193
+ $this->setEmailSent(true);
194
+ $this->_getResource()->saveAttribute($this, 'email_sent');
195
+
196
+ return $this;
197
+ }
198
+
199
+ public function cretejustorder($customer,$newitems,$lastorder,$sworder,$shippingcharge){
200
+ $customer = Mage::getModel('customer/customer')->load($customer);
201
+ $lastorder = Mage::getModel('sales/order')->load($lastorder);
202
+ $address = Mage::getModel('sales/order_address')->load($lastorder->getShippingAddressId());
203
+ $transaction = Mage::getModel('core/resource_transaction');
204
+ $storeId = $lastorder->getStoreId();
205
+ $reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId);
206
+
207
+ $order = Mage::getModel('sales/order')
208
+ ->setIncrementId($reservedOrderId)
209
+ ->setStoreId($storeId)
210
+ ->setQuoteId(0)
211
+ ->setBaseCurrencyCode(Mage::app()->getBaseCurrencyCode())
212
+ ->setOrderCurrencyCode(Mage::app()->getBaseCurrencyCode())
213
+ ->setGlobalCurrencyCode(Mage::app()->getBaseCurrencyCode());
214
+
215
+
216
+
217
+ if($lastorder->getCustomerGroupId()){
218
+ $order->setCustomer_email($address->getEmail())
219
+ ->setCustomerFirstname($address->getFirstname())
220
+ ->setCustomerLastname($address->getLastname())
221
+ ->setCustomerGroupId($lastorder->getCustomerGroupId())
222
+ ->setCustomer_is_guest(0)
223
+ ->setCustomer($customer);
224
+ }else{
225
+ // set Customer data
226
+ $order->setCustomer_email($address->getEmail())
227
+ ->setCustomerFirstname($address->getFirstname())
228
+ ->setCustomerLastname($address->getLastname())
229
+ ->setCustomerGroupId($lastorder->getCustomerGroupId());
230
+
231
+
232
+ }
233
+
234
+ $billingAddress = Mage::getModel('sales/order_address')
235
+ ->setStoreId($storeId)
236
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_BILLING)
237
+ ->setCustomerId($address->getCustomerId())
238
+ ->setCustomerAddressId($address->getCustomerAddressId())
239
+ ->setCustomer_address_id($address->getEntityId())
240
+ ->setPrefix($address->getPrefix())
241
+ ->setFirstname($address->getFirstname())
242
+ ->setMiddlename($address->getMiddlename())
243
+ ->setLastname($address->getLastname())
244
+ ->setSuffix($address->getSuffix())
245
+ ->setCompany($address->getCompany())
246
+ ->setStreet($address->getStreet())
247
+ ->setCity($address->getCity())
248
+ ->setCountry_id($address->getCountryId())
249
+ ->setRegion($address->getRegion())
250
+ ->setRegion_id($address->getRegionId())
251
+ ->setPostcode($address->getPostcode())
252
+ ->setTelephone($address->getTelephone())
253
+ ->setFax($address->getFax());
254
+ $order->setBillingAddress($billingAddress);
255
+ //$shipping = $customer->getDefaultShippingAddress();
256
+ $shippingAddress = Mage::getModel('sales/order_address')
257
+ ->setStoreId($storeId)
258
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
259
+ ->setCustomerId($address->getCustomerId())
260
+ ->setCustomerAddressId($address->getCustomerAddressId())
261
+ ->setCustomer_address_id($address->getEntityId())
262
+ ->setPrefix($address->getPrefix())
263
+ ->setFirstname($address->getFirstname())
264
+ ->setMiddlename($address->getMiddlename())
265
+ ->setLastname($address->getLastname())
266
+ ->setSuffix($address->getSuffix())
267
+ ->setCompany($address->getCompany())
268
+ ->setStreet($address->getStreet())
269
+ ->setCity($address->getCity())
270
+ ->setCountryId($address->getCountryId())
271
+ ->setRegion($address->getRegion())
272
+ ->setRegionId($address->getRegionId())
273
+ ->setPostcode($address->getPostcode())
274
+ ->setTelephone($address->getTelephone())
275
+ ->setFax($address->getFax());
276
+
277
+ $order->setShippingAddress($shippingAddress)
278
+ ->setShipping_method('flatrate_flatrate');
279
+ $order->setShippingDescription($lastorder->getShippingDescription());
280
+ $order->setShippingAmount($shippingcharge);
281
+
282
+ /*->setShippingDescription($this->getCarrierName('flatrate'));*/
283
+ /*some error i am getting here need to solve further*/
284
+
285
+ //you can set your payment method name here as per your need
286
+ $orderPayment = Mage::getModel('sales/order_payment')
287
+ ->setStoreId($storeId)
288
+ ->setCustomerPaymentId(0)
289
+ ->setMethod('free')
290
+ ->setAction('yes')
291
+ ->setPo_number(' – ')
292
+ ->setOrderStatus('processing');
293
+ $order->setPayment($orderPayment);
294
+
295
+ // let say, we have 2 products
296
+ //check that your products exists
297
+ //need to add code for configurable products if any
298
+ $subTotal = 0;
299
+
300
+ //$products = getFreeProducts($point);
301
+
302
+ foreach ($newitems as $product) {
303
+ $_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $product['ProductCode']);
304
+ $rowTotal = $_product->getPrice() * $product['Quantity'];
305
+ $orderItem = Mage::getModel('sales/order_item')
306
+ ->setStoreId($storeId)
307
+ ->setQuoteItemId(0)
308
+ ->setQuoteParentItemId(NULL)
309
+ ->setProductId($_product->getId())
310
+ ->setProductType($_product->getTypeId())
311
+ ->setQtyBackordered(NULL)
312
+ ->setTotalQtyOrdered($product['Quantity'])
313
+ ->setQtyOrdered($product['Quantity'])
314
+ ->setName($_product->getName())
315
+ ->setSku($_product->getSku())
316
+ ->setPrice($_product->getPrice())
317
+ ->setBasePrice($_product->getPrice())
318
+ ->setOriginalPrice($_product->getPrice())
319
+ ->setRowTotal($rowTotal)
320
+ ->setBaseRowTotal($rowTotal);
321
+
322
+ $subTotal += $rowTotal;
323
+ //$subTotal = 0;
324
+ $order->addItem($orderItem);
325
+ }
326
+
327
+ $order->setSubtotal($subTotal)
328
+ ->setBaseSubtotal($subTotal)
329
+ ->setGrandTotal($subTotal+$shippingcharge)
330
+ ->setBaseGrandTotal($subTotal+$shippingcharge);
331
+
332
+ $transaction->addObject($order);
333
+ $transaction->addCommitCallback(array($order, 'place'));
334
+ $transaction->addCommitCallback(array($order, 'save'));
335
+ $transaction->save();
336
+
337
+ $order= Mage::getModel('sales/order')->load($order->getId());
338
+ $order->setSwipezoomOrderNumberTemp($sworder)->save();
339
+
340
+
341
+ $transactionSave = Mage::getModel('core/resource_transaction')
342
+ ->addObject($order);
343
+
344
+ $transactionSave->save();
345
+
346
+ return $order->getId();
347
+ }
348
+ public function creteorder($customer,$newitems,$lastorder,$sworder,$shippingcharge){
349
+ $customer = Mage::getModel('customer/customer')->load($customer);
350
+ $lastorder = Mage::getModel('sales/order')->load($lastorder);
351
+ $address = Mage::getModel('sales/order_address')->load($lastorder->getShippingAddressId());
352
+ $transaction = Mage::getModel('core/resource_transaction');
353
+ $storeId = $lastorder->getStoreId();
354
+ $reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId);
355
+
356
+ $order = Mage::getModel('sales/order')
357
+ ->setIncrementId($reservedOrderId)
358
+ ->setStoreId($storeId)
359
+ ->setQuoteId(0)
360
+ ->setBaseCurrencyCode(Mage::app()->getBaseCurrencyCode())
361
+ ->setOrderCurrencyCode(Mage::app()->getBaseCurrencyCode())
362
+ ->setGlobalCurrencyCode(Mage::app()->getBaseCurrencyCode());
363
+
364
+
365
+
366
+ if($lastorder->getCustomerGroupId()){
367
+ $order->setCustomer_email($address->getEmail())
368
+ ->setCustomerFirstname($address->getFirstname())
369
+ ->setCustomerLastname($address->getLastname())
370
+ ->setCustomerGroupId($lastorder->getCustomerGroupId())
371
+ ->setCustomer_is_guest(0)
372
+ ->setCustomer($customer);
373
+ }else{
374
+ // set Customer data
375
+ $order->setCustomer_email($address->getEmail())
376
+ ->setCustomerFirstname($address->getFirstname())
377
+ ->setCustomerLastname($address->getLastname())
378
+ ->setCustomerGroupId($lastorder->getCustomerGroupId());
379
+
380
+
381
+ }
382
+
383
+ $billingAddress = Mage::getModel('sales/order_address')
384
+ ->setStoreId($storeId)
385
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_BILLING)
386
+ ->setCustomerId($address->getCustomerId())
387
+ ->setCustomerAddressId($address->getCustomerAddressId())
388
+ ->setCustomer_address_id($address->getEntityId())
389
+ ->setPrefix($address->getPrefix())
390
+ ->setFirstname($address->getFirstname())
391
+ ->setMiddlename($address->getMiddlename())
392
+ ->setLastname($address->getLastname())
393
+ ->setSuffix($address->getSuffix())
394
+ ->setCompany($address->getCompany())
395
+ ->setStreet($address->getStreet())
396
+ ->setCity($address->getCity())
397
+ ->setCountry_id($address->getCountryId())
398
+ ->setRegion($address->getRegion())
399
+ ->setRegion_id($address->getRegionId())
400
+ ->setPostcode($address->getPostcode())
401
+ ->setTelephone($address->getTelephone())
402
+ ->setFax($address->getFax());
403
+ $order->setBillingAddress($billingAddress);
404
+ //$shipping = $customer->getDefaultShippingAddress();
405
+ $shippingAddress = Mage::getModel('sales/order_address')
406
+ ->setStoreId($storeId)
407
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
408
+ ->setCustomerId($address->getCustomerId())
409
+ ->setCustomerAddressId($address->getCustomerAddressId())
410
+ ->setCustomer_address_id($address->getEntityId())
411
+ ->setPrefix($address->getPrefix())
412
+ ->setFirstname($address->getFirstname())
413
+ ->setMiddlename($address->getMiddlename())
414
+ ->setLastname($address->getLastname())
415
+ ->setSuffix($address->getSuffix())
416
+ ->setCompany($address->getCompany())
417
+ ->setStreet($address->getStreet())
418
+ ->setCity($address->getCity())
419
+ ->setCountryId($address->getCountryId())
420
+ ->setRegion($address->getRegion())
421
+ ->setRegionId($address->getRegionId())
422
+ ->setPostcode($address->getPostcode())
423
+ ->setTelephone($address->getTelephone())
424
+ ->setFax($address->getFax());
425
+
426
+ $order->setShippingAddress($shippingAddress)
427
+ ->setShipping_method('flatrate_flatrate');
428
+ $order->setShippingDescription($lastorder->getShippingDescription());
429
+ $order->setShippingAmount($shippingcharge);
430
+
431
+ /*->setShippingDescription($this->getCarrierName('flatrate'));*/
432
+ /*some error i am getting here need to solve further*/
433
+
434
+ //you can set your payment method name here as per your need
435
+ $orderPayment = Mage::getModel('sales/order_payment')
436
+ ->setStoreId($storeId)
437
+ ->setCustomerPaymentId(0)
438
+ ->setMethod('free')
439
+ ->setAction('yes')
440
+ ->setPo_number(' – ')
441
+ ->setOrderStatus('processing');
442
+ $order->setPayment($orderPayment);
443
+
444
+ // let say, we have 2 products
445
+ //check that your products exists
446
+ //need to add code for configurable products if any
447
+ $subTotal = 0;
448
+
449
+ //$products = getFreeProducts($point);
450
+
451
+ foreach ($newitems as $product) {
452
+ $_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $product['ProductCode']);
453
+ $rowTotal = $_product->getPrice() * $product['Quantity'];
454
+ $orderItem = Mage::getModel('sales/order_item')
455
+ ->setStoreId($storeId)
456
+ ->setQuoteItemId(0)
457
+ ->setQuoteParentItemId(NULL)
458
+ ->setProductId($_product->getId())
459
+ ->setProductType($_product->getTypeId())
460
+ ->setQtyBackordered(NULL)
461
+ ->setTotalQtyOrdered($product['Quantity'])
462
+ ->setQtyOrdered($product['Quantity'])
463
+ ->setName($_product->getName())
464
+ ->setSku($_product->getSku())
465
+ ->setPrice($_product->getPrice())
466
+ ->setBasePrice($_product->getPrice())
467
+ ->setOriginalPrice($_product->getPrice())
468
+ ->setRowTotal($rowTotal)
469
+ ->setBaseRowTotal($rowTotal);
470
+
471
+ $subTotal += $rowTotal;
472
+ //$subTotal = 0;
473
+ $order->addItem($orderItem);
474
+ }
475
+
476
+ $order->setSubtotal($subTotal)
477
+ ->setBaseSubtotal($subTotal)
478
+ ->setGrandTotal($subTotal+$shippingcharge)
479
+ ->setBaseGrandTotal($subTotal+$shippingcharge);
480
+
481
+ $transaction->addObject($order);
482
+ $transaction->addCommitCallback(array($order, 'place'));
483
+ $transaction->addCommitCallback(array($order, 'save'));
484
+ $transaction->save();
485
+
486
+ $order= Mage::getModel('sales/order')->load($order->getId());
487
+ $order->setSwipezoomOrderNumberTemp($sworder)->save();
488
+
489
+
490
+
491
+
492
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
493
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
494
+ $invoice->register();
495
+
496
+ $itemQty = $order->getItemsCollection();//->count();
497
+ $newarray = array();
498
+ foreach($itemQty as $item){
499
+ $newarray[$item->getId()] = $item->getQtyInvoiced();
500
+ }
501
+ $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($newarray);
502
+ $shipment->register();
503
+ $transactionSave = Mage::getModel('core/resource_transaction')
504
+ ->addObject($invoice)
505
+ ->addObject($shipment)
506
+ ->addObject($order);
507
+
508
+
509
+ //->addStatusHistoryComment('', 'refund')
510
+
511
+ $transactionSave->save();
512
+
513
+ return $order->getId();
514
+ }
515
+
516
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Packingdetail.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Packingdetail
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Packingdetail extends Mage_Core_Model_Abstract
10
+ {
11
+ protected function _construct(){
12
+
13
+ $this->_init("internationalshipping/packingdetail");
14
+
15
+ }
16
+
17
+ }
18
+
app/code/local/Swipezoom/InternationalShipping/Model/Partshipreq.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Partshipreq
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Partshipreq extends Mage_Core_Model_Abstract
10
+ {
11
+ protected function _construct(){
12
+
13
+ $this->_init("internationalshipping/partshipreq");
14
+
15
+ }
16
+
17
+ }
18
+
app/code/local/Swipezoom/InternationalShipping/Model/Partshipreqitems.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Partshipreqitems
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Partshipreqitems extends Mage_Core_Model_Abstract
10
+ {
11
+ protected function _construct(){
12
+
13
+ $this->_init("internationalshipping/partshipreqitems");
14
+
15
+ }
16
+
17
+ }
18
+
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Invoice.php ADDED
@@ -0,0 +1,533 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Invoice
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Abstract
10
+ {
11
+ /**
12
+ * Draw header for item table
13
+ *
14
+ * @param Zend_Pdf_Page $page
15
+ * @return void
16
+ */
17
+ protected function _drawHeader(Zend_Pdf_Page $page)
18
+ {
19
+ /* Add table head */
20
+ $this->_setFontRegular($page, 10);
21
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
22
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
23
+ $page->setLineWidth(0.5);
24
+ $page->drawRectangle(25, $this->y, 570, $this->y -15);
25
+ $this->y -= 10;
26
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
27
+
28
+ //columns headers
29
+ $lines[0][] = array(
30
+ 'text' => Mage::helper('sales')->__('Products'),
31
+ 'feed' => 35
32
+ );
33
+
34
+ $lines[0][] = array(
35
+ 'text' => Mage::helper('sales')->__('SKU'),
36
+ 'feed' => 290,
37
+ 'align' => 'right'
38
+ );
39
+
40
+ $lines[0][] = array(
41
+ 'text' => Mage::helper('sales')->__('Qty'),
42
+ 'feed' => 435,
43
+ 'align' => 'right'
44
+ );
45
+
46
+ $lines[0][] = array(
47
+ 'text' => Mage::helper('sales')->__('Price'),
48
+ 'feed' => 360,
49
+ 'align' => 'right'
50
+ );
51
+
52
+ $lines[0][] = array(
53
+ 'text' => Mage::helper('sales')->__('Tax'),
54
+ 'feed' => 495,
55
+ 'align' => 'right'
56
+ );
57
+
58
+ $lines[0][] = array(
59
+ 'text' => Mage::helper('sales')->__('Subtotal'),
60
+ 'feed' => 565,
61
+ 'align' => 'right'
62
+ );
63
+
64
+ $lineBlock = array(
65
+ 'lines' => $lines,
66
+ 'height' => 5
67
+ );
68
+
69
+ $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
70
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
71
+ $this->y -= 20;
72
+ }
73
+
74
+ /**
75
+ * Draw header for Packing item table
76
+ *
77
+ * @param Zend_Pdf_Page $page
78
+ * @return void
79
+ */
80
+ protected function _packdrawHeader(Zend_Pdf_Page $page)
81
+ {
82
+ $this->y -=20;
83
+ $this->_setFontBold($page, 12);
84
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
85
+ $page->drawText(Mage::helper('sales')->__('Items Packing Detail'), 35, $this->y, 'UTF-8');
86
+
87
+
88
+ $this->y -=10;
89
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
90
+
91
+
92
+ /* Add table head */
93
+ $this->_setFontRegular($page, 10);
94
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
95
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
96
+ $page->setLineWidth(0.5);
97
+ $page->drawRectangle(25, $this->y, 570, $this->y -15);
98
+ $this->y -= 10;
99
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
100
+
101
+ //columns headers
102
+ $lines[0][] = array(
103
+ 'text' => Mage::helper('sales')->__('Item'),
104
+ 'feed' => 35
105
+ );
106
+
107
+ $lines[0][] = array(
108
+ 'text' => Mage::helper('sales')->__('Box Code'),
109
+ 'feed' => 170,
110
+ 'align' => 'right'
111
+ );
112
+
113
+ $lines[0][] = array(
114
+ 'text' => Mage::helper('sales')->__('Box No.'),
115
+ 'feed' => 265,
116
+ 'align' => 'right'
117
+ );
118
+
119
+ $lines[0][] = array(
120
+ 'text' => Mage::helper('sales')->__('Product Description'),
121
+ 'feed' => 350,
122
+ 'align' => 'right'
123
+ );
124
+
125
+ $lines[0][] = array(
126
+ 'text' => Mage::helper('sales')->__('Product Code'),
127
+ 'feed' => 465,
128
+ 'align' => 'right'
129
+ );
130
+
131
+ $lines[0][] = array(
132
+ 'text' => Mage::helper('sales')->__('Quantity'),
133
+ 'feed' => 565,
134
+ 'align' => 'right'
135
+ );
136
+
137
+ $lineBlock = array(
138
+ 'lines' => $lines,
139
+ 'height' => 5
140
+ );
141
+
142
+ $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
143
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
144
+ $this->y -= 20;
145
+ }
146
+
147
+
148
+ protected function insertOrder1(&$page, $obj, $putOrderId = true)
149
+ {
150
+ if ($obj instanceof Mage_Sales_Model_Order) {
151
+ $shipment = null;
152
+ $order = $obj;
153
+ } elseif ($obj instanceof Mage_Sales_Model_Order_Shipment) {
154
+ $shipment = $obj;
155
+ $order = $shipment->getOrder();
156
+ }
157
+
158
+ $this->y = $this->y ? $this->y : 815;
159
+ $top = $this->y;
160
+
161
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.45));
162
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.45));
163
+ $page->drawRectangle(25, $top, 570, $top - 55);
164
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
165
+ $this->setDocHeaderCoordinates(array(25, $top, 570, $top - 55));
166
+ $this->_setFontRegular($page, 10);
167
+
168
+ if ($putOrderId) {
169
+ $page->drawText(
170
+ Mage::helper('sales')->__('Order # ') . $order->getRealOrderId(), 35, ($top -= 30), 'UTF-8'
171
+ );
172
+ }
173
+ $page->drawText(
174
+ Mage::helper('sales')->__('Order Date: ') . Mage::helper('core')->formatDate(
175
+ $order->getCreatedAtStoreDate(), 'medium', false
176
+ ),
177
+ 35,
178
+ ($top -= 15),
179
+ 'UTF-8'
180
+ );
181
+
182
+ $top -= 10;
183
+ $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
184
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
185
+ $page->setLineWidth(0.5);
186
+ $page->drawRectangle(25, $top, 275, ($top - 25));
187
+ $page->drawRectangle(275, $top, 570, ($top - 25));
188
+
189
+ /* Calculate blocks info */
190
+
191
+ /* Billing Address */
192
+ $billingAddress = $this->_formatAddress($order->getBillingAddress()->format('pdf'));
193
+
194
+ /* Payment */
195
+ $paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment())
196
+ ->setIsSecureMode(true)
197
+ ->toPdf();
198
+ $paymentInfo = htmlspecialchars_decode($paymentInfo, ENT_QUOTES);
199
+ $payment = explode('{{pdf_row_separator}}', $paymentInfo);
200
+ foreach ($payment as $key=>$value){
201
+ if (strip_tags(trim($value)) == '') {
202
+ unset($payment[$key]);
203
+ }
204
+ }
205
+ reset($payment);
206
+
207
+ /* Shipping Address and Method */
208
+ if (!$order->getIsVirtual()) {
209
+ /* Shipping Address */
210
+ $shippingAddress = $this->_formatAddress($order->getShippingAddress()->format('pdf'));
211
+ $shippingMethod = $order->getShippingDescription();
212
+ }
213
+
214
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
215
+ $this->_setFontBold($page, 12);
216
+ $page->drawText(Mage::helper('sales')->__('Sold to:'), 35, ($top - 15), 'UTF-8');
217
+
218
+ if (!$order->getIsVirtual()) {
219
+ $page->drawText(Mage::helper('sales')->__('Ship to:'), 285, ($top - 15), 'UTF-8');
220
+ } else {
221
+ //$page->drawText(Mage::helper('sales')->__('Payment Method:'), 285, ($top - 15), 'UTF-8');
222
+ }
223
+
224
+ $addressesHeight = $this->_calcAddressHeight($billingAddress);
225
+ if (isset($shippingAddress)) {
226
+ $addressesHeight = max($addressesHeight, $this->_calcAddressHeight($shippingAddress));
227
+ }
228
+
229
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
230
+ $page->drawRectangle(25, ($top - 25), 570, $top - 33 - $addressesHeight);
231
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
232
+ $this->_setFontRegular($page, 10);
233
+ $this->y = $top - 40;
234
+ $addressesStartY = $this->y;
235
+
236
+ foreach ($billingAddress as $value){
237
+ if ($value !== '') {
238
+ $text = array();
239
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
240
+ $text[] = $_value;
241
+ }
242
+ foreach ($text as $part) {
243
+ $page->drawText(strip_tags(ltrim($part)), 35, $this->y, 'UTF-8');
244
+ $this->y -= 15;
245
+ }
246
+ }
247
+ }
248
+
249
+ $addressesEndY = $this->y;
250
+
251
+ if (!$order->getIsVirtual()) {
252
+ $this->y = $addressesStartY;
253
+ foreach ($shippingAddress as $value){
254
+ if ($value!=='') {
255
+ $text = array();
256
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
257
+ $text[] = $_value;
258
+ }
259
+ foreach ($text as $part) {
260
+ $page->drawText(strip_tags(ltrim($part)), 285, $this->y, 'UTF-8');
261
+ $this->y -= 15;
262
+ }
263
+ }
264
+ }
265
+
266
+ $addressesEndY = min($addressesEndY, $this->y);
267
+ $this->y = $addressesEndY;
268
+ /*
269
+ $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
270
+ $page->setLineWidth(0.5);
271
+ $page->drawRectangle(25, $this->y, 275, $this->y-25);
272
+ $page->drawRectangle(275, $this->y, 570, $this->y-25);
273
+
274
+ $this->y -= 15;
275
+ $this->_setFontBold($page, 12);
276
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
277
+ $page->drawText(Mage::helper('sales')->__('Payment Method'), 35, $this->y, 'UTF-8');
278
+ $page->drawText(Mage::helper('sales')->__('Shipping Method:'), 285, $this->y , 'UTF-8');
279
+
280
+ $this->y -=10;
281
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));*/
282
+
283
+ $this->_setFontRegular($page, 10);
284
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
285
+
286
+ $paymentLeft = 35;
287
+ $yPayments = $this->y - 15;
288
+ }
289
+ else {
290
+ $yPayments = $addressesStartY;
291
+ $paymentLeft = 285;
292
+ }
293
+
294
+ /*foreach ($payment as $value){
295
+ if (trim($value) != '') {
296
+ //Printing "Payment Method" lines
297
+ $value = preg_replace('/<br[^>]*>/i', "\n", $value);
298
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
299
+ $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8');
300
+ $yPayments -= 15;
301
+ }
302
+ }
303
+ }*/
304
+
305
+ /*if ($order->getIsVirtual()) {
306
+ // replacement of Shipments-Payments rectangle block
307
+ $yPayments = min($addressesEndY, $yPayments);
308
+ $page->drawLine(25, ($top - 25), 25, $yPayments);
309
+ $page->drawLine(570, ($top - 25), 570, $yPayments);
310
+ $page->drawLine(25, $yPayments, 570, $yPayments);
311
+
312
+ $this->y = $yPayments - 15;
313
+ } else {
314
+ $topMargin = 15;
315
+ $methodStartY = $this->y;
316
+ $this->y -= 15;
317
+
318
+ foreach (Mage::helper('core/string')->str_split($shippingMethod, 45, true, true) as $_value) {
319
+ $page->drawText(strip_tags(trim($_value)), 285, $this->y, 'UTF-8');
320
+ $this->y -= 15;
321
+ }
322
+
323
+ $yShipments = $this->y;
324
+ $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " "
325
+ . $order->formatPriceTxt($order->getShippingAmount()) . ")";
326
+
327
+ $page->drawText($totalShippingChargesText, 285, $yShipments - $topMargin, 'UTF-8');
328
+ $yShipments -= $topMargin + 10;
329
+
330
+ $tracks = array();
331
+ if ($shipment) {
332
+ $tracks = $shipment->getAllTracks();
333
+ }
334
+ if (count($tracks)) {
335
+ $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
336
+ $page->setLineWidth(0.5);
337
+ $page->drawRectangle(285, $yShipments, 510, $yShipments - 10);
338
+ $page->drawLine(400, $yShipments, 400, $yShipments - 10);
339
+ //$page->drawLine(510, $yShipments, 510, $yShipments - 10);
340
+
341
+ $this->_setFontRegular($page, 9);
342
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
343
+ //$page->drawText(Mage::helper('sales')->__('Carrier'), 290, $yShipments - 7 , 'UTF-8');
344
+ $page->drawText(Mage::helper('sales')->__('Title'), 290, $yShipments - 7, 'UTF-8');
345
+ $page->drawText(Mage::helper('sales')->__('Number'), 410, $yShipments - 7, 'UTF-8');
346
+
347
+ $yShipments -= 20;
348
+ $this->_setFontRegular($page, 8);
349
+ foreach ($tracks as $track) {
350
+
351
+ $CarrierCode = $track->getCarrierCode();
352
+ if ($CarrierCode != 'custom') {
353
+ $carrier = Mage::getSingleton('shipping/config')->getCarrierInstance($CarrierCode);
354
+ $carrierTitle = $carrier->getConfigData('title');
355
+ } else {
356
+ $carrierTitle = Mage::helper('sales')->__('Custom Value');
357
+ }
358
+
359
+ //$truncatedCarrierTitle = substr($carrierTitle, 0, 35) . (strlen($carrierTitle) > 35 ? '...' : '');
360
+ $maxTitleLen = 45;
361
+ $endOfTitle = strlen($track->getTitle()) > $maxTitleLen ? '...' : '';
362
+ $truncatedTitle = substr($track->getTitle(), 0, $maxTitleLen) . $endOfTitle;
363
+ //$page->drawText($truncatedCarrierTitle, 285, $yShipments , 'UTF-8');
364
+ $page->drawText($truncatedTitle, 292, $yShipments , 'UTF-8');
365
+ $page->drawText($track->getNumber(), 410, $yShipments , 'UTF-8');
366
+ $yShipments -= $topMargin - 5;
367
+ }
368
+ } else {
369
+ $yShipments -= $topMargin - 5;
370
+ }
371
+
372
+ $currentY = min($yPayments, $yShipments);
373
+
374
+ // replacement of Shipments-Payments rectangle block
375
+ $page->drawLine(25, $methodStartY, 25, $currentY); //left
376
+ $page->drawLine(25, $currentY, 570, $currentY); //bottom
377
+ $page->drawLine(570, $currentY, 570, $methodStartY); //right
378
+
379
+ $this->y = $currentY;
380
+ $this->y -= 15;
381
+ }*/
382
+ }
383
+
384
+ /**
385
+ * Return PDF document
386
+ *
387
+ * @param array $invoices
388
+ * @return Zend_Pdf
389
+ */
390
+ public function getPdf($invoices = array())
391
+ {
392
+ $this->_beforeGetPdf();
393
+ $this->_initRenderer('invoice');
394
+
395
+ $pdf = new Zend_Pdf();
396
+ $this->_setPdf($pdf);
397
+ $style = new Zend_Pdf_Style();
398
+ $this->_setFontBold($style, 10);
399
+
400
+ foreach ($invoices as $invoice) {
401
+ if ($invoice->getStoreId()) {
402
+ Mage::app()->getLocale()->emulate($invoice->getStoreId());
403
+ Mage::app()->setCurrentStore($invoice->getStoreId());
404
+ }
405
+ $order = $invoice->getOrder();
406
+ $page = $this->newPage($order);
407
+
408
+ /* Add image */
409
+ $this->insertLogo($page, $invoice->getStore());
410
+ /* Add address */
411
+ $this->insertAddress($page, $invoice->getStore());
412
+ /* Add head */
413
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
414
+ if(!$swipwzoomorder){
415
+ $this->insertOrder1(
416
+ $page,
417
+ $order,
418
+ Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())
419
+ );
420
+ }else{
421
+ $this->insertOrder1(
422
+ $page,
423
+ $order,
424
+ Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())
425
+ );
426
+ }
427
+ /* Add document text and number */
428
+ $this->insertDocumentNumber(
429
+ $page,
430
+ Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId()
431
+ );
432
+ /* Add table */
433
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
434
+ if($swipwzoomorder){
435
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
436
+ if(!count($count)){
437
+ $this->_drawHeader($page);
438
+ /* Add body */
439
+
440
+ foreach ($invoice->getAllItems() as $item){
441
+ if ($item->getOrderItem()->getParentItem()) {
442
+ continue;
443
+ }
444
+ /* Draw item */
445
+ $this->_drawItem($item, $page, $order);
446
+ $page = end($pdf->pages);
447
+ }
448
+ $this->insertTotals($page, $invoice);
449
+ }else{
450
+ $this->_packdrawHeader($page);
451
+
452
+
453
+
454
+
455
+ $i = 1;
456
+ foreach ($count as $item){
457
+ //if ($item->getOrderItem()->getParentItem()) {
458
+ // continue;
459
+ //}
460
+ /* Draw item */
461
+
462
+ $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getProductcode());
463
+ if(!$products){ $proname = "Somthing wrong happen - Product not found"; }else{
464
+ $proname = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getProductcode())->getName();
465
+ }
466
+ $this->_packdrawItem($item, $page, $order,$i++,$proname);
467
+ $page = end($pdf->pages);
468
+ }
469
+ }}else{
470
+ $this->_drawHeader($page);
471
+ /* Add body */
472
+ foreach ($invoice->getAllItems() as $item){
473
+ if ($item->getOrderItem()->getParentItem()) {
474
+ continue;
475
+ }
476
+ /* Draw item */
477
+ $this->_drawItem($item, $page, $order);
478
+ $page = end($pdf->pages);
479
+ }
480
+ $this->insertTotals($page, $invoice);
481
+ }
482
+
483
+
484
+ if ($invoice->getStoreId()) {
485
+ Mage::app()->getLocale()->revert();
486
+ }
487
+ }
488
+ $this->_afterGetPdf();
489
+ return $pdf;
490
+ }
491
+ protected function _packdrawItem(Varien_Object $item, Zend_Pdf_Page $page, Mage_Sales_Model_Order $order, $numnber,$proname)
492
+ {
493
+ $type = 'default';
494
+ $renderer = $this->_getRenderer($type);
495
+ Mage::log(get_class($renderer),null,'ren.log');
496
+ $renderer->setOrder($order);
497
+ $renderer->setItem($item);
498
+ $renderer->setPdf($this);
499
+ $renderer->setPage($page);
500
+ $renderer->setLineno($numnber);
501
+ $renderer->setRenderedModel($this);
502
+ $renderer->setProname($proname);
503
+
504
+ $renderer->draw();
505
+
506
+ return $renderer->getPage();
507
+ }
508
+ /**
509
+ * Create new page and assign to PDF object
510
+ *
511
+ * @param array $settings
512
+ * @return Zend_Pdf_Page
513
+ */
514
+ public function newPage($order)
515
+ {
516
+ /* Add new table head */
517
+ $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_A4);
518
+ $this->_getPdf()->pages[] = $page;
519
+ $this->y = 800;
520
+
521
+ if (!empty($settings['table_header'])) {
522
+
523
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
524
+ if($swipwzoomorder){
525
+ $this->_packdrawHeader($page);
526
+ }else{
527
+ $this->_drawHeader($page);
528
+ }
529
+ }
530
+ return $page;
531
+ }
532
+ }
533
+
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Invoice/Amasty/Pure.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php /* added automatically by conflict fixing tool */ if (Mage::getConfig()->getNode('modules/Fooman_PdfCustomiser/active')) {
2
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Invoice_Amasty_Pure extends Fooman_PdfCustomiser_Model_Invoice {}
3
+ } else { class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Invoice_Amasty_Pure extends Mage_Sales_Model_Order_Pdf_Abstract {} } ?>
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Items/Invoice/Default.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Invoice_Default
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Invoice_Default
8
+ {
9
+ public function draw()
10
+ {
11
+ $order = $this->getOrder();
12
+ $item = $this->getItem();
13
+ $pdf = $this->getPdf();
14
+ $page = $this->getPage();
15
+ $linenumber = $this->getLineno();
16
+ $lines = array();
17
+
18
+
19
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
20
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
21
+
22
+
23
+ if($swipwzoomorder && count($count)){
24
+
25
+ // draw Product name
26
+ $lines[0] = array(array(
27
+ 'text' => $linenumber,
28
+ 'feed' => 35,
29
+ ));
30
+
31
+ // draw QTY
32
+ $lines[0][] = array(
33
+ 'text' => $item->getBoxcode(),
34
+ 'feed' => 170,
35
+ 'align' => 'right'
36
+ );
37
+
38
+ // draw SKU
39
+ $lines[0][] = array(
40
+ 'text' => $item->getBoxno(),
41
+ 'feed' => 265,
42
+ 'align' => 'right'
43
+ );
44
+
45
+
46
+
47
+ // draw QTY
48
+ $lines[0][] = array(
49
+ 'text' => Mage::helper('core/string')->str_split($this->getProname(), 35, true, true),
50
+ 'feed' => 350,
51
+ 'align' => 'right'
52
+ );
53
+
54
+ // draw QTY
55
+ $lines[0][] = array(
56
+ 'text' => $item->getProductcode(),
57
+ 'feed' => 465,
58
+ 'align' => 'right'
59
+ );
60
+
61
+ // draw QTY
62
+ $lines[0][] = array(
63
+ 'text' => $item->getProductqty(),
64
+ 'feed' => 565,
65
+ 'align' => 'right'
66
+ );
67
+
68
+
69
+
70
+
71
+
72
+ }else{
73
+ // draw Product name
74
+ $lines[0] = array(array(
75
+ 'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
76
+ 'feed' => 35,
77
+ ));
78
+
79
+ // draw SKU
80
+ $lines[0][] = array(
81
+ 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17),
82
+ 'feed' => 170,
83
+ 'align' => 'right'
84
+ );
85
+
86
+ // draw QTY
87
+ $lines[0][] = array(
88
+ 'text' => $item->getQty() * 1,
89
+ 'feed' => 435,
90
+ 'align' => 'right'
91
+ );
92
+
93
+ // draw item Prices
94
+ $i = 0;
95
+ $prices = $this->getItemPricesForDisplay();
96
+ $feedPrice = 395;
97
+ $feedSubtotal = $feedPrice + 170;
98
+ foreach ($prices as $priceData){
99
+ if (isset($priceData['label'])) {
100
+ // draw Price label
101
+ $lines[$i][] = array(
102
+ 'text' => $priceData['label'],
103
+ 'feed' => $feedPrice,
104
+ 'align' => 'right'
105
+ );
106
+ // draw Subtotal label
107
+ $lines[$i][] = array(
108
+ 'text' => $priceData['label'],
109
+ 'feed' => $feedSubtotal,
110
+ 'align' => 'right'
111
+ );
112
+ $i++;
113
+ }
114
+ // draw Price
115
+ $lines[$i][] = array(
116
+ 'text' => $priceData['price'],
117
+ 'feed' => $feedPrice,
118
+ 'font' => 'bold',
119
+ 'align' => 'right'
120
+ );
121
+ // draw Subtotal
122
+ $lines[$i][] = array(
123
+ 'text' => $priceData['subtotal'],
124
+ 'feed' => $feedSubtotal,
125
+ 'font' => 'bold',
126
+ 'align' => 'right'
127
+ );
128
+ $i++;
129
+ }
130
+
131
+ // draw Tax
132
+ $lines[0][] = array(
133
+ 'text' => $order->formatPriceTxt($item->getTaxAmount()),
134
+ 'feed' => 495,
135
+ 'font' => 'bold',
136
+ 'align' => 'right'
137
+ );
138
+
139
+ // custom options
140
+ $options = $this->getItemOptions();
141
+ if ($options) {
142
+ foreach ($options as $option) {
143
+ // draw options label
144
+ $lines[][] = array(
145
+ 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
146
+ 'font' => 'italic',
147
+ 'feed' => 35
148
+ );
149
+
150
+ if ($option['value']) {
151
+ if (isset($option['print_value'])) {
152
+ $_printValue = $option['print_value'];
153
+ } else {
154
+ $_printValue = strip_tags($option['value']);
155
+ }
156
+ $values = explode(', ', $_printValue);
157
+ foreach ($values as $value) {
158
+ $lines[][] = array(
159
+ 'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
160
+ 'feed' => 40
161
+ );
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+
168
+ }
169
+ $lineBlock = array(
170
+ 'lines' => $lines,
171
+ 'height' => 20
172
+ );
173
+ $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
174
+ $this->setPage($page);
175
+ }
176
+ }
177
+
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Items/Shipment/Default.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Shipment_Default
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Shipment_Default extends Mage_Sales_Model_Order_Pdf_Items_Shipment_Default
9
+ {
10
+ /**
11
+ * Draw item line
12
+ */
13
+ public function draw()
14
+ {
15
+ $item = $this->getItem();
16
+ $pdf = $this->getPdf();
17
+ $page = $this->getPage();
18
+ $linenumber = $this->getLineno();
19
+ $order = $this->getOrder();
20
+ $lines = array();
21
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
22
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
23
+ if($swipwzoomorder && count($count)){
24
+
25
+ // draw Product name
26
+ $lines[0] = array(array(
27
+ 'text' => $linenumber,
28
+ 'feed' => 35,
29
+ ));
30
+
31
+ // draw QTY
32
+ $lines[0][] = array(
33
+ 'text' => $item->getBoxcode(),
34
+ 'feed' => 170,
35
+ 'align' => 'right'
36
+ );
37
+
38
+ // draw SKU
39
+ $lines[0][] = array(
40
+ 'text' => $item->getBoxno(),
41
+ 'feed' => 265,
42
+ 'align' => 'right'
43
+ );
44
+
45
+
46
+
47
+ // draw QTY
48
+ $lines[0][] = array(
49
+ 'text' => Mage::helper('core/string')->str_split($this->getProname(), 35, true, true),
50
+ 'feed' => 350,
51
+ 'align' => 'right'
52
+ );
53
+
54
+ // draw QTY
55
+ $lines[0][] = array(
56
+ 'text' => $item->getProductcode(),
57
+ 'feed' => 465,
58
+ 'align' => 'right'
59
+ );
60
+
61
+ // draw QTY
62
+ $lines[0][] = array(
63
+ 'text' => $item->getProductqty(),
64
+ 'feed' => 565,
65
+ 'align' => 'right'
66
+ );
67
+
68
+
69
+
70
+
71
+
72
+ }else{
73
+ // draw Product name
74
+ $lines[0] = array(array(
75
+ 'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true),
76
+ 'feed' => 100,
77
+ ));
78
+
79
+ // draw QTY
80
+ $lines[0][] = array(
81
+ 'text' => $item->getQty()*1,
82
+ 'feed' => 35
83
+ );
84
+
85
+ // draw SKU
86
+ $lines[0][] = array(
87
+ 'text' => Mage::helper('core/string')->str_split($this->getSku($item), 25),
88
+ 'feed' => 565,
89
+ 'align' => 'right'
90
+ );
91
+
92
+ // Custom options
93
+ $options = $this->getItemOptions();
94
+ if ($options) {
95
+ foreach ($options as $option) {
96
+ // draw options label
97
+ $lines[][] = array(
98
+ 'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true),
99
+ 'font' => 'italic',
100
+ 'feed' => 110
101
+ );
102
+
103
+ // draw options value
104
+ if ($option['value']) {
105
+ $_printValue = isset($option['print_value'])
106
+ ? $option['print_value']
107
+ : strip_tags($option['value']);
108
+ $values = explode(', ', $_printValue);
109
+ foreach ($values as $value) {
110
+ $lines[][] = array(
111
+ 'text' => Mage::helper('core/string')->str_split($value, 50, true, true),
112
+ 'feed' => 115
113
+ );
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ $lineBlock = array(
121
+ 'lines' => $lines,
122
+ 'height' => 20
123
+ );
124
+
125
+ $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
126
+ $this->setPage($page);
127
+ }
128
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Shipment.php ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Shipment
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Shipment extends Mage_Sales_Model_Order_Pdf_Abstract
8
+ {
9
+ /**
10
+ * Draw table header for product items
11
+ *
12
+ * @param Zend_Pdf_Page $page
13
+ * @return void
14
+ */
15
+ protected function _drawHeader(Zend_Pdf_Page $page)
16
+ {
17
+ /* Add table head */
18
+ $this->_setFontRegular($page, 10);
19
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
20
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
21
+ $page->setLineWidth(0.5);
22
+ $page->drawRectangle(25, $this->y, 570, $this->y-15);
23
+ $this->y -= 10;
24
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
25
+
26
+ //columns headers
27
+ $lines[0][] = array(
28
+ 'text' => Mage::helper('sales')->__('Products'),
29
+ 'feed' => 100,
30
+ );
31
+
32
+ $lines[0][] = array(
33
+ 'text' => Mage::helper('sales')->__('Qty'),
34
+ 'feed' => 35
35
+ );
36
+
37
+ $lines[0][] = array(
38
+ 'text' => Mage::helper('sales')->__('SKU'),
39
+ 'feed' => 565,
40
+ 'align' => 'right'
41
+ );
42
+
43
+ $lineBlock = array(
44
+ 'lines' => $lines,
45
+ 'height' => 10
46
+ );
47
+
48
+ $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
49
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
50
+ $this->y -= 20;
51
+ }
52
+ /**
53
+ * Draw header for Packing item table
54
+ *
55
+ * @param Zend_Pdf_Page $page
56
+ * @return void
57
+ */
58
+ protected function _packdrawHeader(Zend_Pdf_Page $page)
59
+ {
60
+ /* Add table head */
61
+ $this->_setFontRegular($page, 10);
62
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
63
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
64
+ $page->setLineWidth(0.5);
65
+ $page->drawRectangle(25, $this->y, 570, $this->y -15);
66
+ $this->y -= 10;
67
+ $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
68
+
69
+ //columns headers
70
+ $lines[0][] = array(
71
+ 'text' => Mage::helper('sales')->__('Item'),
72
+ 'feed' => 35
73
+ );
74
+
75
+ $lines[0][] = array(
76
+ 'text' => Mage::helper('sales')->__('Box Code'),
77
+ 'feed' => 170,
78
+ 'align' => 'right'
79
+ );
80
+
81
+ $lines[0][] = array(
82
+ 'text' => Mage::helper('sales')->__('Box No.'),
83
+ 'feed' => 265,
84
+ 'align' => 'right'
85
+ );
86
+
87
+ $lines[0][] = array(
88
+ 'text' => Mage::helper('sales')->__('Product Description'),
89
+ 'feed' => 350,
90
+ 'align' => 'right'
91
+ );
92
+
93
+ $lines[0][] = array(
94
+ 'text' => Mage::helper('sales')->__('Product Code'),
95
+ 'feed' => 465,
96
+ 'align' => 'right'
97
+ );
98
+
99
+ $lines[0][] = array(
100
+ 'text' => Mage::helper('sales')->__('Quantity'),
101
+ 'feed' => 565,
102
+ 'align' => 'right'
103
+ );
104
+
105
+ $lineBlock = array(
106
+ 'lines' => $lines,
107
+ 'height' => 5
108
+ );
109
+
110
+ $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
111
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
112
+ $this->y -= 20;
113
+ }
114
+
115
+ /**
116
+ * Return PDF document
117
+ *
118
+ * @param array $shipments
119
+ * @return Zend_Pdf
120
+ */
121
+ public function getPdf($shipments = array())
122
+ {
123
+ $this->_beforeGetPdf();
124
+ $this->_initRenderer('shipment');
125
+
126
+ $pdf = new Zend_Pdf();
127
+ $this->_setPdf($pdf);
128
+ $style = new Zend_Pdf_Style();
129
+ $this->_setFontBold($style, 10);
130
+ foreach ($shipments as $shipment) {
131
+ if ($shipment->getStoreId()) {
132
+ Mage::app()->getLocale()->emulate($shipment->getStoreId());
133
+ Mage::app()->setCurrentStore($shipment->getStoreId());
134
+ }
135
+ $order = $shipment->getOrder();
136
+ $page = $this->newPage($order);
137
+
138
+ /* Add image */
139
+ $this->insertLogo($page, $shipment->getStore());
140
+ /* Add address */
141
+ $this->insertAddress($page, $shipment->getStore());
142
+ /* Add head */
143
+ $this->insertOrder(
144
+ $page,
145
+ $shipment,
146
+ Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId())
147
+ );
148
+ /* Add document text and number */
149
+ $this->insertDocumentNumber(
150
+ $page,
151
+ Mage::helper('sales')->__('Packingslip # ') . $shipment->getIncrementId()
152
+ );
153
+ /* Add table */
154
+
155
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
156
+ if($swipwzoomorder){
157
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
158
+ if(count($count)){
159
+ $this->_packdrawHeader($page);
160
+ $i = 1;
161
+ foreach ($count as $item){
162
+ //if ($item->getOrderItem()->getParentItem()) {
163
+ // continue;
164
+ //}
165
+ /* Draw item */
166
+ $proname = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getProductcode())->getName();
167
+ $this->_packdrawItem($item, $page, $order,$i++,$proname);
168
+ $page = end($pdf->pages);
169
+ }
170
+ }else{
171
+ $this->_drawHeader($page);
172
+ /* Add body */
173
+ foreach ($shipment->getAllItems() as $item) {
174
+ if ($item->getOrderItem()->getParentItem()) {
175
+ continue;
176
+ }
177
+ /* Draw item */
178
+ $this->_drawItem($item, $page, $order);
179
+ $page = end($pdf->pages);
180
+ }
181
+ }
182
+ }else{
183
+ $this->_drawHeader($page);
184
+ /* Add body */
185
+ foreach ($shipment->getAllItems() as $item) {
186
+ if ($item->getOrderItem()->getParentItem()) {
187
+ continue;
188
+ }
189
+ /* Draw item */
190
+ $this->_drawItem($item, $page, $order);
191
+ $page = end($pdf->pages);
192
+ }
193
+ }
194
+
195
+
196
+ }
197
+ $this->_afterGetPdf();
198
+ if ($shipment->getStoreId()) {
199
+ Mage::app()->getLocale()->revert();
200
+ }
201
+ return $pdf;
202
+ }
203
+
204
+ protected function _packdrawItem(Varien_Object $item, Zend_Pdf_Page $page, Mage_Sales_Model_Order $order, $numnber,$proname)
205
+ {
206
+ $type = 'default';
207
+ $renderer = $this->_getRenderer($type);
208
+ Mage::log(get_class($renderer),null,'ren.log');
209
+
210
+ $renderer->setItem($item);
211
+ $renderer->setPdf($this);
212
+ $renderer->setPage($page);
213
+ $renderer->setLineno($numnber);
214
+ $renderer->setRenderedModel($this);
215
+ $renderer->setProname($proname);
216
+ $renderer->setOrder($order);
217
+
218
+ $renderer->draw();
219
+
220
+ return $renderer->getPage();
221
+ }
222
+
223
+ /* Insert order to pdf page
224
+ *
225
+ * @param Zend_Pdf_Page $page
226
+ * @param Mage_Sales_Model_Order $obj
227
+ * @param bool $putOrderId
228
+ */
229
+ protected function insertOrder(&$page, $obj, $putOrderId = true)
230
+ {
231
+ if ($obj instanceof Mage_Sales_Model_Order) {
232
+ $shipment = null;
233
+ $order = $obj;
234
+ } elseif ($obj instanceof Mage_Sales_Model_Order_Shipment) {
235
+ $shipment = $obj;
236
+ $order = $shipment->getOrder();
237
+ }
238
+
239
+ $this->y = $this->y ? $this->y : 815;
240
+ $top = $this->y;
241
+
242
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.45));
243
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.45));
244
+ $page->drawRectangle(25, $top, 570, $top - 55);
245
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
246
+ $this->setDocHeaderCoordinates(array(25, $top, 570, $top - 55));
247
+ $this->_setFontRegular($page, 10);
248
+
249
+ if ($putOrderId) {
250
+ $page->drawText(
251
+ Mage::helper('sales')->__('Order # ') . $order->getRealOrderId(), 35, ($top -= 30), 'UTF-8'
252
+ );
253
+ }
254
+ $page->drawText(
255
+ Mage::helper('sales')->__('Order Date: ') . Mage::helper('core')->formatDate(
256
+ $order->getCreatedAtStoreDate(), 'medium', false
257
+ ),
258
+ 35,
259
+ ($top -= 15),
260
+ 'UTF-8'
261
+ );
262
+
263
+ $top -= 10;
264
+ $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
265
+ $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
266
+ $page->setLineWidth(0.5);
267
+ $page->drawRectangle(25, $top, 275, ($top - 25));
268
+ $page->drawRectangle(275, $top, 570, ($top - 25));
269
+
270
+ /* Calculate blocks info */
271
+
272
+ /* Billing Address */
273
+ $billingAddress = $this->_formatAddress($order->getBillingAddress()->format('pdf'));
274
+
275
+ /* Payment */
276
+ $paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment())
277
+ ->setIsSecureMode(true)
278
+ ->toPdf();
279
+ $paymentInfo = htmlspecialchars_decode($paymentInfo, ENT_QUOTES);
280
+ $payment = explode('{{pdf_row_separator}}', $paymentInfo);
281
+ foreach ($payment as $key=>$value){
282
+ if (strip_tags(trim($value)) == '') {
283
+ unset($payment[$key]);
284
+ }
285
+ }
286
+ reset($payment);
287
+
288
+ /* Shipping Address and Method */
289
+ if (!$order->getIsVirtual()) {
290
+ /* Shipping Address */
291
+ $shippingAddress = $this->_formatAddress($order->getShippingAddress()->format('pdf'));
292
+ $shippingMethod = $order->getShippingDescription();
293
+ }
294
+
295
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
296
+ $this->_setFontBold($page, 12);
297
+ $page->drawText(Mage::helper('sales')->__('Sold to:'), 35, ($top - 15), 'UTF-8');
298
+
299
+ if (!$order->getIsVirtual()) {
300
+ $page->drawText(Mage::helper('sales')->__('Ship to:'), 285, ($top - 15), 'UTF-8');
301
+ } else {
302
+ $page->drawText(Mage::helper('sales')->__('Payment Method:'), 285, ($top - 15), 'UTF-8');
303
+ }
304
+
305
+ $addressesHeight = $this->_calcAddressHeight($billingAddress);
306
+ if (isset($shippingAddress)) {
307
+ $addressesHeight = max($addressesHeight, $this->_calcAddressHeight($shippingAddress));
308
+ }
309
+
310
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
311
+ $page->drawRectangle(25, ($top - 25), 570, $top - 33 - $addressesHeight);
312
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
313
+ $this->_setFontRegular($page, 10);
314
+ $this->y = $top - 40;
315
+ $addressesStartY = $this->y;
316
+
317
+ foreach ($billingAddress as $value){
318
+ if ($value !== '') {
319
+ $text = array();
320
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
321
+ $text[] = $_value;
322
+ }
323
+ foreach ($text as $part) {
324
+ $page->drawText(strip_tags(ltrim($part)), 35, $this->y, 'UTF-8');
325
+ $this->y -= 15;
326
+ }
327
+ }
328
+ }
329
+
330
+ $addressesEndY = $this->y;
331
+
332
+ if (!$order->getIsVirtual()) {
333
+ $this->y = $addressesStartY;
334
+ foreach ($shippingAddress as $value){
335
+ if ($value!=='') {
336
+ $text = array();
337
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
338
+ $text[] = $_value;
339
+ }
340
+ foreach ($text as $part) {
341
+ $page->drawText(strip_tags(ltrim($part)), 285, $this->y, 'UTF-8');
342
+ $this->y -= 15;
343
+ }
344
+ }
345
+ }
346
+
347
+ $addressesEndY = min($addressesEndY, $this->y);
348
+ $this->y = $addressesEndY;
349
+
350
+ /* $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
351
+ $page->setLineWidth(0.5);
352
+ $page->drawRectangle(25, $this->y, 275, $this->y-25);
353
+ $page->drawRectangle(275, $this->y, 570, $this->y-25);
354
+
355
+ $this->y -= 15;
356
+ $this->_setFontBold($page, 12);
357
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
358
+ $page->drawText(Mage::helper('sales')->__('Payment Method'), 35, $this->y, 'UTF-8');
359
+ $page->drawText(Mage::helper('sales')->__('Shipping Method:'), 285, $this->y , 'UTF-8');
360
+
361
+ $this->y -=10;
362
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));*/
363
+
364
+ $this->_setFontRegular($page, 10);
365
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
366
+
367
+ $paymentLeft = 35;
368
+ $yPayments = $this->y - 15;
369
+ }
370
+ else {
371
+ $yPayments = $addressesStartY;
372
+ $paymentLeft = 285;
373
+ }
374
+
375
+ /*foreach ($payment as $value){
376
+ if (trim($value) != '') {
377
+ //Printing "Payment Method" lines
378
+ $value = preg_replace('/<br[^>]*>/i', "\n", $value);
379
+ foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {
380
+ $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8');
381
+ $yPayments -= 15;
382
+ }
383
+ }
384
+ }*/
385
+
386
+ /*if ($order->getIsVirtual()) {
387
+ // replacement of Shipments-Payments rectangle block
388
+ $yPayments = min($addressesEndY, $yPayments);
389
+ $page->drawLine(25, ($top - 25), 25, $yPayments);
390
+ $page->drawLine(570, ($top - 25), 570, $yPayments);
391
+ $page->drawLine(25, $yPayments, 570, $yPayments);
392
+
393
+ $this->y = $yPayments - 15;
394
+ } else {
395
+ $topMargin = 15;
396
+ $methodStartY = $this->y;
397
+ $this->y -= 15;
398
+
399
+ foreach (Mage::helper('core/string')->str_split($shippingMethod, 45, true, true) as $_value) {
400
+ $page->drawText(strip_tags(trim($_value)), 285, $this->y, 'UTF-8');
401
+ $this->y -= 15;
402
+ }
403
+
404
+ $yShipments = $this->y;
405
+ $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " "
406
+ . $order->formatPriceTxt($order->getShippingAmount()) . ")";
407
+
408
+ $page->drawText($totalShippingChargesText, 285, $yShipments - $topMargin, 'UTF-8');
409
+ $yShipments -= $topMargin + 10;
410
+
411
+ $tracks = array();
412
+ if ($shipment) {
413
+ $tracks = $shipment->getAllTracks();
414
+ }
415
+ if (count($tracks)) {
416
+ $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
417
+ $page->setLineWidth(0.5);
418
+ $page->drawRectangle(285, $yShipments, 510, $yShipments - 10);
419
+ $page->drawLine(400, $yShipments, 400, $yShipments - 10);
420
+ //$page->drawLine(510, $yShipments, 510, $yShipments - 10);
421
+
422
+ $this->_setFontRegular($page, 9);
423
+ $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
424
+ //$page->drawText(Mage::helper('sales')->__('Carrier'), 290, $yShipments - 7 , 'UTF-8');
425
+ $page->drawText(Mage::helper('sales')->__('Title'), 290, $yShipments - 7, 'UTF-8');
426
+ $page->drawText(Mage::helper('sales')->__('Number'), 410, $yShipments - 7, 'UTF-8');
427
+
428
+ $yShipments -= 20;
429
+ $this->_setFontRegular($page, 8);
430
+ foreach ($tracks as $track) {
431
+
432
+ $CarrierCode = $track->getCarrierCode();
433
+ if ($CarrierCode != 'custom') {
434
+ $carrier = Mage::getSingleton('shipping/config')->getCarrierInstance($CarrierCode);
435
+ $carrierTitle = $carrier->getConfigData('title');
436
+ } else {
437
+ $carrierTitle = Mage::helper('sales')->__('Custom Value');
438
+ }
439
+
440
+ //$truncatedCarrierTitle = substr($carrierTitle, 0, 35) . (strlen($carrierTitle) > 35 ? '...' : '');
441
+ $maxTitleLen = 45;
442
+ $endOfTitle = strlen($track->getTitle()) > $maxTitleLen ? '...' : '';
443
+ $truncatedTitle = substr($track->getTitle(), 0, $maxTitleLen) . $endOfTitle;
444
+ //$page->drawText($truncatedCarrierTitle, 285, $yShipments , 'UTF-8');
445
+ $page->drawText($truncatedTitle, 292, $yShipments , 'UTF-8');
446
+ $page->drawText($track->getNumber(), 410, $yShipments , 'UTF-8');
447
+ $yShipments -= $topMargin - 5;
448
+ }
449
+ } else {
450
+ $yShipments -= $topMargin - 5;
451
+ }
452
+
453
+ $currentY = min($yPayments, $yShipments);
454
+
455
+ // replacement of Shipments-Payments rectangle block
456
+ $page->drawLine(25, $methodStartY, 25, $currentY); //left
457
+ $page->drawLine(25, $currentY, 570, $currentY); //bottom
458
+ $page->drawLine(570, $currentY, 570, $methodStartY); //right
459
+
460
+ $this->y = $currentY;
461
+ $this->y -= 15;
462
+ }*/
463
+ }
464
+ /**
465
+ * Create new page and assign to PDF object
466
+ *
467
+ * @param array $settings
468
+ * @return Zend_Pdf_Page
469
+ */
470
+ public function newPage($order)
471
+ {
472
+ /* Add new table head */
473
+ $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_A4);
474
+ $this->_getPdf()->pages[] = $page;
475
+ $this->y = 800;
476
+ if (!empty($settings['table_header'])) {
477
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
478
+ if($swipwzoomorder){
479
+ $this->_packdrawHeader($page);
480
+ }else{
481
+ $this->_drawHeader($page);
482
+ }
483
+ }
484
+ return $page;
485
+ }
486
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Order/Pdf/Shipment/Amasty/Pure.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php /* added automatically by conflict fixing tool */ if (Mage::getConfig()->getNode('modules/Fooman_PdfCustomiser/active')) {
2
+ class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Shipment_Amasty_Pure extends Fooman_PdfCustomiser_Model_Shipment {}
3
+ } else { class Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Shipment_Amasty_Pure extends Mage_Sales_Model_Order_Pdf_Abstract {} } ?>
app/code/local/Swipezoom/InternationalShipping/Model/Sales/Quote/Address/Total/Vat.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Swipezoom_InternationalShipping_Model_Sales_Quote_Address_Total_Vat extends Mage_Sales_Model_Quote_Address_Total_Abstract{
3
+ protected $_code = 'VAT';
4
+
5
+ public function collect(Mage_Sales_Model_Quote_Address $address)
6
+ {
7
+ parent::collect($address);
8
+
9
+ $this->_setAmount(0);
10
+ $this->_setBaseAmount(0);
11
+
12
+ $items = $this->_getAddressItems($address);
13
+ if (!count($items)) {
14
+ return $this; //this makes only address type shipping to come through
15
+ }
16
+
17
+ $quote = $address->getQuote();
18
+
19
+ $fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
20
+ $extraRates = Mage::getSingleton('checkout/session')->getSwipezoomExtraRates();
21
+ $extraRates['CustVatAmount'] = floatval($extraRates['CustVatAmount']);
22
+
23
+ if(!empty($extraRates['CustVatAmount']) && $fullActionName != 'checkout_cart_index') {
24
+ $address->setVatAmount($extraRates['CustVatAmount']);
25
+ $address->setBaseVatAmount($extraRates['CustVatAmount']);
26
+ $quote->setVatAmount($extraRates['CustVatAmount']);
27
+
28
+ $address->setGrandTotal($address->getGrandTotal() + $address->getVatAmount());
29
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseVatAmount());
30
+ }
31
+ }
32
+
33
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
34
+ {
35
+ if ($address->getData('address_type') == 'billing')
36
+ return $this;
37
+
38
+ $fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
39
+
40
+ $amt = floatval($address->getVatAmount());
41
+
42
+ if(!empty($amt) && $fullActionName != 'checkout_cart_index') {
43
+ $address->addTotal(array(
44
+ 'code'=>$this->getCode(),
45
+ 'title'=>'VAT',
46
+ 'value'=> $amt
47
+ ));
48
+ }
49
+ return $this;
50
+ }
51
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Shipmentdetail.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Shipmentdetail
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Shipmentdetail extends Mage_Core_Model_Abstract
10
+ {
11
+ protected function _construct(){
12
+
13
+ $this->_init("internationalshipping/shipmentdetail");
14
+
15
+ }
16
+
17
+ }
18
+
app/code/local/Swipezoom/InternationalShipping/Model/Swipezoomcreditmemo.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Swipezoomcreditmemo
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Swipezoomcreditmemo extends Mage_Core_Model_Abstract
10
+ {
11
+ protected function _construct(){
12
+
13
+ $this->_init("internationalshipping/swipezoomcreditmemo");
14
+
15
+ }
16
+
17
+ }
18
+
app/code/local/Swipezoom/InternationalShipping/Model/System/Config/Source/Extmode.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Swipezoom_InternationalShipping_Model_System_Config_Source_Extmode
4
+ {
5
+ /**
6
+ * Options getter
7
+ *
8
+ * @return array
9
+ */
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array('value' => 0, 'label'=>Mage::helper('adminhtml')->__('Development')),
14
+ array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Production')),
15
+ );
16
+ }
17
+
18
+ /**
19
+ * Get options in "key-value" format
20
+ *
21
+ * @return array
22
+ */
23
+ public function toArray()
24
+ {
25
+ return array(
26
+ 0 => Mage::helper('adminhtml')->__('Development'),
27
+ 1 => Mage::helper('adminhtml')->__('Production'),
28
+ );
29
+ }
30
+
31
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Total/Vat/Creditmemo.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Total_Vat_Creditmemo
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Total_Vat_Creditmemo extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
10
+ {
11
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
12
+ {
13
+ $order = $creditmemo->getOrder();
14
+ $amount = floatval($order->getVatAmount());
15
+
16
+ if (!empty($amount)) {
17
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $amount);
18
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $amount);
19
+ }
20
+
21
+ return $this;
22
+ }
23
+ }
24
+
app/code/local/Swipezoom/InternationalShipping/Model/Total/Vat/Invoice.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Model_Total_Vat_Invoice
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_Model_Total_Vat_Invoice extends Mage_Sales_Model_Order_Invoice_Total_Abstract
10
+ {
11
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
12
+ {
13
+ $order = $invoice->getOrder();
14
+
15
+ $amount = floatval($order->getVatAmount());
16
+ if (!empty($amount)) {
17
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $amount);
18
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $amount);
19
+ }
20
+
21
+ return $this;
22
+ }
23
+ }
24
+
app/code/local/Swipezoom/InternationalShipping/Model/Validation/Abstract.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Validation_Abstract
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Validation_Abstract extends Mage_Customer_Model_Address_Abstract
9
+ {
10
+
11
+ public function validate()
12
+ {
13
+ $errors = array();
14
+ $this->implodeStreetAddress();
15
+ if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
16
+ $errors[] = Mage::helper('customer')->__('Please enter the first name.');
17
+ }
18
+
19
+ if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
20
+ $errors[] = Mage::helper('customer')->__('Please enter the last name.');
21
+ }
22
+
23
+ if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
24
+ $errors[] = Mage::helper('customer')->__('Please enter the street.');
25
+ }
26
+
27
+ if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) {
28
+ $errors[] = Mage::helper('customer')->__('Please enter the city.');
29
+ }
30
+
31
+ if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
32
+ $errors[] = Mage::helper('customer')->__('Please enter the telephone number.');
33
+ }
34
+
35
+ $_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
36
+ if (!in_array($this->getCountryId(), $_havingOptionalZip)
37
+ && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')
38
+ ) {
39
+ $errors[] = Mage::helper('customer')->__('Please enter the zip/postal code.');
40
+ }
41
+
42
+ if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
43
+ $errors[] = Mage::helper('customer')->__('Please enter the country.');
44
+ }
45
+
46
+ if ($this->getCountryModel()->getRegionCollection()->getSize()
47
+ && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')
48
+ && Mage::helper('directory')->isRegionRequired($this->getCountryId())
49
+ ) {
50
+ $errors[] = Mage::helper('customer')->__('Please enter the state/province.');
51
+ }
52
+
53
+ if (empty($errors) || $this->getShouldIgnoreValidation()) {
54
+ return true;
55
+ }
56
+ return $errors;
57
+ }
58
+
59
+ }
app/code/local/Swipezoom/InternationalShipping/Model/Validation/Address.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Swipezoom_InternationalShipping_Model_Validation_Address
4
+ *
5
+ * @author Swipezoom
6
+ */
7
+
8
+ class Swipezoom_InternationalShipping_Model_Validation_Address extends Mage_Customer_Model_Address
9
+ {
10
+
11
+ public function validate()
12
+ {
13
+ $errors = array();
14
+ $this->implodeStreetAddress();
15
+ if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
16
+ $errors[] = Mage::helper('customer')->__('Please enter the first name.');
17
+ }
18
+
19
+ if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
20
+ $errors[] = Mage::helper('customer')->__('Please enter the last name.');
21
+ }
22
+
23
+ if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
24
+ $errors[] = Mage::helper('customer')->__('Please enter the street.');
25
+ }
26
+
27
+ if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) {
28
+ $errors[] = Mage::helper('customer')->__('Please enter the city.');
29
+ }
30
+
31
+ if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
32
+ $errors[] = Mage::helper('customer')->__('Please enter the telephone number.');
33
+ }
34
+
35
+ $_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
36
+ if (!in_array($this->getCountryId(), $_havingOptionalZip)
37
+ && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')
38
+ ) {
39
+ $errors[] = Mage::helper('customer')->__('Please enter the zip/postal code.');
40
+ }
41
+
42
+ if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
43
+ $errors[] = Mage::helper('customer')->__('Please enter the country.');
44
+ }
45
+
46
+ if ($this->getCountryModel()->getRegionCollection()->getSize()
47
+ && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')
48
+ && Mage::helper('directory')->isRegionRequired($this->getCountryId())
49
+ ) {
50
+ $errors[] = Mage::helper('customer')->__('Please enter the state/province.');
51
+ }
52
+
53
+ if (empty($errors) || $this->getShouldIgnoreValidation()) {
54
+ return true;
55
+ }
56
+ return $errors;
57
+ }
58
+
59
+ }
app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/CreateController.php ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreateController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once "Mage/Adminhtml/controllers/Sales/Order/CreateController.php";
10
+ class Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController{
11
+
12
+ protected function _processActionData($action = null)
13
+ {
14
+ Mage::log('niraj',null,'niraj.log');
15
+ $eventData = array(
16
+ 'order_create_model' => $this->_getOrderCreateModel(),
17
+ 'request_model' => $this->getRequest(),
18
+ 'session' => $this->_getSession(),
19
+ );
20
+
21
+ Mage::dispatchEvent('adminhtml_sales_order_create_process_data_before', $eventData);
22
+
23
+ /**
24
+ * Saving order data
25
+ */
26
+ if ($data = $this->getRequest()->getPost('order')) {
27
+ $this->_getOrderCreateModel()->importPostData($data);
28
+ }
29
+
30
+ /**
31
+ * Initialize catalog rule data
32
+ */
33
+ $this->_getOrderCreateModel()->initRuleData();
34
+
35
+ /**
36
+ * init first billing address, need for virtual products
37
+ */
38
+ $this->_getOrderCreateModel()->getBillingAddress();
39
+
40
+ /**
41
+ * Flag for using billing address for shipping
42
+ */
43
+ if (!$this->_getOrderCreateModel()->getQuote()->isVirtual()) {
44
+ $syncFlag = $this->getRequest()->getPost('shipping_as_billing');
45
+ $shippingMethod = $this->_getOrderCreateModel()->getShippingAddress()->getShippingMethod();
46
+ if (is_null($syncFlag)
47
+ && $this->_getOrderCreateModel()->getShippingAddress()->getSameAsBilling()
48
+ && empty($shippingMethod)
49
+ ) {
50
+ $this->_getOrderCreateModel()->setShippingAsBilling(1);
51
+ } else {
52
+ $this->_getOrderCreateModel()->setShippingAsBilling((int)$syncFlag);
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Change shipping address flag
58
+ */
59
+ if (!$this->_getOrderCreateModel()->getQuote()->isVirtual() && $this->getRequest()->getPost('reset_shipping')) {
60
+ $this->_getOrderCreateModel()->resetShippingMethod(true);
61
+ }
62
+
63
+ /**
64
+ * Collecting shipping rates
65
+ */
66
+ if (!$this->_getOrderCreateModel()->getQuote()->isVirtual() &&
67
+ $this->getRequest()->getPost('collect_shipping_rates')
68
+ ) {
69
+ $this->_getOrderCreateModel()->collectShippingRates();
70
+ }
71
+
72
+
73
+ /**
74
+ * Apply mass changes from sidebar
75
+ */
76
+ if ($data = $this->getRequest()->getPost('sidebar')) {
77
+ $this->_getOrderCreateModel()->applySidebarData($data);
78
+ }
79
+
80
+ /**
81
+ * Adding product to quote from shopping cart, wishlist etc.
82
+ */
83
+ if ($productId = (int) $this->getRequest()->getPost('add_product')) {
84
+ $this->_getOrderCreateModel()->addProduct($productId, $this->getRequest()->getPost());
85
+ }
86
+
87
+ /**
88
+ * Adding products to quote from special grid
89
+ */
90
+ if ($this->getRequest()->has('item') && !$this->getRequest()->getPost('update_items') && !($action == 'save')) {
91
+ $items = $this->getRequest()->getPost('item');
92
+ $items = $this->_processFiles($items);
93
+ $this->_getOrderCreateModel()->addProducts($items);
94
+ }
95
+
96
+ /**
97
+ * Update quote items
98
+ */
99
+ if ($this->getRequest()->getPost('update_items')) {
100
+ $items = $this->getRequest()->getPost('item', array());
101
+ $items = $this->_processFiles($items);
102
+ $this->_getOrderCreateModel()->updateQuoteItems($items);
103
+ }
104
+
105
+ /**
106
+ * Remove quote item
107
+ */
108
+ $removeItemId = (int) $this->getRequest()->getPost('remove_item');
109
+ $removeFrom = (string) $this->getRequest()->getPost('from');
110
+ if ($removeItemId && $removeFrom) {
111
+ $this->_getOrderCreateModel()->removeItem($removeItemId, $removeFrom);
112
+ }
113
+
114
+ /**
115
+ * Move quote item
116
+ */
117
+ $moveItemId = (int) $this->getRequest()->getPost('move_item');
118
+ $moveTo = (string) $this->getRequest()->getPost('to');
119
+ if ($moveItemId && $moveTo) {
120
+ $this->_getOrderCreateModel()->moveQuoteItem($moveItemId, $moveTo);
121
+ }
122
+
123
+ /*if ($paymentData = $this->getRequest()->getPost('payment')) {
124
+ $this->_getOrderCreateModel()->setPaymentData($paymentData);
125
+ }*/
126
+ if ($paymentData = $this->getRequest()->getPost('payment')) {
127
+ $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
128
+ }
129
+
130
+ $eventData = array(
131
+ 'order_create_model' => $this->_getOrderCreateModel(),
132
+ 'request' => $this->getRequest()->getPost(),
133
+ );
134
+
135
+ Mage::dispatchEvent('adminhtml_sales_order_create_process_data', $eventData);
136
+
137
+ $this->_getOrderCreateModel()
138
+ ->saveQuote();
139
+
140
+ if ($paymentData = $this->getRequest()->getPost('payment')) {
141
+ $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
142
+ }
143
+
144
+ /**
145
+ * Saving of giftmessages
146
+ */
147
+ $giftmessages = $this->getRequest()->getPost('giftmessage');
148
+ if ($giftmessages) {
149
+ $this->_getGiftmessageSaveModel()->setGiftmessages($giftmessages)
150
+ ->saveAllInQuote();
151
+ }
152
+
153
+ /**
154
+ * Importing gift message allow items from specific product grid
155
+ */
156
+ if ($data = $this->getRequest()->getPost('add_products')) {
157
+ $this->_getGiftmessageSaveModel()
158
+ ->importAllowQuoteItemsFromProducts(Mage::helper('core')->jsonDecode($data));
159
+ }
160
+
161
+ /**
162
+ * Importing gift message allow items on update quote items
163
+ */
164
+ if ($this->getRequest()->getPost('update_items')) {
165
+ $items = $this->getRequest()->getPost('item', array());
166
+ $this->_getGiftmessageSaveModel()->importAllowQuoteItemsFromItems($items);
167
+ }
168
+
169
+
170
+
171
+ $data = $this->getRequest()->getPost('order');
172
+ $couponCode = '';
173
+ if (isset($data) && isset($data['coupon']['code'])) {
174
+ $couponCode = trim($data['coupon']['code']);
175
+ }
176
+ if (!empty($couponCode)) {
177
+ if ($this->_getQuote()->getCouponCode() !== $couponCode) {
178
+ $this->_getSession()->addError(
179
+ $this->__('"%s" coupon code is not valid.', $this->_getHelper()->escapeHtml($couponCode)));
180
+ } else {
181
+ $this->_getSession()->addSuccess($this->__('The coupon code has been accepted.'));
182
+ }
183
+ }
184
+
185
+ return $this;
186
+ }
187
+
188
+
189
+ /**
190
+ * Loading page block
191
+ */
192
+ public function loadBlockAction()
193
+ {
194
+ Mage::log('1',null,'niraj.log');
195
+ $request = $this->getRequest();
196
+ try {
197
+ $this->_initSession()
198
+ ->_processData();
199
+ }
200
+ catch (Mage_Core_Exception $e){
201
+ $this->_reloadQuote();
202
+ $this->_getSession()->addError($e->getMessage());
203
+ }
204
+ catch (Exception $e){
205
+ $this->_reloadQuote();
206
+ $this->_getSession()->addException($e, $e->getMessage());
207
+ }
208
+
209
+
210
+ if ($this->getRequest()->getPost('update_items') && $this->getRequest()->getPost('szorderid')) {
211
+ Mage::register('szorderid', $this->getRequest()->getPost('szorderid'));
212
+ $this->_getQuote()->setSwipezoomOrderNumber($this->getRequest()->getPost('szorderid'))->save();
213
+ }
214
+ $asJson= $request->getParam('json');
215
+ $block = $request->getParam('block');
216
+
217
+ $update = $this->getLayout()->getUpdate();
218
+ if ($asJson) {
219
+ $update->addHandle('adminhtml_sales_order_create_load_block_json');
220
+ } else {
221
+ $update->addHandle('adminhtml_sales_order_create_load_block_plain');
222
+ }
223
+
224
+ if ($block) {
225
+ $blocks = explode(',', $block);
226
+ if ($asJson && !in_array('message', $blocks)) {
227
+ $blocks[] = 'message';
228
+ }
229
+
230
+ foreach ($blocks as $block) {
231
+ $update->addHandle('adminhtml_sales_order_create_load_block_' . $block);
232
+ }
233
+ }
234
+ $this->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks();
235
+ $result = $this->getLayout()->getBlock('content')->toHtml();
236
+ if ($request->getParam('as_js_varname')) {
237
+ Mage::getSingleton('adminhtml/session')->setUpdateResult($result);
238
+ $this->_redirect('*/*/showUpdateResult');
239
+ } else {
240
+ $this->getResponse()->setBody($result);
241
+ }
242
+ }
243
+
244
+ public function showUpdateResultAction()
245
+ {
246
+ Mage::log('niraj',null,'niraj.log');
247
+ $session = Mage::getSingleton('adminhtml/session');
248
+ if ($session->hasUpdateResult() && is_scalar($session->getUpdateResult())){
249
+ $this->getResponse()->setBody($session->getUpdateResult());
250
+ $session->unsUpdateResult();
251
+ } else {
252
+ $session->unsUpdateResult();
253
+ return false;
254
+ }
255
+ }
256
+ }
257
+
app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/CreditmemoController.php ADDED
@@ -0,0 +1,702 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreditmemoController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once "Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php";
10
+ class Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreditmemoController extends Mage_Adminhtml_Sales_Order_CreditmemoController{
11
+ public function newAction()
12
+ {
13
+ if ($creditmemo = $this->_initCreditmemo()) {
14
+ if ($creditmemo->getInvoice()) {
15
+ $this->_title($this->__("New Memo for #%s", $creditmemo->getInvoice()->getIncrementId()));
16
+ } else {
17
+ $this->_title($this->__("New Memo"));
18
+ }
19
+
20
+ if ($comment = Mage::getSingleton('adminhtml/session')->getCommentText(true)) {
21
+ $creditmemo->setCommentText($comment);
22
+ }
23
+
24
+
25
+ $this->loadLayout()
26
+ ->_setActiveMenu('sales/order')
27
+ ->renderLayout();
28
+
29
+ } else {
30
+ $this->_forward('noRoute');
31
+ }
32
+ }
33
+
34
+ public function saveAction()
35
+ {
36
+
37
+ $data = $this->getRequest()->getPost('creditmemo');
38
+ if (!empty($data['comment_text'])) {
39
+ Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
40
+ }
41
+
42
+ try {
43
+ $creditmemo = $this->_initCreditmemo();
44
+ $orderId = $this->getRequest()->getParam('order_id');
45
+ $order = Mage::getModel('sales/order')->load($orderId);
46
+ if($order->getSwipezoomOrderNumberTemp()){
47
+ if(!$this->getRequest()->getPost('reasoncode')){
48
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Please choose Refund option'));
49
+ $this->_redirect('adminhtml/sales_order_creditmemo/new', array('order_id' => $this->getRequest()->getParam('order_id')));
50
+ return;
51
+ }
52
+ $this->checkstatusavail();
53
+ // $creditmemo = $this->_initCreditmemo();
54
+ $orderId = $this->getRequest()->getParam('order_id');
55
+ $order = Mage::getModel('sales/order')->load($orderId);
56
+ $params = array("Caller" => $this->getCallerArray(),"RogOrderNo" =>$order->getSwipezoomOrderNumberTemp(),"RogRefundOption"=> $this->getRequest()->getPost('reasoncode'));
57
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
58
+ $response = $client->RogRefundActivate($params);
59
+ $statuscheck=$response->ResponseStatusCode;
60
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
61
+ if($statuscheck=="000"){
62
+ $swipezoomcreditmemo= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('reforderno',$this->getRequest()->getParam('order_id'));
63
+ foreach($swipezoomcreditmemo as $singlememo){
64
+ $parentorder = Mage::getModel('sales/order')->load($singlememo->getRealorderno());
65
+ break;
66
+ }
67
+
68
+ $parentorder->addStatusHistoryComment('Refund Confirmed', 'refund_confirmed')->save();
69
+
70
+ }else{
71
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'RogRefundActivate');
72
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
73
+ if($debugmode){
74
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($statuscheck.' : '.$ResponseStatusDesc));
75
+ }else{
76
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Credit Memo Action (Swipezoom Refund Confirm service)'));
77
+ }
78
+ $this->_redirect('adminhtml/sales_order_creditmemo/new', array('order_id' => $this->getRequest()->getParam('order_id')));
79
+ return;
80
+ }
81
+
82
+ }
83
+
84
+
85
+ if ($creditmemo) {
86
+ if (($creditmemo->getGrandTotal() <=0) && (!$creditmemo->getAllowZeroGrandTotal())) {
87
+ Mage::throwException(
88
+ $this->__('Credit memo\'s total must be positive.')
89
+ );
90
+ }
91
+
92
+ $comment = '';
93
+ if (!empty($data['comment_text'])) {
94
+ $creditmemo->addComment(
95
+ $data['comment_text'],
96
+ isset($data['comment_customer_notify']),
97
+ isset($data['is_visible_on_front'])
98
+ );
99
+ if (isset($data['comment_customer_notify'])) {
100
+ $comment = $data['comment_text'];
101
+ }
102
+ }
103
+
104
+ if (isset($data['do_refund'])) {
105
+ $creditmemo->setRefundRequested(true);
106
+ }
107
+ if (isset($data['do_offline'])) {
108
+ $creditmemo->setOfflineRequested((bool)(int)$data['do_offline']);
109
+ }
110
+
111
+ $creditmemo->register();
112
+ if (!empty($data['send_email'])) {
113
+ $creditmemo->setEmailSent(true);
114
+ }
115
+
116
+ $creditmemo->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
117
+ $this->_saveCreditmemo($creditmemo);
118
+
119
+ if($order->getSwipezoomOrderNumberTemp() && empty($data['send_email'])){
120
+ $sendmail = false;
121
+ }else{
122
+ $sendmail = empty($data['send_email']);
123
+ }
124
+ if(!$order->getSwipezoomOrderNumberTemp()){
125
+ $creditmemo->sendEmail(!$sendmail, $comment);
126
+ }else{
127
+ $creditmemo->setEmailSent(true);
128
+ }
129
+ $this->_getSession()->addSuccess($this->__('The credit memo has been created.'));
130
+ Mage::getSingleton('adminhtml/session')->getCommentText(true);
131
+
132
+ if($order->getSwipezoomOrderNumberTemp()){
133
+ $orderId = $this->getRequest()->getParam('order_id');
134
+ $order = Mage::getModel('sales/order')->load($orderId);
135
+
136
+ $order->addStatusToHistory('refund_confirmed', 'Refund Confirmed', false);
137
+ $order->save();
138
+
139
+ $swipezoomcreditmemo= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('reforderno',$this->getRequest()->getParam('order_id'));
140
+ if(count($swipezoomcreditmemo)){
141
+ foreach($swipezoomcreditmemo as $parent){
142
+ $orderparent = Mage::getModel('sales/order')->load($parent->getRealorderno());
143
+ /*$un = unserialize($parent->getCreditmemoitems());
144
+
145
+ $dif = array();
146
+ foreach($un as $u){
147
+ $dif[] = array('order_item_id' => $u['itemid'],'qty'=>$u['Quantity'],'back_to_stock'=>1);
148
+ }
149
+
150
+ if ($orderparent->hasInvoices()) {
151
+ // $invIncrementIDs = array();
152
+ foreach ($orderparent->getInvoiceCollection() as $inv) {
153
+ $invIncrementIDs = $inv->getIncrementId();
154
+ break;
155
+ //other invoice details...
156
+ }
157
+ }
158
+
159
+ $info = array("order_increment_id" => $orderparent->getIncrementId(), "invoice_id" => $invIncrementIDs,'shipping_amount'=>$creditmemo->getShippingAmount());
160
+ $this->createparentcredtimemo($dif, $info);*/
161
+ $orderparent->addStatusToHistory('void', 'Void', false);
162
+ $orderparent->save();
163
+ }
164
+ }
165
+
166
+ }
167
+ $this->_redirect('*/sales_order/view', array('order_id' => $creditmemo->getOrderId()));
168
+ return;
169
+ } else {
170
+ $this->_forward('noRoute');
171
+ return;
172
+ }
173
+ } catch (Mage_Core_Exception $e) {
174
+ $this->_getSession()->addError($e->getMessage());
175
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
176
+ } catch (Exception $e) {
177
+ Mage::logException($e);
178
+ $this->_getSession()->addError($this->__('Cannot save the credit memo.'));
179
+ }
180
+ $this->_redirect('*/*/new', array('_current' => true));
181
+ }
182
+
183
+ protected function createparentcredtimemo($dif, $info)
184
+ {
185
+ $qtys = array();
186
+
187
+ foreach ($dif as $item) {
188
+ if (isset($item['qty'])) {
189
+ $qtys[$item['order_item_id']] = array("qty"=> $item['qty']);
190
+ }
191
+ if (isset($item['back_to_stock'])) {
192
+ $backToStock[$item['order_item_id']] = true;
193
+ }
194
+ }
195
+ if($info['shipping_amount']){
196
+ $shipping_amount = $info['shipping_amount'];
197
+ }else{
198
+ $shipping_amount = 0;
199
+ }
200
+ $data = array(
201
+ "items" => $qtys,
202
+ "do_offline" => "1",
203
+ "comment_text" => "",
204
+ "shipping_amount" => $shipping_amount ,
205
+ "adjustment_positive" => "0",
206
+ "adjustment_negative" => "0",
207
+ );
208
+ if (!empty($data['comment_text'])) {
209
+ Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
210
+ }
211
+
212
+ try {
213
+ $creditmemo = $this->_initparentCreditmemo($data, $info);
214
+ if ($creditmemo) {
215
+ if (($creditmemo->getGrandTotal() <=0) && (!$creditmemo->getAllowZeroGrandTotal())) {
216
+ Mage::throwException(
217
+ $this->__('Credit memo\'s total must be positive.')
218
+ );
219
+ }
220
+
221
+ $comment = '';
222
+ if (!empty($data['comment_text'])) {
223
+ $creditmemo->addComment(
224
+ $data['comment_text'],
225
+ isset($data['comment_customer_notify']),
226
+ isset($data['is_visible_on_front'])
227
+ );
228
+ if (isset($data['comment_customer_notify'])) {
229
+ $comment = $data['comment_text'];
230
+ }
231
+ }
232
+
233
+ if (isset($data['do_refund'])) {
234
+ $creditmemo->setRefundRequested(true);
235
+ }
236
+ if (isset($data['do_offline'])) {
237
+ $creditmemo->setOfflineRequested((bool)(int)$data['do_offline']);
238
+ }
239
+
240
+ $creditmemo->register();
241
+ //if (!empty($data['send_email'])) {
242
+ $creditmemo->setEmailSent(true);
243
+ //}
244
+
245
+ $creditmemo->getOrder()->setCustomerNoteNotify(1);//!empty($data['send_email'])
246
+ $this->_saveCreditmemo($creditmemo);
247
+ $creditmemo->sendEmail(true, $comment); //!empty($data['send_email'])
248
+
249
+ $order = $creditmemo->getOrder();
250
+ $order->addStatusToHistory('void', 'Void', false);
251
+ $order->save();
252
+
253
+ Mage::getSingleton('adminhtml/session')->getCommentText(true);
254
+ return;
255
+ } else {
256
+ //$this->_forward('noRoute');
257
+ //return;
258
+ }
259
+ } catch (Mage_Core_Exception $e) {
260
+ $this->_getSession()->addError($e->getMessage());
261
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
262
+ } catch (Exception $e) {
263
+ Mage::logException($e);
264
+ $this->_getSession()->addError($this->__('Cannot save the credit memo.'));
265
+ }
266
+ }
267
+
268
+ protected function _initparentCreditmemo($data, $info, $update = false){
269
+ $creditmemo = false;
270
+ $invoice=false;
271
+ $creditmemoId = null;//$this->getRequest()->getParam('creditmemo_id');
272
+ $orderId = $info['order_increment_id'];//$this->getRequest()->getParam('order_id');
273
+ $invoiceId = $data['invoice_id'];
274
+ //echo "<br>abans if. OrderId: ".$orderId;
275
+ if ($creditmemoId) {
276
+ $creditmemo = Mage::getModel('sales/order_creditmemo')->load($creditmemoId);
277
+ } elseif ($orderId) {
278
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
279
+ if ($invoiceId) {
280
+ $invoice = Mage::getModel('sales/order_invoice')
281
+ ->load($invoiceId)
282
+ ->setOrder($order);
283
+ //echo '<br>loaded_invoice_number: '.$invoice->getId();
284
+ }
285
+
286
+ if (!$order->canCreditmemo()) {
287
+ //echo '<br>cannot create credit memo';
288
+ if(!$order->isPaymentReview())
289
+ {
290
+ // echo '<br>cannot credit memo Payment is in review';
291
+ Mage::getModel('core/session')->addError($this->__('cannot credit memo Payment is in review'));
292
+ }
293
+ if(!$order->canUnhold())
294
+ {
295
+ Mage::getModel('core/session')->addError($this->__('cannot credit memo Order is on hold'));
296
+ // echo '<br>cannot credit memo Order is on hold';
297
+ }
298
+ if(abs($order->getTotalPaid()-$order->getTotalRefunded())<.0001)
299
+ {
300
+ Mage::getModel('core/session')->addError($this->__('cannot credit memo Amount Paid is equal or less than amount refunded'));
301
+ //echo '<br>cannot credit memo Amount Paid is equal or less than amount refunded';
302
+ }
303
+ if($order->getActionFlag('edit') === false)
304
+ {
305
+ Mage::getModel('core/session')->addError($this->__('cannot credit memo Action Flag of Edit not set'));
306
+ //echo '<br>cannot credit memo Action Flag of Edit not set';
307
+ }
308
+ if ($order->hasForcedCanCreditmemo()) {
309
+ Mage::getModel('core/session')->addError($this->__('cannot credit memo Can Credit Memo has been forced set'));
310
+ //echo '<br>cannot credit memo Can Credit Memo has been forced set';
311
+ }
312
+ return false;
313
+ }
314
+
315
+ $savedData = array();
316
+ if (isset($data['items'])) {
317
+ $savedData = $data['items'];
318
+ } else {
319
+ $savedData = array();
320
+ }
321
+
322
+ $qtys = array();
323
+ $backToStock = array();
324
+ foreach ($savedData as $orderItemId =>$itemData) {
325
+ if (isset($itemData['qty'])) {
326
+ $qtys[$orderItemId] = $itemData['qty'];
327
+ }
328
+ if (isset($itemData['back_to_stock'])) {
329
+ $backToStock[$orderItemId] = true;
330
+ }
331
+ }
332
+ $data['qtys'] = $qtys;
333
+
334
+ $service = Mage::getModel('sales/service_order', $order);
335
+ if ($invoice) {
336
+ $creditmemo = $service->prepareInvoiceCreditmemo($invoice, $data);
337
+ } else {
338
+ $creditmemo = $service->prepareCreditmemo($data);
339
+ }
340
+
341
+ /**
342
+ * Process back to stock flags
343
+ */
344
+ foreach ($creditmemo->getAllItems() as $creditmemoItem) {
345
+ $orderItem = $creditmemoItem->getOrderItem();
346
+ $parentId = $orderItem->getParentItemId();
347
+ if (isset($backToStock[$orderItem->getId()])) {
348
+ $creditmemoItem->setBackToStock(true);
349
+ } elseif ($orderItem->getParentItem() && isset($backToStock[$parentId]) && $backToStock[$parentId]) {
350
+ $creditmemoItem->setBackToStock(true);
351
+ } elseif (empty($savedData)) {
352
+ $creditmemoItem->setBackToStock(Mage::helper('cataloginventory')->isAutoReturnEnabled());
353
+ } else {
354
+ $creditmemoItem->setBackToStock(false);
355
+ }
356
+ }
357
+ }
358
+
359
+ return $creditmemo;
360
+ }
361
+
362
+
363
+ public function checkstatusavail(){
364
+ /** * Adding New status */
365
+ $status = Mage::getModel('sales/order_status')->load('refund');
366
+ if(!$status->getStatus()){
367
+ $data['label'] = 'Refund';
368
+ $data['status'] = 'refund';
369
+ $status->setData($data)->setStatus('refund');
370
+ $status->save();$status->assignState('complete', '0');
371
+ }
372
+ $status = Mage::getModel('sales/order_status')->load('refund_reqsted');
373
+ if(!$status->getStatus()){
374
+ $data['label'] = 'Refund Requested';
375
+ $data['status'] = 'refund_reqsted';
376
+ $status->setData($data)->setStatus('refund_reqsted');
377
+ $status->save();$status->assignState('complete', '0');
378
+ }
379
+ $status = Mage::getModel('sales/order_status')->load('refund_confirmed');
380
+ if(!$status->getStatus()){
381
+ $data['label'] = 'Refund Confirmed';
382
+ $data['status'] = 'refund_confirmed';
383
+ $status->setData($data)->setStatus('refund_confirmed');
384
+ $status->save();$status->assignState('complete', '0');
385
+ }
386
+ $status = Mage::getModel('sales/order_status')->load('void');
387
+ if(!$status->getStatus()){
388
+ $data['label'] = 'Void';
389
+ $data['status'] = 'void';
390
+ $status->setData($data)->setStatus('void');
391
+ $status->save();$status->assignState('complete', '0');
392
+ }
393
+ /** * Adding New status */
394
+ }
395
+
396
+ /**
397
+ * Update items qty action
398
+ */
399
+ public function updateQtynewAction()
400
+ {
401
+ try {
402
+ $data = $this->getRequest()->getPost();
403
+ //print_r($data);
404
+ $orderId = $this->getRequest()->getParam('order_id');
405
+ $order = Mage::getModel('sales/order')->load($orderId);
406
+
407
+
408
+ $this->checkstatusavail();
409
+
410
+ /** * Credit memo items */
411
+ $creditmemo = $this->_initCreditmemo(true);
412
+
413
+ /** * Credit memo items */
414
+
415
+ if($data['returnauthentication'] && $data['reasoncode']){
416
+
417
+ $newitemarray = array();
418
+ $itemarray = array();
419
+ foreach ($creditmemo->getAllItems() as $creditmemoItem) {
420
+ if( $creditmemoItem->getQty()){
421
+ $orderItem = $creditmemoItem->getOrderItem();
422
+ $itemarray[] = array('ProductCode' => $creditmemoItem->getSku(), 'Quantity' => $creditmemoItem->getQty());
423
+ $newitemarray[] = array('itemid' => $creditmemoItem->getOrderItemId(),'ProductCode' => $creditmemoItem->getSku(), 'Quantity' => $creditmemoItem->getQty());
424
+ }
425
+ }
426
+
427
+
428
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$order->getSwipezoomOrderNumberTemp(),"ReturnAuthentication"=>$data['returnauthentication'],"ROGReasonCode"=>$data['reasoncode'],"ProductLineItems"=>$itemarray );
429
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
430
+ $response1 = $client->RogRefundReq($params);
431
+ }else{
432
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Please enter Return Authentication and Reason Code'));
433
+ }
434
+
435
+ Mage::log($response1,null,'SW_CreditMemo_'.$order->getSwipezoomOrderNumberTemp().'.log');
436
+ if($order->getSwipezoomOrderNumberTemp()){
437
+ if($response1->ResponseStatusCode=="000"){
438
+
439
+ $newreforderid = $response1->RogActivityDetail->RogOrderNo;
440
+
441
+ $folder1 = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS;
442
+ if (!(@is_dir($folder1) || @mkdir($folder1, 0777, true))) {
443
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__( "Unable to create directory '{$folder1}'."));
444
+ }
445
+ $folder = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $newreforderid. DS ;
446
+ if (!(@is_dir($folder) || @mkdir($folder, 0777, true))) {
447
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__( "Unable to create directory '{$folder}'."));
448
+ }
449
+ foreach( glob( $folder.'*.pdf' ) as $filename ) { chmod($filename, 0777); }
450
+ foreach( glob( $folder.'*.zip' ) as $filename ) {chmod($filename, 0777);}
451
+
452
+ //$folder = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $newreforderid . DS ;
453
+ //mkdir($folder);
454
+ $imageFilename = basename($response1->File->FileName);
455
+ $image_type = substr(strrchr($imageFilename,"."),1);
456
+ $zipfile= $filename = $imageFilename;
457
+ $filepath = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $newreforderid. DS . $filename;
458
+ $newImgUrl = file_put_contents($filepath, $response1->File->Contents);
459
+ $zip = new ZipArchive;
460
+ if ($zip->open($filepath) === TRUE) {
461
+ $zip->extractTo(Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $newreforderid. DS);
462
+ $zip->close();
463
+ }
464
+ /** * Create new order */
465
+ $id = $neworder = $this->creteorder($order->getCustomerId(),$itemarray,$this->getRequest()->getParam('order_id'),$newreforderid);// $response1->RogActivityDetail->RogOrderNo);
466
+
467
+ /** * Create new order */
468
+
469
+ $order->setSwipezoomOrderCreditmemo('2')->save();
470
+ $order->addStatusToHistory('refund', 'Do Refund', false);
471
+ $order->save();
472
+
473
+
474
+ $swipezoomcreditmemo= Mage::getModel('internationalshipping/swipezoomcreditmemo')->setId()->setSwipezoomorderid($order->getSwipezoomOrderNumberTemp())->setRealorderno($order->getId())->setRefswipezoomorderid($newreforderid)->setReforderno($id)->setCreditmemoitems(serialize($newitemarray))->save();
475
+
476
+ $neworder= Mage::getModel('sales/order')->load($neworder)->setSwipezoomOrderCreditmemo($order->getIncrementId())->save();
477
+ $neworder= Mage::getModel('sales/order')->load($id);//->addStatusHistoryComment('', 'refund')->save();
478
+ $neworder->addStatusToHistory('refund_reqsted', 'Refund Requested', false);
479
+ $neworder->save();
480
+
481
+
482
+ $response = array(
483
+ 'ajaxRedirect' => $this->getUrl('adminhtml/sales_order/index' ),//, array('order_id'=>$id)
484
+ 'ajaxExpired' => true
485
+ );
486
+ $response = Mage::helper('core')->jsonEncode($response);
487
+
488
+ }else{
489
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response1,'RogRefundReq');
490
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
491
+ if($debugmode){
492
+ $message = $response1->ResponseStatusDesc;
493
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($response1->ResponseStatusCode.' : '.$message));
494
+ }else{
495
+ $message = 'Unable to perform Credti Memo Action (Swipezoom Refund Request service)';
496
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Credti Memo Action (Swipezoom Refund Request service)'));
497
+ }
498
+
499
+
500
+
501
+ $response = array(
502
+ 'error' => true,
503
+ 'message' => $message,
504
+ 'ajaxRedirect' => $this->getUrl('adminhtml/sales_order_creditmemo/new' , array('order_id'=>$orderId)),
505
+ 'ajaxExpired' => true
506
+ );
507
+ $response = Mage::helper('core')->jsonEncode($response);
508
+ }
509
+ }
510
+ } catch (Mage_Core_Exception $e) {
511
+ $response = array(
512
+ 'error' => true,
513
+ 'message' => $e->getMessage(),
514
+ 'ajaxRedirect' => $this->getUrl('adminhtml/sales_order_creditmemo/new' , array('order_id'=>$orderId)),
515
+ 'ajaxExpired' => true
516
+ );
517
+ Mage::getSingleton('core/session')->addError($e->getMessage());
518
+ $response = Mage::helper('core')->jsonEncode($response);
519
+ }
520
+ $this->getResponse()->setBody($response);
521
+ }
522
+
523
+ public function creteorder($customer,$newitems,$lastorder,$sworder){
524
+ $customer = Mage::getModel('customer/customer')->load($customer);
525
+ $lastorder = Mage::getModel('sales/order')->load($lastorder);
526
+ $address = Mage::getModel('sales/order_address')->load($lastorder->getShippingAddressId());
527
+ $transaction = Mage::getModel('core/resource_transaction');
528
+ $storeId = $lastorder->getStoreId();
529
+ $reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId);
530
+
531
+ $order = Mage::getModel('sales/order')
532
+ ->setIncrementId($reservedOrderId)
533
+ ->setStoreId($storeId)
534
+ ->setQuoteId(0)
535
+ ->setBaseCurrencyCode(Mage::app()->getBaseCurrencyCode())
536
+ ->setOrderCurrencyCode(Mage::app()->getBaseCurrencyCode())
537
+ ->setGlobalCurrencyCode(Mage::app()->getBaseCurrencyCode());
538
+
539
+
540
+ if($lastorder->getCustomerGroupId()){
541
+ $order->setCustomer_email($address->getEmail())
542
+ ->setCustomerFirstname($address->getFirstname())
543
+ ->setCustomerLastname($address->getLastname())
544
+ ->setCustomerGroupId($lastorder->getCustomerGroupId())
545
+ ->setCustomer_is_guest(0)
546
+ ->setCustomer($customer);
547
+ }else{
548
+ // set Customer data
549
+ $order->setCustomer_email($address->getEmail())
550
+ ->setCustomerFirstname($address->getFirstname())
551
+ ->setCustomerLastname($address->getLastname())
552
+ ->setCustomerGroupId($lastorder->getCustomerGroupId());
553
+
554
+
555
+ }
556
+
557
+ $billingAddress = Mage::getModel('sales/order_address')
558
+ ->setStoreId($storeId)
559
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_BILLING)
560
+ ->setCustomerId($address->getCustomerId())
561
+ ->setCustomerAddressId($address->getCustomerAddressId())
562
+ ->setCustomer_address_id($address->getEntityId())
563
+ ->setPrefix($address->getPrefix())
564
+ ->setFirstname($address->getFirstname())
565
+ ->setMiddlename($address->getMiddlename())
566
+ ->setLastname($address->getLastname())
567
+ ->setSuffix($address->getSuffix())
568
+ ->setCompany($address->getCompany())
569
+ ->setStreet($address->getStreet())
570
+ ->setCity($address->getCity())
571
+ ->setCountry_id($address->getCountryId())
572
+ ->setRegion($address->getRegion())
573
+ ->setRegion_id($address->getRegionId())
574
+ ->setPostcode($address->getPostcode())
575
+ ->setTelephone($address->getTelephone())
576
+ ->setFax($address->getFax());
577
+ $order->setBillingAddress($billingAddress);
578
+ //$shipping = $customer->getDefaultShippingAddress();
579
+ $shippingAddress = Mage::getModel('sales/order_address')
580
+ ->setStoreId($storeId)
581
+ ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
582
+ ->setCustomerId($address->getCustomerId())
583
+ ->setCustomerAddressId($address->getCustomerAddressId())
584
+ ->setCustomer_address_id($address->getEntityId())
585
+ ->setPrefix($address->getPrefix())
586
+ ->setFirstname($address->getFirstname())
587
+ ->setMiddlename($address->getMiddlename())
588
+ ->setLastname($address->getLastname())
589
+ ->setSuffix($address->getSuffix())
590
+ ->setCompany($address->getCompany())
591
+ ->setStreet($address->getStreet())
592
+ ->setCity($address->getCity())
593
+ ->setCountryId($address->getCountryId())
594
+ ->setRegion($address->getRegion())
595
+ ->setRegionId($address->getRegionId())
596
+ ->setPostcode($address->getPostcode())
597
+ ->setTelephone($address->getTelephone())
598
+ ->setFax($address->getFax());
599
+
600
+
601
+
602
+ $order->setShippingAddress($shippingAddress)
603
+ ->setShipping_method('flatrate_flatrate');
604
+ $order->setShippingDescription($lastorder->getShippingDescription());
605
+ $order->setShippingAmount($lastorder->getShippingAmount());
606
+
607
+ /*->setShippingDescription($this->getCarrierName('flatrate'));*/
608
+ /*some error i am getting here need to solve further*/
609
+
610
+ //you can set your payment method name here as per your need
611
+ $orderPayment = Mage::getModel('sales/order_payment')
612
+ ->setStoreId($storeId)
613
+ ->setCustomerPaymentId(0)
614
+ ->setMethod('free')
615
+ ->setAction('yes')
616
+ ->setPo_number(' – ')
617
+ ->setOrderStatus('processing');
618
+ $order->setPayment($orderPayment);
619
+
620
+ // let say, we have 2 products
621
+ //check that your products exists
622
+ //need to add code for configurable products if any
623
+ $subTotal = 0;
624
+
625
+ //$products = getFreeProducts($point);
626
+
627
+ foreach ($newitems as $product) {
628
+ $_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $product['ProductCode']);
629
+ $rowTotal = $_product->getPrice() * $product['Quantity'];
630
+ $orderItem = Mage::getModel('sales/order_item')
631
+ ->setStoreId($storeId)
632
+ ->setQuoteItemId(0)
633
+ ->setQuoteParentItemId(NULL)
634
+ ->setProductId($_product->getId())
635
+ ->setProductType($_product->getTypeId())
636
+ ->setQtyBackordered(NULL)
637
+ ->setTotalQtyOrdered($product['Quantity'])
638
+ ->setQtyOrdered($product['Quantity'])
639
+ ->setName($_product->getName())
640
+ ->setSku($_product->getSku())
641
+ ->setPrice($_product->getPrice())
642
+ ->setBasePrice($_product->getPrice())
643
+ ->setOriginalPrice($_product->getPrice())
644
+ ->setRowTotal($rowTotal)
645
+ ->setBaseRowTotal($rowTotal);
646
+
647
+ $subTotal += $rowTotal;
648
+ //$subTotal = 0;
649
+ $order->addItem($orderItem);
650
+ }
651
+
652
+ $order->setSubtotal($subTotal)
653
+ ->setBaseSubtotal($subTotal)
654
+ ->setGrandTotal($subTotal)
655
+ ->setBaseGrandTotal($subTotal);
656
+
657
+ $transaction->addObject($order);
658
+ $transaction->addCommitCallback(array($order, 'place'));
659
+ $transaction->addCommitCallback(array($order, 'save'));
660
+ $transaction->save();
661
+
662
+ $order= Mage::getModel('sales/order')->load($order->getId());
663
+ $order->setSwipezoomOrderNumberTemp($sworder)->save();
664
+
665
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
666
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
667
+ $invoice->register();
668
+
669
+ $itemQty = $order->getItemsCollection();//->count();
670
+ $newarray = array();
671
+ foreach($itemQty as $item){
672
+ $newarray[$item->getId()] = $item->getQtyInvoiced();
673
+ }
674
+ $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($newarray);
675
+ $shipment->register();
676
+ $transactionSave = Mage::getModel('core/resource_transaction')
677
+ ->addObject($invoice)
678
+ ->addObject($shipment)
679
+ ->addObject($order);
680
+
681
+
682
+ //->addStatusHistoryComment('', 'refund')
683
+
684
+ $transactionSave->save();
685
+
686
+ return $order->getId();
687
+ }
688
+
689
+
690
+ public function getCallerArray(){
691
+ $merchantRefNo = "123";
692
+
693
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
694
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
695
+ "Version"=> "SW0101",
696
+ "Datetime" => date("Y-m-d h:i:s"),
697
+ "MerchantRefNo" => $merchantRefNo);
698
+ return $callerObj;
699
+ }
700
+
701
+ }
702
+
app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/EditController.php ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Adminhtml_Sales_Order_EditController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once('CreateController.php');
10
+ class Swipezoom_InternationalShipping_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Order_CreateController{
11
+ public function startAction()
12
+ {
13
+ $this->_getSession()->clear();
14
+ $orderId = $this->getRequest()->getParam('order_id');
15
+ $order = Mage::getModel('sales/order')->load($orderId);
16
+
17
+ try {
18
+ if ($order->getId()) {
19
+ $this->_getSession()->setUseOldShippingMethod(true);
20
+ $this->_getOrderCreateModel()->initFromOrder($order);
21
+ $this->_redirect('*/*');
22
+ }
23
+ else {
24
+ $this->_redirect('*/sales_order/');
25
+ }
26
+ } catch (Mage_Core_Exception $e) {
27
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
28
+ $this->_redirect('*/sales_order/view', array('order_id' => $orderId));
29
+ } catch (Exception $e) {
30
+ Mage::getSingleton('adminhtml/session')->addException($e, $e->getMessage());
31
+ $this->_redirect('*/sales_order/view', array('order_id' => $orderId));
32
+ }
33
+ }
34
+
35
+ public function createnewAction()
36
+ {
37
+ $orderId = $this->getRequest()->getParam('order_id');
38
+ $order = Mage::getModel('sales/order')->load($orderId);
39
+
40
+ $colleciotn = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$orderId);
41
+ if(count($colleciotn)){
42
+ foreach($colleciotn as $getneworder){
43
+ $neworderid = $getneworder->getNewszorderid();
44
+ $shippingcharge = ($getneworder->getCouriercharges() + $getneworder->getInsurancecharges() + $getneworder->getCourierduties())*$getneworder->getExcrate();
45
+ $getCouriercharges= $getneworder->getCouriercharges()*$getneworder->getExcrate();
46
+ $getInsurancecharges = $getneworder->getInsurancecharges()*$getneworder->getExcrate();
47
+ $getCourierduties = $getneworder->getCourierduties()*$getneworder->getExcrate();
48
+ break;
49
+ }
50
+
51
+ try{
52
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
53
+ $params = array("Caller" => $this->getCallerArray($this->getRequest()->getPost('refno')),"OrderNo"=>$neworderid,"MerchantRefNo"=>$this->getRequest()->getPost('refno'));
54
+ Mage::log($params,null,'PartShipConfirm'.$orderId.'.log');
55
+ $response = $client->PartShipConfirm($params);
56
+ Mage::log($response,null,'PartShipConfirm'.$orderId.'.log');
57
+
58
+ if($response->ResponseStatusCode=="000"){
59
+
60
+ $colleciotnitems = Mage::getModel('internationalshipping/partshipreqitems')->getCollection()->addFieldToFilter('swipezoomorderid',$orderId);
61
+
62
+ $itemaray = array();
63
+ foreach($colleciotnitems as $items){
64
+ $itemaray[] = array('ProductCode' => $items->getProductcode(), 'Quantity' => $items->getQty());
65
+ }
66
+
67
+
68
+ $ordermodel = Mage::getModel('internationalshipping/order');
69
+
70
+ $newroderid1 = $ordermodel->cretejustorder($order->getCustomerId(),$itemaray,$orderId,$neworderid,$shippingcharge);
71
+
72
+ $updateorder = Mage::getModel('sales/order')->load($newroderid1);
73
+ $updateorder->setSwipezoomOrderShippingCharges($getCouriercharges)->setSwipezoomOrderDutiesTaxes($getCourierduties)
74
+ ->setSwipezoomOrderInsuranceCharges($getInsurancecharges)->setSwipezoomOrderDutiesTaxPrepaid('Y')
75
+ ->setSwipezoomOrderInsurancePaid('Y')->setSwipezoomOrderConfirmed('1')
76
+ ->save();
77
+
78
+ $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
79
+ $response = array(
80
+ 'ajaxRedirect' => $this->getUrl('adminhtml/sales_order/index' ),//, array('order_id'=>$id)
81
+ 'ajaxExpired' => true
82
+ );
83
+ $response = Mage::helper('core')->jsonEncode($response);
84
+
85
+
86
+ }else{
87
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'PartShipConfirm');
88
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
89
+ if($debugmode){
90
+ $message = $response->ResponseStatusDesc;
91
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($response->ResponseStatusCode.' : '.$message));
92
+ }else{
93
+ $message = 'Unable to perform Partship Confirm Action (Swipezoom Partship Confirm service)';
94
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Credti Memo Action (Swipezoom Partship Confirm service)'));
95
+ }
96
+
97
+
98
+
99
+ $response = array(
100
+ 'error' => true,
101
+ 'message' => $message,
102
+ 'ajaxRedirect' => $this->getUrl('*/*'),
103
+ 'ajaxExpired' => true
104
+ );
105
+ $response = Mage::helper('core')->jsonEncode($response);
106
+ }
107
+
108
+ }catch (Mage_Core_Exception $e) {
109
+ $response = array(
110
+ 'error' => true,
111
+ 'message' => $e->getMessage(),
112
+ 'ajaxRedirect' => $this->getUrl('*/*'),
113
+ 'ajaxExpired' => true
114
+ );
115
+ Mage::getSingleton('core/session')->addError($e->getMessage());
116
+ $response = Mage::helper('core')->jsonEncode($response);
117
+ }
118
+ }else{
119
+ Mage::getSingleton('adminhtml/session')->addError("Partship Request Doesn't Exists");
120
+ $response = array(
121
+ 'error' => true,
122
+ 'message' => 'Partship Request Doesn\'t Exists',
123
+ 'ajaxRedirect' => $this->getUrl('*/*'),
124
+ 'ajaxExpired' => true
125
+ );
126
+
127
+ $response = Mage::helper('core')->jsonEncode($response);
128
+ }
129
+
130
+ $this->getResponse()->setBody($response);
131
+
132
+ //Mage::getModel('internationalShipping/order')->creteorder($order->getCustomerId())
133
+ }
134
+ /**
135
+ * Loading page block
136
+ */
137
+
138
+
139
+ public function sendpartshiprqAction()
140
+ {
141
+
142
+
143
+ try {
144
+ if ($this->getRequest()->getPost('szorderid') && $this->getRequest()->getPost('sendrequest')) {
145
+ Mage::register('szorderid', $this->getRequest()->getPost('szorderid'));
146
+ Mage::getSingleton('adminhtml/session_quote')->setSwipezoomOrderNumber($this->getRequest()->getPost('szorderid'));
147
+
148
+ $ordercolection = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('swipezoom_order_number_temp',$this->getRequest()->getPost('szorderid'));
149
+ foreach($ordercolection as $orders){
150
+ $realorderid = $orders->getId();break;
151
+ }
152
+ $updateditem = array();
153
+
154
+ $realorderload = Mage::getModel('sales/order')->load($realorderid);
155
+ $ordered_items = $realorderload->getAllItems();
156
+ $realitemqty = array();
157
+ foreach($ordered_items as $item2){
158
+ $realitemqty[$item2->getSku()] = $item2->getQtyOrdered();
159
+ }
160
+
161
+ foreach($this->getRequest()->getPost('item',false) as $iditem => $item){
162
+ if(!$item['action']){
163
+ $realitemqty[$item['sku']] = $realitemqty[$item['sku']] - $item['qty'];
164
+ }else{
165
+ $realitemqty[$item['sku']] = $realitemqty[$item['sku']];
166
+ }
167
+ }
168
+
169
+ foreach($realitemqty as $sku => $itemqty){
170
+ if($itemqty>0){
171
+ $updateditem[] = array('ProductCode'=>$sku,'Quantity'=>(int)($itemqty));
172
+ }
173
+
174
+ }
175
+ //Mage::getModel('internationalshipping/observer')->editordersave($updateditem,$this->getRequest()->getPost('szorderid'),$realorderid);
176
+
177
+
178
+ $proitems = $updateditem;
179
+ $swipwzoomorder = $this->getRequest()->getPost('szorderid');
180
+ $realorderid = $realorderid;
181
+
182
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
183
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder,"ProductLineItems"=>$proitems );
184
+ Mage::log($params,null,'PartShipReq'.$swipwzoomorder.'.log');
185
+ $response = $client->PartShipReq($params);
186
+ Mage::log($response,null,'PartShipReq'.$swipwzoomorder.'.log');
187
+
188
+ if($response->ResponseStatusCode == '000')
189
+ {
190
+
191
+ $OrderNo = $response->Order->OrderNo;
192
+ $OrderNoRef = $response->Order->TransDetail->OrderNoRef;
193
+ $ProductPrice = $response->Order->Merchant->ProductPrice;
194
+ $ProductPriceCurrency = $response->Order->Merchant->ProductPriceCurrency;
195
+ $CustCurrency = $response->Order->TransDetail->CustCurrency;
196
+ $CustExcRate = $response->Order->TransDetail->CustExcRate;
197
+ $CustTotalValue = $response->Order->TransDetail->CustTotalValue;
198
+ $CourierCharges = $response->Order->TransDetail->CourierCharges;
199
+ $CourierDuties = $response->Order->TransDetail->CourierDuties;
200
+ $InsuranceCharges = $response->Order->TransDetail->InsuranceCharges;
201
+ Mage::log($CourierDuties,null,'1PartShipReq'.$swipwzoomorder.'.log');
202
+ $SZMarkup = $response->Order->TransDetail->SZMarkup;
203
+ $newcoll = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$realorderid); ////
204
+ foreach ($newcoll as $ccitem) {
205
+ $ccitem->delete();
206
+ }
207
+ $colection = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$realorderid);
208
+
209
+ $model = Mage::getModel('internationalshipping/partshipreq')->setId()
210
+ ->setSwipezoomorderid($OrderNoRef)
211
+ ->setNewszorderid($OrderNo)
212
+ ->setProductprice($ProductPrice)
213
+ ->setPricecurrency($ProductPriceCurrency)
214
+ ->setSalecurrency($CustCurrency)
215
+ ->setExcrate($CustExcRate)
216
+ ->setOrdertotal($CustTotalValue)
217
+ ->setCouriercharges($CourierCharges)
218
+ ->setCourierduties($CourierDuties)
219
+ ->setInsurancecharges($InsuranceCharges)
220
+ ->setSzmarkup($SZMarkup)
221
+ ->setRealorderid($realorderid) //Mage::app()->getRequest()->getParam('order_id')
222
+ ->save();
223
+
224
+
225
+ $newcoll1 = Mage::getModel('internationalshipping/partshipreqitems')->getCollection()
226
+ ->addFieldToFilter('swipezoomorderid',$realorderid);
227
+
228
+ foreach ($newcoll1 as $ccitem) {
229
+ $ccitem->delete();
230
+ }
231
+ if(is_array( $response->Order->ProductLineItems->ProductLineItem)){
232
+ foreach($response->Order->ProductLineItems->ProductLineItem as $proitem){
233
+ $LineItemNo = $proitem->LineItemNo;
234
+ $ProductCode = $proitem->ProductCode;
235
+ $Description = $proitem->Description;
236
+ $Price = $proitem->Price;
237
+ $Quantity = $proitem->Quantity;
238
+ $SaleValue = $proitem->SaleValue;
239
+
240
+
241
+ $model = Mage::getModel('internationalshipping/partshipreqitems')->setId()
242
+ ->setSwipezoomorderid($realorderid)
243
+ ->setLineitemno($LineItemNo)
244
+ ->setProductcode($ProductCode)
245
+ ->setDescription($Description)
246
+ ->setPrice($Price)
247
+ ->setQty($Quantity)
248
+ ->setSalevalue($SaleValue)
249
+ ->save();
250
+
251
+
252
+ }
253
+
254
+
255
+ }else{
256
+
257
+ $LineItemNo = $response->Order->ProductLineItems->ProductLineItem>LineItemNo;
258
+ $ProductCode = $response->Order->ProductLineItems->ProductLineItem->ProductCode;
259
+ $Description = $response->Order->ProductLineItems->ProductLineItem->Description;
260
+ $Price = $response->Order->ProductLineItems->ProductLineItem->Price;
261
+ $Quantity = $response->Order->ProductLineItems->ProductLineItem->Quantity;
262
+ $SaleValue = $response->Order->ProductLineItems->ProductLineItem->SaleValue;
263
+
264
+ $model = Mage::getModel('internationalshipping/partshipreqitems')->setId()
265
+ ->setSwipezoomorderid($realorderid)
266
+ ->setLineitemno($LineItemNo)
267
+ ->setProductcode($ProductCode)
268
+ ->setDescription($Description)
269
+ ->setPrice($Price)
270
+ ->setQty($Quantity)
271
+ ->setSalevalue($SaleValue)
272
+ ->save();
273
+
274
+
275
+ }
276
+
277
+
278
+
279
+
280
+
281
+ $response = array(
282
+ 'ajaxRedirect' => $this->getUrl('*/*' ),//, array('order_id'=>$id)
283
+ 'ajaxExpired' => true
284
+ );
285
+ $response = Mage::helper('core')->jsonEncode($response);
286
+ }else{
287
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'PartShipReq');
288
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
289
+ if($debugmode){
290
+ $message = $response->ResponseStatusDesc;
291
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($response->ResponseStatusCode.' : '.$message));
292
+ }else{
293
+ $message = 'Unable to perform Partship Request Action (Swipezoom Partship Request Service)';
294
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Credti Memo Action (Swipezoom Refund Request service)'));
295
+ }
296
+
297
+ $response = array(
298
+ 'error' => true,
299
+ 'message' => $message,
300
+ 'ajaxRedirect' => $this->getUrl('*/*'),
301
+ 'ajaxExpired' => true
302
+ );
303
+ $response = Mage::helper('core')->jsonEncode($response); }
304
+
305
+
306
+
307
+
308
+
309
+ }
310
+
311
+ } catch (Mage_Core_Exception $e) {
312
+ $response = array(
313
+ 'error' => true,
314
+ 'message' => $e->getMessage(),
315
+ 'ajaxRedirect' => $this->getUrl('*/*'),
316
+ 'ajaxExpired' => true
317
+ );
318
+ Mage::getSingleton('core/session')->addError($e->getMessage());
319
+ $response = Mage::helper('core')->jsonEncode($response);
320
+ }
321
+ $this->getResponse()->setBody($response);
322
+
323
+ }
324
+ public function loadBlockAction()
325
+ {
326
+
327
+ $request = $this->getRequest();
328
+ try {
329
+ $this->_initSession()
330
+ ->_processData();
331
+
332
+ }
333
+ catch (Mage_Core_Exception $e){
334
+ $this->_reloadQuote();
335
+ $this->_getSession()->addError($e->getMessage());
336
+ }
337
+ catch (Exception $e){
338
+ $this->_reloadQuote();
339
+ $this->_getSession()->addException($e, $e->getMessage());
340
+ }
341
+
342
+
343
+
344
+ $asJson= $request->getParam('json');
345
+ $block = $request->getParam('block');
346
+
347
+ $update = $this->getLayout()->getUpdate();
348
+ if ($asJson) {
349
+ $update->addHandle('adminhtml_sales_order_create_load_block_json');
350
+ } else {
351
+ $update->addHandle('adminhtml_sales_order_create_load_block_plain');
352
+ }
353
+
354
+ if ($block) {
355
+ $blocks = explode(',', $block);
356
+ if ($asJson && !in_array('message', $blocks)) {
357
+ $blocks[] = 'message';
358
+ }
359
+
360
+ foreach ($blocks as $block) {
361
+ $update->addHandle('adminhtml_sales_order_create_load_block_' . $block);
362
+ }
363
+ }
364
+ $this->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks();
365
+ $result = $this->getLayout()->getBlock('content')->toHtml();
366
+ if ($request->getParam('as_js_varname')) {
367
+ Mage::getSingleton('adminhtml/session')->setUpdateResult($result);
368
+ $this->_redirect('*/*/showUpdateResult');
369
+ } else {
370
+ $this->getResponse()->setBody($result);
371
+ }
372
+ }
373
+
374
+ /**
375
+ * Index page
376
+ */
377
+ public function indexAction()
378
+ {
379
+ $this->_title($this->__('Sales'))->_title($this->__('Orders'))->_title($this->__('Edit Order'));
380
+ $this->loadLayout();
381
+
382
+ $this->_initSession()
383
+ ->_setActiveMenu('sales/order')
384
+ ->renderLayout();
385
+ }
386
+
387
+ /**
388
+ * Acl check for admin
389
+ *
390
+ * @return bool
391
+ */
392
+ protected function _isAllowed()
393
+ {
394
+ return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/edit');
395
+ }
396
+ public function getCallerArray($merchantRefNo){
397
+ if(!$merchantRefNo){
398
+ $merchantRefNo = "123";
399
+ }
400
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
401
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
402
+ "Version"=> "SW0101",
403
+ "Datetime" => date("Y-m-d h:i:s"),
404
+ "MerchantRefNo" => $merchantRefNo);
405
+ return $callerObj;
406
+ }
407
+
408
+ }
409
+
app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/InvoiceController.php ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Adminhtml_Sales_Order_InvoiceController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once "Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php";
10
+ class Swipezoom_InternationalShipping_Adminhtml_Sales_Order_InvoiceController extends Mage_Adminhtml_Sales_Order_InvoiceController{
11
+
12
+ /**
13
+ * Shipment
14
+ */
15
+ public function doshipmentAction()
16
+ {
17
+
18
+ Mage::getModel('internationalshipping/observer')->salesordershipmentnew1();
19
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
20
+ $order = Mage::getModel('sales/order')->load($orderId);
21
+
22
+ $swipeorderId = Mage::app()->getRequest()->getParam('sorid');
23
+ $count = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipeorderId);
24
+ if(count($count)){
25
+
26
+ foreach($count as $oid){
27
+ $carrier = $oid->getCouriername();
28
+ $trackInfo = $oid->getCourierwaybillno();
29
+ $carrier_code = $oid->getCourierservicename();
30
+ $shiptime = $oid->getPickupdue();
31
+ }
32
+
33
+ //create shipment
34
+ /*$itemQty = $order->getItemsCollection()->count();
35
+ $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($itemQty);
36
+ $shipment = new Mage_Sales_Model_Order_Shipment_Api();
37
+ $shipmentId = $shipment->create( $order->getIncrementId(), array(), 'Shipment created through SwipeZoom on '.$shiptime, true, true);*/
38
+ $savedQtys = $this->_getItemQtys();
39
+ $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($savedQtys);
40
+ if (!$shipment->getTotalQty()) {
41
+ Mage::getSingleton('core/session')->addError('items for order '.$orderId.' no found');
42
+ }
43
+
44
+
45
+ $shipment->register();
46
+
47
+ $transactionSave = Mage::getModel('core/resource_transaction')
48
+ ->addObject($order);
49
+ if ($shipment) {
50
+ $transactionSave->addObject($shipment);
51
+ }
52
+ $transactionSave->save();
53
+
54
+ //add tracking info
55
+ $shipment_collection = Mage::getResourceModel('sales/order_shipment_collection');
56
+ $shipment_collection->addAttributeToFilter('order_id', $orderId);
57
+ foreach($shipment_collection as $sc)
58
+ {
59
+ $shipment = Mage::getModel('sales/order_shipment');
60
+ $shipment->load($sc->getId());
61
+ if($shipment->getId() != '')
62
+ {
63
+ try
64
+ {
65
+ Mage::getModel('sales/order_shipment_track')
66
+ ->setShipment($shipment)
67
+ ->setData('title', $carrier)
68
+ ->setData('number', $trackInfo)
69
+ ->setData('carrier_code', $carrier_code )
70
+ ->setData('order_id', $shipment->getData('order_id'))
71
+ ->save();
72
+ Mage::getSingleton('core/session')->addSuccess('Order Shipped successfully.');
73
+ }catch (Exception $e)
74
+ {
75
+ Mage::getSingleton('core/session')->addError('order id '.$orderId.' no found');
76
+ }
77
+ }
78
+ }
79
+ // change order status to complete
80
+ $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);
81
+ $order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
82
+ $order->save();
83
+
84
+
85
+
86
+
87
+
88
+ }
89
+ $this->_redirect('adminhtml/sales_order/view', array('order_id'=>$this->getRequest()->getParam('order_id')));
90
+ }
91
+
92
+
93
+ public function getCallerArray(){
94
+ $merchantRefNo = "123";
95
+
96
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
97
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
98
+ "Version"=> "SW0101",
99
+ "Datetime" => date("Y-m-d h:i:s"),
100
+ "MerchantRefNo" => $merchantRefNo);
101
+ return $callerObj;
102
+ }
103
+
104
+ public function submitinvoice(Varien_Event_Observer $observer)
105
+ {
106
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
107
+ $order= Mage::getModel('sales/order')->load($orderid);
108
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
109
+ if($swipwzoomorder){
110
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
111
+ if(!count($count)){
112
+ try {
113
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
114
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
115
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder );
116
+
117
+ $response = $client->Pack($params);
118
+ $statuscheck=$response->ResponseStatusCode;
119
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
120
+ $message = array();
121
+ if($statuscheck=="000"){
122
+ $chk = json_decode(json_encode($response), true);
123
+
124
+ $boxlist = $chk['PackingBoxes']['PackingBox'];
125
+ if(is_array($response->PackingBoxes->PackingBox)){
126
+ foreach($response->PackingBoxes->PackingBox as $box){
127
+
128
+ $boxno = $box->BoxNo;
129
+ $boxcode = $box->BoxCode;
130
+ if(is_array($box->ProductLineItems->ProductLineItem)){
131
+ foreach($box->ProductLineItems->ProductLineItem as $lineitems){
132
+
133
+ $productcode = $lineitems->ProductCode;
134
+ $quantity = $lineitems->Quantity;
135
+ //$products = Mage::getModel('catalog/product') ;
136
+ $newpack = Mage::getModel('internationalshipping/packingdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setBoxno($boxno)->setBoxcode($boxcode)->setProductcode($productcode)->setProductqty($quantity)->setProductname("Product")->setMagentoorderid(Mage::app()->getRequest()->getParam('order_id'))->save();
137
+
138
+
139
+ }
140
+ }else{
141
+ $productcode = $box->ProductLineItems->ProductLineItem->ProductCode;
142
+ $quantity = $box->ProductLineItems->ProductLineItem->Quantity;
143
+ $newpack = Mage::getModel('internationalshipping/packingdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setBoxno($boxno)->setBoxcode($boxcode)->setProductcode($productcode)->setProductqty($quantity)->setProductname("Product")->setMagentoorderid(Mage::app()->getRequest()->getParam('order_id'))->save();
144
+ }
145
+ }
146
+ $message['error'] = false;
147
+ $message['message'] = 'The invoice has been created.';
148
+ }else{
149
+
150
+
151
+ $boxno = $response->PackingBoxes->PackingBox->BoxNo;
152
+ $boxcode = $response->PackingBoxes->PackingBox->BoxCode;
153
+
154
+ if(is_array( $response->PackingBoxes->PackingBox->ProductLineItems->ProductLineItem)){
155
+ foreach($response->PackingBoxes->PackingBox->ProductLineItems->ProductLineItem as $lineitems){
156
+ $productcode = $lineitems->ProductCode;
157
+ $quantity = $lineitems->Quantity;
158
+ //$products = Mage::getModel('catalog/product') ;
159
+ $newpack = Mage::getModel('internationalshipping/packingdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setBoxno($boxno)->setBoxcode($boxcode)->setProductcode($productcode)->setProductqty($quantity)->setProductname("Product")->setMagentoorderid(Mage::app()->getRequest()->getParam('order_id'))->save();
160
+ }
161
+ }else{
162
+ $productcode = $response->PackingBoxes->PackingBox->ProductLineItems->ProductLineItem->ProductCode;
163
+ $quantity = $response->PackingBoxes->PackingBox->ProductLineItems->ProductLineItem->Quantity;
164
+ $newpack = Mage::getModel('internationalshipping/packingdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setBoxno($boxno)->setBoxcode($boxcode)->setProductcode($productcode)->setProductqty($quantity)->setProductname("Product")->setMagentoorderid(Mage::app()->getRequest()->getParam('order_id'))->save();
165
+ }
166
+ $message['error'] = false;
167
+ $message['message'] = 'The invoice has been created.';
168
+ }
169
+
170
+ return $message;
171
+ }
172
+ else{
173
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'Pack');
174
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
175
+ $message['error'] = true;
176
+ if($debugmode){
177
+ $message['message'] = Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($statuscheck.' : '.$ResponseStatusDesc));
178
+ }else{
179
+ $message['message'] = Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Invoice action (Swipezoom Pack service)'));
180
+ }
181
+ return $message;
182
+ }
183
+
184
+ } catch (Exception $e) {
185
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
186
+ Mage::log($debugData,null,'debug.log');
187
+ Mage::logException($e);
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Save invoice
195
+ * We can save only new invoice. Existing invoices are not editable
196
+ */
197
+ public function saveAction()
198
+ {
199
+ $data = $this->getRequest()->getPost('invoice');
200
+ $orderId = $this->getRequest()->getParam('order_id');
201
+
202
+ $order= Mage::getModel('sales/order')->load($orderId);
203
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
204
+ if($swipwzoomorder){
205
+ $response = $this->submitinvoice();
206
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
207
+ if(!count($count)){
208
+ $this->_redirect('adminhtml/sales_order_invoice/new', array('order_id' => $orderId));
209
+ return;
210
+ }
211
+ }
212
+
213
+
214
+ if (!empty($data['comment_text'])) {
215
+ Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
216
+ }
217
+
218
+ try {
219
+ $invoice = $this->_initInvoice();
220
+ if ($invoice) {
221
+
222
+ if (!empty($data['capture_case'])) {
223
+ $invoice->setRequestedCaptureCase($data['capture_case']);
224
+ }
225
+
226
+ if (!empty($data['comment_text'])) {
227
+ $invoice->addComment(
228
+ $data['comment_text'],
229
+ isset($data['comment_customer_notify']),
230
+ isset($data['is_visible_on_front'])
231
+ );
232
+ }
233
+
234
+ $invoice->register();
235
+
236
+ if (!empty($data['send_email'])) {
237
+ $invoice->setEmailSent(true);
238
+ }
239
+ if($swipwzoomorder && empty($data['send_email'])){
240
+ $invoice->setEmailSent(true);
241
+ }
242
+ $invoice->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
243
+ $invoice->getOrder()->setIsInProcess(true);
244
+
245
+ $transactionSave = Mage::getModel('core/resource_transaction')
246
+ ->addObject($invoice)
247
+ ->addObject($invoice->getOrder());
248
+ $shipment = false;
249
+ if (!empty($data['do_shipment']) || (int) $invoice->getOrder()->getForcedDoShipmentWithInvoice()) {
250
+ $shipment = $this->_prepareShipment($invoice);
251
+ if ($shipment) {
252
+ $shipment->setEmailSent($invoice->getEmailSent());
253
+ $transactionSave->addObject($shipment);
254
+ }
255
+ }
256
+ $transactionSave->save();
257
+
258
+ if (isset($shippingResponse) && $shippingResponse->hasErrors()) {
259
+ $this->_getSession()->addError($this->__('The invoice and the shipment have been created. The shipping label cannot be created at the moment.'));
260
+ } elseif (!empty($data['do_shipment'])) {
261
+ $this->_getSession()->addSuccess($this->__('The invoice and shipment have been created.'));
262
+ } else {
263
+ $this->_getSession()->addSuccess($this->__('The invoice has been created.'));
264
+ }
265
+
266
+ // send invoice/shipment emails
267
+ $comment = '';
268
+ if (isset($data['comment_customer_notify'])) {
269
+ $comment = $data['comment_text'];
270
+ }
271
+
272
+ if($swipwzoomorder && empty($data['send_email'])){
273
+ $sendmail = false;
274
+ }else{
275
+ $sendmail = empty($data['send_email']);
276
+ }
277
+ try {
278
+ if(!$swipwzoomorder )
279
+ { $invoice->sendEmail(!$sendmail, $comment); }else{
280
+ $invoice->setEmailSent(true);
281
+ }
282
+ } catch (Exception $e) {
283
+ Mage::logException($e);
284
+ $this->_getSession()->addError($this->__('Unable to send the invoice email.'));
285
+ }
286
+ if ($shipment) {
287
+ try {
288
+ $shipment->sendEmail(!empty($data['send_email']));
289
+ } catch (Exception $e) {
290
+ Mage::logException($e);
291
+ $this->_getSession()->addError($this->__('Unable to send the shipment email.'));
292
+ }
293
+ }
294
+ Mage::getSingleton('adminhtml/session')->getCommentText(true);
295
+ if($order->getSwipezoomOrderNumberTemp()){
296
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $orderId,'showpopup'=> '1'));
297
+ }else{
298
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $orderId));
299
+ }
300
+ } else {
301
+ $this->_redirect('*/*/new', array('order_id' => $orderId));
302
+ }
303
+ return;
304
+ } catch (Mage_Core_Exception $e) {
305
+ $this->_getSession()->addError($e->getMessage());
306
+ } catch (Exception $e) {
307
+ $this->_getSession()->addError($this->__('Unable to save the invoice.'));
308
+ Mage::logException($e);
309
+ }
310
+ $this->_redirect('*/*/new', array('order_id' => $orderId));
311
+ }
312
+
313
+
314
+ }
315
+
316
+
317
+
app/code/local/Swipezoom/InternationalShipping/controllers/Adminhtml/Sales/Order/ShipmentController.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_Adminhtml_Sales_Order_ShipmentController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once "Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php";
10
+ class Swipezoom_InternationalShipping_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Sales_Order_ShipmentController{
11
+ /**
12
+ * Save shipment
13
+ * We can save only new shipment. Existing shipments are not editable
14
+ *
15
+ * @return null
16
+ */
17
+ public function saveAction()
18
+ {
19
+
20
+ //Mage::getModel('internationalshipping/observer')->salesordershipmentnew1();
21
+
22
+
23
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
24
+ $order= Mage::getModel('sales/order')->load($orderid);
25
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
26
+ if($swipwzoomorder){
27
+ $count = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
28
+ if(!count($count)){
29
+ try {
30
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
31
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
32
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" => $swipwzoomorder );
33
+ $response = $client->Ship($params);
34
+ $statuscheck=$response->ResponseStatusCode;
35
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
36
+ if($statuscheck=="000"){
37
+ $CourierName = $response->ShipmentBooking->CourierName;
38
+ $CourierServiceName = $response->ShipmentBooking->CourierServiceName;
39
+ $CourierWaybillNo = $response->ShipmentBooking->CourierWaybillNo;
40
+ $PickupDue = $response->ShipmentBooking->PickupDue;
41
+
42
+ $ship = Mage::getModel('internationalshipping/shipmentdetail')->setId()->setSwipezoomorderid($swipwzoomorder)->setCouriername($CourierName)->setCourierservicename($CourierServiceName)->setCourierwaybillno($CourierWaybillNo)->setPickupdue($PickupDue)->save();
43
+ }else{
44
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'Ship');
45
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
46
+ if($debugmode){
47
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($statuscheck.' : '.$ResponseStatusDesc));
48
+ }else{
49
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Ship action (Swipezoom Ship service)'));
50
+ }
51
+ $this->_redirect('adminhtml/sales_order_shipment/new', array('order_id' => $this->getRequest()->getParam('order_id')));
52
+ return;
53
+ }
54
+
55
+
56
+ } catch (Exception $e) {
57
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
58
+ Mage::log($debugData,null,'debug.log');
59
+ Mage::logException($e);
60
+ }
61
+ }
62
+ }
63
+
64
+ $data = $this->getRequest()->getPost('shipment');
65
+ if (!empty($data['comment_text'])) {
66
+ Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
67
+ }
68
+
69
+ try {
70
+ $shipment = $this->_initShipment();
71
+ if (!$shipment) {
72
+ $this->_forward('noRoute');
73
+ return;
74
+ }
75
+
76
+ $shipment->register();
77
+ $comment = '';
78
+ if (!empty($data['comment_text'])) {
79
+ $shipment->addComment(
80
+ $data['comment_text'],
81
+ isset($data['comment_customer_notify']),
82
+ isset($data['is_visible_on_front'])
83
+ );
84
+ if (isset($data['comment_customer_notify'])) {
85
+ $comment = $data['comment_text'];
86
+ }
87
+ }
88
+
89
+ if (!empty($data['send_email'])) {
90
+ $shipment->setEmailSent(true);
91
+ }
92
+
93
+ $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
94
+ $responseAjax = new Varien_Object();
95
+ $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];
96
+
97
+ if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {
98
+ $responseAjax->setOk(true);
99
+ }
100
+
101
+ $this->_saveShipment($shipment);
102
+
103
+
104
+ if($swipwzoomorder && empty($data['send_email'])){
105
+ $sendmail = false;
106
+ }else{
107
+ $sendmail = empty($data['send_email']);
108
+ }
109
+
110
+ if(!$swipwzoomorder)
111
+ { $shipment->sendEmail(!$sendmail, $comment); }else{
112
+ $shipment->setEmailSent(true);
113
+ }
114
+ if($swipwzoomorder){
115
+ $count = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
116
+ if(count($count)){
117
+
118
+ foreach($count as $oid){
119
+ $carrier = $oid->getCouriername();
120
+ $trackInfo = $oid->getCourierwaybillno();
121
+ $carrier_code = $oid->getCourierservicename();
122
+ $shiptime = $oid->getPickupdue();
123
+ }
124
+
125
+ $shipment_collection = Mage::getResourceModel('sales/order_shipment_collection');
126
+ $shipment_collection->addAttributeToFilter('order_id', Mage::app()->getRequest()->getParam('order_id'));
127
+ foreach($shipment_collection as $sc)
128
+ {
129
+ $shipment = Mage::getModel('sales/order_shipment');
130
+ $shipment->load($sc->getId());
131
+ if($shipment->getId() != '')
132
+ {
133
+ try
134
+ {
135
+ Mage::getModel('sales/order_shipment_track')
136
+ ->setShipment($shipment)
137
+ ->setData('title', $carrier)
138
+ ->setData('number', $trackInfo)
139
+ ->setData('carrier_code', $carrier_code )
140
+ ->setData('order_id', $shipment->getData('order_id'))
141
+ ->save();
142
+
143
+ }catch (Exception $e)
144
+ {
145
+
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ $shipmentCreatedMessage = $this->__('The shipment has been created.');
152
+ $labelCreatedMessage = $this->__('The shipping label has been created.');
153
+
154
+ $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage
155
+ : $shipmentCreatedMessage);
156
+ Mage::getSingleton('adminhtml/session')->getCommentText(true);
157
+ } catch (Mage_Core_Exception $e) {
158
+ if ($isNeedCreateLabel) {
159
+ $responseAjax->setError(true);
160
+ $responseAjax->setMessage($e->getMessage());
161
+ } else {
162
+ $this->_getSession()->addError($e->getMessage());
163
+ $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
164
+ }
165
+ } catch (Exception $e) {
166
+ Mage::logException($e);
167
+ if ($isNeedCreateLabel) {
168
+ $responseAjax->setError(true);
169
+ $responseAjax->setMessage(
170
+ Mage::helper('sales')->__('An error occurred while creating shipping label.'));
171
+ } else {
172
+ $this->_getSession()->addError($this->__('Cannot save shipment.'));
173
+ $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
174
+ }
175
+
176
+ }
177
+ if ($isNeedCreateLabel) {
178
+ $this->getResponse()->setBody($responseAjax->toJson());
179
+ } else {
180
+ $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));
181
+ }
182
+ }
183
+
184
+
185
+ public function getCallerArray(){
186
+ $merchantRefNo = "123";
187
+
188
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
189
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
190
+ "Version"=> "SW0101",
191
+ "Datetime" => date("Y-m-d h:i:s"),
192
+ "MerchantRefNo" => $merchantRefNo);
193
+ return $callerObj;
194
+ }
195
+
196
+ }
197
+
app/code/local/Swipezoom/InternationalShipping/controllers/CartController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_CartControllers
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ require_once 'Mage/Checkout/controllers/CartController.php';
10
+
11
+ class Swipezoom_InternationalShipping_CartController extends Mage_Checkout_CartController
12
+ {
13
+ /**
14
+ * Shopping cart display action
15
+ */
16
+ public function indexAction()
17
+ {
18
+ $shippingaddress = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
19
+ $shippingaddress->setShippingMethod('');
20
+ $shippingaddress->save();
21
+
22
+ //Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->unsetData();
23
+ Mage::getSingleton('checkout/session')->setSwipezoomExtraRates('');
24
+ Mage::getSingleton('core/session')->setSwipezoomExtraRates('');
25
+ Mage::getSingleton('core/session')->setRequestedString('');
26
+ parent::indexAction();
27
+ }
28
+ }
29
+
30
+ ?>
31
+
app/code/local/Swipezoom/InternationalShipping/controllers/IndexController.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Swipezoom_InternationalShipping_IndexController
5
+ *
6
+ * @author Swipezoom
7
+ */
8
+
9
+ class Swipezoom_InternationalShipping_IndexController extends Mage_Core_Controller_Front_Action
10
+ {
11
+ public function indexAction()
12
+ {
13
+ try {
14
+ $countrycode= Mage::app()->getRequest()->getParam("countrycode");
15
+ $specificCountry = Mage::getStoreConfig('carriers/swipezoom/sallowspecific',Mage::app()->getStore());
16
+ $specificCountryList = Mage::getStoreConfig('carriers/swipezoom/specificcountry',Mage::app()->getStore());
17
+ if($specificCountry == 1 && strpos($specificCountryList,$countrycode) === FALSE){
18
+ $html = $this->getLayout()->createBlock("checkout/onepage_billing")->setTemplate("internationalshipping/processformat.phtml")->setFlag("reset")->toHtml();
19
+ }else{
20
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->doAddressFormatRequest();
21
+ $html = $this->getLayout()->createBlock("checkout/onepage_billing")->setTemplate("internationalshipping/processformat.phtml")->setResponseArray($responseArray)->toHtml();
22
+ }
23
+
24
+ $this->getResponse()->setBody($html);
25
+ return;
26
+ } catch (Exception $e) {
27
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
28
+ }
29
+ }
30
+
31
+ public function cancelAction() {
32
+
33
+ $this->loadLayout();
34
+ $this->renderLayout();
35
+
36
+ }
37
+
38
+ public function openpdfAction() {
39
+
40
+ $this->loadLayout();
41
+ $this->renderLayout();
42
+
43
+ }
44
+
45
+ public function printallAction() {
46
+
47
+ $this->loadLayout();
48
+ $this->renderLayout();
49
+
50
+ }
51
+
52
+ public function printpackAction() {
53
+ $orderId = (int) $this->getRequest()->getParam('order_id');
54
+ $order = Mage::getModel('sales/order')->load($orderId);
55
+ Mage::register('current_order', $order);
56
+
57
+ $this->loadLayout();
58
+ $this->renderLayout();
59
+
60
+ }
61
+
62
+ public function adcommentAction() {
63
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
64
+ $key = Mage::app()->getRequest()->getParam('key');
65
+ $order = Mage::getModel('sales/order')->load($orderid);
66
+ try {
67
+ $haserror = false;
68
+ $debugData['alertpopup'] = false;
69
+ $debugData['me'] = Mage::getSingleton('core/session')->getEncryptedSessionId();
70
+ if(!$this->getRequest()->getPost('comment')){
71
+ $debugData['error'] = true;
72
+ $debugData['message'] = 'Please choose reason.';
73
+ $debugData['ajaxRedirect'] = Mage::getUrl('internationalshipping/index/cancel/order_id/'.$orderid.'/key/'.$key);
74
+ $debugData['ajaxExpired'] = true;
75
+ $debugData['alertpopup'] = true;
76
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Please choose reason.'));
77
+ $haserror = true;
78
+ }
79
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
80
+ if($swipwzoomorder && !$haserror){
81
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
82
+ $params = array("Caller" => $this->getCallerArray(),"OrderNo" =>$swipwzoomorder,"ReasonCode"=> preg_replace('/[^A-Za-z0-9\-]/', '', Mage::app()->getRequest()->getPost('comment')) );
83
+ Mage::log($params,null,'SW_CANCEL_'.$swipwzoomorder.'.log');
84
+ $response = $client->CancelOrder($params);
85
+ Mage::log($response,null,'SW_CANCEL_'.$swipwzoomorder.'.log');
86
+ $statuscheck=$response->ResponseStatusCode;
87
+ $ResponseStatusDesc=$response->ResponseStatusDesc;
88
+ if($response->ResponseStatusCode == '000' ){
89
+ $debugData['error'] = false;
90
+ }else{
91
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'CancelOrder');
92
+ $debugData['error'] = true;
93
+ $debugmode = Mage::getStoreConfig('carriers/swipezoom/debug',Mage::app()->getStore());
94
+ if($debugmode){
95
+
96
+ $debugData['message'] = $statuscheck.' : '.$ResponseStatusDesc;
97
+
98
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($response->ResponseStatusCode.' : '.$ResponseStatusDesc));
99
+ }else{
100
+ $debugData['message'] = "Unable to perform Cancel Action (Swipezoom Cancel service)";
101
+ Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Unable to perform Cancel Action (Swipezoom Cancel service)'));
102
+ }
103
+ $debugData['ajaxRedirect'] = Mage::getUrl('internationalshipping/index/cancel/order_id/'.$orderid.'/key/'.$key);
104
+ $debugData['ajaxExpired'] = true;
105
+ }
106
+ }
107
+
108
+
109
+ } catch (Exception $e) {
110
+ $debugData['result'] = array('error' => true, 'message' => $e->getCode());
111
+ }
112
+ $response = Mage::helper('core')->jsonEncode($debugData);
113
+ $this->getResponse()->setBody($response);
114
+
115
+ }
116
+
117
+ public function getCallerArray(){
118
+ $merchantRefNo = "123";
119
+
120
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
121
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
122
+ "Version"=> "SW0101",
123
+ "Datetime" => date("Y-m-d h:i:s"),
124
+ "MerchantRefNo" => $merchantRefNo);
125
+ return $callerObj;
126
+ }
127
+
128
+ public function CheckAddressAction()
129
+ {
130
+ $task = Mage::getModel('internationalshipping/carrier_swipezoom')->AddressVerifacation();
131
+ }
132
+
133
+ public function getCitiesForAutoCompleteAction() {
134
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->getCitiesForAutoComplete();
135
+ echo $responseArray;
136
+ return true;
137
+
138
+ }
139
+
140
+ public function checkIfCityExistsAction() {
141
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->checkIfCityExists();
142
+ echo $responseArray;
143
+ return true;
144
+ }
145
+
146
+ public function getStatesForAutoCompleteAction() {
147
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->getCitiesForAutoComplete();
148
+ echo $responseArray;
149
+ return true;
150
+
151
+ }
152
+
153
+ public function getCityStatesAction() {
154
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->getCityStates();
155
+ echo $responseArray;
156
+ return true;
157
+ }
158
+
159
+ public function getPostCodesForAutoCompleteAction() {
160
+ $responseArray = Mage::getModel('internationalshipping/carrier_swipezoom')->getPostCodesForAutoComplete();
161
+ echo $responseArray;
162
+ return true;
163
+
164
+ }
165
+
166
+ public function getEnabledPaymentMethodsAction() {
167
+ $payments = Mage::getSingleton('payment/config')->getActiveMethods();
168
+ $methods = "<b><span style='color:red'>Following payment methods will be disabled with Swipezoom Payment enabled: </span></b>";
169
+
170
+ if(!empty($payments)) {
171
+
172
+ foreach ($payments as $paymentCode => $paymentModel) {
173
+ $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
174
+ if($paymentCode != 'cardpayment')
175
+ $methods .= "<br>".$paymentTitle.', ';
176
+ }
177
+
178
+ echo trim($methods,', ');
179
+ } else {
180
+ echo "";
181
+ }
182
+ return true;
183
+ }
184
+
185
+ public function getEnabledShippingMethodsAction() {
186
+ $shipping = Mage::getSingleton('shipping/config')->getActiveCarriers();
187
+ $methods = "<b><span style='color:red'>Following shipping methods will be disabled with Swipezoom Shipment enabled: </span></b>";
188
+
189
+
190
+ if(!empty($shipping)) {
191
+ foreach ($shipping as $shippingCode => $shipModel) {
192
+ $shipTitle = Mage::getStoreConfig('carriers/'.$shippingCode.'/title');
193
+
194
+ if($shippingCode != 'swipezoom')
195
+ $methods .= "<br>".$shipTitle.', ';
196
+ }
197
+
198
+ echo trim($methods,', ');
199
+ } else {
200
+ echo "";
201
+ }
202
+ return true;
203
+ }
204
+
205
+ }
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/GecaWs.wsdl ADDED
@@ -0,0 +1,616 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions targetNamespace="http://ws.geca.sz.com/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
4
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://ws.geca.sz.com/wsdl" xmlns:intf="http://ws.geca.sz.com/wsdl"
5
+
6
+ xmlns:request="http://www.geca.sz.com/ws/schema/request" xmlns:response="http://www.geca.sz.com/ws/schema/response">
7
+
8
+ <!-- ************************************************************** -->
9
+ <!-- #### GECA WEB SERVICES WSDL TYPES DECLARATIONS #### -->
10
+ <!-- ************************************************************** -->
11
+
12
+ <wsdl:types>
13
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
14
+ <xsd:import namespace="http://www.geca.sz.com/ws/schema/request" schemaLocation="schema/request/GecaWsRequestSchema.xsd" />
15
+ <xsd:import namespace="http://www.geca.sz.com/ws/schema/response" schemaLocation="schema/response/GecaWsResponseSchema.xsd" />
16
+ </xsd:schema>
17
+ </wsdl:types>
18
+
19
+
20
+ <!-- ************************************************************** -->
21
+ <!-- #### GECA WEB SERVICES WSDL MESSAGES DECLARATIONS #### -->
22
+ <!-- ************************************************************** -->
23
+
24
+
25
+ <wsdl:message name="EchoRequestMsg">
26
+ <wsdl:part name="request" element="request:Echo" />
27
+ </wsdl:message>
28
+ <wsdl:message name="EchoResponseMsg">
29
+ <wsdl:part name="response" element="response:EchoResponse" />
30
+ </wsdl:message>
31
+
32
+
33
+
34
+ <wsdl:message name="OrderListRequsetMsg">
35
+ <wsdl:part name="request" element="request:OrderList" />
36
+ </wsdl:message>
37
+ <wsdl:message name="OrderListResponseMsg">
38
+ <wsdl:part name="response" element="response:OrderListResponse" />
39
+ </wsdl:message>
40
+
41
+ <wsdl:message name="PickRequsetMsg">
42
+ <wsdl:part name="request" element="request:Pick" />
43
+ </wsdl:message>
44
+ <wsdl:message name="PickResponseMsg">
45
+ <wsdl:part name="response" element="response:PickResponse" />
46
+ </wsdl:message>
47
+
48
+ <wsdl:message name="PackRequsetMsg">
49
+ <wsdl:part name="request" element="request:Pack" />
50
+ </wsdl:message>
51
+ <wsdl:message name="PackResponseMsg">
52
+ <wsdl:part name="response" element="response:PackResponse" />
53
+ </wsdl:message>
54
+
55
+ <wsdl:message name="ShipRequsetMsg">
56
+ <wsdl:part name="request" element="request:Ship" />
57
+ </wsdl:message>
58
+ <wsdl:message name="ShipResponseMsg">
59
+ <wsdl:part name="response" element="response:ShipResponse" />
60
+ </wsdl:message>
61
+
62
+ <wsdl:message name="ShipDocRequsetMsg">
63
+ <wsdl:part name="request" element="request:ShipDoc" />
64
+ </wsdl:message>
65
+ <wsdl:message name="ShipDocResponseMsg">
66
+ <wsdl:part name="response" element="response:ShipDocResponse" />
67
+ </wsdl:message>
68
+
69
+ <wsdl:message name="TrackRequsetMsg">
70
+ <wsdl:part name="request" element="request:Track" />
71
+ </wsdl:message>
72
+ <wsdl:message name="TrackResponseMsg">
73
+ <wsdl:part name="response" element="response:TrackResponse" />
74
+ </wsdl:message>
75
+
76
+ <wsdl:message name="EditPackingRequsetMsg">
77
+ <wsdl:part name="request" element="request:EditPacking" />
78
+ </wsdl:message>
79
+ <wsdl:message name="EditPackingResponseMsg">
80
+ <wsdl:part name="response" element="response:EditPackingResponse" />
81
+ </wsdl:message>
82
+
83
+ <wsdl:message name="RestorePackingRequsetMsg">
84
+ <wsdl:part name="request" element="request:RestorePacking" />
85
+ </wsdl:message>
86
+ <wsdl:message name="RestorePackingResponseMsg">
87
+ <wsdl:part name="response" element="response:RestorePackingResponse" />
88
+ </wsdl:message>
89
+
90
+ <wsdl:message name="OrderDetailsRequsetMsg">
91
+ <wsdl:part name="request" element="request:OrderDetails" />
92
+ </wsdl:message>
93
+ <wsdl:message name="OrderDetailsResponseMsg">
94
+ <wsdl:part name="response" element="response:OrderDetailsResponse" />
95
+ </wsdl:message>
96
+
97
+ <wsdl:message name="PartShipReqRequsetMsg">
98
+ <wsdl:part name="request" element="request:PartShipReq" />
99
+ </wsdl:message>
100
+ <wsdl:message name="PartShipReqResponseMsg">
101
+ <wsdl:part name="response" element="response:PartShipReqResponse" />
102
+ </wsdl:message>
103
+
104
+ <wsdl:message name="PartShipConfirmRequsetMsg">
105
+ <wsdl:part name="request" element="request:PartShipConfirm" />
106
+ </wsdl:message>
107
+ <wsdl:message name="PartShipConfirmResponseMsg">
108
+ <wsdl:part name="response" element="response:PartShipConfirmResponse" />
109
+ </wsdl:message>
110
+
111
+
112
+
113
+ <wsdl:message name="ServiceInvoiceRequsetMsg">
114
+ <wsdl:part name="request" element="request:ServiceInvoice" />
115
+ </wsdl:message>
116
+ <wsdl:message name="ServiceInvoiceResponseMsg">
117
+ <wsdl:part name="response" element="response:ServiceInvoiceResponse" />
118
+ </wsdl:message>
119
+
120
+ <wsdl:message name="DailyStatementRequsetMsg">
121
+ <wsdl:part name="request" element="request:DailyStatement" />
122
+ </wsdl:message>
123
+ <wsdl:message name="DailyStatementResponseMsg">
124
+ <wsdl:part name="response" element="response:DailyStatementResponse" />
125
+ </wsdl:message>
126
+
127
+
128
+
129
+ <wsdl:message name="CancelOrderRequsetMsg">
130
+ <wsdl:part name="request" element="request:CancelOrder" />
131
+ </wsdl:message>
132
+ <wsdl:message name="CancelOrderResponseMsg">
133
+ <wsdl:part name="response" element="response:CancelOrderResponse" />
134
+ </wsdl:message>
135
+
136
+ <wsdl:message name="RogRefundReqRequsetMsg">
137
+ <wsdl:part name="request" element="request:RogRefundReq" />
138
+ </wsdl:message>
139
+ <wsdl:message name="RogRefundReqResponseMsg">
140
+ <wsdl:part name="response" element="response:RogRefundReqResponse" />
141
+ </wsdl:message>
142
+
143
+ <wsdl:message name="RogRefundActivateRequsetMsg">
144
+ <wsdl:part name="request" element="request:RogRefundActivate" />
145
+ </wsdl:message>
146
+ <wsdl:message name="RogRefundActivateResponseMsg">
147
+ <wsdl:part name="response" element="response:RogRefundActivateResponse" />
148
+ </wsdl:message>
149
+
150
+ <wsdl:message name="RogExchangeReqRequsetMsg">
151
+ <wsdl:part name="request" element="request:RogExchangeReq" />
152
+ </wsdl:message>
153
+ <wsdl:message name="RogExchangeReqResponseMsg">
154
+ <wsdl:part name="response" element="response:RogExchangeReqResponse" />
155
+ </wsdl:message>
156
+
157
+ <wsdl:message name="RogExchangeActivateRequsetMsg">
158
+ <wsdl:part name="request" element="request:RogExchangeActivate" />
159
+ </wsdl:message>
160
+ <wsdl:message name="RogExchangeActivateResponseMsg">
161
+ <wsdl:part name="response" element="response:RogExchangeActivateResponse" />
162
+ </wsdl:message>
163
+
164
+ <wsdl:message name="ChargebackRequsetMsg">
165
+ <wsdl:part name="request" element="request:Chargeback" />
166
+ </wsdl:message>
167
+ <wsdl:message name="ChargebackResponseMsg">
168
+ <wsdl:part name="response" element="response:ChargebackResponse" />
169
+ </wsdl:message>
170
+
171
+
172
+
173
+ <wsdl:message name="SaleSummRequsetMsg">
174
+ <wsdl:part name="request" element="request:SaleSumm" />
175
+ </wsdl:message>
176
+ <wsdl:message name="SaleSummResponseMsg">
177
+ <wsdl:part name="response" element="response:SaleSummResponse" />
178
+ </wsdl:message>
179
+
180
+ <wsdl:message name="CustInfoRequsetMsg">
181
+ <wsdl:part name="request" element="request:CustInfo" />
182
+ </wsdl:message>
183
+ <wsdl:message name="CustInfoResponseMsg">
184
+ <wsdl:part name="response" element="response:CustInfoResponse" />
185
+ </wsdl:message>
186
+
187
+ <wsdl:message name="FailedTransRequsetMsg">
188
+ <wsdl:part name="request" element="request:FailedTrans" />
189
+ </wsdl:message>
190
+ <wsdl:message name="FailedTransResponseMsg">
191
+ <wsdl:part name="response" element="response:FailedTransResponse" />
192
+ </wsdl:message>
193
+
194
+ <wsdl:message name="RollingReservesRequsetMsg">
195
+ <wsdl:part name="request" element="request:RollingReserves" />
196
+ </wsdl:message>
197
+ <wsdl:message name="RollingReservesResponseMsg">
198
+ <wsdl:part name="response" element="response:RollingReservesResponse" />
199
+ </wsdl:message>
200
+
201
+
202
+ <!-- ************************************************************** -->
203
+ <!-- #### GECA WEB SERVICES WSDL PORT TYPE DECLARATION #### -->
204
+ <!-- ************************************************************** -->
205
+
206
+
207
+ <wsdl:portType name="GecaWsHandlerPort">
208
+
209
+
210
+ <wsdl:operation name="Echo">
211
+ <wsdl:input message="impl:EchoRequestMsg" name="echoRequest" />
212
+ <wsdl:output message="impl:EchoResponseMsg" name="echoResponse" />
213
+ </wsdl:operation>
214
+
215
+
216
+
217
+ <wsdl:operation name="OrderList">
218
+ <wsdl:input message="impl:OrderListRequsetMsg" name="orderListRequest" />
219
+ <wsdl:output message="impl:OrderListResponseMsg" name="orderListResponse" />
220
+ </wsdl:operation>
221
+
222
+ <wsdl:operation name="Pick">
223
+ <wsdl:input message="impl:PickRequsetMsg" name="pickRequest" />
224
+ <wsdl:output message="impl:PickResponseMsg" name="pickResponse" />
225
+ </wsdl:operation>
226
+
227
+ <wsdl:operation name="Pack">
228
+ <wsdl:input message="impl:PackRequsetMsg" name="packRequest" />
229
+ <wsdl:output message="impl:PackResponseMsg" name="packResponse" />
230
+ </wsdl:operation>
231
+
232
+ <wsdl:operation name="Ship">
233
+ <wsdl:input message="impl:ShipRequsetMsg" name="shipRequest" />
234
+ <wsdl:output message="impl:ShipResponseMsg" name="shipResponse" />
235
+ </wsdl:operation>
236
+
237
+ <wsdl:operation name="ShipDoc">
238
+ <wsdl:input message="impl:ShipDocRequsetMsg" name="shipDocRequest" />
239
+ <wsdl:output message="impl:ShipDocResponseMsg" name="shipDocResponse" />
240
+ </wsdl:operation>
241
+
242
+ <wsdl:operation name="Track">
243
+ <wsdl:input message="impl:TrackRequsetMsg" name="trackRequest" />
244
+ <wsdl:output message="impl:TrackResponseMsg" name="trackResponse" />
245
+ </wsdl:operation>
246
+
247
+ <wsdl:operation name="EditPacking">
248
+ <wsdl:input message="impl:EditPackingRequsetMsg" name="editPackingRequest" />
249
+ <wsdl:output message="impl:EditPackingResponseMsg" name="editPackingResponse" />
250
+ </wsdl:operation>
251
+
252
+ <wsdl:operation name="RestorePacking">
253
+ <wsdl:input message="impl:RestorePackingRequsetMsg" name="restorePackingRequest" />
254
+ <wsdl:output message="impl:RestorePackingResponseMsg" name="restorePackingResponse" />
255
+ </wsdl:operation>
256
+
257
+ <wsdl:operation name="OrderDetails">
258
+ <wsdl:input message="impl:OrderDetailsRequsetMsg" name="orderDetailsRequest" />
259
+ <wsdl:output message="impl:OrderDetailsResponseMsg" name="orderDetailsResponse" />
260
+ </wsdl:operation>
261
+
262
+ <wsdl:operation name="PartShipReq">
263
+ <wsdl:input message="impl:PartShipReqRequsetMsg" name="partShipReqRequest" />
264
+ <wsdl:output message="impl:PartShipReqResponseMsg" name="partShipReqResponse" />
265
+ </wsdl:operation>
266
+
267
+ <wsdl:operation name="PartShipConfirm">
268
+ <wsdl:input message="impl:PartShipConfirmRequsetMsg" name="partShipConfirmRequest" />
269
+ <wsdl:output message="impl:PartShipConfirmResponseMsg" name="partShipConfirmResponse" />
270
+ </wsdl:operation>
271
+
272
+
273
+
274
+ <wsdl:operation name="ServiceInvoice">
275
+ <wsdl:input message="impl:ServiceInvoiceRequsetMsg" name="serviceInvoiceRequest" />
276
+ <wsdl:output message="impl:ServiceInvoiceResponseMsg" name="serviceInvoiceResponse" />
277
+ </wsdl:operation>
278
+
279
+ <wsdl:operation name="DailyStatement">
280
+ <wsdl:input message="impl:DailyStatementRequsetMsg" name="dailyStatementRequest" />
281
+ <wsdl:output message="impl:DailyStatementResponseMsg" name="dailyStatementResponse" />
282
+ </wsdl:operation>
283
+
284
+
285
+
286
+ <wsdl:operation name="CancelOrder">
287
+ <wsdl:input message="impl:CancelOrderRequsetMsg" name="cancelOrderRequest" />
288
+ <wsdl:output message="impl:CancelOrderResponseMsg" name="cancelOrderResponse" />
289
+ </wsdl:operation>
290
+
291
+ <wsdl:operation name="RogRefundReq">
292
+ <wsdl:input message="impl:RogRefundReqRequsetMsg" name="rogRefundReqRequest" />
293
+ <wsdl:output message="impl:RogRefundReqResponseMsg" name="rogRefundReqResponse" />
294
+ </wsdl:operation>
295
+
296
+ <wsdl:operation name="RogRefundActivate">
297
+ <wsdl:input message="impl:RogRefundActivateRequsetMsg" name="rogRefundActivateRequest" />
298
+ <wsdl:output message="impl:RogRefundActivateResponseMsg" name="rogRefundActivateResponse" />
299
+ </wsdl:operation>
300
+
301
+ <wsdl:operation name="RogExchangeReq">
302
+ <wsdl:input message="impl:RogExchangeReqRequsetMsg" name="rogExchangeReqRequest" />
303
+ <wsdl:output message="impl:RogExchangeReqResponseMsg" name="rogExchangeReqResponse" />
304
+ </wsdl:operation>
305
+
306
+ <wsdl:operation name="RogExchangeActivate">
307
+ <wsdl:input message="impl:RogExchangeActivateRequsetMsg" name="rogExchangeActivateRequest" />
308
+ <wsdl:output message="impl:RogExchangeActivateResponseMsg" name="rogExchangeActivateResponse" />
309
+ </wsdl:operation>
310
+
311
+ <wsdl:operation name="Chargeback">
312
+ <wsdl:input message="impl:ChargebackRequsetMsg" name="chargebackRequest" />
313
+ <wsdl:output message="impl:ChargebackResponseMsg" name="chargebackResponse" />
314
+ </wsdl:operation>
315
+
316
+
317
+
318
+ <wsdl:operation name="SaleSumm">
319
+ <wsdl:input message="impl:SaleSummRequsetMsg" name="saleSummRequest" />
320
+ <wsdl:output message="impl:SaleSummResponseMsg" name="saleSummResponse" />
321
+ </wsdl:operation>
322
+
323
+ <wsdl:operation name="CustInfo">
324
+ <wsdl:input message="impl:CustInfoRequsetMsg" name="custInfoRequest" />
325
+ <wsdl:output message="impl:CustInfoResponseMsg" name="custInfoResponse" />
326
+ </wsdl:operation>
327
+
328
+ <wsdl:operation name="FailedTrans">
329
+ <wsdl:input message="impl:FailedTransRequsetMsg" name="failedTransRequest" />
330
+ <wsdl:output message="impl:FailedTransResponseMsg" name="failedTransResponse" />
331
+ </wsdl:operation>
332
+
333
+ <wsdl:operation name="RollingReserves">
334
+ <wsdl:input message="impl:RollingReservesRequsetMsg" name="rollingReservesRequest" />
335
+ <wsdl:output message="impl:RollingReservesResponseMsg" name="rollingReservesResponse" />
336
+ </wsdl:operation>
337
+
338
+
339
+ </wsdl:portType>
340
+
341
+
342
+ <!-- ************************************************************** -->
343
+ <!-- #### GECA WEB SERVICES WSDL PORT BINDING DECLARATION #### -->
344
+ <!-- ************************************************************** -->
345
+
346
+
347
+ <wsdl:binding name="GecaWsHandlerSoapBinding" type="impl:GecaWsHandlerPort">
348
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
349
+
350
+
351
+ <wsdl:operation name="Echo">
352
+ <wsdlsoap:operation soapAction="" />
353
+ <wsdl:input name="echoRequest">
354
+ <wsdlsoap:body use="literal" />
355
+ </wsdl:input>
356
+ <wsdl:output name="echoResponse">
357
+ <wsdlsoap:body use="literal" />
358
+ </wsdl:output>
359
+ </wsdl:operation>
360
+
361
+
362
+
363
+ <wsdl:operation name="OrderList">
364
+ <wsdlsoap:operation soapAction="" />
365
+ <wsdl:input name="orderListRequest">
366
+ <wsdlsoap:body use="literal" />
367
+ </wsdl:input>
368
+ <wsdl:output name="orderListResponse">
369
+ <wsdlsoap:body use="literal" />
370
+ </wsdl:output>
371
+ </wsdl:operation>
372
+
373
+ <wsdl:operation name="Pick">
374
+ <wsdlsoap:operation soapAction="" />
375
+ <wsdl:input name="pickRequest">
376
+ <wsdlsoap:body use="literal" />
377
+ </wsdl:input>
378
+ <wsdl:output name="pickResponse">
379
+ <wsdlsoap:body use="literal" />
380
+ </wsdl:output>
381
+ </wsdl:operation>
382
+
383
+ <wsdl:operation name="Pack">
384
+ <wsdlsoap:operation soapAction="" />
385
+ <wsdl:input name="packRequest">
386
+ <wsdlsoap:body use="literal" />
387
+ </wsdl:input>
388
+ <wsdl:output name="packResponse">
389
+ <wsdlsoap:body use="literal" />
390
+ </wsdl:output>
391
+ </wsdl:operation>
392
+
393
+ <wsdl:operation name="Ship">
394
+ <wsdlsoap:operation soapAction="" />
395
+ <wsdl:input name="shipRequest">
396
+ <wsdlsoap:body use="literal" />
397
+ </wsdl:input>
398
+ <wsdl:output name="shipResponse">
399
+ <wsdlsoap:body use="literal" />
400
+ </wsdl:output>
401
+ </wsdl:operation>
402
+
403
+ <wsdl:operation name="ShipDoc">
404
+ <wsdlsoap:operation soapAction="" />
405
+ <wsdl:input name="shipDocRequest">
406
+ <wsdlsoap:body use="literal" />
407
+ </wsdl:input>
408
+ <wsdl:output name="shipDocResponse">
409
+ <wsdlsoap:body use="literal" />
410
+ </wsdl:output>
411
+ </wsdl:operation>
412
+
413
+ <wsdl:operation name="Track">
414
+ <wsdlsoap:operation soapAction="" />
415
+ <wsdl:input name="trackRequest">
416
+ <wsdlsoap:body use="literal" />
417
+ </wsdl:input>
418
+ <wsdl:output name="trackResponse">
419
+ <wsdlsoap:body use="literal" />
420
+ </wsdl:output>
421
+ </wsdl:operation>
422
+
423
+ <wsdl:operation name="EditPacking">
424
+ <wsdlsoap:operation soapAction="" />
425
+ <wsdl:input name="editPackingRequest">
426
+ <wsdlsoap:body use="literal" />
427
+ </wsdl:input>
428
+ <wsdl:output name="editPackingResponse">
429
+ <wsdlsoap:body use="literal" />
430
+ </wsdl:output>
431
+ </wsdl:operation>
432
+
433
+ <wsdl:operation name="RestorePacking">
434
+ <wsdlsoap:operation soapAction="" />
435
+ <wsdl:input name="restorePackingRequest">
436
+ <wsdlsoap:body use="literal" />
437
+ </wsdl:input>
438
+ <wsdl:output name="restorePackingResponse">
439
+ <wsdlsoap:body use="literal" />
440
+ </wsdl:output>
441
+ </wsdl:operation>
442
+
443
+ <wsdl:operation name="OrderDetails">
444
+ <wsdlsoap:operation soapAction="" />
445
+ <wsdl:input name="orderDetailsRequest">
446
+ <wsdlsoap:body use="literal" />
447
+ </wsdl:input>
448
+ <wsdl:output name="orderDetailsResponse">
449
+ <wsdlsoap:body use="literal" />
450
+ </wsdl:output>
451
+ </wsdl:operation>
452
+
453
+ <wsdl:operation name="PartShipReq">
454
+ <wsdlsoap:operation soapAction="" />
455
+ <wsdl:input name="partShipReqRequest">
456
+ <wsdlsoap:body use="literal" />
457
+ </wsdl:input>
458
+ <wsdl:output name="partShipReqResponse">
459
+ <wsdlsoap:body use="literal" />
460
+ </wsdl:output>
461
+ </wsdl:operation>
462
+
463
+ <wsdl:operation name="PartShipConfirm">
464
+ <wsdlsoap:operation soapAction="" />
465
+ <wsdl:input name="partShipConfirmRequest">
466
+ <wsdlsoap:body use="literal" />
467
+ </wsdl:input>
468
+ <wsdl:output name="partShipConfirmResponse">
469
+ <wsdlsoap:body use="literal" />
470
+ </wsdl:output>
471
+ </wsdl:operation>
472
+
473
+
474
+
475
+ <wsdl:operation name="ServiceInvoice">
476
+ <wsdlsoap:operation soapAction="" />
477
+ <wsdl:input name="serviceInvoiceRequest">
478
+ <wsdlsoap:body use="literal" />
479
+ </wsdl:input>
480
+ <wsdl:output name="serviceInvoiceResponse">
481
+ <wsdlsoap:body use="literal" />
482
+ </wsdl:output>
483
+ </wsdl:operation>
484
+
485
+ <wsdl:operation name="DailyStatement">
486
+ <wsdlsoap:operation soapAction="" />
487
+ <wsdl:input name="dailyStatementRequest">
488
+ <wsdlsoap:body use="literal" />
489
+ </wsdl:input>
490
+ <wsdl:output name="dailyStatementResponse">
491
+ <wsdlsoap:body use="literal" />
492
+ </wsdl:output>
493
+ </wsdl:operation>
494
+
495
+
496
+
497
+ <wsdl:operation name="CancelOrder">
498
+ <wsdlsoap:operation soapAction="" />
499
+ <wsdl:input name="cancelOrderRequest">
500
+ <wsdlsoap:body use="literal" />
501
+ </wsdl:input>
502
+ <wsdl:output name="cancelOrderResponse">
503
+ <wsdlsoap:body use="literal" />
504
+ </wsdl:output>
505
+ </wsdl:operation>
506
+
507
+ <wsdl:operation name="RogRefundReq">
508
+ <wsdlsoap:operation soapAction="" />
509
+ <wsdl:input name="rogRefundReqRequest">
510
+ <wsdlsoap:body use="literal" />
511
+ </wsdl:input>
512
+ <wsdl:output name="rogRefundReqResponse">
513
+ <wsdlsoap:body use="literal" />
514
+ </wsdl:output>
515
+ </wsdl:operation>
516
+
517
+ <wsdl:operation name="RogRefundActivate">
518
+ <wsdlsoap:operation soapAction="" />
519
+ <wsdl:input name="rogRefundActivateRequest">
520
+ <wsdlsoap:body use="literal" />
521
+ </wsdl:input>
522
+ <wsdl:output name="rogRefundActivateResponse">
523
+ <wsdlsoap:body use="literal" />
524
+ </wsdl:output>
525
+ </wsdl:operation>
526
+
527
+ <wsdl:operation name="RogExchangeReq">
528
+ <wsdlsoap:operation soapAction="" />
529
+ <wsdl:input name="rogExchangeReqRequest">
530
+ <wsdlsoap:body use="literal" />
531
+ </wsdl:input>
532
+ <wsdl:output name="rogExchangeReqResponse">
533
+ <wsdlsoap:body use="literal" />
534
+ </wsdl:output>
535
+ </wsdl:operation>
536
+
537
+ <wsdl:operation name="RogExchangeActivate">
538
+ <wsdlsoap:operation soapAction="" />
539
+ <wsdl:input name="rogExchangeActivateRequest">
540
+ <wsdlsoap:body use="literal" />
541
+ </wsdl:input>
542
+ <wsdl:output name="rogExchangeActivateResponse">
543
+ <wsdlsoap:body use="literal" />
544
+ </wsdl:output>
545
+ </wsdl:operation>
546
+
547
+ <wsdl:operation name="Chargeback">
548
+ <wsdlsoap:operation soapAction="" />
549
+ <wsdl:input name="chargebackRequest">
550
+ <wsdlsoap:body use="literal" />
551
+ </wsdl:input>
552
+ <wsdl:output name="chargebackResponse">
553
+ <wsdlsoap:body use="literal" />
554
+ </wsdl:output>
555
+ </wsdl:operation>
556
+
557
+
558
+
559
+ <wsdl:operation name="SaleSumm">
560
+ <wsdlsoap:operation soapAction="" />
561
+ <wsdl:input name="saleSummRequest">
562
+ <wsdlsoap:body use="literal" />
563
+ </wsdl:input>
564
+ <wsdl:output name="saleSummResponse">
565
+ <wsdlsoap:body use="literal" />
566
+ </wsdl:output>
567
+ </wsdl:operation>
568
+
569
+ <wsdl:operation name="CustInfo">
570
+ <wsdlsoap:operation soapAction="" />
571
+ <wsdl:input name="custInfoRequest">
572
+ <wsdlsoap:body use="literal" />
573
+ </wsdl:input>
574
+ <wsdl:output name="custInfoResponse">
575
+ <wsdlsoap:body use="literal" />
576
+ </wsdl:output>
577
+ </wsdl:operation>
578
+
579
+ <wsdl:operation name="FailedTrans">
580
+ <wsdlsoap:operation soapAction="" />
581
+ <wsdl:input name="failedTransRequest">
582
+ <wsdlsoap:body use="literal" />
583
+ </wsdl:input>
584
+ <wsdl:output name="failedTransResponse">
585
+ <wsdlsoap:body use="literal" />
586
+ </wsdl:output>
587
+ </wsdl:operation>
588
+
589
+ <wsdl:operation name="RollingReserves">
590
+ <wsdlsoap:operation soapAction="" />
591
+ <wsdl:input name="rollingReservesRequest">
592
+ <wsdlsoap:body use="literal" />
593
+ </wsdl:input>
594
+ <wsdl:output name="rollingReservesResponse">
595
+ <wsdlsoap:body use="literal" />
596
+ </wsdl:output>
597
+ </wsdl:operation>
598
+
599
+
600
+ </wsdl:binding>
601
+
602
+
603
+ <!-- ************************************************************** -->
604
+ <!-- #### GECA WEB SERVICES WSDL PORT SERVICE DECLARATION #### -->
605
+ <!-- ************************************************************** -->
606
+
607
+ <wsdl:service name="GecaWs">
608
+ <wsdl:port binding="impl:GecaWsHandlerSoapBinding" name="GecaWsHandler">
609
+ <!-- wsdlsoap:address location="http://localhost:8080/GecaWs/services/GecaWsHandler" /-->
610
+ <!-- wsdlsoap:address location="http://192.168.1.93:8095/GecaWs/services/GecaWsHandler" /-->
611
+ <!-- wsdlsoap:address location="http://staging.swipezoom.com/GecaWs/services/GecaWsHandler" /-->
612
+ <wsdlsoap:address location="http://staging.swipezoom.com:8080/GecaWs/services/GecaWsHandler" />
613
+
614
+ </wsdl:port>
615
+ </wsdl:service>
616
+ </wsdl:definitions>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/_GecaWs.wsdl ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions targetNamespace="http://ws.geca.sz.com/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
4
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://ws.geca.sz.com/wsdl" xmlns:intf="http://ws.geca.sz.com/wsdl"
5
+ xmlns:request="http://www.geca.sz.com/ws/schema/request" xmlns:response="http://www.geca.sz.com/ws/schema/response">
6
+
7
+ <!-- ************************************************************** -->
8
+ <!-- #### GECA WEB SERVICES WSDL TYPES DECLARATIONS #### -->
9
+ <!-- ************************************************************** -->
10
+
11
+ <wsdl:types>
12
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
13
+ <xsd:import namespace="http://www.geca.sz.com/ws/schema/request" schemaLocation="./schema/request/GecaWsRequestSchema.xsd" />
14
+ <xsd:import namespace="http://www.geca.sz.com/ws/schema/response" schemaLocation="./schema/response/GecaWsResponseSchema.xsd" />
15
+ </xsd:schema>
16
+ </wsdl:types>
17
+
18
+
19
+ <!-- ************************************************************** -->
20
+ <!-- #### GECA WEB SERVICES WSDL MESSAGES DECLARATIONS #### -->
21
+ <!-- ************************************************************** -->
22
+
23
+
24
+ <wsdl:message name="EchoRequestMsg">
25
+ <wsdl:part name="request" element="request:Echo" />
26
+ </wsdl:message>
27
+ <wsdl:message name="EchoResponseMsg">
28
+ <wsdl:part name="response" element="response:EchoResponse" />
29
+ </wsdl:message>
30
+
31
+
32
+
33
+ <wsdl:message name="OrderListRequsetMsg">
34
+ <wsdl:part name="request" element="request:OrderList" />
35
+ </wsdl:message>
36
+ <wsdl:message name="OrderListResponseMsg">
37
+ <wsdl:part name="response" element="response:OrderListResponse" />
38
+ </wsdl:message>
39
+
40
+ <wsdl:message name="PickRequsetMsg">
41
+ <wsdl:part name="request" element="request:Pick" />
42
+ </wsdl:message>
43
+ <wsdl:message name="PickResponseMsg">
44
+ <wsdl:part name="response" element="response:PickResponse" />
45
+ </wsdl:message>
46
+
47
+ <wsdl:message name="PackRequsetMsg">
48
+ <wsdl:part name="request" element="request:Pack" />
49
+ </wsdl:message>
50
+ <wsdl:message name="PackResponseMsg">
51
+ <wsdl:part name="response" element="response:PackResponse" />
52
+ </wsdl:message>
53
+
54
+ <wsdl:message name="ShipRequsetMsg">
55
+ <wsdl:part name="request" element="request:Ship" />
56
+ </wsdl:message>
57
+ <wsdl:message name="ShipResponseMsg">
58
+ <wsdl:part name="response" element="response:ShipResponse" />
59
+ </wsdl:message>
60
+
61
+ <wsdl:message name="ShipDocRequsetMsg">
62
+ <wsdl:part name="request" element="request:ShipDoc" />
63
+ </wsdl:message>
64
+ <wsdl:message name="ShipDocResponseMsg">
65
+ <wsdl:part name="response" element="response:ShipDocResponse" />
66
+ </wsdl:message>
67
+
68
+ <wsdl:message name="TrackRequsetMsg">
69
+ <wsdl:part name="request" element="request:Track" />
70
+ </wsdl:message>
71
+ <wsdl:message name="TrackResponseMsg">
72
+ <wsdl:part name="response" element="response:TrackResponse" />
73
+ </wsdl:message>
74
+
75
+ <wsdl:message name="EditPackingRequsetMsg">
76
+ <wsdl:part name="request" element="request:EditPacking" />
77
+ </wsdl:message>
78
+ <wsdl:message name="EditPackingResponseMsg">
79
+ <wsdl:part name="response" element="response:EditPackingResponse" />
80
+ </wsdl:message>
81
+
82
+ <wsdl:message name="RestorePackingRequsetMsg">
83
+ <wsdl:part name="request" element="request:RestorePacking" />
84
+ </wsdl:message>
85
+ <wsdl:message name="RestorePackingResponseMsg">
86
+ <wsdl:part name="response" element="response:RestorePackingResponse" />
87
+ </wsdl:message>
88
+
89
+ <wsdl:message name="OrderDetailsRequsetMsg">
90
+ <wsdl:part name="request" element="request:OrderDetails" />
91
+ </wsdl:message>
92
+ <wsdl:message name="OrderDetailsResponseMsg">
93
+ <wsdl:part name="response" element="response:OrderDetailsResponse" />
94
+ </wsdl:message>
95
+
96
+ <wsdl:message name="PartShipReqRequsetMsg">
97
+ <wsdl:part name="request" element="request:PartShipReq" />
98
+ </wsdl:message>
99
+ <wsdl:message name="PartShipReqResponseMsg">
100
+ <wsdl:part name="response" element="response:PartShipReqResponse" />
101
+ </wsdl:message>
102
+
103
+ <wsdl:message name="PartShipConfirmRequsetMsg">
104
+ <wsdl:part name="request" element="request:PartShipConfirm" />
105
+ </wsdl:message>
106
+ <wsdl:message name="PartShipConfirmResponseMsg">
107
+ <wsdl:part name="response" element="response:PartShipConfirmResponse" />
108
+ </wsdl:message>
109
+
110
+
111
+
112
+ <wsdl:message name="ServiceInvoiceRequsetMsg">
113
+ <wsdl:part name="request" element="request:ServiceInvoice" />
114
+ </wsdl:message>
115
+ <wsdl:message name="ServiceInvoiceResponseMsg">
116
+ <wsdl:part name="response" element="response:ServiceInvoiceResponse" />
117
+ </wsdl:message>
118
+
119
+ <wsdl:message name="DailyStatementRequsetMsg">
120
+ <wsdl:part name="request" element="request:DailyStatement" />
121
+ </wsdl:message>
122
+ <wsdl:message name="DailyStatementResponseMsg">
123
+ <wsdl:part name="response" element="response:DailyStatementResponse" />
124
+ </wsdl:message>
125
+
126
+
127
+
128
+ <wsdl:message name="CancelOrderRequsetMsg">
129
+ <wsdl:part name="request" element="request:CancelOrder" />
130
+ </wsdl:message>
131
+ <wsdl:message name="CancelOrderResponseMsg">
132
+ <wsdl:part name="response" element="response:CancelOrderResponse" />
133
+ </wsdl:message>
134
+
135
+ <wsdl:message name="RogRefundReqRequsetMsg">
136
+ <wsdl:part name="request" element="request:RogRefundReq" />
137
+ </wsdl:message>
138
+ <wsdl:message name="RogRefundReqResponseMsg">
139
+ <wsdl:part name="response" element="response:RogRefundReqResponse" />
140
+ </wsdl:message>
141
+
142
+ <wsdl:message name="RogRefundActivateRequsetMsg">
143
+ <wsdl:part name="request" element="request:RogRefundActivate" />
144
+ </wsdl:message>
145
+ <wsdl:message name="RogRefundActivateResponseMsg">
146
+ <wsdl:part name="response" element="response:RogRefundActivateResponse" />
147
+ </wsdl:message>
148
+
149
+ <wsdl:message name="RogExchangeReqRequsetMsg">
150
+ <wsdl:part name="request" element="request:RogExchangeReq" />
151
+ </wsdl:message>
152
+ <wsdl:message name="RogExchangeReqResponseMsg">
153
+ <wsdl:part name="response" element="response:RogExchangeReqResponse" />
154
+ </wsdl:message>
155
+
156
+ <wsdl:message name="RogExchangeActivateRequsetMsg">
157
+ <wsdl:part name="request" element="request:RogExchangeActivate" />
158
+ </wsdl:message>
159
+ <wsdl:message name="RogExchangeActivateResponseMsg">
160
+ <wsdl:part name="response" element="response:RogExchangeActivateResponse" />
161
+ </wsdl:message>
162
+
163
+ <wsdl:message name="ChargebackRequsetMsg">
164
+ <wsdl:part name="request" element="request:Chargeback" />
165
+ </wsdl:message>
166
+ <wsdl:message name="ChargebackResponseMsg">
167
+ <wsdl:part name="response" element="response:ChargebackResponse" />
168
+ </wsdl:message>
169
+
170
+
171
+
172
+ <wsdl:message name="SaleSummRequsetMsg">
173
+ <wsdl:part name="request" element="request:SaleSumm" />
174
+ </wsdl:message>
175
+ <wsdl:message name="SaleSummResponseMsg">
176
+ <wsdl:part name="response" element="response:SaleSummResponse" />
177
+ </wsdl:message>
178
+
179
+ <wsdl:message name="CustInfoRequsetMsg">
180
+ <wsdl:part name="request" element="request:CustInfo" />
181
+ </wsdl:message>
182
+ <wsdl:message name="CustInfoResponseMsg">
183
+ <wsdl:part name="response" element="response:CustInfoResponse" />
184
+ </wsdl:message>
185
+
186
+ <wsdl:message name="FailedTransRequsetMsg">
187
+ <wsdl:part name="request" element="request:FailedTrans" />
188
+ </wsdl:message>
189
+ <wsdl:message name="FailedTransResponseMsg">
190
+ <wsdl:part name="response" element="response:FailedTransResponse" />
191
+ </wsdl:message>
192
+
193
+ <wsdl:message name="RollingReservesRequsetMsg">
194
+ <wsdl:part name="request" element="request:RollingReserves" />
195
+ </wsdl:message>
196
+ <wsdl:message name="RollingReservesResponseMsg">
197
+ <wsdl:part name="response" element="response:RollingReservesResponse" />
198
+ </wsdl:message>
199
+
200
+
201
+ <!-- ************************************************************** -->
202
+ <!-- #### GECA WEB SERVICES WSDL PORT TYPE DECLARATION #### -->
203
+ <!-- ************************************************************** -->
204
+
205
+
206
+ <wsdl:portType name="GecaWsHandlerPort">
207
+
208
+
209
+ <wsdl:operation name="Echo">
210
+ <wsdl:input message="impl:EchoRequestMsg" name="echoRequest" />
211
+ <wsdl:output message="impl:EchoResponseMsg" name="echoResponse" />
212
+ </wsdl:operation>
213
+
214
+
215
+
216
+ <wsdl:operation name="OrderList">
217
+ <wsdl:input message="impl:OrderListRequsetMsg" name="orderListRequest" />
218
+ <wsdl:output message="impl:OrderListResponseMsg" name="orderListResponse" />
219
+ </wsdl:operation>
220
+
221
+ <wsdl:operation name="Pick">
222
+ <wsdl:input message="impl:PickRequsetMsg" name="pickRequest" />
223
+ <wsdl:output message="impl:PickResponseMsg" name="pickResponse" />
224
+ </wsdl:operation>
225
+
226
+ <wsdl:operation name="Pack">
227
+ <wsdl:input message="impl:PackRequsetMsg" name="packRequest" />
228
+ <wsdl:output message="impl:PackResponseMsg" name="packResponse" />
229
+ </wsdl:operation>
230
+
231
+ <wsdl:operation name="Ship">
232
+ <wsdl:input message="impl:ShipRequsetMsg" name="shipRequest" />
233
+ <wsdl:output message="impl:ShipResponseMsg" name="shipResponse" />
234
+ </wsdl:operation>
235
+
236
+ <wsdl:operation name="ShipDoc">
237
+ <wsdl:input message="impl:ShipDocRequsetMsg" name="shipDocRequest" />
238
+ <wsdl:output message="impl:ShipDocResponseMsg" name="shipDocResponse" />
239
+ </wsdl:operation>
240
+
241
+ <wsdl:operation name="Track">
242
+ <wsdl:input message="impl:TrackRequsetMsg" name="trackRequest" />
243
+ <wsdl:output message="impl:TrackResponseMsg" name="trackResponse" />
244
+ </wsdl:operation>
245
+
246
+ <wsdl:operation name="EditPacking">
247
+ <wsdl:input message="impl:EditPackingRequsetMsg" name="editPackingRequest" />
248
+ <wsdl:output message="impl:EditPackingResponseMsg" name="editPackingResponse" />
249
+ </wsdl:operation>
250
+
251
+ <wsdl:operation name="RestorePacking">
252
+ <wsdl:input message="impl:RestorePackingRequsetMsg" name="restorePackingRequest" />
253
+ <wsdl:output message="impl:RestorePackingResponseMsg" name="restorePackingResponse" />
254
+ </wsdl:operation>
255
+
256
+ <wsdl:operation name="OrderDetails">
257
+ <wsdl:input message="impl:OrderDetailsRequsetMsg" name="orderDetailsRequest" />
258
+ <wsdl:output message="impl:OrderDetailsResponseMsg" name="orderDetailsResponse" />
259
+ </wsdl:operation>
260
+
261
+ <wsdl:operation name="PartShipReq">
262
+ <wsdl:input message="impl:PartShipReqRequsetMsg" name="partShipReqRequest" />
263
+ <wsdl:output message="impl:PartShipReqResponseMsg" name="partShipReqResponse" />
264
+ </wsdl:operation>
265
+
266
+ <wsdl:operation name="PartShipConfirm">
267
+ <wsdl:input message="impl:PartShipConfirmRequsetMsg" name="partShipConfirmRequest" />
268
+ <wsdl:output message="impl:PartShipConfirmResponseMsg" name="partShipConfirmResponse" />
269
+ </wsdl:operation>
270
+
271
+
272
+
273
+ <wsdl:operation name="ServiceInvoice">
274
+ <wsdl:input message="impl:ServiceInvoiceRequsetMsg" name="serviceInvoiceRequest" />
275
+ <wsdl:output message="impl:ServiceInvoiceResponseMsg" name="serviceInvoiceResponse" />
276
+ </wsdl:operation>
277
+
278
+ <wsdl:operation name="DailyStatement">
279
+ <wsdl:input message="impl:DailyStatementRequsetMsg" name="dailyStatementRequest" />
280
+ <wsdl:output message="impl:DailyStatementResponseMsg" name="dailyStatementResponse" />
281
+ </wsdl:operation>
282
+
283
+
284
+
285
+ <wsdl:operation name="CancelOrder">
286
+ <wsdl:input message="impl:CancelOrderRequsetMsg" name="cancelOrderRequest" />
287
+ <wsdl:output message="impl:CancelOrderResponseMsg" name="cancelOrderResponse" />
288
+ </wsdl:operation>
289
+
290
+ <wsdl:operation name="RogRefundReq">
291
+ <wsdl:input message="impl:RogRefundReqRequsetMsg" name="rogRefundReqRequest" />
292
+ <wsdl:output message="impl:RogRefundReqResponseMsg" name="rogRefundReqResponse" />
293
+ </wsdl:operation>
294
+
295
+ <wsdl:operation name="RogRefundActivate">
296
+ <wsdl:input message="impl:RogRefundActivateRequsetMsg" name="rogRefundActivateRequest" />
297
+ <wsdl:output message="impl:RogRefundActivateResponseMsg" name="rogRefundActivateResponse" />
298
+ </wsdl:operation>
299
+
300
+ <wsdl:operation name="RogExchangeReq">
301
+ <wsdl:input message="impl:RogExchangeReqRequsetMsg" name="rogExchangeReqRequest" />
302
+ <wsdl:output message="impl:RogExchangeReqResponseMsg" name="rogExchangeReqResponse" />
303
+ </wsdl:operation>
304
+
305
+ <wsdl:operation name="RogExchangeActivate">
306
+ <wsdl:input message="impl:RogExchangeActivateRequsetMsg" name="rogExchangeActivateRequest" />
307
+ <wsdl:output message="impl:RogExchangeActivateResponseMsg" name="rogExchangeActivateResponse" />
308
+ </wsdl:operation>
309
+
310
+ <wsdl:operation name="Chargeback">
311
+ <wsdl:input message="impl:ChargebackRequsetMsg" name="chargebackRequest" />
312
+ <wsdl:output message="impl:ChargebackResponseMsg" name="chargebackResponse" />
313
+ </wsdl:operation>
314
+
315
+
316
+
317
+ <wsdl:operation name="SaleSumm">
318
+ <wsdl:input message="impl:SaleSummRequsetMsg" name="saleSummRequest" />
319
+ <wsdl:output message="impl:SaleSummResponseMsg" name="saleSummResponse" />
320
+ </wsdl:operation>
321
+
322
+ <wsdl:operation name="CustInfo">
323
+ <wsdl:input message="impl:CustInfoRequsetMsg" name="custInfoRequest" />
324
+ <wsdl:output message="impl:CustInfoResponseMsg" name="custInfoResponse" />
325
+ </wsdl:operation>
326
+
327
+ <wsdl:operation name="FailedTrans">
328
+ <wsdl:input message="impl:FailedTransRequsetMsg" name="failedTransRequest" />
329
+ <wsdl:output message="impl:FailedTransResponseMsg" name="failedTransResponse" />
330
+ </wsdl:operation>
331
+
332
+ <wsdl:operation name="RollingReserves">
333
+ <wsdl:input message="impl:RollingReservesRequsetMsg" name="rollingReservesRequest" />
334
+ <wsdl:output message="impl:RollingReservesResponseMsg" name="rollingReservesResponse" />
335
+ </wsdl:operation>
336
+
337
+
338
+ </wsdl:portType>
339
+
340
+
341
+ <!-- ************************************************************** -->
342
+ <!-- #### GECA WEB SERVICES WSDL PORT BINDING DECLARATION #### -->
343
+ <!-- ************************************************************** -->
344
+
345
+
346
+ <wsdl:binding name="GecaWsHandlerSoapBinding" type="impl:GecaWsHandlerPort">
347
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
348
+
349
+
350
+ <wsdl:operation name="Echo">
351
+ <wsdlsoap:operation soapAction="" />
352
+ <wsdl:input name="echoRequest">
353
+ <wsdlsoap:body use="literal" />
354
+ </wsdl:input>
355
+ <wsdl:output name="echoResponse">
356
+ <wsdlsoap:body use="literal" />
357
+ </wsdl:output>
358
+ </wsdl:operation>
359
+
360
+
361
+
362
+ <wsdl:operation name="OrderList">
363
+ <wsdlsoap:operation soapAction="" />
364
+ <wsdl:input name="orderListRequest">
365
+ <wsdlsoap:body use="literal" />
366
+ </wsdl:input>
367
+ <wsdl:output name="orderListResponse">
368
+ <wsdlsoap:body use="literal" />
369
+ </wsdl:output>
370
+ </wsdl:operation>
371
+
372
+ <wsdl:operation name="Pick">
373
+ <wsdlsoap:operation soapAction="" />
374
+ <wsdl:input name="pickRequest">
375
+ <wsdlsoap:body use="literal" />
376
+ </wsdl:input>
377
+ <wsdl:output name="pickResponse">
378
+ <wsdlsoap:body use="literal" />
379
+ </wsdl:output>
380
+ </wsdl:operation>
381
+
382
+ <wsdl:operation name="Pack">
383
+ <wsdlsoap:operation soapAction="" />
384
+ <wsdl:input name="packRequest">
385
+ <wsdlsoap:body use="literal" />
386
+ </wsdl:input>
387
+ <wsdl:output name="packResponse">
388
+ <wsdlsoap:body use="literal" />
389
+ </wsdl:output>
390
+ </wsdl:operation>
391
+
392
+ <wsdl:operation name="Ship">
393
+ <wsdlsoap:operation soapAction="" />
394
+ <wsdl:input name="shipRequest">
395
+ <wsdlsoap:body use="literal" />
396
+ </wsdl:input>
397
+ <wsdl:output name="shipResponse">
398
+ <wsdlsoap:body use="literal" />
399
+ </wsdl:output>
400
+ </wsdl:operation>
401
+
402
+ <wsdl:operation name="ShipDoc">
403
+ <wsdlsoap:operation soapAction="" />
404
+ <wsdl:input name="shipDocRequest">
405
+ <wsdlsoap:body use="literal" />
406
+ </wsdl:input>
407
+ <wsdl:output name="shipDocResponse">
408
+ <wsdlsoap:body use="literal" />
409
+ </wsdl:output>
410
+ </wsdl:operation>
411
+
412
+ <wsdl:operation name="Track">
413
+ <wsdlsoap:operation soapAction="" />
414
+ <wsdl:input name="trackRequest">
415
+ <wsdlsoap:body use="literal" />
416
+ </wsdl:input>
417
+ <wsdl:output name="trackResponse">
418
+ <wsdlsoap:body use="literal" />
419
+ </wsdl:output>
420
+ </wsdl:operation>
421
+
422
+ <wsdl:operation name="EditPacking">
423
+ <wsdlsoap:operation soapAction="" />
424
+ <wsdl:input name="editPackingRequest">
425
+ <wsdlsoap:body use="literal" />
426
+ </wsdl:input>
427
+ <wsdl:output name="editPackingResponse">
428
+ <wsdlsoap:body use="literal" />
429
+ </wsdl:output>
430
+ </wsdl:operation>
431
+
432
+ <wsdl:operation name="RestorePacking">
433
+ <wsdlsoap:operation soapAction="" />
434
+ <wsdl:input name="restorePackingRequest">
435
+ <wsdlsoap:body use="literal" />
436
+ </wsdl:input>
437
+ <wsdl:output name="restorePackingResponse">
438
+ <wsdlsoap:body use="literal" />
439
+ </wsdl:output>
440
+ </wsdl:operation>
441
+
442
+ <wsdl:operation name="OrderDetails">
443
+ <wsdlsoap:operation soapAction="" />
444
+ <wsdl:input name="orderDetailsRequest">
445
+ <wsdlsoap:body use="literal" />
446
+ </wsdl:input>
447
+ <wsdl:output name="orderDetailsResponse">
448
+ <wsdlsoap:body use="literal" />
449
+ </wsdl:output>
450
+ </wsdl:operation>
451
+
452
+ <wsdl:operation name="PartShipReq">
453
+ <wsdlsoap:operation soapAction="" />
454
+ <wsdl:input name="partShipReqRequest">
455
+ <wsdlsoap:body use="literal" />
456
+ </wsdl:input>
457
+ <wsdl:output name="partShipReqResponse">
458
+ <wsdlsoap:body use="literal" />
459
+ </wsdl:output>
460
+ </wsdl:operation>
461
+
462
+ <wsdl:operation name="PartShipConfirm">
463
+ <wsdlsoap:operation soapAction="" />
464
+ <wsdl:input name="partShipConfirmRequest">
465
+ <wsdlsoap:body use="literal" />
466
+ </wsdl:input>
467
+ <wsdl:output name="partShipConfirmResponse">
468
+ <wsdlsoap:body use="literal" />
469
+ </wsdl:output>
470
+ </wsdl:operation>
471
+
472
+
473
+
474
+ <wsdl:operation name="ServiceInvoice">
475
+ <wsdlsoap:operation soapAction="" />
476
+ <wsdl:input name="serviceInvoiceRequest">
477
+ <wsdlsoap:body use="literal" />
478
+ </wsdl:input>
479
+ <wsdl:output name="serviceInvoiceResponse">
480
+ <wsdlsoap:body use="literal" />
481
+ </wsdl:output>
482
+ </wsdl:operation>
483
+
484
+ <wsdl:operation name="DailyStatement">
485
+ <wsdlsoap:operation soapAction="" />
486
+ <wsdl:input name="dailyStatementRequest">
487
+ <wsdlsoap:body use="literal" />
488
+ </wsdl:input>
489
+ <wsdl:output name="dailyStatementResponse">
490
+ <wsdlsoap:body use="literal" />
491
+ </wsdl:output>
492
+ </wsdl:operation>
493
+
494
+
495
+
496
+ <wsdl:operation name="CancelOrder">
497
+ <wsdlsoap:operation soapAction="" />
498
+ <wsdl:input name="cancelOrderRequest">
499
+ <wsdlsoap:body use="literal" />
500
+ </wsdl:input>
501
+ <wsdl:output name="cancelOrderResponse">
502
+ <wsdlsoap:body use="literal" />
503
+ </wsdl:output>
504
+ </wsdl:operation>
505
+
506
+ <wsdl:operation name="RogRefundReq">
507
+ <wsdlsoap:operation soapAction="" />
508
+ <wsdl:input name="rogRefundReqRequest">
509
+ <wsdlsoap:body use="literal" />
510
+ </wsdl:input>
511
+ <wsdl:output name="rogRefundReqResponse">
512
+ <wsdlsoap:body use="literal" />
513
+ </wsdl:output>
514
+ </wsdl:operation>
515
+
516
+ <wsdl:operation name="RogRefundActivate">
517
+ <wsdlsoap:operation soapAction="" />
518
+ <wsdl:input name="rogRefundActivateRequest">
519
+ <wsdlsoap:body use="literal" />
520
+ </wsdl:input>
521
+ <wsdl:output name="rogRefundActivateResponse">
522
+ <wsdlsoap:body use="literal" />
523
+ </wsdl:output>
524
+ </wsdl:operation>
525
+
526
+ <wsdl:operation name="RogExchangeReq">
527
+ <wsdlsoap:operation soapAction="" />
528
+ <wsdl:input name="rogExchangeReqRequest">
529
+ <wsdlsoap:body use="literal" />
530
+ </wsdl:input>
531
+ <wsdl:output name="rogExchangeReqResponse">
532
+ <wsdlsoap:body use="literal" />
533
+ </wsdl:output>
534
+ </wsdl:operation>
535
+
536
+ <wsdl:operation name="RogExchangeActivate">
537
+ <wsdlsoap:operation soapAction="" />
538
+ <wsdl:input name="rogExchangeActivateRequest">
539
+ <wsdlsoap:body use="literal" />
540
+ </wsdl:input>
541
+ <wsdl:output name="rogExchangeActivateResponse">
542
+ <wsdlsoap:body use="literal" />
543
+ </wsdl:output>
544
+ </wsdl:operation>
545
+
546
+ <wsdl:operation name="Chargeback">
547
+ <wsdlsoap:operation soapAction="" />
548
+ <wsdl:input name="chargebackRequest">
549
+ <wsdlsoap:body use="literal" />
550
+ </wsdl:input>
551
+ <wsdl:output name="chargebackResponse">
552
+ <wsdlsoap:body use="literal" />
553
+ </wsdl:output>
554
+ </wsdl:operation>
555
+
556
+
557
+
558
+ <wsdl:operation name="SaleSumm">
559
+ <wsdlsoap:operation soapAction="" />
560
+ <wsdl:input name="saleSummRequest">
561
+ <wsdlsoap:body use="literal" />
562
+ </wsdl:input>
563
+ <wsdl:output name="saleSummResponse">
564
+ <wsdlsoap:body use="literal" />
565
+ </wsdl:output>
566
+ </wsdl:operation>
567
+
568
+ <wsdl:operation name="CustInfo">
569
+ <wsdlsoap:operation soapAction="" />
570
+ <wsdl:input name="custInfoRequest">
571
+ <wsdlsoap:body use="literal" />
572
+ </wsdl:input>
573
+ <wsdl:output name="custInfoResponse">
574
+ <wsdlsoap:body use="literal" />
575
+ </wsdl:output>
576
+ </wsdl:operation>
577
+
578
+ <wsdl:operation name="FailedTrans">
579
+ <wsdlsoap:operation soapAction="" />
580
+ <wsdl:input name="failedTransRequest">
581
+ <wsdlsoap:body use="literal" />
582
+ </wsdl:input>
583
+ <wsdl:output name="failedTransResponse">
584
+ <wsdlsoap:body use="literal" />
585
+ </wsdl:output>
586
+ </wsdl:operation>
587
+
588
+ <wsdl:operation name="RollingReserves">
589
+ <wsdlsoap:operation soapAction="" />
590
+ <wsdl:input name="rollingReservesRequest">
591
+ <wsdlsoap:body use="literal" />
592
+ </wsdl:input>
593
+ <wsdl:output name="rollingReservesResponse">
594
+ <wsdlsoap:body use="literal" />
595
+ </wsdl:output>
596
+ </wsdl:operation>
597
+
598
+
599
+ </wsdl:binding>
600
+
601
+
602
+ <!-- ************************************************************** -->
603
+ <!-- #### GECA WEB SERVICES WSDL PORT SERVICE DECLARATION #### -->
604
+ <!-- ************************************************************** -->
605
+
606
+ <wsdl:service name="GecaWs">
607
+ <wsdl:port binding="impl:GecaWsHandlerSoapBinding" name="GecaWsHandler">
608
+ <!-- wsdlsoap:address location="http://localhost:8080/GecaWs/services/GecaWsHandler" /-->
609
+ <!-- wsdlsoap:address location="http://192.168.1.93:8095/GecaWs/services/GecaWsHandler" /-->
610
+ <!-- wsdlsoap:address location="http://staging.swipezoom.com/GecaWs/services/GecaWsHandler" /-->
611
+ <wsdlsoap:address location="http://staging.swipezoom.com:8080/GecaWs/services/GecaWsHandler" />
612
+
613
+ </wsdl:port>
614
+ </wsdl:service>
615
+ </wsdl:definitions>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/transaction_binding_root_element.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <jaxb:bindings
2
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
3
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
4
+ jaxb:extensionBindingPrefixes="xjc">
5
+
6
+ <jaxb:globalBindings>
7
+ <xjc:simple />
8
+ </jaxb:globalBindings>
9
+ </jaxb:bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/transaction_binding_wsdl_port.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <bindings
2
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
4
+ wsdlLocation="../transaction_ws.wsdl"
5
+ xmlns="http://java.sun.com/xml/ns/jaxws">
6
+
7
+ <enableWrapperStyle>false</enableWrapperStyle>
8
+ <package name="com.sz.api.ws.transaction" />
9
+
10
+ <bindings node="wsdl:definitions/wsdl:portType">
11
+ <class name="TransactionWsHandler" />
12
+ </bindings>
13
+ <bindings node="wsdl:definitions/wsdl:service">
14
+ <class name="TransactionWs" />
15
+ </bindings>
16
+ </bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <jaxws:bindings wsdlLocation="GecaWs.wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
2
+ xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
3
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc">
4
+
5
+ <jaxb:globalBindings>
6
+ <xjc:simple />
7
+ </jaxb:globalBindings>
8
+
9
+ <jaxb:schemaBindings>
10
+ <jaxb:package name="com.sz.geca.ws" />
11
+ <jaxb:enableWrapperStyle>false</jaxb:enableWrapperStyle>
12
+ </jaxb:schemaBindings>
13
+
14
+ <jaxws:bindings node="wsdl:definitions">
15
+ <jaxb:bindings node="wsdl:portType">
16
+ <jaxb:class name="GecaWsHandler" />
17
+ </jaxb:bindings>
18
+ </jaxws:bindings>
19
+ <jaxws:bindings node="wsdl:definitions">
20
+ <jaxb:bindings node="wsdl:service">
21
+ <jaxb:class name="GecaWs" />
22
+ </jaxb:bindings>
23
+ </jaxws:bindings>
24
+ </jaxws:bindings>
25
+
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding_root_element.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <jaxb:bindings
2
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
3
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
4
+ jaxb:extensionBindingPrefixes="xjc">
5
+
6
+ <jaxb:globalBindings>
7
+ <xjc:simple />
8
+ </jaxb:globalBindings>
9
+ </jaxb:bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/binding/wsdl_binding_wsdl_port.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <bindings
2
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
4
+ wsdlLocation="../GecaWs.wsdl"
5
+ xmlns="http://java.sun.com/xml/ns/jaxws">
6
+
7
+ <enableWrapperStyle>false</enableWrapperStyle>
8
+ <package name="com.sz.geca.ws" />
9
+
10
+ <bindings node="wsdl:definitions/wsdl:portType">
11
+ <class name="GecaWsHandler" />
12
+ </bindings>
13
+ <bindings node="wsdl:definitions/wsdl:service">
14
+ <class name="GecaWs" />
15
+ </bindings>
16
+ </bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/common_schema.xsd ADDED
@@ -0,0 +1,485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsd:schema targetNamespace="http://www.api.sz.com/ws/schema/common" xmlns:CommonSchema="http://www.api.sz.com/ws/schema/common"
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
4
+
5
+
6
+
7
+ <!-- ************************************************************** -->
8
+ <!-- #### WEBSERVICES GROUP DEFINITIONS #### -->
9
+ <!-- ************************************************************** -->
10
+
11
+ <xsd:group name="CommonResponseGroup">
12
+ <xsd:sequence>
13
+ <xsd:element name="ResponseStatusCode" type="CommonSchema:AN3" />
14
+ <xsd:element name="ResponseStatusDesc" type="CommonSchema:AN...60" />
15
+ <xsd:element name="SWRefNo" type="CommonSchema:N...20" />
16
+ <xsd:element name="MerchantRefNo" type="CommonSchema:AN...20" minOccurs="0" />
17
+ </xsd:sequence>
18
+ </xsd:group>
19
+
20
+ <xsd:group name="AddressGroup">
21
+ <xsd:sequence>
22
+ <xsd:element name="Country" type="CommonSchema:A3_COUNTRY_CODE" />
23
+ <xsd:element name="FirstName" type="CommonSchema:ANS...30" />
24
+ <xsd:element name="MiddleName" type="CommonSchema:ANS...30" minOccurs="0" />
25
+ <xsd:element name="LastName" type="CommonSchema:ANS...30" />
26
+ <xsd:element name="AddressLine1" type="CommonSchema:ANS...35" />
27
+ <xsd:element name="AddressLine2" type="CommonSchema:ANS...35" minOccurs="0" />
28
+ <xsd:element name="City" type="CommonSchema:ANS...30" />
29
+ <xsd:element name="StateDivision" type="CommonSchema:ANS...30" minOccurs="0" />
30
+ <xsd:element name="PostalCode" type="CommonSchema:AN...10" minOccurs="0" />
31
+ <xsd:element name="PhoneNumber" type="CommonSchema:AN...20" />
32
+ <xsd:element name="AlternatePhoneNumber" type="CommonSchema:AN...20" minOccurs="0" />
33
+ <xsd:element name="Email" type="CommonSchema:EMAIL" />
34
+ </xsd:sequence>
35
+ </xsd:group>
36
+
37
+ <!-- ************************************************************** -->
38
+ <!-- #### COMMON COMPLEX TYPES #### -->
39
+ <!-- ************************************************************** -->
40
+
41
+ <xsd:complexType name="CallerType">
42
+ <xsd:sequence>
43
+ <xsd:element name="MerchantID" type="CommonSchema:N...20" />
44
+ <xsd:element name="MerchantKey" type="CommonSchema:ANS...60" />
45
+ <xsd:element name="Version" type="CommonSchema:AN6_VERSION_TYPE_E" />
46
+ <xsd:element name="Datetime" type="CommonSchema:DT" />
47
+ <xsd:element name="MerchantRefNo" type="CommonSchema:AN...20" minOccurs="0" />
48
+ </xsd:sequence>
49
+ </xsd:complexType>
50
+
51
+ <xsd:complexType name="PagingRequestType">
52
+ <xsd:sequence>
53
+ <xsd:element name="CurrentPage" type="CommonSchema:N" minOccurs="0" />
54
+ <xsd:element name="RecordsPerPage" type="CommonSchema:N" minOccurs="0" />
55
+ <xsd:element name="ReturnTotalRecordCount" type="CommonSchema:BOOL_YN_A1" default="N" minOccurs="0" />
56
+ </xsd:sequence>
57
+ </xsd:complexType>
58
+
59
+
60
+ <xsd:complexType name="PagingResponseType">
61
+ <xsd:sequence>
62
+ <xsd:element name="CurrentPage" type="CommonSchema:N" />
63
+ <xsd:element name="RecordsPerPage" type="CommonSchema:N" />
64
+ <xsd:element name="TotalRecords" type="CommonSchema:N" minOccurs="0" />
65
+ </xsd:sequence>
66
+ </xsd:complexType>
67
+
68
+ <xsd:complexType name="AddressType">
69
+ <xsd:sequence>
70
+ <xsd:group ref="CommonSchema:AddressGroup" />
71
+ </xsd:sequence>
72
+ </xsd:complexType>
73
+
74
+ <xsd:complexType name="CourierType">
75
+ <xsd:sequence>
76
+ <xsd:element name="InterfaceName" type="CommonSchema:COURIER_TYPE_E" />
77
+ <xsd:element name="ServiceName" type="CommonSchema:AN...500" />
78
+ <xsd:element name="WayBillNo" type="CommonSchema:AN...500" minOccurs="0" />
79
+ <xsd:element name="EstimatedDeliveryDay" type="CommonSchema:AN...500" minOccurs="0" />
80
+ </xsd:sequence>
81
+ </xsd:complexType>
82
+
83
+ <xsd:complexType name="PaymentGatewayType">
84
+ <xsd:sequence>
85
+ <xsd:element name="WebConfirmed" type="CommonSchema:BOOL_YN_A1" />
86
+ <xsd:element name="InterfaceName" type="CommonSchema:AN...500" />
87
+ <xsd:element name="PaymentRefNo" type="CommonSchema:AN...500" minOccurs="0" />
88
+ <xsd:element name="CardAccountType" type="CommonSchema:AN...500" />
89
+ <xsd:element name="AnonymousPan" type="CommonSchema:AN...500" minOccurs="0" />
90
+ <xsd:element name="MaskedPan" type="CommonSchema:AN...500" minOccurs="0" />
91
+ <xsd:element name="GatewayRefNo" type="CommonSchema:AN...500" minOccurs="0" />
92
+ <xsd:element name="GatewayErrorMessage" type="CommonSchema:AN...500" minOccurs="0" />
93
+ </xsd:sequence>
94
+ </xsd:complexType>
95
+
96
+ <xsd:complexType name="CustomersType">
97
+ <xsd:sequence>
98
+ <xsd:element name="Customer" type="CommonSchema:AddressType" minOccurs="1" maxOccurs="unbounded" />
99
+ </xsd:sequence>
100
+ </xsd:complexType>
101
+
102
+ <xsd:complexType name="PackingBoxesType">
103
+ <xsd:sequence>
104
+ <xsd:element name="PackingBox" type="CommonSchema:PackingBoxType" maxOccurs="unbounded" />
105
+ </xsd:sequence>
106
+ </xsd:complexType>
107
+
108
+ <xsd:complexType name="PackingBoxType">
109
+ <xsd:sequence>
110
+ <xsd:element name="BoxNo" type="CommonSchema:N" />
111
+ <xsd:element name="BoxCode" type="CommonSchema:AN...500" />
112
+ <xsd:element name="ItemQuantity" type="CommonSchema:N" />
113
+
114
+ <xsd:element name="DimensionUnit" type="CommonSchema:A2" />
115
+ <xsd:element name="Length" type="CommonSchema:F" />
116
+ <xsd:element name="Width" type="CommonSchema:F" />
117
+ <xsd:element name="Height" type="CommonSchema:F" />
118
+
119
+ <xsd:element name="WeightUnit" type="CommonSchema:A2" />
120
+ <xsd:element name="Weight" type="CommonSchema:F" />
121
+
122
+ <xsd:element name="ProductLineItems" type="CommonSchema:ProductLineItemsType" />
123
+ </xsd:sequence>
124
+ </xsd:complexType>
125
+
126
+ <xsd:complexType name="ProductLineItemsType">
127
+ <xsd:sequence>
128
+ <xsd:element name="ProductLineItem" type="CommonSchema:ProductLineItemType" maxOccurs="unbounded" />
129
+ </xsd:sequence>
130
+ </xsd:complexType>
131
+
132
+ <xsd:complexType name="ProductLineItemType">
133
+ <xsd:sequence>
134
+ <xsd:element name="LineItemNo" type="CommonSchema:AN...500" />
135
+ <xsd:element name="ProductCode" type="CommonSchema:AN...500" />
136
+ <xsd:element name="Description" type="CommonSchema:AN...500" minOccurs="0" />
137
+ <xsd:element name="HSCode" type="CommonSchema:AN...500" />
138
+ <xsd:element name="Price" type="CommonSchema:F" />
139
+ <xsd:element name="Quantity" type="CommonSchema:N" />
140
+ <xsd:element name="SaleValue" type="CommonSchema:F" />
141
+ <xsd:element name="Size" type="CommonSchema:AN...500" minOccurs="0" />
142
+ <xsd:element name="Color" type="CommonSchema:A" minOccurs="0" />
143
+
144
+ <xsd:element name="DimensionUnit" type="CommonSchema:DIMENSION_UNIT_TYPE_E" />
145
+ <xsd:element name="Length" type="CommonSchema:F" />
146
+ <xsd:element name="Width" type="CommonSchema:F" />
147
+ <xsd:element name="Height" type="CommonSchema:F" />
148
+
149
+ <xsd:element name="WeightUnit" type="CommonSchema:WEIGHT_UNIT_TYPE_E" />
150
+ <xsd:element name="Weight" type="CommonSchema:F" />
151
+
152
+ <xsd:element name="IsReturnable" type="CommonSchema:BOOL_YN_A1" minOccurs="0" />
153
+ </xsd:sequence>
154
+ </xsd:complexType>
155
+
156
+ <xsd:complexType name="FilesType">
157
+ <xsd:sequence>
158
+ <xsd:element name="File" type="CommonSchema:FileType" maxOccurs="unbounded" />
159
+ </xsd:sequence>
160
+ </xsd:complexType>
161
+
162
+ <xsd:complexType name="FileType">
163
+ <xsd:sequence>
164
+ <xsd:element name="FileName" type="CommonSchema:AN...500" />
165
+ <xsd:element name="MimeType" type="CommonSchema:AN...500" minOccurs="0"/>
166
+ <xsd:element name="Contents" type="xsd:base64Binary" />
167
+ </xsd:sequence>
168
+ </xsd:complexType>
169
+
170
+ <xsd:complexType name="VouchersType">
171
+ <xsd:sequence>
172
+ <xsd:element name="Voucher" type="CommonSchema:VoucherType" maxOccurs="unbounded" />
173
+ </xsd:sequence>
174
+ </xsd:complexType>
175
+
176
+ <xsd:complexType name="VoucherType">
177
+ <xsd:sequence>
178
+ <xsd:element name="VoucherType" type="CommonSchema:A" />
179
+ <xsd:element name="VoucherDate" type="CommonSchema:DATE" />
180
+ <xsd:element name="VoucherNo" type="CommonSchema:N" />
181
+ <xsd:element name="VoucherComments" type="CommonSchema:AN...60" minOccurs="0" />
182
+ <xsd:element name="VoucherCurrency" type="CommonSchema:A3_CURRENCY_CODE" />
183
+ <xsd:element name="VoucherAmount" type="CommonSchema:F" />
184
+ <xsd:element name="VoucherEffect" type="CommonSchema:DEBIT_CREDIT_TYPE_E" />
185
+ </xsd:sequence>
186
+ </xsd:complexType>
187
+
188
+
189
+ <!-- ************************************************************** -->
190
+ <!-- #### COMMON SIMPLE TYPES #### -->
191
+ <!-- ************************************************************** -->
192
+
193
+ <xsd:simpleType name="DATE">
194
+ <xsd:restriction base="xsd:string">
195
+ <xsd:pattern value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01])">
196
+ </xsd:pattern>
197
+ </xsd:restriction>
198
+ </xsd:simpleType>
199
+
200
+ <xsd:simpleType name="TIME">
201
+ <xsd:restriction base="xsd:string">
202
+ <xsd:pattern value="([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])">
203
+ </xsd:pattern>
204
+ </xsd:restriction>
205
+ </xsd:simpleType>
206
+
207
+ <xsd:simpleType name="DT">
208
+ <xsd:restriction base="xsd:string">
209
+ <xsd:pattern
210
+ value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])"></xsd:pattern>
211
+ </xsd:restriction>
212
+ </xsd:simpleType>
213
+
214
+ <xsd:simpleType name="GENDER_A1">
215
+ <xsd:restriction base="xsd:string">
216
+ <xsd:pattern value="[MF]{1}"></xsd:pattern>
217
+ </xsd:restriction>
218
+ </xsd:simpleType>
219
+
220
+ <xsd:simpleType name="SORTING_ORDER_A1">
221
+ <xsd:restriction base="xsd:string">
222
+ <xsd:pattern value="[AD]{1}"></xsd:pattern>
223
+ </xsd:restriction>
224
+ </xsd:simpleType>
225
+
226
+ <xsd:simpleType name="BOOL_YN_A1">
227
+ <xsd:restriction base="xsd:string">
228
+ <xsd:pattern value="[YN]{1}"></xsd:pattern>
229
+ </xsd:restriction>
230
+ </xsd:simpleType>
231
+
232
+ <xsd:simpleType name="EMAIL">
233
+ <xsd:restriction base="xsd:string">
234
+ <xsd:pattern value="([\.a-zA-Z0-9_\-])+@([a-zA-Z0-9_\-])+(([a-zA-Z0-9_\-])*\.([a-zA-Z0-9_\-])+)+"></xsd:pattern>
235
+ <xsd:maxLength value="50" />
236
+ </xsd:restriction>
237
+ </xsd:simpleType>
238
+
239
+ <xsd:simpleType name="AN6_VERSION_TYPE_E">
240
+ <xsd:restriction base="xsd:string">
241
+ <xsd:enumeration value="SW0101" />
242
+ </xsd:restriction>
243
+ </xsd:simpleType>
244
+
245
+
246
+
247
+ <xsd:simpleType name="COURIER_TYPE_E">
248
+ <xsd:restriction base="xsd:string">
249
+ <xsd:enumeration value="DHL" />
250
+ <xsd:enumeration value="DHL_UAE" />
251
+ <xsd:enumeration value="DHL_GBR" />
252
+ <xsd:enumeration value="DHL_ITA" />
253
+ <xsd:enumeration value="DHL_PRT" />
254
+ <xsd:enumeration value="FEDEX" />
255
+ <xsd:enumeration value="UPS" />
256
+ </xsd:restriction>
257
+ </xsd:simpleType>
258
+
259
+ <xsd:simpleType name="DIMENSION_UNIT_TYPE_E">
260
+ <xsd:restriction base="xsd:string">
261
+ <xsd:enumeration value="IN" />
262
+ <xsd:enumeration value="CM" />
263
+ </xsd:restriction>
264
+ </xsd:simpleType>
265
+
266
+ <xsd:simpleType name="WEIGHT_UNIT_TYPE_E">
267
+ <xsd:restriction base="xsd:string">
268
+ <xsd:enumeration value="KG" />
269
+ <xsd:enumeration value="LB" />
270
+ </xsd:restriction>
271
+ </xsd:simpleType>
272
+
273
+ <xsd:simpleType name="DEBIT_CREDIT_TYPE_E">
274
+ <xsd:restriction base="xsd:string">
275
+ <xsd:enumeration value="D" />
276
+ <xsd:enumeration value="C" />
277
+ </xsd:restriction>
278
+ </xsd:simpleType>
279
+
280
+ <xsd:simpleType name="CARD_TYPE_A1_E">
281
+ <xsd:restriction base="xsd:string">
282
+ <xsd:enumeration value="M" />
283
+ <xsd:enumeration value="V" />
284
+ </xsd:restriction>
285
+ </xsd:simpleType>
286
+
287
+ <xsd:simpleType name="STATEMENT_STATUS_TYPE_E">
288
+ <xsd:restriction base="xsd:string">
289
+ <xsd:enumeration value="G" />
290
+ <xsd:enumeration value="P" />
291
+ <xsd:enumeration value="F" />
292
+ <xsd:enumeration value="D" />
293
+ <xsd:enumeration value="R" />
294
+ </xsd:restriction>
295
+ </xsd:simpleType>
296
+
297
+ <xsd:simpleType name="A3_COUNTRY_CODE">
298
+ <xsd:restriction base="xsd:string">
299
+ <xsd:pattern value="[A-Za-z]{3}"></xsd:pattern>
300
+ </xsd:restriction>
301
+ </xsd:simpleType>
302
+
303
+ <xsd:simpleType name="A2_COUNTRY_CODE">
304
+ <xsd:restriction base="xsd:string">
305
+ <xsd:pattern value="[A-Za-z]{2}"></xsd:pattern>
306
+ </xsd:restriction>
307
+ </xsd:simpleType>
308
+
309
+ <xsd:simpleType name="A3_CURRENCY_CODE">
310
+ <xsd:restriction base="xsd:string">
311
+ <xsd:pattern value="[A-Za-z]{3}"></xsd:pattern>
312
+ </xsd:restriction>
313
+ </xsd:simpleType>
314
+
315
+ <xsd:simpleType name="N">
316
+ <xsd:restriction base="xsd:string">
317
+ <xsd:pattern value="\d*"></xsd:pattern>
318
+ </xsd:restriction>
319
+ </xsd:simpleType>
320
+
321
+ <xsd:simpleType name="N...3">
322
+ <xsd:restriction base="xsd:string">
323
+ <xsd:pattern value="\d{0,3}"></xsd:pattern>
324
+ </xsd:restriction>
325
+ </xsd:simpleType>
326
+
327
+ <xsd:simpleType name="N...20">
328
+ <xsd:restriction base="xsd:string">
329
+ <xsd:pattern value="\d{0,20}"></xsd:pattern>
330
+ </xsd:restriction>
331
+ </xsd:simpleType>
332
+
333
+ <xsd:simpleType name="F">
334
+ <xsd:restriction base="xsd:string">
335
+ <xsd:pattern value="(\d*\.\d+|\d*)"></xsd:pattern>
336
+ </xsd:restriction>
337
+ </xsd:simpleType>
338
+
339
+ <xsd:simpleType name="AM">
340
+ <xsd:restriction base="xsd:string">
341
+ <xsd:pattern value="(\d*\.\d{1,4}|\d*)"></xsd:pattern>
342
+ </xsd:restriction>
343
+ </xsd:simpleType>
344
+
345
+ <xsd:simpleType name="A">
346
+ <xsd:restriction base="xsd:string">
347
+ <xsd:pattern value="[A-Za-z]*"></xsd:pattern>
348
+ </xsd:restriction>
349
+ </xsd:simpleType>
350
+
351
+ <xsd:simpleType name="A1">
352
+ <xsd:restriction base="xsd:string">
353
+ <xsd:pattern value="[A-Za-z]{1}"></xsd:pattern>
354
+ </xsd:restriction>
355
+ </xsd:simpleType>
356
+
357
+ <xsd:simpleType name="A2">
358
+ <xsd:restriction base="xsd:string">
359
+ <xsd:pattern value="[A-Za-z]{2}"></xsd:pattern>
360
+ </xsd:restriction>
361
+ </xsd:simpleType>
362
+
363
+ <xsd:simpleType name="AN">
364
+ <xsd:restriction base="xsd:string">
365
+ <xsd:pattern value="[A-Za-z0-9! #$%'()*+,-./:;=>?@\]\[\\^_`{|}~&amp;&lt;&quot;]*"></xsd:pattern>
366
+ <xsd:minLength value="0" />
367
+ </xsd:restriction>
368
+ </xsd:simpleType>
369
+
370
+ <xsd:simpleType name="AN1">
371
+ <xsd:restriction base="CommonSchema:AN">
372
+ <xsd:maxLength value="1" />
373
+ </xsd:restriction>
374
+ </xsd:simpleType>
375
+
376
+ <xsd:simpleType name="AN3">
377
+ <xsd:restriction base="CommonSchema:AN">
378
+ <xsd:maxLength value="3" />
379
+ </xsd:restriction>
380
+ </xsd:simpleType>
381
+
382
+ <xsd:simpleType name="AN...10">
383
+ <xsd:restriction base="CommonSchema:AN">
384
+ <xsd:maxLength value="10" />
385
+ </xsd:restriction>
386
+ </xsd:simpleType>
387
+
388
+ <xsd:simpleType name="AN...15">
389
+ <xsd:restriction base="CommonSchema:AN">
390
+ <xsd:maxLength value="15" />
391
+ </xsd:restriction>
392
+ </xsd:simpleType>
393
+
394
+ <xsd:simpleType name="AN...20">
395
+ <xsd:restriction base="CommonSchema:AN">
396
+ <xsd:maxLength value="20" />
397
+ </xsd:restriction>
398
+ </xsd:simpleType>
399
+
400
+ <xsd:simpleType name="AN...30">
401
+ <xsd:restriction base="CommonSchema:AN">
402
+ <xsd:maxLength value="30" />
403
+ </xsd:restriction>
404
+ </xsd:simpleType>
405
+
406
+ <xsd:simpleType name="AN...35">
407
+ <xsd:restriction base="CommonSchema:AN">
408
+ <xsd:maxLength value="35" />
409
+ </xsd:restriction>
410
+ </xsd:simpleType>
411
+
412
+ <xsd:simpleType name="AN...40">
413
+ <xsd:restriction base="CommonSchema:AN">
414
+ <xsd:maxLength value="40" />
415
+ </xsd:restriction>
416
+ </xsd:simpleType>
417
+
418
+ <xsd:simpleType name="AN...60">
419
+ <xsd:restriction base="CommonSchema:AN">
420
+ <xsd:maxLength value="60" />
421
+ </xsd:restriction>
422
+ </xsd:simpleType>
423
+
424
+ <xsd:simpleType name="AN...100">
425
+ <xsd:restriction base="CommonSchema:AN">
426
+ <xsd:maxLength value="100" />
427
+ </xsd:restriction>
428
+ </xsd:simpleType>
429
+
430
+ <xsd:simpleType name="AN...130">
431
+ <xsd:restriction base="CommonSchema:AN">
432
+ <xsd:maxLength value="130" />
433
+ </xsd:restriction>
434
+ </xsd:simpleType>
435
+
436
+ <xsd:simpleType name="AN...255">
437
+ <xsd:restriction base="CommonSchema:AN">
438
+ <xsd:maxLength value="255" />
439
+ </xsd:restriction>
440
+ </xsd:simpleType>
441
+
442
+ <xsd:simpleType name="AN...500">
443
+ <xsd:restriction base="CommonSchema:AN">
444
+ <xsd:maxLength value="500" />
445
+ </xsd:restriction>
446
+ </xsd:simpleType>
447
+
448
+ <!-- To Support Multi-Lingual Support -->
449
+ <xsd:simpleType name="ANS">
450
+ <xsd:restriction base="xsd:string">
451
+ <xsd:minLength value="0" />
452
+ </xsd:restriction>
453
+ </xsd:simpleType>
454
+
455
+ <xsd:simpleType name="ANS...30">
456
+ <xsd:restriction base="CommonSchema:ANS">
457
+ <xsd:maxLength value="30" />
458
+ </xsd:restriction>
459
+ </xsd:simpleType>
460
+
461
+ <xsd:simpleType name="ANS...35">
462
+ <xsd:restriction base="CommonSchema:ANS">
463
+ <xsd:maxLength value="35" />
464
+ </xsd:restriction>
465
+ </xsd:simpleType>
466
+
467
+ <xsd:simpleType name="ANS...60">
468
+ <xsd:restriction base="CommonSchema:ANS">
469
+ <xsd:maxLength value="60" />
470
+ </xsd:restriction>
471
+ </xsd:simpleType>
472
+
473
+ <xsd:simpleType name="ANS...130">
474
+ <xsd:restriction base="CommonSchema:ANS">
475
+ <xsd:maxLength value="130" />
476
+ </xsd:restriction>
477
+ </xsd:simpleType>
478
+
479
+ <xsd:simpleType name="ANS...500">
480
+ <xsd:restriction base="CommonSchema:ANS">
481
+ <xsd:maxLength value="500" />
482
+ </xsd:restriction>
483
+ </xsd:simpleType>
484
+
485
+ </xsd:schema>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/request/GecaWsRequestSchema.xsd ADDED
@@ -0,0 +1,754 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsd:schema targetNamespace="http://www.geca.sz.com/ws/schema/request" xmlns:RequestSchema="http://www.geca.sz.com/ws/schema/request"
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
4
+
5
+ <!-- ************************************************************** -->
6
+ <!-- #### GECA WEBSERVICES TYPE DECLARATIONS #### -->
7
+ <!-- ************************************************************** -->
8
+
9
+
10
+ <xsd:element name="Echo" type="RequestSchema:EchoType" />
11
+
12
+ <xsd:element name="OrderList" type="RequestSchema:OrderListType" />
13
+ <xsd:element name="Pick" type="RequestSchema:PickType" />
14
+ <xsd:element name="Pack" type="RequestSchema:PackType" />
15
+ <xsd:element name="Ship" type="RequestSchema:ShipType" />
16
+ <xsd:element name="ShipDoc" type="RequestSchema:ShipDocType" />
17
+ <xsd:element name="Track" type="RequestSchema:TrackType" />
18
+ <xsd:element name="EditPacking" type="RequestSchema:EditPackingType" />
19
+ <xsd:element name="RestorePacking" type="RequestSchema:RestorePackingType" />
20
+ <xsd:element name="OrderDetails" type="RequestSchema:OrderDetailsType" />
21
+ <xsd:element name="PartShipReq" type="RequestSchema:PartShipReqType" />
22
+ <xsd:element name="PartShipConfirm" type="RequestSchema:PartShipConfirmType" />
23
+
24
+ <xsd:element name="ServiceInvoice" type="RequestSchema:ServiceInvoiceType" />
25
+ <xsd:element name="DailyStatement" type="RequestSchema:DailyStatementType" />
26
+
27
+ <xsd:element name="CancelOrder" type="RequestSchema:CancelOrderType" />
28
+ <xsd:element name="RogRefundReq" type="RequestSchema:RogRefundReqType" />
29
+ <xsd:element name="RogRefundActivate" type="RequestSchema:RogRefundActivateType" />
30
+ <xsd:element name="RogExchangeReq" type="RequestSchema:RogExchangeReqType" />
31
+ <xsd:element name="RogExchangeActivate" type="RequestSchema:RogExchangeActivateType" />
32
+ <xsd:element name="Chargeback" type="RequestSchema:ChargebackType" />
33
+
34
+ <xsd:element name="SaleSumm" type="RequestSchema:SaleSummType" />
35
+ <xsd:element name="CustInfo" type="RequestSchema:CustInfoType" />
36
+ <xsd:element name="FailedTrans" type="RequestSchema:FailedTransType" />
37
+ <xsd:element name="RollingReserves" type="RequestSchema:RollingReservesType" />
38
+
39
+ <!-- ************************************************************** -->
40
+ <!-- #### GECA WEBSERVICES TYPE DEFINITIONS #### -->
41
+ <!-- ************************************************************** -->
42
+
43
+
44
+ <xsd:complexType name="EchoType">
45
+ <xsd:sequence>
46
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
47
+ <xsd:element name="echoMessage" type="RequestSchema:S500" minOccurs="0" />
48
+ </xsd:sequence>
49
+ </xsd:complexType>
50
+
51
+
52
+
53
+ <xsd:complexType name="OrderListType">
54
+ <xsd:sequence>
55
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
56
+ <xsd:element name="OrderRequest" type="RequestSchema:OrderRequestType" />
57
+ <xsd:element name="PagingRequest" type="RequestSchema:PagingRequestType" minOccurs="0" />
58
+ </xsd:sequence>
59
+ </xsd:complexType>
60
+
61
+ <xsd:complexType name="PickType">
62
+ <xsd:sequence>
63
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
64
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
65
+ </xsd:sequence>
66
+ </xsd:complexType>
67
+
68
+ <xsd:complexType name="PackType">
69
+ <xsd:sequence>
70
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
71
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
72
+ </xsd:sequence>
73
+ </xsd:complexType>
74
+
75
+ <xsd:complexType name="ShipType">
76
+ <xsd:sequence>
77
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
78
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
79
+ </xsd:sequence>
80
+ </xsd:complexType>
81
+
82
+ <xsd:complexType name="ShipDocType">
83
+ <xsd:sequence>
84
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
85
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
86
+ <!-- xsd:element name="DocCode" type="RequestSchema:S500" minOccurs="0" /> <xsd:element name="IsSpecificDocRequest" type="RequestSchema:YN_A1"
87
+ minOccurs="0" / -->
88
+ </xsd:sequence>
89
+ </xsd:complexType>
90
+
91
+ <xsd:complexType name="TrackType">
92
+ <xsd:sequence>
93
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
94
+ <xsd:element name="OrderNumber" type="RequestSchema:INT" minOccurs="0" />
95
+ <xsd:element name="TrackingNumber" type="RequestSchema:INT" minOccurs="0" />
96
+ </xsd:sequence>
97
+ </xsd:complexType>
98
+
99
+ <xsd:complexType name="EditPackingType">
100
+ <xsd:sequence>
101
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
102
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
103
+ <xsd:element name="PackingBoxes" type="RequestSchema:PackingBoxesType" />
104
+ </xsd:sequence>
105
+ </xsd:complexType>
106
+
107
+ <xsd:complexType name="RestorePackingType">
108
+ <xsd:sequence>
109
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
110
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
111
+ </xsd:sequence>
112
+ </xsd:complexType>
113
+
114
+ <xsd:complexType name="OrderDetailsType">
115
+ <xsd:sequence>
116
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
117
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
118
+ </xsd:sequence>
119
+ </xsd:complexType>
120
+
121
+ <xsd:complexType name="PartShipReqType">
122
+ <xsd:sequence>
123
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
124
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
125
+ <xsd:element name="ProductLineItems" type="RequestSchema:ProductLineItemsType" />
126
+ </xsd:sequence>
127
+ </xsd:complexType>
128
+
129
+ <xsd:complexType name="PartShipConfirmType">
130
+ <xsd:sequence>
131
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
132
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
133
+ <xsd:element name="MerchantRefNo" type="RequestSchema:S60" />
134
+ </xsd:sequence>
135
+ </xsd:complexType>
136
+
137
+
138
+
139
+ <xsd:complexType name="ServiceInvoiceType">
140
+ <xsd:sequence>
141
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
142
+ <xsd:element name="OrderNo" type="RequestSchema:INT" minOccurs="0" />
143
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" minOccurs="0" />
144
+ <xsd:element name="DateTo" type="RequestSchema:DATE" minOccurs="0" />
145
+ <xsd:element name="TimeFrom" type="RequestSchema:TIME" minOccurs="0" />
146
+ <xsd:element name="TimeTo" type="RequestSchema:TIME" minOccurs="0" />
147
+ </xsd:sequence>
148
+ </xsd:complexType>
149
+
150
+ <xsd:complexType name="DailyStatementType">
151
+ <xsd:sequence>
152
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
153
+ <xsd:element name="Period" type="RequestSchema:PERIOD_TYPE_E" minOccurs="0" />
154
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" minOccurs="0" />
155
+ <xsd:element name="DateTo" type="RequestSchema:DATE" minOccurs="0" />
156
+ </xsd:sequence>
157
+ </xsd:complexType>
158
+
159
+
160
+
161
+ <xsd:complexType name="CancelOrderType">
162
+ <xsd:sequence>
163
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
164
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
165
+ <xsd:element name="ReasonCode" type="RequestSchema:AN" />
166
+ </xsd:sequence>
167
+ </xsd:complexType>
168
+
169
+ <xsd:complexType name="RogRefundReqType">
170
+ <xsd:sequence>
171
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
172
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
173
+ <xsd:element name="ReturnAuthentication" type="RequestSchema:S500" />
174
+ <xsd:element name="ROGReasonCode" type="RequestSchema:REASON_CODE_ROG_TYPE_E" />
175
+ <xsd:element name="ProductLineItems" type="RequestSchema:ProductLineItemsType" />
176
+ </xsd:sequence>
177
+ </xsd:complexType>
178
+
179
+ <xsd:complexType name="RogRefundActivateType">
180
+ <xsd:sequence>
181
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
182
+ <xsd:element name="RogOrderNo" type="RequestSchema:INT" />
183
+ <xsd:element name="RogRefundOption" type="RequestSchema:ROG_REFUND_OPTION_TYPE_E" />
184
+ </xsd:sequence>
185
+ </xsd:complexType>
186
+
187
+ <xsd:complexType name="RogExchangeReqType">
188
+ <xsd:sequence>
189
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
190
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
191
+ <xsd:element name="ReturnAuthentication" type="RequestSchema:S500" />
192
+ <xsd:element name="ROGReasonCode" type="RequestSchema:REASON_CODE_ROG_TYPE_E" />
193
+ <xsd:element name="ProductLineItems" type="RequestSchema:ProductLineItemsType" />
194
+ </xsd:sequence>
195
+ </xsd:complexType>
196
+
197
+ <xsd:complexType name="RogExchangeActivateType">
198
+ <xsd:sequence>
199
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
200
+ <xsd:element name="RogOrderNo" type="RequestSchema:INT" />
201
+ </xsd:sequence>
202
+ </xsd:complexType>
203
+
204
+ <xsd:complexType name="ChargebackType">
205
+ <xsd:sequence>
206
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
207
+ <xsd:element name="OrderNo" type="RequestSchema:INT" />
208
+ <xsd:element name="NetworkFlag" type="RequestSchema:CARD_NETWORK_TYPE_E" />
209
+ <xsd:element name="IsCodeRetrieval" type="RequestSchema:CHARGEBACK_CODE_RETRIEVAL_TYPE_E" />
210
+ <xsd:element name="ReasonCode" type="RequestSchema:INT" />
211
+ <xsd:element name="CustomerComments" type="RequestSchema:S500" minOccurs="0" />
212
+ <xsd:element name="GatewayComments" type="RequestSchema:S500" minOccurs="0" />
213
+ </xsd:sequence>
214
+ </xsd:complexType>
215
+
216
+
217
+
218
+ <xsd:complexType name="SaleSummType">
219
+ <xsd:sequence>
220
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
221
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" />
222
+ <xsd:element name="DateTo" type="RequestSchema:DATE" />
223
+ <xsd:element name="Frequency" type="RequestSchema:FREQUENCY_TYPE_E" default="D" minOccurs="0" />
224
+ </xsd:sequence>
225
+ </xsd:complexType>
226
+
227
+ <xsd:complexType name="CustInfoType">
228
+ <xsd:sequence>
229
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
230
+ <xsd:element name="CustomerRequest" type="RequestSchema:CustomerRequestType" />
231
+ </xsd:sequence>
232
+ </xsd:complexType>
233
+
234
+ <xsd:complexType name="FailedTransType">
235
+ <xsd:sequence>
236
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
237
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" />
238
+ <xsd:element name="DateTo" type="RequestSchema:DATE" />
239
+ <xsd:element name="TimeFrom" type="RequestSchema:TIME" minOccurs="0" />
240
+ <xsd:element name="TimeTo" type="RequestSchema:TIME" minOccurs="0" />
241
+ <xsd:element name="PagingRequest" type="RequestSchema:PagingRequestType" minOccurs="0" />
242
+ </xsd:sequence>
243
+ </xsd:complexType>
244
+
245
+ <xsd:complexType name="RollingReservesType">
246
+ <xsd:sequence>
247
+ <xsd:element name="Caller" type="RequestSchema:CallerType" />
248
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" />
249
+ <xsd:element name="DateTo" type="RequestSchema:DATE" minOccurs="0" />
250
+ </xsd:sequence>
251
+ </xsd:complexType>
252
+
253
+
254
+
255
+ <!-- ************************************************************** -->
256
+ <!-- #### GECA WEBSERVICES GROUP DEFINITIONS #### -->
257
+ <!-- ************************************************************** -->
258
+ <xsd:group name="CommonRequestGroup1">
259
+ <xsd:sequence>
260
+ </xsd:sequence>
261
+ </xsd:group>
262
+
263
+
264
+
265
+ <!-- ************************************************************** -->
266
+ <!-- #### COMMON COMPLEX TYPES #### -->
267
+ <!-- ************************************************************** -->
268
+
269
+ <xsd:complexType name="CallerType">
270
+ <xsd:sequence>
271
+ <xsd:element name="MerchantID" type="RequestSchema:N20" />
272
+ <xsd:element name="MerchantKey" type="RequestSchema:S60" />
273
+ <xsd:element name="Version" type="RequestSchema:VERSION_TYPE_E" />
274
+ <xsd:element name="Datetime" type="RequestSchema:DATETIME" />
275
+ <xsd:element name="MerchantRefNo" type="RequestSchema:AN20" minOccurs="0" />
276
+ </xsd:sequence>
277
+ </xsd:complexType>
278
+
279
+ <xsd:complexType name="PagingRequestType">
280
+ <xsd:sequence>
281
+ <xsd:element name="CurrentPage" type="RequestSchema:INT" minOccurs="0" />
282
+ <xsd:element name="RecordsPerPage" type="RequestSchema:INT" minOccurs="0" />
283
+ <xsd:element name="ReturnTotalRecordCount" type="RequestSchema:YN_A1" default="N" minOccurs="0" />
284
+ </xsd:sequence>
285
+ </xsd:complexType>
286
+
287
+ <!-- xsd:complexType name="OrderRequestType"> <xsd:sequence> <xsd:element name="TransectionState" type="RequestSchema:TRANSECTION_STATE_TYPE_E"
288
+ /> <xsd:element name="TransectionListOrderBy" type="RequestSchema:TRANSECTION_LIST_ORDER_BY_TYPE_E" minOccurs="0" /> <xsd:element
289
+ name="OrderDateFrom" type="RequestSchema:DATE" minOccurs="0" /> <xsd:element name="OrderDateTo" type="RequestSchema:DATE"
290
+ minOccurs="0" /> <xsd:element name="OrderTimeFrom" type="RequestSchema:TIME" minOccurs="0" /> <xsd:element name="OrderTimeTo"
291
+ type="RequestSchema:TIME" minOccurs="0" /> <xsd:element name="DestinationCountry" type="RequestSchema:COUNTRY_CODE_A3" minOccurs="0"
292
+ /> <xsd:element name="Courier" type="RequestSchema:COURIER_TYPE_E" minOccurs="0" /> </xsd:sequence> </xsd:complexType -->
293
+
294
+ <xsd:complexType name="OrderRequestType">
295
+ <xsd:sequence>
296
+ <xsd:element name="TransectionState" type="RequestSchema:TRANSECTION_STATE_TYPE_E" />
297
+ <xsd:element name="TransectionListOrderBy" type="RequestSchema:TRANSECTION_LIST_ORDER_BY_TYPE_E"
298
+ minOccurs="0" />
299
+ <xsd:element name="orderNo" type="RequestSchema:INT" minOccurs="0" />
300
+ <xsd:element name="orderNoRef" type="RequestSchema:INT" minOccurs="0" />
301
+ <xsd:element name="orderNoParent" type="RequestSchema:INT" minOccurs="0" />
302
+ <xsd:element name="TransType" type="RequestSchema:TRANS_TYPE_TYPE_E" minOccurs="0" />
303
+ <xsd:element name="TransStatus" type="RequestSchema:TRANS_STATUS_TYPE_E" minOccurs="0" />
304
+ <xsd:element name="OrderDateFrom" type="RequestSchema:DATE" minOccurs="0" />
305
+ <xsd:element name="OrderDateTo" type="RequestSchema:DATE" minOccurs="0" />
306
+ <xsd:element name="OrderTimeFrom" type="RequestSchema:TIME" minOccurs="0" />
307
+ <xsd:element name="OrderTimeTo" type="RequestSchema:TIME" minOccurs="0" />
308
+ <xsd:element name="MerchantFilter" type="RequestSchema:MerchantFilterType" minOccurs="0" />
309
+ <xsd:element name="CourierFilter" type="RequestSchema:CourierFilterType" minOccurs="0" />
310
+ <xsd:element name="CustomerFilter" type="RequestSchema:CustomerFilterType" minOccurs="0" />
311
+ <xsd:element name="PaymentFilter" type="RequestSchema:PaymentFilterType" minOccurs="0" />
312
+ <xsd:element name="OtherFilter" type="RequestSchema:OtherFilterType" minOccurs="0" />
313
+ </xsd:sequence>
314
+ </xsd:complexType>
315
+
316
+ <xsd:complexType name="MerchantFilterType">
317
+ <xsd:sequence>
318
+ <xsd:element name="MerchantRefNo" type="RequestSchema:AN35" minOccurs="0" />
319
+ <xsd:element name="MerchantRMA" type="RequestSchema:AN25" minOccurs="0" />
320
+ <xsd:element name="MerchantTransDate" type="RequestSchema:DATE" minOccurs="0" />
321
+ <xsd:element name="MerchantTransTime" type="RequestSchema:TIME" minOccurs="0" />
322
+ <xsd:element name="MerchantTransDateTime" type="RequestSchema:DATETIME" minOccurs="0" />
323
+ <xsd:element name="MerchantIsBackorder" type="RequestSchema:YN_A1" minOccurs="0" />
324
+ <xsd:element name="MerchantMaxBackOrderDate" type="RequestSchema:DATE" minOccurs="0" />
325
+ </xsd:sequence>
326
+ </xsd:complexType>
327
+
328
+
329
+ <xsd:complexType name="CourierFilterType">
330
+ <xsd:sequence>
331
+ <xsd:element name="courierWaybillNo" type="RequestSchema:AN30" minOccurs="0" />
332
+ <xsd:element name="courier" type="RequestSchema:COURIER_TYPE_E" minOccurs="0" />
333
+ </xsd:sequence>
334
+ </xsd:complexType>
335
+
336
+ <xsd:complexType name="CustomerFilterType">
337
+ <xsd:sequence>
338
+ <xsd:element name="CustTransDate" type="RequestSchema:DATE" minOccurs="0" />
339
+ <xsd:element name="CustTransTime" type="RequestSchema:TIME" minOccurs="0" />
340
+ <xsd:element name="CustTransDateTime" type="RequestSchema:DATETIME" minOccurs="0" />
341
+ <xsd:element name="CustEstimatedDeliveryDateTime" type="RequestSchema:DATETIME" minOccurs="0" />
342
+ <xsd:element name="CustShipFirstName" type="RequestSchema:A40" minOccurs="0" />
343
+ <xsd:element name="CustShipMidleName" type="RequestSchema:A40" minOccurs="0" />
344
+ <xsd:element name="CustShipLastName" type="RequestSchema:A40" minOccurs="0" />
345
+ <xsd:element name="CustShipCountryA3" type="RequestSchema:COUNTRY_CODE_A3" minOccurs="0" />
346
+ <xsd:element name="CustShipAddressLine1" type="RequestSchema:S35" minOccurs="0" />
347
+ <xsd:element name="CustShipAddressLine2" type="RequestSchema:S35" minOccurs="0" />
348
+ <xsd:element name="CustShipCityName" type="RequestSchema:A40" minOccurs="0" />
349
+ <xsd:element name="CustShipStateDivision" type="RequestSchema:A40" minOccurs="0" />
350
+ <xsd:element name="CustShipPostCode" type="RequestSchema:S35" minOccurs="0" />
351
+ <xsd:element name="CustShipPrimaryPhone" type="RequestSchema:S35" minOccurs="0" />
352
+ <xsd:element name="CustShipSecondaryPhone" type="RequestSchema:S35" minOccurs="0" />
353
+ <xsd:element name="CustShipEmail" type="RequestSchema:S60" minOccurs="0" />
354
+ <xsd:element name="CustBillFirstName" type="RequestSchema:A40" minOccurs="0" />
355
+ <xsd:element name="CustBillMidleName" type="RequestSchema:A40" minOccurs="0" />
356
+ <xsd:element name="CustBillLastName" type="RequestSchema:A40" minOccurs="0" />
357
+ <xsd:element name="CustBillCountryA3" type="RequestSchema:COUNTRY_CODE_A3" minOccurs="0" />
358
+ <xsd:element name="CustBillAddressLine1" type="RequestSchema:S35" minOccurs="0" />
359
+ <xsd:element name="CustBillAddressLine2" type="RequestSchema:S35" minOccurs="0" />
360
+ <xsd:element name="CustBillCityName" type="RequestSchema:A40" minOccurs="0" />
361
+ <xsd:element name="CustBillStateDivision" type="RequestSchema:A40" minOccurs="0" />
362
+ <xsd:element name="CustBillPostCode" type="RequestSchema:S35" minOccurs="0" />
363
+ <xsd:element name="CustBillPrimaryPhone" type="RequestSchema:S35" minOccurs="0" />
364
+ <xsd:element name="CustBillSecondaryPhone" type="RequestSchema:S35" minOccurs="0" />
365
+ <xsd:element name="CustBillEmail" type="RequestSchema:S60" minOccurs="0" />
366
+ <xsd:element name="CustOtherEmails" type="RequestSchema:S60" minOccurs="0" />
367
+ </xsd:sequence>
368
+ </xsd:complexType>
369
+
370
+ <xsd:complexType name="PaymentFilterType">
371
+ <xsd:sequence>
372
+ <xsd:element name="PaymentStatus" type="RequestSchema:PAYMENT_STATUS_TYPE_E" minOccurs="0" />
373
+ <xsd:element name="CardAccountType" type="RequestSchema:CARD_ACCOUNT_TYPE_E" minOccurs="0" />
374
+ </xsd:sequence>
375
+ </xsd:complexType>
376
+
377
+ <xsd:complexType name="OtherFilterType">
378
+ <xsd:sequence>
379
+ <xsd:element name="StatementRefNo" type="RequestSchema:INT" minOccurs="0" />
380
+ </xsd:sequence>
381
+ </xsd:complexType>
382
+
383
+ <xsd:complexType name="PackingBoxesType">
384
+ <xsd:sequence>
385
+ <xsd:element name="PackingBox" type="RequestSchema:PackingBoxType" maxOccurs="unbounded" />
386
+ </xsd:sequence>
387
+ </xsd:complexType>
388
+
389
+ <xsd:complexType name="PackingBoxType">
390
+ <xsd:sequence>
391
+ <xsd:element name="BoxNo" type="RequestSchema:INT" />
392
+ <xsd:element name="BoxCode" type="RequestSchema:S500" />
393
+ <xsd:element name="ProductLineItems" type="RequestSchema:ProductLineItemsType" />
394
+ </xsd:sequence>
395
+ </xsd:complexType>
396
+
397
+ <xsd:complexType name="ProductLineItemsType">
398
+ <xsd:sequence>
399
+ <xsd:element name="ProductLineItem" type="RequestSchema:ProductLineItemType" maxOccurs="unbounded" />
400
+ </xsd:sequence>
401
+ </xsd:complexType>
402
+
403
+ <xsd:complexType name="ProductLineItemType">
404
+ <xsd:sequence>
405
+ <xsd:element name="ProductCode" type="RequestSchema:S500" />
406
+ <xsd:element name="Quantity" type="RequestSchema:INT" />
407
+ </xsd:sequence>
408
+ </xsd:complexType>
409
+
410
+ <xsd:complexType name="CustomerRequestType">
411
+ <xsd:sequence>
412
+ <xsd:element name="OrderNo" type="RequestSchema:INT" minOccurs="0" />
413
+ <xsd:element name="DateFrom" type="RequestSchema:DATE" minOccurs="0" />
414
+ <xsd:element name="DateTo" type="RequestSchema:DATE" minOccurs="0" />
415
+ <xsd:element name="TimeFrom" type="RequestSchema:TIME" minOccurs="0" />
416
+ <xsd:element name="TimeTo" type="RequestSchema:TIME" minOccurs="0" />
417
+ </xsd:sequence>
418
+ </xsd:complexType>
419
+
420
+ <!-- ************************************************************** -->
421
+ <!-- #### COMMON SIMPLE TYPES #### -->
422
+ <!-- ************************************************************** -->
423
+
424
+ <xsd:simpleType name="DATE">
425
+ <xsd:restriction base="xsd:string">
426
+ <xsd:pattern value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01])">
427
+ </xsd:pattern>
428
+ </xsd:restriction>
429
+ </xsd:simpleType>
430
+
431
+ <xsd:simpleType name="TIME">
432
+ <xsd:restriction base="xsd:string">
433
+ <xsd:pattern value="([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])">
434
+ </xsd:pattern>
435
+ </xsd:restriction>
436
+ </xsd:simpleType>
437
+
438
+ <xsd:simpleType name="DATETIME">
439
+ <xsd:restriction base="xsd:string">
440
+ <xsd:pattern
441
+ value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])"></xsd:pattern>
442
+ </xsd:restriction>
443
+ </xsd:simpleType>
444
+
445
+ <xsd:simpleType name="GENDER_A1">
446
+ <xsd:restriction base="xsd:string">
447
+ <xsd:pattern value="[MF]{1,1}"></xsd:pattern>
448
+ </xsd:restriction>
449
+ </xsd:simpleType>
450
+
451
+ <xsd:simpleType name="SORTING_ORDER_A1">
452
+ <xsd:restriction base="xsd:string">
453
+ <xsd:pattern value="[AD]{1,1}"></xsd:pattern>
454
+ </xsd:restriction>
455
+ </xsd:simpleType>
456
+
457
+ <xsd:simpleType name="YN_A1">
458
+ <xsd:restriction base="xsd:string">
459
+ <xsd:pattern value="[YN]{1,1}"></xsd:pattern>
460
+ </xsd:restriction>
461
+ </xsd:simpleType>
462
+
463
+ <xsd:simpleType name="INTERFACE_A1">
464
+ <xsd:restriction base="xsd:string">
465
+ <xsd:pattern value="[WMI]{1,1}"></xsd:pattern>
466
+ </xsd:restriction>
467
+ </xsd:simpleType>
468
+
469
+ <xsd:simpleType name="VERSION_TYPE_E">
470
+ <xsd:restriction base="xsd:string">
471
+ <xsd:enumeration value="SW0101" />
472
+ </xsd:restriction>
473
+ </xsd:simpleType>
474
+
475
+ <xsd:simpleType name="COURIER_TYPE_E">
476
+ <xsd:restriction base="xsd:string">
477
+ <xsd:enumeration value="DHL" />
478
+ <xsd:enumeration value="DHL_UAE" />
479
+ <xsd:enumeration value="DHL_GBR" />
480
+ <xsd:enumeration value="DHL_ITA" />
481
+ <xsd:enumeration value="DHL_PRT" />
482
+ <xsd:enumeration value="FEDEX" />
483
+ <xsd:enumeration value="UPS" />
484
+ </xsd:restriction>
485
+ </xsd:simpleType>
486
+
487
+ <xsd:simpleType name="TRANSECTION_STATE_TYPE_E">
488
+ <xsd:restriction base="xsd:string">
489
+ <xsd:enumeration value="FE" />
490
+ <xsd:enumeration value="FD" />
491
+ <xsd:enumeration value="AA" />
492
+ <!-- xsd:enumeration value="PG" / -->
493
+ <!-- xsd:enumeration value="PP" / -->
494
+ <xsd:enumeration value="RR" />
495
+ <xsd:enumeration value="RA" />
496
+ </xsd:restriction>
497
+ </xsd:simpleType>
498
+
499
+ <xsd:simpleType name="TRANSECTION_LIST_ORDER_BY_TYPE_E">
500
+ <xsd:restriction base="xsd:string">
501
+ <xsd:enumeration value="MD" />
502
+ <xsd:enumeration value="MS" />
503
+ <xsd:enumeration value="CV" />
504
+ <xsd:enumeration value="MV" />
505
+ <xsd:enumeration value="SD" />
506
+ </xsd:restriction>
507
+ </xsd:simpleType>
508
+
509
+ <xsd:simpleType name="TRANS_TYPE_TYPE_E">
510
+ <xsd:restriction base="xsd:string">
511
+ <xsd:enumeration value="TS" />
512
+ <xsd:enumeration value="TE" />
513
+ <xsd:enumeration value="GR" />
514
+ <xsd:enumeration value="GE" />
515
+ </xsd:restriction>
516
+ </xsd:simpleType>
517
+
518
+ <xsd:simpleType name="TRANS_STATUS_TYPE_E">
519
+ <xsd:restriction base="xsd:string">
520
+ <!-- xsd:enumeration value="I" /-->
521
+ <xsd:enumeration value="P" />
522
+ <xsd:enumeration value="K" />
523
+ <xsd:enumeration value="L" />
524
+ <xsd:enumeration value="B" />
525
+ <xsd:enumeration value="Q" />
526
+ <xsd:enumeration value="S" />
527
+ <xsd:enumeration value="D" />
528
+ <xsd:enumeration value="V" />
529
+ <xsd:enumeration value="R" />
530
+ <xsd:enumeration value="F" />
531
+ <xsd:enumeration value="X" />
532
+ <xsd:enumeration value="C" />
533
+ <xsd:enumeration value="G" />
534
+ <xsd:enumeration value="E" />
535
+ <xsd:enumeration value="8" />
536
+ <xsd:enumeration value="9" />
537
+ <xsd:enumeration value="4" />
538
+ <xsd:enumeration value="U" />
539
+ <xsd:enumeration value="Z" />
540
+ <xsd:enumeration value="" />
541
+ </xsd:restriction>
542
+ </xsd:simpleType>
543
+
544
+ <xsd:simpleType name="REASON_CODE_ROG_TYPE_E">
545
+ <xsd:restriction base="xsd:string">
546
+ <xsd:enumeration value="RD" />
547
+ <xsd:enumeration value="RQ" />
548
+ <xsd:enumeration value="ES" />
549
+ </xsd:restriction>
550
+ </xsd:simpleType>
551
+
552
+ <xsd:simpleType name="ROG_REFUND_OPTION_TYPE_E">
553
+ <xsd:restriction base="xsd:string">
554
+ <xsd:pattern value="[A-Z]{2}"></xsd:pattern>
555
+ </xsd:restriction>
556
+ </xsd:simpleType>
557
+
558
+ <xsd:simpleType name="FREQUENCY_TYPE_E">
559
+ <xsd:restriction base="xsd:string">
560
+ <xsd:enumeration value="D" />
561
+ </xsd:restriction>
562
+ </xsd:simpleType>
563
+
564
+ <xsd:simpleType name="PERIOD_TYPE_E">
565
+ <xsd:restriction base="xsd:string">
566
+ <xsd:enumeration value="L" />
567
+ <xsd:enumeration value="W" />
568
+ <xsd:enumeration value="M" />
569
+ </xsd:restriction>
570
+ </xsd:simpleType>
571
+
572
+ <xsd:simpleType name="CARD_NETWORK_TYPE_E">
573
+ <xsd:restriction base="xsd:string">
574
+ <xsd:enumeration value="V" />
575
+ <xsd:enumeration value="M" />
576
+ </xsd:restriction>
577
+ </xsd:simpleType>
578
+
579
+ <xsd:simpleType name="PAYMENT_STATUS_TYPE_E">
580
+ <xsd:restriction base="xsd:string">
581
+ <xsd:enumeration value="P" />
582
+ <xsd:enumeration value="M" />
583
+ <xsd:enumeration value="F" />
584
+ <xsd:enumeration value="C" />
585
+ <xsd:enumeration value="N" />
586
+ <xsd:enumeration value="R" />
587
+ <xsd:enumeration value="S" />
588
+ <xsd:enumeration value="V" />
589
+ <xsd:enumeration value="A" />
590
+ <xsd:enumeration value="4" />
591
+ </xsd:restriction>
592
+ </xsd:simpleType>
593
+
594
+ <xsd:simpleType name="CARD_ACCOUNT_TYPE_E">
595
+ <xsd:restriction base="xsd:string">
596
+ <xsd:enumeration value="V" />
597
+ <xsd:enumeration value="M" />
598
+ <xsd:enumeration value="A" />
599
+ <xsd:enumeration value="E" />
600
+ <xsd:enumeration value="P" />
601
+ <xsd:enumeration value="D" />
602
+ <xsd:enumeration value="J" />
603
+ <xsd:enumeration value="1" />
604
+ <xsd:enumeration value="2" />
605
+ <xsd:enumeration value="U" />
606
+ </xsd:restriction>
607
+ </xsd:simpleType>
608
+
609
+ <xsd:simpleType name="CHARGEBACK_CODE_RETRIEVAL_TYPE_E">
610
+ <xsd:restriction base="xsd:string">
611
+ <xsd:enumeration value="C" />
612
+ <xsd:enumeration value="R" />
613
+ </xsd:restriction>
614
+ </xsd:simpleType>
615
+
616
+ <xsd:simpleType name="EMAIL">
617
+ <xsd:restriction base="xsd:string">
618
+ <xsd:pattern value="([\.a-zA-Z0-9_\-])+@([a-zA-Z0-9_\-])+(([a-zA-Z0-9_\-])*\.([a-zA-Z0-9_\-])+)+"></xsd:pattern>
619
+ <xsd:maxLength value="100" />
620
+ </xsd:restriction>
621
+ </xsd:simpleType>
622
+
623
+ <xsd:simpleType name="COUNTRY_CODE_A3">
624
+ <xsd:restriction base="xsd:string">
625
+ <xsd:pattern value="[A-Za-z]{3}"></xsd:pattern>
626
+ </xsd:restriction>
627
+ </xsd:simpleType>
628
+
629
+ <xsd:simpleType name="COUNTRY_CODE_A2">
630
+ <xsd:restriction base="xsd:string">
631
+ <xsd:pattern value="[A-Za-z]{2}"></xsd:pattern>
632
+ </xsd:restriction>
633
+ </xsd:simpleType>
634
+
635
+ <xsd:simpleType name="VERSION_NO_A10">
636
+ <xsd:restriction base="xsd:string">
637
+ <xsd:pattern value="[A-Za-z0-9 .\-_]{1,10}"></xsd:pattern>
638
+ </xsd:restriction>
639
+ </xsd:simpleType>
640
+
641
+ <xsd:simpleType name="INT">
642
+ <xsd:restriction base="xsd:string">
643
+ <xsd:pattern value="\d*"></xsd:pattern>
644
+ </xsd:restriction>
645
+ </xsd:simpleType>
646
+
647
+ <xsd:simpleType name="FLOAT">
648
+ <xsd:restriction base="xsd:string">
649
+ <xsd:pattern value="(\d*\.\d+|\d*)"></xsd:pattern>
650
+ </xsd:restriction>
651
+ </xsd:simpleType>
652
+
653
+ <xsd:simpleType name="N12">
654
+ <xsd:restriction base="xsd:string">
655
+ <xsd:pattern value="\d{0,12}"></xsd:pattern>
656
+ </xsd:restriction>
657
+ </xsd:simpleType>
658
+
659
+ <xsd:simpleType name="N20">
660
+ <xsd:restriction base="xsd:string">
661
+ <xsd:pattern value="\d{0,20}"></xsd:pattern>
662
+ </xsd:restriction>
663
+ </xsd:simpleType>
664
+
665
+ <xsd:simpleType name="A">
666
+ <xsd:restriction base="xsd:string">
667
+ <xsd:pattern value="[A-Za-z]*"></xsd:pattern>
668
+ </xsd:restriction>
669
+ </xsd:simpleType>
670
+
671
+ <xsd:simpleType name="A6">
672
+ <xsd:restriction base="xsd:string">
673
+ <xsd:pattern value="[A-Za-z]{0,6}"></xsd:pattern>
674
+ </xsd:restriction>
675
+ </xsd:simpleType>
676
+
677
+ <xsd:simpleType name="A19">
678
+ <xsd:restriction base="xsd:string">
679
+ <xsd:pattern value="[A-Za-z]{0,19}"></xsd:pattern>
680
+ </xsd:restriction>
681
+ </xsd:simpleType>
682
+
683
+ <xsd:simpleType name="A40">
684
+ <xsd:restriction base="xsd:string">
685
+ <xsd:pattern value="[A-Za-z]{0,40}"></xsd:pattern>
686
+ </xsd:restriction>
687
+ </xsd:simpleType>
688
+
689
+ <xsd:simpleType name="A60">
690
+ <xsd:restriction base="xsd:string">
691
+ <xsd:pattern value="[A-Za-z]{0,60}"></xsd:pattern>
692
+ </xsd:restriction>
693
+ </xsd:simpleType>
694
+
695
+
696
+ <xsd:simpleType name="AN">
697
+ <xsd:restriction base="xsd:string">
698
+ <xsd:pattern value="[A-Za-z0-9]*"></xsd:pattern>
699
+ </xsd:restriction>
700
+ </xsd:simpleType>
701
+
702
+ <xsd:simpleType name="AN20">
703
+ <xsd:restriction base="xsd:string">
704
+ <xsd:pattern value="[A-Za-z0-9]{0,20}"></xsd:pattern>
705
+ </xsd:restriction>
706
+ </xsd:simpleType>
707
+
708
+ <xsd:simpleType name="AN25">
709
+ <xsd:restriction base="xsd:string">
710
+ <xsd:pattern value="[A-Za-z0-9]{0,25}"></xsd:pattern>
711
+ </xsd:restriction>
712
+ </xsd:simpleType>
713
+
714
+ <xsd:simpleType name="AN30">
715
+ <xsd:restriction base="xsd:string">
716
+ <xsd:pattern value="[A-Za-z0-9]{0,30}"></xsd:pattern>
717
+ </xsd:restriction>
718
+ </xsd:simpleType>
719
+
720
+ <xsd:simpleType name="AN40">
721
+ <xsd:restriction base="xsd:string">
722
+ <xsd:pattern value="[A-Za-z0-9]{0,30}"></xsd:pattern>
723
+ </xsd:restriction>
724
+ </xsd:simpleType>
725
+
726
+ <xsd:simpleType name="AN35">
727
+ <xsd:restriction base="xsd:string">
728
+ <xsd:pattern value="[A-Za-z0-9]{0,35}"></xsd:pattern>
729
+ </xsd:restriction>
730
+ </xsd:simpleType>
731
+
732
+
733
+ <xsd:simpleType name="S35">
734
+ <xsd:restriction base="xsd:string">
735
+ <xsd:minLength value="0" />
736
+ <xsd:maxLength value="35" />
737
+ </xsd:restriction>
738
+ </xsd:simpleType>
739
+
740
+ <xsd:simpleType name="S60">
741
+ <xsd:restriction base="xsd:string">
742
+ <xsd:minLength value="0" />
743
+ <xsd:maxLength value="60" />
744
+ </xsd:restriction>
745
+ </xsd:simpleType>
746
+
747
+ <xsd:simpleType name="S500">
748
+ <xsd:restriction base="xsd:string">
749
+ <xsd:minLength value="0" />
750
+ <xsd:maxLength value="500" />
751
+ </xsd:restriction>
752
+ </xsd:simpleType>
753
+
754
+ </xsd:schema>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/request/transaction_request_schema.xsd ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsd:schema targetNamespace="http://www.api.sz.com/ws/schema/transaction/request" xmlns:RequestSchema="http://www.api.sz.com/ws/schema/transaction/request"
3
+ xmlns:CommonSchema="http://www.api.sz.com/ws/schema/common" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ elementFormDefault="qualified">
5
+
6
+ <xsd:import namespace="http://www.api.sz.com/ws/schema/common" schemaLocation="../common_schema.xsd" />
7
+
8
+ <!-- ************************************************************** -->
9
+ <!-- #### WEBSERVICES TYPE DECLARATIONS #### -->
10
+ <!-- ************************************************************** -->
11
+
12
+
13
+ <xsd:element name="Echo" type="RequestSchema:EchoType" />
14
+
15
+ <xsd:element name="TransAddressLabeling" type="RequestSchema:TransAddressLabelingType" />
16
+ <xsd:element name="TransAddressValidation" type="RequestSchema:TransAddressValidationType" />
17
+
18
+ <xsd:element name="TransLogisticsReq" type="RequestSchema:TransLogisticsReqType" />
19
+ <xsd:element name="TransLogisticsConfirm" type="RequestSchema:TransLogisticsConfirmType" />
20
+
21
+
22
+
23
+ <!-- ************************************************************** -->
24
+ <!-- #### WEBSERVICES TYPE DEFINITIONS #### -->
25
+ <!-- ************************************************************** -->
26
+
27
+
28
+ <xsd:complexType name="EchoType">
29
+ <xsd:sequence>
30
+ <xsd:element name="Caller" type="CommonSchema:CallerType" />
31
+ <xsd:element name="echoMessage" type="CommonSchema:AN...500" minOccurs="0" />
32
+ </xsd:sequence>
33
+ </xsd:complexType>
34
+
35
+ <xsd:complexType name="TransAddressLabelingType">
36
+ <xsd:sequence>
37
+ <xsd:element name="Caller" type="CommonSchema:CallerType" />
38
+ <xsd:element name="LanguageCode" type="CommonSchema:A2" default="EN" minOccurs="0" />
39
+ <xsd:element name="CountryCode" type="CommonSchema:A3_COUNTRY_CODE" />
40
+ </xsd:sequence>
41
+ </xsd:complexType>
42
+
43
+ <xsd:complexType name="TransAddressValidationType">
44
+ <xsd:sequence>
45
+ <xsd:element name="Caller" type="CommonSchema:CallerType" />
46
+ <xsd:element name="CountryCode" type="CommonSchema:A3_COUNTRY_CODE" />
47
+ <xsd:element name="FieldValues" type="RequestSchema:FieldValuesType" />
48
+ </xsd:sequence>
49
+ </xsd:complexType>
50
+
51
+ <xsd:complexType name="TransLogisticsReqType">
52
+ <xsd:sequence>
53
+ <xsd:element name="Caller" type="CommonSchema:CallerType" />
54
+ <xsd:element name="RequestFingerprint" type="CommonSchema:AN...255" />
55
+ <xsd:element name="Order" type="RequestSchema:OrderType" />
56
+ <xsd:element name="LineItems" type="RequestSchema:LineItemsType" />
57
+ <xsd:element name="Customer" type="RequestSchema:CustomerType" />
58
+
59
+ </xsd:sequence>
60
+ </xsd:complexType>
61
+
62
+ <xsd:complexType name="TransLogisticsConfirmType">
63
+ <xsd:sequence>
64
+ <xsd:element name="Caller" type="CommonSchema:CallerType" />
65
+ <xsd:element name="OrderNo" type="CommonSchema:N...20" />
66
+ <xsd:element name="PrepaidDuties" type="CommonSchema:BOOL_YN_A1" default="Y" />
67
+ <xsd:element name="PrepaidInsurance" type="CommonSchema:BOOL_YN_A1" default="Y" />
68
+ </xsd:sequence>
69
+ </xsd:complexType>
70
+
71
+ <xsd:complexType name="FieldValuesType">
72
+ <xsd:sequence>
73
+ <xsd:element name="FieldValue" type="RequestSchema:FieldValueType" maxOccurs="unbounded" />
74
+ </xsd:sequence>
75
+ </xsd:complexType>
76
+ <xsd:complexType name="FieldValueType">
77
+ <xsd:sequence>
78
+ <xsd:element name="FieldType" type="CommonSchema:AN1" />
79
+ <xsd:element name="FieldValue" type="CommonSchema:ANS...130" />
80
+ </xsd:sequence>
81
+ </xsd:complexType>
82
+ <xsd:complexType name="OrderType">
83
+ <xsd:sequence>
84
+ <xsd:element name="OrderDescription" type="CommonSchema:AN...100" minOccurs="0" />
85
+ <xsd:element name="OrderAmount" type="CommonSchema:AM" />
86
+ <xsd:element name="OrderLineItemCount" type="CommonSchema:N...3" />
87
+ <xsd:element name="TransactionCurrency" type="CommonSchema:A3_CURRENCY_CODE" /> <!-- As discussed with safder, would be conditional in geca side -->
88
+ <xsd:element name="CustomerLanguage" type="CommonSchema:A2" default="EN" minOccurs="0" />
89
+ </xsd:sequence>
90
+ </xsd:complexType>
91
+
92
+ <xsd:complexType name="LineItemsType">
93
+ <xsd:sequence>
94
+ <xsd:element name="LineItem" type="RequestSchema:LineItemType" maxOccurs="unbounded" />
95
+ </xsd:sequence>
96
+ </xsd:complexType>
97
+
98
+ <xsd:complexType name="LineItemType">
99
+ <xsd:sequence>
100
+ <xsd:element name="ItemId" type="CommonSchema:AN...40" />
101
+ <xsd:element name="ItemDescription" type="CommonSchema:AN...60" minOccurs="0" />
102
+ <xsd:element name="ItemHsCode" type="CommonSchema:AN...15" minOccurs="0" />
103
+ <xsd:element name="ItemQuantity" type="CommonSchema:N" />
104
+ <xsd:element name="ItemPrice" type="CommonSchema:AM" />
105
+ <xsd:element name="ItemTotalAmount" type="CommonSchema:AM" />
106
+ <xsd:element name="ItemImageURL" type="CommonSchema:AN...100" minOccurs="0" />
107
+ <xsd:element name="ItemColor" type="CommonSchema:AN" minOccurs="0" />
108
+ <xsd:element name="ItemSize" type="CommonSchema:AN" minOccurs="0" />
109
+ <xsd:element name="ItemDimensionUnit" type="CommonSchema:A2" minOccurs="0" />
110
+ <xsd:element name="ItemLength" type="CommonSchema:F" minOccurs="0" />
111
+ <xsd:element name="ItemWidth" type="CommonSchema:F" minOccurs="0" />
112
+ <xsd:element name="ItemHeight" type="CommonSchema:F" minOccurs="0" />
113
+ <xsd:element name="ItemWeightUnit" type="CommonSchema:A2" minOccurs="0" />
114
+ <xsd:element name="ItemWeight" type="CommonSchema:F" minOccurs="0" />
115
+ </xsd:sequence>
116
+ </xsd:complexType>
117
+
118
+ <xsd:complexType name="CustomerType">
119
+ <xsd:sequence>
120
+ <xsd:element name="SameAddForShipping" type="CommonSchema:BOOL_YN_A1" default="Y" />
121
+ <xsd:element name="BillingAddress" type="CommonSchema:AddressType" />
122
+ <xsd:element name="ShippingAddress" type="CommonSchema:AddressType" minOccurs="0" />
123
+ <xsd:element name="OtherEmail" type="CommonSchema:EMAIL" minOccurs="0" />
124
+ </xsd:sequence>
125
+ </xsd:complexType>
126
+
127
+ </xsd:schema>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/response/GecaWsResponseSchema.xsd ADDED
@@ -0,0 +1,936 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsd:schema targetNamespace="http://www.geca.sz.com/ws/schema/response" xmlns:ResponseSchema="http://www.geca.sz.com/ws/schema/response"
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
4
+
5
+
6
+ <!-- ************************************************************** -->
7
+ <!-- #### GECA WEBSERVICES TYPE DECLARATIONS #### -->
8
+ <!-- ************************************************************** -->
9
+
10
+ <xsd:element name="EchoResponse" type="ResponseSchema:EchoResponseType" />
11
+
12
+ <xsd:element name="OrderListResponse" type="ResponseSchema:OrderListResponseType" />
13
+ <xsd:element name="PickResponse" type="ResponseSchema:PickResponseType" />
14
+ <xsd:element name="PackResponse" type="ResponseSchema:PackResponseType" />
15
+ <xsd:element name="ShipResponse" type="ResponseSchema:ShipResponseType" />
16
+ <xsd:element name="ShipDocResponse" type="ResponseSchema:ShipDocResponseType" />
17
+ <xsd:element name="TrackResponse" type="ResponseSchema:TrackResponseType" />
18
+ <xsd:element name="EditPackingResponse" type="ResponseSchema:EditPackingResponseType" />
19
+ <xsd:element name="RestorePackingResponse" type="ResponseSchema:RestorePackingResponseType" />
20
+ <xsd:element name="OrderDetailsResponse" type="ResponseSchema:OrderDetailsResponseType" />
21
+ <xsd:element name="PartShipReqResponse" type="ResponseSchema:PartShipReqResponseType" />
22
+ <xsd:element name="PartShipConfirmResponse" type="ResponseSchema:PartShipConfirmResponseType" />
23
+
24
+ <xsd:element name="ServiceInvoiceResponse" type="ResponseSchema:ServiceInvoiceResponseType" />
25
+ <xsd:element name="DailyStatementResponse" type="ResponseSchema:DailyStatementResponseType" />
26
+
27
+ <xsd:element name="CancelOrderResponse" type="ResponseSchema:CancelOrderResponseType" />
28
+ <xsd:element name="RogRefundReqResponse" type="ResponseSchema:RogRefundReqResponseType" />
29
+ <xsd:element name="RogRefundActivateResponse" type="ResponseSchema:RogRefundActivateResponseType" />
30
+ <xsd:element name="RogExchangeReqResponse" type="ResponseSchema:RogExchangeReqResponseType" />
31
+ <xsd:element name="RogExchangeActivateResponse" type="ResponseSchema:RogExchangeActivateResponseType" />
32
+ <xsd:element name="ChargebackResponse" type="ResponseSchema:ChargebackResponseType" />
33
+
34
+ <xsd:element name="SaleSummResponse" type="ResponseSchema:SaleSummResponseType" />
35
+ <xsd:element name="CustInfoResponse" type="ResponseSchema:CustInfoResponseType" />
36
+ <xsd:element name="FailedTransResponse" type="ResponseSchema:FailedTransResponseType" />
37
+ <xsd:element name="RollingReservesResponse" type="ResponseSchema:RollingReservesResponseType" />
38
+
39
+
40
+ <!-- ************************************************************** -->
41
+ <!-- #### GECA WEBSERVICES TYPE DEFINITIONS #### -->
42
+ <!-- ************************************************************** -->
43
+
44
+ <xsd:complexType name="EchoResponseType">
45
+ <xsd:sequence>
46
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
47
+ <xsd:element name="echoMessage" type="ResponseSchema:S500" minOccurs="0" />
48
+ </xsd:sequence>
49
+ </xsd:complexType>
50
+
51
+
52
+
53
+ <xsd:complexType name="OrderListResponseType">
54
+ <xsd:sequence>
55
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
56
+ <xsd:element name="SaleOrders" type="ResponseSchema:SaleOrdersType" minOccurs="0" />
57
+ <xsd:element name="PagingResponse" type="ResponseSchema:PagingResponseType" minOccurs="0" />
58
+ </xsd:sequence>
59
+ </xsd:complexType>
60
+
61
+ <xsd:complexType name="PickResponseType">
62
+ <xsd:sequence>
63
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
64
+ <xsd:element name="Customer" type="ResponseSchema:CustomerType" minOccurs="0" />
65
+ <xsd:element name="ProductLineItems" type="ResponseSchema:ProductLineItemsType" minOccurs="0" />
66
+ </xsd:sequence>
67
+ </xsd:complexType>
68
+
69
+ <xsd:complexType name="PackResponseType">
70
+ <xsd:sequence>
71
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
72
+ <xsd:element name="Customer" type="ResponseSchema:CustomerType" minOccurs="0" />
73
+ <xsd:element name="PackingBoxes" type="ResponseSchema:PackingBoxesType" minOccurs="0" />
74
+ <xsd:element name="SpecialInstructions" type="ResponseSchema:SpecialInstructionsType" minOccurs="0" />
75
+ </xsd:sequence>
76
+ </xsd:complexType>
77
+
78
+ <xsd:complexType name="ShipResponseType">
79
+ <xsd:sequence>
80
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
81
+ <xsd:element name="ShipmentBooking" type="ResponseSchema:ShipmentBookingType" minOccurs="0" />
82
+ </xsd:sequence>
83
+ </xsd:complexType>
84
+
85
+ <xsd:complexType name="ShipDocResponseType">
86
+ <xsd:sequence>
87
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
88
+ <xsd:element name="ShipDoc" type="ResponseSchema:FileType" minOccurs="0" />
89
+ </xsd:sequence>
90
+ </xsd:complexType>
91
+
92
+ <xsd:complexType name="TrackResponseType">
93
+ <xsd:sequence>
94
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
95
+ <xsd:element name="Tracking" type="ResponseSchema:TrackingType" minOccurs="0" />
96
+ </xsd:sequence>
97
+ </xsd:complexType>
98
+
99
+ <xsd:complexType name="EditPackingResponseType">
100
+ <xsd:sequence>
101
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
102
+ <xsd:element name="AdjustmentVoucher" type="ResponseSchema:VoucherType" minOccurs="0" />
103
+ </xsd:sequence>
104
+ </xsd:complexType>
105
+
106
+ <xsd:complexType name="RestorePackingResponseType">
107
+ <xsd:sequence>
108
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
109
+ <xsd:element name="AdjustmentVoucher" type="ResponseSchema:VoucherType" minOccurs="0" />
110
+ </xsd:sequence>
111
+ </xsd:complexType>
112
+
113
+ <xsd:complexType name="OrderDetailsResponseType">
114
+ <xsd:sequence>
115
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
116
+ <xsd:element name="Order" type="ResponseSchema:OrderType" minOccurs="0" />
117
+ </xsd:sequence>
118
+ </xsd:complexType>
119
+
120
+ <xsd:complexType name="PartShipReqResponseType">
121
+ <xsd:sequence>
122
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
123
+ <xsd:element name="Order" type="ResponseSchema:OrderType" minOccurs="0" />
124
+ </xsd:sequence>
125
+ </xsd:complexType>
126
+
127
+ <xsd:complexType name="PartShipConfirmResponseType">
128
+ <xsd:sequence>
129
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
130
+ </xsd:sequence>
131
+ </xsd:complexType>
132
+
133
+
134
+
135
+ <xsd:complexType name="ServiceInvoiceResponseType">
136
+ <xsd:sequence>
137
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
138
+ <xsd:element name="Stakeholder" type="ResponseSchema:StakeholderType" minOccurs="0" />
139
+ <xsd:element name="ServiceInvoices" type="ResponseSchema:ServiceInvoicesType" minOccurs="0" />
140
+ <xsd:element name="File" type="ResponseSchema:FileType" minOccurs="0" />
141
+ </xsd:sequence>
142
+ </xsd:complexType>
143
+
144
+ <xsd:complexType name="DailyStatementResponseType">
145
+ <xsd:sequence>
146
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
147
+ <xsd:element name="Stakeholder" type="ResponseSchema:StakeholderType" minOccurs="0" />
148
+ <xsd:element name="DailyStatements" type="ResponseSchema:DailyStatementsType" minOccurs="0" />
149
+ <xsd:element name="File" type="ResponseSchema:FileType" minOccurs="0" />
150
+ </xsd:sequence>
151
+ </xsd:complexType>
152
+
153
+
154
+
155
+ <xsd:complexType name="CancelOrderResponseType">
156
+ <xsd:sequence>
157
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
158
+ <xsd:element name="ActivityDetail" type="ResponseSchema:ActivityDetailType" minOccurs="0" />
159
+ <xsd:element name="Vouchers" type="ResponseSchema:VouchersType" minOccurs="0" />
160
+ </xsd:sequence>
161
+ </xsd:complexType>
162
+
163
+ <xsd:complexType name="RogRefundReqResponseType">
164
+ <xsd:sequence>
165
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
166
+ <xsd:element name="RogActivityDetail" type="ResponseSchema:RogActivityDetailType" minOccurs="0" />
167
+ <xsd:element name="File" type="ResponseSchema:FileType" minOccurs="0" />
168
+ </xsd:sequence>
169
+ </xsd:complexType>
170
+
171
+ <xsd:complexType name="RogRefundActivateResponseType">
172
+ <xsd:sequence>
173
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
174
+ <xsd:element name="RogActivationDetail" type="ResponseSchema:RogActivationDetailType" minOccurs="0" />
175
+ <xsd:element name="Vouchers" type="ResponseSchema:VouchersType" minOccurs="0" />
176
+ </xsd:sequence>
177
+ </xsd:complexType>
178
+
179
+ <xsd:complexType name="RogExchangeReqResponseType">
180
+ <xsd:sequence>
181
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
182
+ <xsd:element name="RogActivityDetail" type="ResponseSchema:RogActivityDetailType" minOccurs="0" />
183
+ <xsd:element name="File" type="ResponseSchema:FileType" minOccurs="0" />
184
+ </xsd:sequence>
185
+ </xsd:complexType>
186
+
187
+ <xsd:complexType name="RogExchangeActivateResponseType">
188
+ <xsd:sequence>
189
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
190
+ <xsd:element name="RogActivationDetail" type="ResponseSchema:RogActivationDetailType" minOccurs="0" />
191
+ <xsd:element name="Vouchers" type="ResponseSchema:VouchersType" minOccurs="0" />
192
+ </xsd:sequence>
193
+ </xsd:complexType>
194
+
195
+ <xsd:complexType name="ChargebackResponseType">
196
+ <xsd:sequence>
197
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
198
+ <xsd:element name="ActivityDetail" type="ResponseSchema:ActivityDetailType" minOccurs="0" />
199
+ </xsd:sequence>
200
+ </xsd:complexType>
201
+
202
+
203
+
204
+ <xsd:complexType name="SaleSummResponseType">
205
+ <xsd:sequence>
206
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
207
+ <xsd:element name="SaleSumms" type="ResponseSchema:SaleSummsType" minOccurs="0" />
208
+ </xsd:sequence>
209
+ </xsd:complexType>
210
+
211
+ <xsd:complexType name="CustInfoResponseType">
212
+ <xsd:sequence>
213
+ <xsd:group ref="ResponseSchema:CommonResponseGroup" />
214
+ <xsd:element name="Customers" type="ResponseSchema:CustomersType" minOccurs="0" />
215
+ </xsd:sequence>
216
+ </xsd:complexType>
217
+
218
+ <xsd:complexType name="FailedTransResponseType">
219
+ <xsd:sequence>
220
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
221
+ <xsd:element name="SaleOrders" type="ResponseSchema:SaleOrdersType" minOccurs="0" />
222
+ <xsd:element name="PagingResponse" type="ResponseSchema:PagingResponseType" minOccurs="0" />
223
+ </xsd:sequence>
224
+ </xsd:complexType>
225
+
226
+ <xsd:complexType name="RollingReservesResponseType">
227
+ <xsd:sequence>
228
+ <xsd:group ref="ResponseSchema:CommonResponseGroup"></xsd:group>
229
+ <xsd:element name="RollingReserves" type="ResponseSchema:RollingReservesType" minOccurs="0" />
230
+ </xsd:sequence>
231
+ </xsd:complexType>
232
+
233
+ <!-- ************************************************************** -->
234
+ <!-- #### GECA WEBSERVICES GROUP DEFINITIONS #### -->
235
+ <!-- ************************************************************** -->
236
+
237
+ <xsd:group name="CommonResponseGroup">
238
+ <xsd:sequence>
239
+ <xsd:element name="ResponseStatusCode" type="ResponseSchema:AN3" />
240
+ <xsd:element name="ResponseStatusDesc" type="ResponseSchema:S60" />
241
+ <xsd:element name="SWRefNo" type="ResponseSchema:N20" />
242
+ <xsd:element name="MerchantRefNo" type="ResponseSchema:AN20" minOccurs="0" />
243
+ </xsd:sequence>
244
+ </xsd:group>
245
+
246
+ <xsd:group name="CustomerShipAddressGroup">
247
+ <xsd:sequence>
248
+ <xsd:element name="CustShipFirstName" type="ResponseSchema:S500" />
249
+ <xsd:element name="CustShipMidleName" type="ResponseSchema:S500" minOccurs="0" />
250
+ <xsd:element name="CustShipLastName" type="ResponseSchema:S500" />
251
+ <xsd:element name="CustShipCountryA3" type="ResponseSchema:COUNTRY_CODE_A3" />
252
+ <xsd:element name="CustShipAddressLine1" type="ResponseSchema:S500" />
253
+ <xsd:element name="CustShipAddressLine2" type="ResponseSchema:S500" minOccurs="0" />
254
+ <xsd:element name="CustShipCityName" type="ResponseSchema:S500" />
255
+ <xsd:element name="CustShipStateDivision" type="ResponseSchema:S500" minOccurs="0" />
256
+ <xsd:element name="CustShipPOSTCode" type="ResponseSchema:S500" minOccurs="0" />
257
+ <xsd:element name="CustShipPrimaryPhone" type="ResponseSchema:S500" />
258
+ <xsd:element name="CustShipSecondaryPhone" type="ResponseSchema:S500" minOccurs="0" />
259
+ <xsd:element name="CustShipEmail" type="ResponseSchema:EMAIL" />
260
+ <xsd:element name="CustShipAddress" type="ResponseSchema:S500" />
261
+ </xsd:sequence>
262
+ </xsd:group>
263
+
264
+ <xsd:group name="CustomerBillAddressGroup">
265
+ <xsd:sequence>
266
+ <xsd:element name="CustBillFirstName" type="ResponseSchema:S500" />
267
+ <xsd:element name="CustBillMidleName" type="ResponseSchema:S500" minOccurs="0" />
268
+ <xsd:element name="CustBillLastName" type="ResponseSchema:S500" />
269
+ <xsd:element name="CustBillCountryA3" type="ResponseSchema:COUNTRY_CODE_A3" />
270
+ <xsd:element name="CustBillAddressLine1" type="ResponseSchema:S500" />
271
+ <xsd:element name="CustBillAddressLine2" type="ResponseSchema:S500" minOccurs="0" />
272
+ <xsd:element name="CustBillCityName" type="ResponseSchema:S500" minOccurs="0" />
273
+ <xsd:element name="CustBillStateDivision" type="ResponseSchema:S500" />
274
+ <xsd:element name="CustBillPOSTCode" type="ResponseSchema:S500" />
275
+ <xsd:element name="CustBillPrimaryPhone" type="ResponseSchema:S500" minOccurs="0" />
276
+ <xsd:element name="CustBillSecondaryPhone" type="ResponseSchema:S500" />
277
+ <xsd:element name="CustBillEmail" type="ResponseSchema:EMAIL" minOccurs="0" />
278
+
279
+ <xsd:element name="CustBillAddress" type="ResponseSchema:S500" />
280
+ </xsd:sequence>
281
+ </xsd:group>
282
+
283
+
284
+ <!-- ************************************************************** -->
285
+ <!-- #### COMMON COMPLEX TYPES #### -->
286
+ <!-- ************************************************************** -->
287
+
288
+ <xsd:complexType name="PagingResponseType">
289
+ <xsd:sequence>
290
+ <xsd:element name="CurrentPage" type="ResponseSchema:INT" />
291
+ <xsd:element name="RecordsPerPage" type="ResponseSchema:INT" />
292
+ <xsd:element name="TotalRecords" type="ResponseSchema:INT" minOccurs="0" />
293
+ </xsd:sequence>
294
+ </xsd:complexType>
295
+
296
+ <xsd:complexType name="SaleOrdersType">
297
+ <xsd:sequence>
298
+ <xsd:element name="SaleOrder" type="ResponseSchema:SaleOrderType" minOccurs="1" maxOccurs="unbounded" />
299
+ </xsd:sequence>
300
+ </xsd:complexType>
301
+
302
+ <xsd:complexType name="SaleOrderType">
303
+ <xsd:sequence>
304
+ <xsd:element name="OrderNo" type="ResponseSchema:INT" />
305
+ <xsd:element name="OrderDetail" type="ResponseSchema:SaleOrderDetailType" />
306
+ <xsd:element name="Customer" type="ResponseSchema:CustomerType" minOccurs="0" />
307
+ <xsd:element name="PaymentGateway" type="ResponseSchema:PaymentGatewayType" />
308
+ </xsd:sequence>
309
+ </xsd:complexType>
310
+
311
+ <xsd:complexType name="SaleOrderDetailType">
312
+ <xsd:sequence>
313
+ <xsd:element name="MerchantPickupDueDatetime" type="ResponseSchema:DATETIME" minOccurs="0" />
314
+ <xsd:element name="MerchantProductAmount" type="ResponseSchema:FLOAT"></xsd:element>
315
+ <xsd:element name="MerchantCurrency" type="ResponseSchema:CURRENCY_CODE_A" />
316
+ <xsd:element name="MerchantOrderQty" type="ResponseSchema:INT" />
317
+ <xsd:element name="MerchantRefNo" type="ResponseSchema:AN" />
318
+ <xsd:element name="MerchantRMA" type="ResponseSchema:AN25" />
319
+ <xsd:element name="MerchantTransDateTime" type="ResponseSchema:DATETIME" />
320
+
321
+ <xsd:element name="CustTransDateTime" type="ResponseSchema:DATETIME" />
322
+ <xsd:element name="CustEstimatedDeliveryDateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
323
+ <xsd:element name="CustTotalValue" type="ResponseSchema:FLOAT" />
324
+ <xsd:element name="CustCurrency" type="ResponseSchema:CURRENCY_CODE_A" />
325
+
326
+ <xsd:element name="Courier" type="ResponseSchema:COURIER_TYPE_E" />
327
+ <xsd:element name="CourierWaybillNo" type="ResponseSchema:S500" minOccurs="0" />
328
+ <xsd:element name="IsPackingModified" type="ResponseSchema:YN_A1" />
329
+
330
+ <xsd:element name="OrderNoOrg" type="ResponseSchema:INT" />
331
+ <xsd:element name="OrderNoRef" type="ResponseSchema:INT" />
332
+ <xsd:element name="SZMarkup" type="ResponseSchema:FLOAT" />
333
+ <xsd:element name="IsReturnable" type="ResponseSchema:YN_A1" />
334
+ <xsd:element name="TransType" type="ResponseSchema:A2" />
335
+ <xsd:element name="TransStatus" type="ResponseSchema:A" />
336
+ <xsd:element name="PaymentStatus" type="ResponseSchema:A1" />
337
+
338
+ <xsd:element name="PaymentRefNo" type="ResponseSchema:S500" minOccurs="0" />
339
+ <xsd:element name="OrderDescription" type="ResponseSchema:S500" minOccurs="0" />
340
+ </xsd:sequence>
341
+ </xsd:complexType>
342
+
343
+
344
+ <xsd:complexType name="FailedOrdersType">
345
+ <xsd:sequence>
346
+ <xsd:element name="Order" type="ResponseSchema:OrderType" minOccurs="1" maxOccurs="unbounded" />
347
+ </xsd:sequence>
348
+ </xsd:complexType>
349
+
350
+ <xsd:complexType name="OrderType">
351
+ <xsd:sequence>
352
+ <xsd:element name="OrderNo" type="ResponseSchema:INT" />
353
+ <xsd:element name="TransDetail" type="ResponseSchema:OrderTransDetailType" />
354
+ <xsd:element name="Merchant" type="ResponseSchema:MerchantType" />
355
+ <xsd:element name="Courier" type="ResponseSchema:CourierType" />
356
+ <xsd:element name="PaymentGateway" type="ResponseSchema:PaymentGatewayType" />
357
+ <xsd:element name="Customer" type="ResponseSchema:CustomerDetailType" minOccurs="0" />
358
+ <xsd:element name="ProductLineItems" type="ResponseSchema:ProductLineItemsType" minOccurs="0" />
359
+ </xsd:sequence>
360
+ </xsd:complexType>
361
+
362
+ <xsd:complexType name="OrderTransDetailType">
363
+ <xsd:sequence>
364
+ <xsd:element name="OrderNoRef" type="ResponseSchema:INT" />
365
+ <xsd:element name="OrderNoParent" type="ResponseSchema:INT" />
366
+ <xsd:element name="TransType" type="ResponseSchema:A" />
367
+ <xsd:element name="TransDateTime" type="ResponseSchema:DATETIME" />
368
+ <xsd:element name="PackingModified" type="ResponseSchema:YN_A1" />
369
+ <xsd:element name="TransStatus" type="ResponseSchema:A" />
370
+ <xsd:element name="PaymentStatus" type="ResponseSchema:A" />
371
+ <xsd:element name="LastUpdateDateTime" type="ResponseSchema:DATETIME" />
372
+ <xsd:element name="CustTotalValue" type="ResponseSchema:FLOAT" />
373
+ <xsd:element name="CustCurrency" type="ResponseSchema:CURRENCY_CODE_A" />
374
+ <xsd:element name="CustExcRate" type="ResponseSchema:FLOAT" />
375
+ <xsd:element name="CourierCharges" type="ResponseSchema:FLOAT" />
376
+ <xsd:element name="CourierDuties" type="ResponseSchema:FLOAT" />
377
+ <xsd:element name="InsuranceCharges" type="ResponseSchema:FLOAT" />
378
+ <xsd:element name="SZMarkup" type="ResponseSchema:FLOAT" />
379
+ </xsd:sequence>
380
+ </xsd:complexType>
381
+
382
+ <xsd:complexType name="MerchantType">
383
+ <xsd:sequence>
384
+ <xsd:element name="MerchantRefNo" type="ResponseSchema:AN" minOccurs="0" />
385
+ <xsd:element name="TransDateTime" type="ResponseSchema:DATETIME" />
386
+ <xsd:element name="OrderDescription" type="ResponseSchema:S500" minOccurs="0" />
387
+ <xsd:element name="ItemQuantity" type="ResponseSchema:INT" />
388
+ <xsd:element name="BoxesQuantity" type="ResponseSchema:INT" minOccurs="0" />
389
+ <xsd:element name="BackOrder" type="ResponseSchema:YN_A1" />
390
+ <xsd:element name="MaxBackOrderDate" type="ResponseSchema:DATETIME" minOccurs="0" />
391
+ <xsd:element name="ProductPrice" type="ResponseSchema:FLOAT" />
392
+ <xsd:element name="ProductPriceCurrency" type="ResponseSchema:CURRENCY_CODE_A" />
393
+ <xsd:element name="ShipDueDateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
394
+ <xsd:element name="PickupDueDateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
395
+ <xsd:element name="PickedupDateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
396
+ <xsd:element name="ReturnAuthentication" type="ResponseSchema:S500" minOccurs="0" />
397
+ </xsd:sequence>
398
+ </xsd:complexType>
399
+
400
+ <xsd:complexType name="CourierType">
401
+ <xsd:sequence>
402
+ <xsd:element name="InterfaceName" type="ResponseSchema:COURIER_TYPE_E" />
403
+ <xsd:element name="ServiceName" type="ResponseSchema:S500" />
404
+ <xsd:element name="WayBillNo" type="ResponseSchema:S500" minOccurs="0" />
405
+ <xsd:element name="EstimatedDeliveryDay" type="ResponseSchema:S500" minOccurs="0" />
406
+ </xsd:sequence>
407
+ </xsd:complexType>
408
+
409
+ <xsd:complexType name="PaymentGatewayType">
410
+ <xsd:sequence>
411
+ <xsd:element name="WebConfirmed" type="ResponseSchema:YN_A1" />
412
+ <xsd:element name="InterfaceName" type="ResponseSchema:S500" />
413
+ <xsd:element name="PaymentRefNo" type="ResponseSchema:S500" minOccurs="0" />
414
+ <xsd:element name="CardAccountType" type="ResponseSchema:S500" />
415
+ <xsd:element name="AnonymousPan" type="ResponseSchema:S500" minOccurs="0" />
416
+ <xsd:element name="MaskedPan" type="ResponseSchema:S500" minOccurs="0" />
417
+ <xsd:element name="GatewayRefNo" type="ResponseSchema:S500" minOccurs="0" />
418
+ <xsd:element name="GatewayErrorMessage" type="ResponseSchema:S500" minOccurs="0" />
419
+ </xsd:sequence>
420
+ </xsd:complexType>
421
+
422
+ <xsd:complexType name="CustomerDetailType">
423
+ <xsd:sequence>
424
+ <xsd:element name="TransDateTime" type="ResponseSchema:DATETIME" />
425
+ <xsd:element name="EstimatedDeliveryDateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
426
+ <xsd:element name="CustomerStatement" type="ResponseSchema:S500" minOccurs="0" />
427
+
428
+ <xsd:group ref="ResponseSchema:CustomerShipAddressGroup" />
429
+ <xsd:group ref="ResponseSchema:CustomerBillAddressGroup" />
430
+
431
+ </xsd:sequence>
432
+ </xsd:complexType>
433
+
434
+ <xsd:complexType name="StakeholderType">
435
+ <xsd:sequence>
436
+ <xsd:element name="StakeholderName" type="ResponseSchema:S500" />
437
+ <xsd:element name="AddressLine1" type="ResponseSchema:S500" />
438
+ <xsd:element name="AddressLine2" type="ResponseSchema:S500" minOccurs="0" />
439
+ <xsd:element name="City" type="ResponseSchema:S500" />
440
+ <xsd:element name="State" type="ResponseSchema:S500" />
441
+ <xsd:element name="ZipCode" type="ResponseSchema:S500" />
442
+ <xsd:element name="CountryCode" type="ResponseSchema:COUNTRY_CODE_A3" />
443
+ <xsd:element name="PcurrencyCode" type="ResponseSchema:CURRENCY_CODE_A" />
444
+ </xsd:sequence>
445
+ </xsd:complexType>
446
+
447
+
448
+ <xsd:complexType name="CustomersType">
449
+ <xsd:sequence>
450
+ <xsd:element name="Customer" type="ResponseSchema:CustomerAddressType" minOccurs="1" maxOccurs="unbounded" />
451
+ </xsd:sequence>
452
+ </xsd:complexType>
453
+
454
+ <xsd:complexType name="CustomerType">
455
+ <xsd:sequence>
456
+ <xsd:group ref="ResponseSchema:CustomerShipAddressGroup" />
457
+ </xsd:sequence>
458
+ </xsd:complexType>
459
+
460
+ <xsd:complexType name="CustomerAddressType">
461
+ <xsd:sequence>
462
+ <xsd:group ref="ResponseSchema:CustomerShipAddressGroup" />
463
+ <xsd:group ref="ResponseSchema:CustomerBillAddressGroup" />
464
+ </xsd:sequence>
465
+ </xsd:complexType>
466
+
467
+ <xsd:complexType name="ShipmentBookingType">
468
+ <xsd:sequence>
469
+ <xsd:element name="CourierName" type="ResponseSchema:COURIER_TYPE_E" />
470
+ <xsd:element name="CourierServiceName" type="ResponseSchema:S500" />
471
+ <xsd:element name="CourierWaybillNo" type="ResponseSchema:S500" />
472
+ <xsd:element name="CourierWaybillNoRussia" type="ResponseSchema:S500" minOccurs="0"/>
473
+ <xsd:element name="PickupDue" type="ResponseSchema:DATETIME" />
474
+ </xsd:sequence>
475
+ </xsd:complexType>
476
+
477
+ <xsd:complexType name="PackingBoxesType">
478
+ <xsd:sequence>
479
+ <xsd:element name="PackingBox" type="ResponseSchema:PackingBoxType" maxOccurs="unbounded" />
480
+ </xsd:sequence>
481
+ </xsd:complexType>
482
+
483
+ <xsd:complexType name="PackingBoxType">
484
+ <xsd:sequence>
485
+ <xsd:element name="BoxNo" type="ResponseSchema:INT" />
486
+ <xsd:element name="BoxCode" type="ResponseSchema:S500" />
487
+ <xsd:element name="ItemQuantity" type="ResponseSchema:INT" />
488
+
489
+ <xsd:element name="DimensionUnit" type="ResponseSchema:DIMENSION_UNIT_TYPE_E" />
490
+ <xsd:element name="Length" type="ResponseSchema:FLOAT" />
491
+ <xsd:element name="Width" type="ResponseSchema:FLOAT" />
492
+ <xsd:element name="Height" type="ResponseSchema:FLOAT" />
493
+
494
+ <xsd:element name="WeightUnit" type="ResponseSchema:WEIGHT_UNIT_TYPE_E" />
495
+ <xsd:element name="Weight" type="ResponseSchema:FLOAT" />
496
+
497
+ <xsd:element name="ProductLineItems" type="ResponseSchema:ProductLineItemsType" />
498
+ </xsd:sequence>
499
+ </xsd:complexType>
500
+
501
+ <xsd:complexType name="ProductLineItemsType">
502
+ <xsd:sequence>
503
+ <xsd:element name="ProductLineItem" type="ResponseSchema:ProductLineItemType" maxOccurs="unbounded" />
504
+ </xsd:sequence>
505
+ </xsd:complexType>
506
+
507
+ <xsd:complexType name="ProductLineItemType">
508
+ <xsd:sequence>
509
+ <xsd:element name="LineItemNo" type="ResponseSchema:S500" />
510
+ <xsd:element name="ProductCode" type="ResponseSchema:S500" />
511
+ <xsd:element name="Description" type="ResponseSchema:S500" minOccurs="0" />
512
+ <xsd:element name="HSCode" type="ResponseSchema:S500" />
513
+ <xsd:element name="Price" type="ResponseSchema:FLOAT" />
514
+ <xsd:element name="Quantity" type="ResponseSchema:INT" />
515
+ <xsd:element name="SaleValue" type="ResponseSchema:FLOAT" />
516
+ <xsd:element name="Size" type="ResponseSchema:S500" minOccurs="0" />
517
+ <xsd:element name="Color" type="ResponseSchema:A" minOccurs="0" />
518
+
519
+ <xsd:element name="DimensionUnit" type="ResponseSchema:DIMENSION_UNIT_TYPE_E" />
520
+ <xsd:element name="Length" type="ResponseSchema:FLOAT" />
521
+ <xsd:element name="Width" type="ResponseSchema:FLOAT" />
522
+ <xsd:element name="Height" type="ResponseSchema:FLOAT" />
523
+
524
+ <xsd:element name="WeightUnit" type="ResponseSchema:WEIGHT_UNIT_TYPE_E" />
525
+ <xsd:element name="Weight" type="ResponseSchema:FLOAT" />
526
+
527
+ <xsd:element name="IsReturnable" type="ResponseSchema:YN_A1" minOccurs="0" />
528
+ </xsd:sequence>
529
+ </xsd:complexType>
530
+
531
+ <xsd:complexType name="SpecialInstructionsType">
532
+ <xsd:sequence>
533
+ <xsd:element name="SpecialInstruction" type="ResponseSchema:SpecialInstructionType" maxOccurs="unbounded" />
534
+ </xsd:sequence>
535
+ </xsd:complexType>
536
+
537
+ <xsd:complexType name="SpecialInstructionType">
538
+ <xsd:sequence>
539
+ <xsd:element name="Instruction" type="ResponseSchema:S500" />
540
+ <xsd:element name="InstructedBy" type="ResponseSchema:S500" />
541
+ <xsd:element name="DateTime" type="ResponseSchema:S500" />
542
+ </xsd:sequence>
543
+ </xsd:complexType>
544
+
545
+ <xsd:complexType name="FilesType">
546
+ <xsd:sequence>
547
+ <xsd:element name="File" type="ResponseSchema:FileType" maxOccurs="unbounded" />
548
+ </xsd:sequence>
549
+ </xsd:complexType>
550
+
551
+ <xsd:complexType name="FileType">
552
+ <xsd:sequence>
553
+ <xsd:element name="FileName" type="ResponseSchema:S500" />
554
+ <xsd:element name="MimeType" type="ResponseSchema:S500" />
555
+ <xsd:element name="Contents" type="xsd:base64Binary" />
556
+ </xsd:sequence>
557
+ </xsd:complexType>
558
+
559
+ <xsd:complexType name="VouchersType">
560
+ <xsd:sequence>
561
+ <xsd:element name="Voucher" type="ResponseSchema:VoucherType" maxOccurs="unbounded" />
562
+ </xsd:sequence>
563
+ </xsd:complexType>
564
+
565
+ <xsd:complexType name="VoucherType">
566
+ <xsd:sequence>
567
+ <xsd:element name="VoucherType" type="ResponseSchema:A" />
568
+ <xsd:element name="VoucherDate" type="ResponseSchema:DATE" />
569
+ <xsd:element name="VoucherNo" type="ResponseSchema:INT" />
570
+ <xsd:element name="VoucherComments" type="ResponseSchema:S60" minOccurs="0" />
571
+ <xsd:element name="VoucherCurrency" type="ResponseSchema:CURRENCY_CODE_A" />
572
+ <xsd:element name="VoucherAmount" type="ResponseSchema:FLOAT" />
573
+ <xsd:element name="VoucherEffect" type="ResponseSchema:DEBIT_CREDIT_TYPE_E" />
574
+ </xsd:sequence>
575
+ </xsd:complexType>
576
+
577
+ <xsd:complexType name="TrackingType">
578
+ <xsd:sequence>
579
+ <xsd:element name="AirWayBillNumber" type="ResponseSchema:INT" />
580
+ <xsd:element name="ShippedOnDate" type="ResponseSchema:S500" />
581
+ <xsd:element name="DeliveryDate" type="ResponseSchema:S500" />
582
+ <xsd:element name="OriginServiceArea" type="ResponseSchema:S500" />
583
+ <xsd:element name="DestinationServiceArea" type="ResponseSchema:S500" />
584
+ <xsd:element name="CustomerFirstName" type="ResponseSchema:S500" />
585
+ <xsd:element name="CustomerLastName" type="ResponseSchema:S500" />
586
+ <xsd:element name="LastEvent" type="ResponseSchema:TrackingEventType" minOccurs="0" />
587
+ <xsd:element name="EventDates" type="ResponseSchema:TrackingEventDatesType" minOccurs="0" />
588
+ <!-- xsd:element name="EventDateMap" type="xsd:" / -->
589
+ </xsd:sequence>
590
+ </xsd:complexType>
591
+
592
+ <xsd:complexType name="TrackingEventDatesType">
593
+ <xsd:sequence>
594
+ <xsd:element name="EventDate" type="ResponseSchema:TrackingEventDateMapType" minOccurs="1" maxOccurs="unbounded" />
595
+ </xsd:sequence>
596
+ </xsd:complexType>
597
+
598
+ <xsd:complexType name="TrackingEventDateMapType">
599
+ <xsd:sequence>
600
+ <xsd:element name="DateTime" type="ResponseSchema:S500" minOccurs="1" />
601
+ <xsd:element name="TrackingEvents" type="ResponseSchema:TrackingEventsType" minOccurs="1" />
602
+ </xsd:sequence>
603
+ </xsd:complexType>
604
+
605
+ <xsd:complexType name="TrackingEventsType">
606
+ <xsd:sequence>
607
+ <xsd:element name="TrackingEvent" type="ResponseSchema:TrackingEventType" minOccurs="1" maxOccurs="unbounded" />
608
+ </xsd:sequence>
609
+ </xsd:complexType>
610
+
611
+ <xsd:complexType name="TrackingEventType">
612
+ <xsd:sequence>
613
+ <xsd:element name="EventCode" type="ResponseSchema:A" />
614
+ <xsd:element name="SrNo" type="ResponseSchema:INT" />
615
+ <xsd:element name="Description" type="ResponseSchema:S500" />
616
+ <xsd:element name="Location" type="ResponseSchema:S500" minOccurs="0" />
617
+ <xsd:element name="TransitionDate" type="ResponseSchema:S500" minOccurs="0" />
618
+ <xsd:element name="TransitionTime" type="ResponseSchema:S500" minOccurs="0" />
619
+ <xsd:element name="Signatory" type="ResponseSchema:S500" minOccurs="0" />
620
+ </xsd:sequence>
621
+ </xsd:complexType>
622
+
623
+ <xsd:complexType name="ActivityDetailType">
624
+ <xsd:sequence>
625
+ <xsd:element name="ActivityNo" type="ResponseSchema:INT" />
626
+ <xsd:element name="DateTime" type="ResponseSchema:DATETIME" />
627
+ </xsd:sequence>
628
+ </xsd:complexType>
629
+
630
+ <xsd:complexType name="RogActivityDetailType">
631
+ <xsd:sequence>
632
+ <xsd:element name="RogOrderNo" type="ResponseSchema:INT" />
633
+ <xsd:element name="OrderNoRef" type="ResponseSchema:INT" />
634
+ <xsd:element name="RogDateTime" type="ResponseSchema:DATETIME" />
635
+ <xsd:element name="WayBillNo" type="ResponseSchema:INT" />
636
+ </xsd:sequence>
637
+ </xsd:complexType>
638
+
639
+ <xsd:complexType name="RogActivationDetailType">
640
+ <xsd:sequence>
641
+ <xsd:element name="RogOrderNo" type="ResponseSchema:INT" />
642
+ <xsd:element name="WayBillNo" type="ResponseSchema:INT" />
643
+ <xsd:element name="CustomerRefund" type="ResponseSchema:FLOAT" />
644
+ <xsd:element name="CustomerCurrency" type="ResponseSchema:CURRENCY_CODE_A" minOccurs="0" />
645
+ </xsd:sequence>
646
+ </xsd:complexType>
647
+
648
+ <xsd:complexType name="SaleSummsType">
649
+ <xsd:sequence>
650
+ <xsd:element name="SaleSumm" type="ResponseSchema:SaleSummType" maxOccurs="unbounded" />
651
+ </xsd:sequence>
652
+ </xsd:complexType>
653
+
654
+ <xsd:complexType name="SaleSummType">
655
+ <xsd:sequence>
656
+ <xsd:element name="Date" type="ResponseSchema:DATE" />
657
+ <xsd:element name="CardType" type="ResponseSchema:CARD_TYPE_A1_E" />
658
+ <xsd:element name="ProductAmount" type="ResponseSchema:FLOAT" />
659
+ </xsd:sequence>
660
+ </xsd:complexType>
661
+
662
+ <xsd:complexType name="RollingReservesType">
663
+ <xsd:sequence>
664
+ <xsd:element name="RollingReserve" type="ResponseSchema:RollingReserveType" maxOccurs="unbounded" />
665
+ </xsd:sequence>
666
+ </xsd:complexType>
667
+
668
+ <xsd:complexType name="RollingReserveType">
669
+ <xsd:sequence>
670
+ <xsd:element name="InvoiceNo" type="ResponseSchema:INT" />
671
+ <xsd:element name="Date" type="ResponseSchema:DATE" />
672
+ <xsd:element name="Currency" type="ResponseSchema:CURRENCY_CODE_A" />
673
+ <xsd:element name="Debit" type="ResponseSchema:A" />
674
+ <xsd:element name="DebitRolingReserveAmount" type="ResponseSchema:FLOAT" />
675
+ <xsd:element name="DebitRolingReserveCount" type="ResponseSchema:INT" />
676
+ <xsd:element name="Credit" type="ResponseSchema:A" />
677
+ <xsd:element name="CreditRolingReserveAmount" type="ResponseSchema:FLOAT" />
678
+ <xsd:element name="CreditRolingReserveCount" type="ResponseSchema:INT" />
679
+ <xsd:element name="Status" type="ResponseSchema:A" />
680
+ </xsd:sequence>
681
+ </xsd:complexType>
682
+
683
+ <xsd:complexType name="ServiceInvoicesType">
684
+ <xsd:sequence>
685
+ <xsd:element name="ServiceInvoice" type="ResponseSchema:ServiceInvoiceType" minOccurs="1" maxOccurs="unbounded" />
686
+ </xsd:sequence>
687
+ </xsd:complexType>
688
+
689
+ <xsd:complexType name="ServiceInvoiceType">
690
+ <xsd:sequence>
691
+ <xsd:element name="IssuedBy" type="ResponseSchema:S500" />
692
+ <xsd:element name="OrderNo" type="ResponseSchema:S500" />
693
+ <xsd:element name="WayBillNo" type="ResponseSchema:S500" minOccurs="0" />
694
+ <xsd:element name="PlatformUsageFee" type="ResponseSchema:FLOAT" minOccurs="0" />
695
+ <xsd:element name="ShippingCharges" type="ResponseSchema:FLOAT" minOccurs="0" />
696
+ <xsd:element name="DutyTaxes" type="ResponseSchema:FLOAT" minOccurs="0" />
697
+ <xsd:element name="InsurancePremium" type="ResponseSchema:FLOAT" minOccurs="0" />
698
+ <xsd:element name="InvoiceTotal" type="ResponseSchema:FLOAT" />
699
+ <xsd:element name="InvoiceTransDate" type="ResponseSchema:DATE" />
700
+ </xsd:sequence>
701
+ </xsd:complexType>
702
+
703
+ <xsd:complexType name="DailyStatementsType">
704
+ <xsd:sequence>
705
+ <xsd:element name="DailyStatement" type="ResponseSchema:DailyStatementType" minOccurs="1" maxOccurs="unbounded" />
706
+ </xsd:sequence>
707
+ </xsd:complexType>
708
+
709
+ <xsd:complexType name="DailyStatementType">
710
+ <xsd:sequence>
711
+ <xsd:element name="StatementNo" type="ResponseSchema:INT" minOccurs="0" />
712
+ <xsd:element name="DateTime" type="ResponseSchema:DATETIME" minOccurs="0" />
713
+ <xsd:element name="Currency" type="ResponseSchema:CURRENCY_CODE_A" minOccurs="0" />
714
+ <xsd:element name="SaleValue" type="ResponseSchema:FLOAT" minOccurs="0" />
715
+ <xsd:element name="SZMarkup" type="ResponseSchema:FLOAT" minOccurs="0" />
716
+ <xsd:element name="ReservesWithholdValue" type="ResponseSchema:FLOAT" minOccurs="0" />
717
+ <xsd:element name="ReservesWithholdCount" type="ResponseSchema:INT" minOccurs="0" />
718
+ <xsd:element name="ReservesReleasedValue" type="ResponseSchema:FLOAT" minOccurs="0" />
719
+ <xsd:element name="ReservesReleasedCount" type="ResponseSchema:INT" minOccurs="0" />
720
+ <xsd:element name="AdminVoucherDebitValue" type="ResponseSchema:FLOAT" minOccurs="0" />
721
+ <xsd:element name="AdminVoucherCreditValue" type="ResponseSchema:FLOAT" minOccurs="0" />
722
+ <xsd:element name="AdminVoucherCount" type="ResponseSchema:INT" minOccurs="0" />
723
+ <xsd:element name="RecieveableValue" type="ResponseSchema:FLOAT" minOccurs="0" />
724
+ <xsd:element name="RecieveableDate" type="ResponseSchema:INT" minOccurs="0" />
725
+ <xsd:element name="StatementStatus" type="ResponseSchema:STATEMENT_STATUS_TYPE_E" minOccurs="0" />
726
+ </xsd:sequence>
727
+ </xsd:complexType>
728
+
729
+
730
+ <!-- ************************************************************** -->
731
+ <!-- #### COMMON SIMPLE TYPES #### -->
732
+ <!-- ************************************************************** -->
733
+
734
+ <xsd:simpleType name="DATE">
735
+ <xsd:restriction base="xsd:string">
736
+ <xsd:pattern value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01])">
737
+ </xsd:pattern>
738
+ </xsd:restriction>
739
+ </xsd:simpleType>
740
+
741
+ <xsd:simpleType name="TIME">
742
+ <xsd:restriction base="xsd:string">
743
+ <xsd:pattern value="([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])">
744
+ </xsd:pattern>
745
+ </xsd:restriction>
746
+ </xsd:simpleType>
747
+
748
+ <xsd:simpleType name="DATETIME">
749
+ <xsd:restriction base="xsd:string">
750
+ <xsd:pattern
751
+ value="(19|20)\d\d[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])"></xsd:pattern>
752
+ </xsd:restriction>
753
+ </xsd:simpleType>
754
+
755
+ <xsd:simpleType name="GENDER_A1">
756
+ <xsd:restriction base="xsd:string">
757
+ <xsd:pattern value="[MF]{1,1}"></xsd:pattern>
758
+ </xsd:restriction>
759
+ </xsd:simpleType>
760
+
761
+ <xsd:simpleType name="SORTING_ORDER_A1">
762
+ <xsd:restriction base="xsd:string">
763
+ <xsd:pattern value="[AD]{1,1}"></xsd:pattern>
764
+ </xsd:restriction>
765
+ </xsd:simpleType>
766
+
767
+ <xsd:simpleType name="YN_A1">
768
+ <xsd:restriction base="xsd:string">
769
+ <xsd:pattern value="[YN]{1,1}"></xsd:pattern>
770
+ </xsd:restriction>
771
+ </xsd:simpleType>
772
+
773
+ <xsd:simpleType name="EMAIL">
774
+ <xsd:restriction base="xsd:string">
775
+ <xsd:pattern value="([\.a-zA-Z0-9_\-])+@([a-zA-Z0-9_\-])+(([a-zA-Z0-9_\-])*\.([a-zA-Z0-9_\-])+)+"></xsd:pattern>
776
+ <xsd:maxLength value="100" />
777
+ </xsd:restriction>
778
+ </xsd:simpleType>
779
+
780
+ <xsd:simpleType name="COURIER_TYPE_E">
781
+ <xsd:restriction base="xsd:string">
782
+ <xsd:enumeration value="DHL" />
783
+ <xsd:enumeration value="DHL_UAE" />
784
+ <xsd:enumeration value="DHL_GBR" />
785
+ <xsd:enumeration value="DHL_ITA" />
786
+ <xsd:enumeration value="DHL_PRT" />
787
+ <xsd:enumeration value="FEDEX" />
788
+ <xsd:enumeration value="UPS" />
789
+ </xsd:restriction>
790
+ </xsd:simpleType>
791
+
792
+ <xsd:simpleType name="DIMENSION_UNIT_TYPE_E">
793
+ <xsd:restriction base="xsd:string">
794
+ <xsd:enumeration value="IN" />
795
+ <xsd:enumeration value="CM" />
796
+ </xsd:restriction>
797
+ </xsd:simpleType>
798
+
799
+ <xsd:simpleType name="WEIGHT_UNIT_TYPE_E">
800
+ <xsd:restriction base="xsd:string">
801
+ <xsd:enumeration value="KG" />
802
+ <xsd:enumeration value="LB" />
803
+ </xsd:restriction>
804
+ </xsd:simpleType>
805
+
806
+ <xsd:simpleType name="DEBIT_CREDIT_TYPE_E">
807
+ <xsd:restriction base="xsd:string">
808
+ <xsd:enumeration value="D" />
809
+ <xsd:enumeration value="C" />
810
+ </xsd:restriction>
811
+ </xsd:simpleType>
812
+
813
+ <xsd:simpleType name="CARD_TYPE_A1_E">
814
+ <xsd:restriction base="xsd:string">
815
+ <xsd:enumeration value="M" />
816
+ <xsd:enumeration value="V" />
817
+ </xsd:restriction>
818
+ </xsd:simpleType>
819
+
820
+ <xsd:simpleType name="STATEMENT_STATUS_TYPE_E">
821
+ <xsd:restriction base="xsd:string">
822
+ <xsd:enumeration value="G" />
823
+ <xsd:enumeration value="P" />
824
+ <xsd:enumeration value="F" />
825
+ <xsd:enumeration value="D" />
826
+ <xsd:enumeration value="R" />
827
+ </xsd:restriction>
828
+ </xsd:simpleType>
829
+
830
+ <xsd:simpleType name="COUNTRY_CODE_A3">
831
+ <xsd:restriction base="xsd:string">
832
+ <xsd:pattern value="[A-Z]{3}"></xsd:pattern>
833
+ </xsd:restriction>
834
+ </xsd:simpleType>
835
+
836
+ <xsd:simpleType name="COUNTRY_CODE_A2">
837
+ <xsd:restriction base="xsd:string">
838
+ <xsd:pattern value="[A-Z]{2}"></xsd:pattern>
839
+ </xsd:restriction>
840
+ </xsd:simpleType>
841
+
842
+ <xsd:simpleType name="CURRENCY_CODE_A">
843
+ <xsd:restriction base="xsd:string">
844
+ <xsd:pattern value="[A-Z]{3}"></xsd:pattern>
845
+ </xsd:restriction>
846
+ </xsd:simpleType>
847
+
848
+ <xsd:simpleType name="VERSION_NO_S500">
849
+ <xsd:restriction base="xsd:string">
850
+ <xsd:pattern value="[A-Za-z0-9 .\-_]{1,10}"></xsd:pattern>
851
+ </xsd:restriction>
852
+ </xsd:simpleType>
853
+
854
+ <xsd:simpleType name="INT">
855
+ <xsd:restriction base="xsd:string">
856
+ <xsd:pattern value="\d*"></xsd:pattern>
857
+ </xsd:restriction>
858
+ </xsd:simpleType>
859
+
860
+ <xsd:simpleType name="N20">
861
+ <xsd:restriction base="xsd:string">
862
+ <xsd:pattern value="\d{0,20}"></xsd:pattern>
863
+ </xsd:restriction>
864
+ </xsd:simpleType>
865
+
866
+ <xsd:simpleType name="FLOAT">
867
+ <xsd:restriction base="xsd:string">
868
+ <xsd:pattern value="(\d*\.\d+|\d*)"></xsd:pattern>
869
+ </xsd:restriction>
870
+ </xsd:simpleType>
871
+
872
+ <xsd:simpleType name="A">
873
+ <xsd:restriction base="xsd:string">
874
+ <xsd:pattern value="[A-Za-z]*"></xsd:pattern>
875
+ </xsd:restriction>
876
+ </xsd:simpleType>
877
+
878
+ <xsd:simpleType name="A1">
879
+ <xsd:restriction base="xsd:string">
880
+ <xsd:pattern value="[A-Za-z]{0,1}"></xsd:pattern>
881
+ </xsd:restriction>
882
+ </xsd:simpleType>
883
+
884
+ <xsd:simpleType name="A2">
885
+ <xsd:restriction base="xsd:string">
886
+ <xsd:pattern value="[A-Za-z]{0,2}"></xsd:pattern>
887
+ </xsd:restriction>
888
+ </xsd:simpleType>
889
+
890
+ <xsd:simpleType name="AN">
891
+ <xsd:restriction base="xsd:string">
892
+ <xsd:pattern value="[A-Za-z0-9]*"></xsd:pattern>
893
+ </xsd:restriction>
894
+ </xsd:simpleType>
895
+
896
+ <xsd:simpleType name="AN3">
897
+ <xsd:restriction base="xsd:string">
898
+ <xsd:pattern value="[A-Za-z0-9]{0,3}"></xsd:pattern>
899
+ </xsd:restriction>
900
+ </xsd:simpleType>
901
+
902
+ <xsd:simpleType name="AN20">
903
+ <xsd:restriction base="xsd:string">
904
+ <xsd:pattern value="[A-Za-z0-9]{0,20}"></xsd:pattern>
905
+ </xsd:restriction>
906
+ </xsd:simpleType>
907
+
908
+ <xsd:simpleType name="AN25">
909
+ <xsd:restriction base="xsd:string">
910
+ <xsd:pattern value="[A-Za-z0-9]{0,25}"></xsd:pattern>
911
+ </xsd:restriction>
912
+ </xsd:simpleType>
913
+
914
+ <xsd:simpleType name="AN60">
915
+ <xsd:restriction base="xsd:string">
916
+ <xsd:pattern value="[A-Za-z0-9]{0,60}"></xsd:pattern>
917
+ </xsd:restriction>
918
+ </xsd:simpleType>
919
+
920
+
921
+
922
+ <xsd:simpleType name="S60">
923
+ <xsd:restriction base="xsd:string">
924
+ <xsd:minLength value="0" />
925
+ <xsd:maxLength value="60" />
926
+ </xsd:restriction>
927
+ </xsd:simpleType>
928
+
929
+ <xsd:simpleType name="S500">
930
+ <xsd:restriction base="xsd:string">
931
+ <xsd:minLength value="0" />
932
+ <xsd:maxLength value="500" />
933
+ </xsd:restriction>
934
+ </xsd:simpleType>
935
+
936
+ </xsd:schema>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/schema/response/transaction_response_schema.xsd ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsd:schema targetNamespace="http://www.api.sz.com/ws/schema/transaction/response" xmlns:ResponseSchema="http://www.api.sz.com/ws/schema/transaction/response"
3
+ xmlns:CommonSchema="http://www.api.sz.com/ws/schema/common" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ elementFormDefault="qualified">
5
+
6
+ <xsd:import namespace="http://www.api.sz.com/ws/schema/common" schemaLocation="../common_schema.xsd" />
7
+
8
+
9
+ <!-- ************************************************************** -->
10
+ <!-- #### WEBSERVICES TYPE DECLARATIONS #### -->
11
+ <!-- ************************************************************** -->
12
+
13
+ <xsd:element name="EchoResponse" type="ResponseSchema:EchoResponseType" />
14
+ <xsd:element name="TransAddressLabelingResponse" type="ResponseSchema:TransAddressLabelingResponseType" />
15
+ <xsd:element name="TransAddressValidationResponse" type="ResponseSchema:TransAddressValidationResponseType" />
16
+ <xsd:element name="TransLogisticsReqResponse" type="ResponseSchema:TransLogisticsReqResponseType" />
17
+ <xsd:element name="TransLogisticsConfirmResponse" type="ResponseSchema:TransLogisticsConfirmResponseType" />
18
+
19
+
20
+
21
+ <!-- ************************************************************** -->
22
+ <!-- #### WEBSERVICES TYPE DEFINITIONS #### -->
23
+ <!-- ************************************************************** -->
24
+
25
+ <xsd:complexType name="EchoResponseType">
26
+ <xsd:sequence>
27
+ <xsd:group ref="CommonSchema:CommonResponseGroup" />
28
+ <xsd:element name="echoMessage" type="CommonSchema:AN...500" minOccurs="0" />
29
+ </xsd:sequence>
30
+ </xsd:complexType>
31
+ <xsd:complexType name="TransAddressLabelingResponseType">
32
+ <xsd:sequence>
33
+ <xsd:group ref="CommonSchema:CommonResponseGroup" />
34
+ <xsd:element name="AddressFormats" type="ResponseSchema:AddressFormatsType" minOccurs="0" />
35
+ </xsd:sequence>
36
+ </xsd:complexType>
37
+
38
+ <xsd:complexType name="TransAddressValidationResponseType">
39
+ <xsd:sequence>
40
+ <xsd:group ref="CommonSchema:CommonResponseGroup" />
41
+ <xsd:element name="FormatedAddress" type="CommonSchema:ANS...500" minOccurs="0"/>
42
+ <xsd:element name="AddressValidationErrors" type="ResponseSchema:AddressValidationErrorsType" minOccurs="0"/>
43
+ </xsd:sequence>
44
+ </xsd:complexType>
45
+
46
+ <xsd:complexType name="TransLogisticsReqResponseType">
47
+ <xsd:sequence>
48
+ <xsd:group ref="CommonSchema:CommonResponseGroup" />
49
+ <xsd:element name="OrderDetails" type="ResponseSchema:OrderDetailsType" />
50
+ <xsd:element name="LogisticDetails" type="ResponseSchema:LogisticDetailsType" />
51
+ <xsd:element name="OrderMerchantDetails" type="ResponseSchema:OrderMerchantDetailsType" />
52
+ <xsd:element name="OrderCustomerDetails" type="ResponseSchema:OrderCustomerDetailsType" />
53
+ </xsd:sequence>
54
+ </xsd:complexType>
55
+
56
+ <xsd:complexType name="TransLogisticsConfirmResponseType">
57
+ <xsd:sequence>
58
+ <xsd:group ref="CommonSchema:CommonResponseGroup" />
59
+ <!-- xsd:element name="OrderInvoiceFile" type="CommonSchema:FileType" / -->
60
+ </xsd:sequence>
61
+ </xsd:complexType>
62
+
63
+ <xsd:complexType name="AddressFormatsType">
64
+ <xsd:sequence>
65
+ <xsd:element name="AddressFormat" type="ResponseSchema:AddressFormatType" maxOccurs="unbounded" />
66
+ </xsd:sequence>
67
+ </xsd:complexType>
68
+
69
+ <xsd:complexType name="AddressFormatType">
70
+ <xsd:sequence>
71
+ <xsd:element name="FieldType" type="CommonSchema:A1" />
72
+ <xsd:element name="FieldLabel" type="CommonSchema:AN...40" />
73
+ <xsd:element name="IsVisible" type="CommonSchema:BOOL_YN_A1" />
74
+ <xsd:element name="IsMandatory" type="CommonSchema:BOOL_YN_A1" />
75
+ <xsd:element name="IsLineBreakRequired" type="CommonSchema:BOOL_YN_A1" />
76
+ <xsd:element name="DisplayOrder" type="CommonSchema:N...3" />
77
+ <xsd:element name="MaxLength" type="CommonSchema:N...3" />
78
+ </xsd:sequence>
79
+ </xsd:complexType>
80
+
81
+ <xsd:complexType name="AddressValidationErrorsType">
82
+ <xsd:sequence>
83
+ <xsd:element name="AddressValidationError" type="ResponseSchema:AddressValidationErrorType" maxOccurs="unbounded"/>
84
+ </xsd:sequence>
85
+ </xsd:complexType>
86
+
87
+ <xsd:complexType name="AddressValidationErrorType">
88
+ <xsd:sequence>
89
+ <xsd:element name="AddressLabelType" type="CommonSchema:A1" />
90
+ <xsd:element name="ErrorCode" type="CommonSchema:AN3" />
91
+ <xsd:element name="ErrorDescription" type="CommonSchema:AN...60" />
92
+ </xsd:sequence>
93
+ </xsd:complexType>
94
+
95
+
96
+ <xsd:complexType name="OrderDetailsType">
97
+ <xsd:sequence>
98
+ <xsd:element name="OrderNo" type="CommonSchema:N...20" />
99
+ <xsd:element name="OrderDatetime" type="CommonSchema:DT" />
100
+ <xsd:element name="ServiceCharges" type="CommonSchema:AM" />
101
+ <xsd:element name="ServiceChargesCurrency" type="CommonSchema:A3_CURRENCY_CODE" />
102
+ </xsd:sequence>
103
+ </xsd:complexType>
104
+
105
+ <xsd:complexType name="LogisticDetailsType">
106
+ <xsd:sequence>
107
+ <xsd:element name="TotalBoxQty" type="CommonSchema:N...3" />
108
+ <xsd:element name="TotalItemsQty" type="CommonSchema:N...3" />
109
+ <xsd:element name="WeigthUnit" type="CommonSchema:A2" />
110
+ <xsd:element name="GrossWeight" type="CommonSchema:AM" />
111
+ <xsd:element name="NetWeight" type="CommonSchema:AM" />
112
+ <xsd:element name="TotalVolumetricWeight" type="CommonSchema:AM" />
113
+ <xsd:element name="PrepaidDutiesAllowed" type="CommonSchema:BOOL_YN_A1" default="Y" />
114
+ </xsd:sequence>
115
+ </xsd:complexType>
116
+
117
+ <xsd:complexType name="OrderMerchantDetailsType">
118
+ <xsd:sequence>
119
+ <xsd:element name="MerchantProductAmount" type="CommonSchema:AM" />
120
+ <xsd:element name="MerchantOrderCurrency" type="CommonSchema:A3_CURRENCY_CODE" />
121
+ <xsd:element name="MerchantShippingCharges" type="CommonSchema:AM" />
122
+ <xsd:element name="MerchantShippingDuties" type="CommonSchema:AM" />
123
+ <xsd:element name="MerchantInsuranceCharges" type="CommonSchema:AM" />
124
+ <xsd:element name="MerchantTotalTransAmount" type="CommonSchema:AM" />
125
+ <xsd:element name="MerchantTransDatetime" type="CommonSchema:DT" />
126
+ <xsd:element name="MerchantPickupDueDatetime" type="CommonSchema:DT" />
127
+ </xsd:sequence>
128
+ </xsd:complexType>
129
+
130
+ <xsd:complexType name="OrderCustomerDetailsType">
131
+ <xsd:sequence>
132
+ <xsd:element name="CustCurrency" type="CommonSchema:A3_CURRENCY_CODE" />
133
+ <xsd:element name="CustCurrencyExcRate" type="CommonSchema:AM" />
134
+ <xsd:element name="CustItemSubtotal" type="CommonSchema:AM" />
135
+ <xsd:element name="CustShippingcharges" type="CommonSchema:AM" />
136
+ <xsd:element name="CustCourierDuties" type="CommonSchema:AM" />
137
+ <xsd:element name="CustInsuranceCharges" type="CommonSchema:AM" />
138
+ <xsd:element name="CustTotalTransAmount" type="CommonSchema:AM" />
139
+ <xsd:element name="TransitDays" type="CommonSchema:N...3" />
140
+ <xsd:element name="CustEstimatedDeliveryDatetime" type="CommonSchema:DT" />
141
+ </xsd:sequence>
142
+ </xsd:complexType>
143
+
144
+ </xsd:schema>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/transaction_ws.wsdl ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions targetNamespace="http://ws.api.sz.com/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
4
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://ws.api.sz.com/wsdl" xmlns:intf="http://ws.api.sz.com/wsdl"
5
+ xmlns:request="http://www.api.sz.com/ws/schema/transaction/request" xmlns:response="http://www.api.sz.com/ws/schema/transaction/response">
6
+
7
+ <!-- ************************************************************** -->
8
+ <!-- #### WEB SERVICES WSDL TYPES DECLARATIONS #### -->
9
+ <!-- ************************************************************** -->
10
+
11
+ <wsdl:types>
12
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
13
+ <xsd:import namespace="http://www.api.sz.com/ws/schema/transaction/request" schemaLocation="./schema/request/transaction_request_schema.xsd" />
14
+ <xsd:import namespace="http://www.api.sz.com/ws/schema/transaction/response" schemaLocation="./schema/response/transaction_response_schema.xsd" />
15
+ </xsd:schema>
16
+ </wsdl:types>
17
+
18
+
19
+ <!-- ************************************************************** -->
20
+ <!-- #### WEB SERVICES WSDL MESSAGES DECLARATIONS #### -->
21
+ <!-- ************************************************************** -->
22
+
23
+
24
+ <wsdl:message name="EchoRequestMsg">
25
+ <wsdl:part name="request" element="request:Echo" />
26
+ </wsdl:message>
27
+ <wsdl:message name="EchoResponseMsg">
28
+ <wsdl:part name="response" element="response:EchoResponse" />
29
+ </wsdl:message>
30
+
31
+ <wsdl:message name="TransAddressLabelingRequestMsg">
32
+ <wsdl:part name="request" element="request:TransAddressLabeling" />
33
+ </wsdl:message>
34
+ <wsdl:message name="TransAddressLabelingResponseMsg">
35
+ <wsdl:part name="response" element="response:TransAddressLabelingResponse" />
36
+ </wsdl:message>
37
+
38
+ <wsdl:message name="TransAddressValidationRequestMsg">
39
+ <wsdl:part name="request" element="request:TransAddressValidation" />
40
+ </wsdl:message>
41
+ <wsdl:message name="TransAddressValidationResponseMsg">
42
+ <wsdl:part name="response" element="response:TransAddressValidationResponse" />
43
+ </wsdl:message>
44
+
45
+ <wsdl:message name="TransLogisticsReqRequestMsg">
46
+ <wsdl:part name="request" element="request:TransLogisticsReq" />
47
+ </wsdl:message>
48
+ <wsdl:message name="TransLogisticsReqResponseMsg">
49
+ <wsdl:part name="response" element="response:TransLogisticsReqResponse" />
50
+ </wsdl:message>
51
+
52
+ <wsdl:message name="TransLogisticsConfirmRequestMsg">
53
+ <wsdl:part name="request" element="request:TransLogisticsConfirm" />
54
+ </wsdl:message>
55
+ <wsdl:message name="TransLogisticsConfirmResponseMsg">
56
+ <wsdl:part name="response" element="response:TransLogisticsConfirmResponse" />
57
+ </wsdl:message>
58
+
59
+
60
+ <!-- ************************************************************** -->
61
+ <!-- #### WEB SERVICES WSDL PORT TYPE DECLARATION #### -->
62
+ <!-- ************************************************************** -->
63
+
64
+
65
+ <wsdl:portType name="TransactionWsHandlerPort">
66
+
67
+
68
+ <wsdl:operation name="Echo">
69
+ <wsdl:input message="impl:EchoRequestMsg" name="echoRequest" />
70
+ <wsdl:output message="impl:EchoResponseMsg" name="echoResponse" />
71
+ </wsdl:operation>
72
+
73
+ <wsdl:operation name="TransAddressLabeling">
74
+ <wsdl:input message="impl:TransAddressLabelingRequestMsg" name="transAddressLabelingRequest" />
75
+ <wsdl:output message="impl:TransAddressLabelingResponseMsg" name="transAddressLabelingResponse" />
76
+ </wsdl:operation>
77
+
78
+
79
+ <wsdl:operation name="TransAddressValidation">
80
+ <wsdl:input message="impl:TransAddressValidationRequestMsg" name="transAddressValidationRequest" />
81
+ <wsdl:output message="impl:TransAddressValidationResponseMsg" name="transAddressValidationResponse" />
82
+ </wsdl:operation>
83
+
84
+ <wsdl:operation name="TransLogisticsReq">
85
+ <wsdl:input message="impl:TransLogisticsReqRequestMsg" name="transLogisticsReqRequest" />
86
+ <wsdl:output message="impl:TransLogisticsReqResponseMsg" name="transLogisticsReqResponse" />
87
+ </wsdl:operation>
88
+
89
+ <wsdl:operation name="TransLogisticsConfirm">
90
+ <wsdl:input message="impl:TransLogisticsConfirmRequestMsg" name="transLogisticsConfirmRequest" />
91
+ <wsdl:output message="impl:TransLogisticsConfirmResponseMsg" name="transLogisticsConfirmResponse" />
92
+ </wsdl:operation>
93
+
94
+
95
+ </wsdl:portType>
96
+
97
+
98
+ <!-- ************************************************************** -->
99
+ <!-- #### WEB SERVICES WSDL PORT BINDING DECLARATION #### -->
100
+ <!-- ************************************************************** -->
101
+
102
+
103
+ <wsdl:binding name="TransactionWsHandlerSoapBinding" type="impl:TransactionWsHandlerPort">
104
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
105
+
106
+
107
+ <wsdl:operation name="Echo">
108
+ <wsdlsoap:operation soapAction="" />
109
+ <wsdl:input name="echoRequest">
110
+ <wsdlsoap:body use="literal" />
111
+ </wsdl:input>
112
+ <wsdl:output name="echoResponse">
113
+ <wsdlsoap:body use="literal" />
114
+ </wsdl:output>
115
+ </wsdl:operation>
116
+
117
+ <wsdl:operation name="TransAddressLabeling">
118
+ <wsdlsoap:operation soapAction="" />
119
+ <wsdl:input name="transAddressLabelingRequest">
120
+ <wsdlsoap:body use="literal" />
121
+ </wsdl:input>
122
+ <wsdl:output name="transAddressLabelingResponse">
123
+ <wsdlsoap:body use="literal" />
124
+ </wsdl:output>
125
+ </wsdl:operation>
126
+
127
+ <wsdl:operation name="TransAddressValidation">
128
+ <wsdlsoap:operation soapAction="" />
129
+ <wsdl:input name="transAddressValidationRequest">
130
+ <wsdlsoap:body use="literal" />
131
+ </wsdl:input>
132
+ <wsdl:output name="transAddressValidationResponse">
133
+ <wsdlsoap:body use="literal" />
134
+ </wsdl:output>
135
+ </wsdl:operation>
136
+
137
+ <wsdl:operation name="TransLogisticsReq">
138
+ <wsdlsoap:operation soapAction="" />
139
+ <wsdl:input name="transLogisticsReqRequest">
140
+ <wsdlsoap:body use="literal" />
141
+ </wsdl:input>
142
+ <wsdl:output name="transLogisticsReqResponse">
143
+ <wsdlsoap:body use="literal" />
144
+ </wsdl:output>
145
+ </wsdl:operation>
146
+
147
+ <wsdl:operation name="TransLogisticsConfirm">
148
+ <wsdlsoap:operation soapAction="" />
149
+ <wsdl:input name="transLogisticsConfirmRequest">
150
+ <wsdlsoap:body use="literal" />
151
+ </wsdl:input>
152
+ <wsdl:output name="transLogisticsConfirmResponse">
153
+ <wsdlsoap:body use="literal" />
154
+ </wsdl:output>
155
+ </wsdl:operation>
156
+
157
+
158
+
159
+ </wsdl:binding>
160
+
161
+
162
+ <!-- ************************************************************** -->
163
+ <!-- #### WEB SERVICES WSDL PORT SERVICE DECLARATION #### -->
164
+ <!-- ************************************************************** -->
165
+
166
+ <wsdl:service name="TransactionWs">
167
+ <wsdl:port binding="impl:TransactionWsHandlerSoapBinding" name="TransactionWsHandler">
168
+ <wsdlsoap:address location="http://staging.swipezoom.com/transaction/services/transaction" />
169
+ <!-- wsdlsoap:address location="http://staging.swipezoom.com/transaction/services/transaction" / -->
170
+ </wsdl:port>
171
+ </wsdl:service>
172
+ </wsdl:definitions>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <jaxws:bindings wsdlLocation="GecaWs.wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
2
+ xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
3
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc">
4
+
5
+ <jaxb:globalBindings>
6
+ <xjc:simple />
7
+ </jaxb:globalBindings>
8
+
9
+ <jaxb:schemaBindings>
10
+ <jaxb:package name="com.sz.geca.ws" />
11
+ <jaxb:enableWrapperStyle>false</jaxb:enableWrapperStyle>
12
+ </jaxb:schemaBindings>
13
+
14
+ <jaxws:bindings node="wsdl:definitions">
15
+ <jaxb:bindings node="wsdl:portType">
16
+ <jaxb:class name="GecaWsHandler" />
17
+ </jaxb:bindings>
18
+ </jaxws:bindings>
19
+ <jaxws:bindings node="wsdl:definitions">
20
+ <jaxb:bindings node="wsdl:service">
21
+ <jaxb:class name="GecaWs" />
22
+ </jaxb:bindings>
23
+ </jaxws:bindings>
24
+ </jaxws:bindings>
25
+
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_root.xjb ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <bindings wsdlLocation="GecaWs.wsdl">
3
+
4
+ <bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
5
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
6
+ xmlns="http://java.sun.com/xml/ns/jaxws"
7
+ node="wsdl:definitions">
8
+ <package name="com.sz.geca.ws"/>
9
+
10
+ <jxb:schemaBindings>
11
+ <jxb:package name="com.sz.geca.ws" />
12
+ </jxb:schemaBindings>
13
+
14
+
15
+ </bindings>
16
+
17
+ </bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_root_element.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <jaxb:bindings
2
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
3
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
4
+ jaxb:extensionBindingPrefixes="xjc">
5
+
6
+ <jaxb:globalBindings>
7
+ <xjc:simple />
8
+ </jaxb:globalBindings>
9
+ </jaxb:bindings>
app/code/local/Swipezoom/InternationalShipping/etc/WsWsdl/wsdl_binding_wsdl_port.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <bindings
2
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
4
+ wsdlLocation="GecaWs.wsdl"
5
+ xmlns="http://java.sun.com/xml/ns/jaxws">
6
+
7
+ <enableWrapperStyle>false</enableWrapperStyle>
8
+ <package name="com.sz.geca.ws" />
9
+
10
+ <bindings node="wsdl:definitions/wsdl:portType">
11
+ <class name="GecaWsHandler" />
12
+ </bindings>
13
+ <bindings node="wsdl:definitions/wsdl:service">
14
+ <class name="GecaWs" />
15
+ </bindings>
16
+ </bindings>
app/code/local/Swipezoom/InternationalShipping/etc/config.xml ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Swipezoom
5
+ * @package Swipezoom_InternationalShipping
6
+ * @author Swipezoom
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Swipezoom_InternationalShipping>
13
+ <version>1.0.0</version>
14
+ </Swipezoom_InternationalShipping>
15
+ </modules>
16
+ <frontend>
17
+ <routers>
18
+ <internationalshipping>
19
+ <use>standard</use>
20
+ <args>
21
+ <module>Swipezoom_InternationalShipping</module>
22
+ <frontName>internationalshipping</frontName>
23
+ </args>
24
+ </internationalshipping>
25
+ </routers>
26
+ <layout>
27
+ <updates>
28
+ <internationalshipping>
29
+ <file>internationalshipping.xml</file>
30
+ </internationalshipping>
31
+ </updates>
32
+ </layout>
33
+ <events>
34
+ <sales_order_place_after>
35
+ <observers>
36
+ <swipezoom_order_checkout_observer>
37
+ <type>singleton</type>
38
+ <class>internationalshipping/observer</class>
39
+ <method>saveSZorderNumber</method>
40
+ </swipezoom_order_checkout_observer>
41
+ </observers>
42
+ </sales_order_place_after>
43
+
44
+ <sales_quote_collect_totals_after>
45
+ <observers>
46
+ <swipezoom_order_checkout_observer>
47
+ <type>singleton</type>
48
+ <class>internationalshipping/observer</class>
49
+ <method>modifySubtotal</method>
50
+ </swipezoom_order_checkout_observer>
51
+ </observers>
52
+ </sales_quote_collect_totals_after>
53
+ </events>
54
+ </frontend>
55
+ <admin>
56
+ <routers>
57
+ <internationalshipping>
58
+ <use>admin</use>
59
+ <args>
60
+ <module>Swipezoom_InternationalShipping</module>
61
+ <frontName>internationalshipping</frontName>
62
+ </args>
63
+ </internationalshipping>
64
+ </routers>
65
+ </admin>
66
+ <adminhtml>
67
+ <acl>
68
+ <resources>
69
+ <all>
70
+ <title>Allow Everything</title>
71
+ </all>
72
+ <admin>
73
+ <children>
74
+ <Swipezoom_InternationalShipping>
75
+ <title>InternationalShipping Module</title>
76
+ <sort_order>10</sort_order>
77
+ </Swipezoom_InternationalShipping>
78
+ </children>
79
+ </admin>
80
+ </resources>
81
+ </acl>
82
+ <layout>
83
+ <updates>
84
+ <internationalshipping>
85
+ <file>internationalshipping.xml</file>
86
+ </internationalshipping>
87
+ </updates>
88
+ </layout>
89
+ </adminhtml>
90
+ <global>
91
+ <sales>
92
+ <quote>
93
+ <totals>
94
+ <vat>
95
+ <class>Swipezoom_InternationalShipping_Model_Sales_Quote_Address_Total_Vat</class>
96
+ <after>subtotal</after>
97
+ <before>tax</before>
98
+ </vat>
99
+ </totals>
100
+ </quote>
101
+ <order_invoice>
102
+ <totals>
103
+ <vat>
104
+ <class>Swipezoom_InternationalShipping_Model_Total_Vat_Invoice</class>
105
+ <after>subtotal</after>
106
+ <before>tax</before>
107
+ </vat>
108
+ </totals>
109
+ </order_invoice>
110
+ <order_creditmemo>
111
+ <totals>
112
+ <vat>
113
+ <class>Swipezoom_InternationalShipping_Model_Total_Vat_Creditmemo</class>
114
+ <after>subtotal</after>
115
+ <before>tax</before>
116
+ </vat>
117
+ </totals>
118
+ </order_creditmemo>
119
+ </sales>
120
+
121
+ <fieldsets>
122
+ <sales_convert_quote_address>
123
+ <vat_amount><to_order>*</to_order></vat_amount>
124
+ <base_vat_amount><to_order>*</to_order></base_vat_amount>
125
+ </sales_convert_quote_address>
126
+ </fieldsets>
127
+ <sales>
128
+ <order>
129
+ <statuses>
130
+ <newrefund translate="label"><label>New Refund</label></newrefund>
131
+ </statuses>
132
+ <states>
133
+ <complete>
134
+ <statuses>
135
+ <newrefund />
136
+ </statuses>
137
+ </complete>
138
+ </states>
139
+ </order>
140
+ </sales>
141
+ <rewrite>
142
+ <swipezoom_internationalshipping_adminhtml_sales_order_createcontroller>
143
+ <from><![CDATA[#^/admin/sales_order_create/#]]></from> <!-- Mage_Adminhtml_Sales_Order_CreateController -->
144
+ <to>/internationalshipping/adminhtml_sales_order_create/</to> <!-- Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreateController -->
145
+ </swipezoom_internationalshipping_adminhtml_sales_order_createcontroller>
146
+ <swipezoom_internationalshipping_adminhtml_sales_order_editcontroller>
147
+ <from><![CDATA[#^/admin/sales_order_edit/#]]></from>
148
+ <to>/internationalshipping/adminhtml_sales_order_edit/</to>
149
+ </swipezoom_internationalshipping_adminhtml_sales_order_editcontroller>
150
+ <swipezoom_internationalshipping_adminhtml_sales_order_invoicecontroller>
151
+ <from><![CDATA[#^/admin/sales_order_invoice/#]]></from>
152
+ <to>/internationalshipping/adminhtml_sales_order_invoice/</to>
153
+ </swipezoom_internationalshipping_adminhtml_sales_order_invoicecontroller>
154
+ <swipezoom_internationalshipping_adminhtml_sales_order_creditmemocontroller>
155
+ <from><![CDATA[#^/admin/sales_order_creditmemo/#]]></from> <!-- Mage_Adminhtml_Sales_Order_CreditmemoController -->
156
+ <to>/internationalshipping/adminhtml_sales_order_creditmemo/</to> <!-- Swipezoom_InternationalShipping_Adminhtml_Sales_Order_CreditmemoController -->
157
+ </swipezoom_internationalshipping_adminhtml_sales_order_creditmemocontroller>
158
+ <swipezoom_internationalshipping_adminhtml_sales_order_shipmentcontroller>
159
+ <from><![CDATA[#^/admin/sales_order_shipment/#]]></from> <!-- Mage_Adminhtml_Sales_Order_ShipmentController -->
160
+ <to>/internationalshipping/adminhtml_sales_order_shipment/</to> <!-- Swipezoom_InternationalShipping_Adminhtml_Sales_Order_ShipmentController -->
161
+ </swipezoom_internationalshipping_adminhtml_sales_order_shipmentcontroller>
162
+ </rewrite>
163
+
164
+ <rewrite>
165
+ <swipezoom_internationalshipping>
166
+ <from><![CDATA[#^/checkout/cart/#]]></from>
167
+ <to>/internationalshipping/cart/</to>
168
+ </swipezoom_internationalshipping>
169
+ </rewrite>
170
+ <models>
171
+ <internationalshipping>
172
+ <class>Swipezoom_InternationalShipping_Model</class>
173
+ <resourceModel>internationalshipping_mysql4</resourceModel>
174
+ </internationalshipping>
175
+ <internationalshipping_mysql4>
176
+ <class>Swipezoom_InternationalShipping_Model_Mysql4</class>
177
+ <entities>
178
+ <packingdetail>
179
+ <table>packingdetail</table>
180
+ </packingdetail>
181
+ <shipmentdetail>
182
+ <table>shipmentdetail</table>
183
+ </shipmentdetail>
184
+ <swipezoomcreditmemo>
185
+ <table>swipezoom_creditmemo</table>
186
+ </swipezoomcreditmemo>
187
+ <partshipreq>
188
+ <table>swipezoom_partshipreq</table>
189
+ </partshipreq>
190
+ <partshipreqitems>
191
+ <table>swipezoom_partshipreqitems</table>
192
+ </partshipreqitems>
193
+ </entities>
194
+ </internationalshipping_mysql4>
195
+ <sales>
196
+ <rewrite>
197
+ <order>Swipezoom_InternationalShipping_Model_Order</order>
198
+ <order_pdf_invoice>Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Invoice</order_pdf_invoice>
199
+ <order_pdf_shipment>Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Shipment</order_pdf_shipment>
200
+ <order_pdf_items_invoice_default>Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Invoice_Default</order_pdf_items_invoice_default>
201
+ <order_pdf_items_shipment_default>Swipezoom_InternationalShipping_Model_Sales_Order_Pdf_Items_Shipment_Default</order_pdf_items_shipment_default>
202
+ </rewrite>
203
+ </sales>
204
+ <customer>
205
+ <rewrite>
206
+ <address_abstract>Swipezoom_InternationalShipping_Model_Validation_Abstract</address_abstract>
207
+ </rewrite>
208
+ </customer>
209
+ </models>
210
+ <resources>
211
+ <internationalshipping_setup>
212
+ <setup>
213
+ <module>Swipezoom_InternationalShipping</module>
214
+ </setup>
215
+ <connection>
216
+ <use>core_setup</use>
217
+ </connection>
218
+ </internationalshipping_setup>
219
+ <internationalshipping_write>
220
+ <connection>
221
+ <use>core_write</use>
222
+ </connection>
223
+ </internationalshipping_write>
224
+ <internationalshipping_read>
225
+ <connection>
226
+ <use>core_read</use>
227
+ </connection>
228
+ </internationalshipping_read>
229
+ </resources>
230
+ <blocks>
231
+ <internationalshipping>
232
+ <class>Swipezoom_InternationalShipping_Block</class>
233
+ </internationalshipping>
234
+ <adminhtml>
235
+ <rewrite>
236
+ <sales_order_grid>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Grid</sales_order_grid>
237
+ <sales_invoice_grid>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Invoice_Grid</sales_invoice_grid>
238
+ <sales_shipment_grid>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Shipment_Grid</sales_shipment_grid>
239
+ <sales_creditmemo_grid>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Creditmemo_Grid</sales_creditmemo_grid>
240
+ <sales_order_view>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_View</sales_order_view>
241
+ <sales_order_shipment_view>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Shipment_View</sales_order_shipment_view>
242
+ <sales_order_invoice_view>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_View</sales_order_invoice_view>
243
+ <sales_order_creditmemo_view>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_View</sales_order_creditmemo_view>
244
+ <sales_order_create_sidebar_reorder>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Create_Sidebar_Reorder</sales_order_create_sidebar_reorder>
245
+ <sales_order_totals>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Totals</sales_order_totals>
246
+ <sales_order_invoice_totals>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Invoice_Totals</sales_order_invoice_totals>
247
+ <sales_order_creditmemo_totals>Swipezoom_InternationalShipping_Block_Adminhtml_Sales_Order_Creditmemo_Totals</sales_order_creditmemo_totals>
248
+ </rewrite>
249
+ </adminhtml>
250
+ </blocks>
251
+ <helpers>
252
+ <internationalshipping>
253
+ <class>Swipezoom_InternationalShipping_Helper</class>
254
+ </internationalshipping>
255
+ </helpers>
256
+ <sales>
257
+ <shipping>
258
+ <carriers>
259
+ <swipezoom>
260
+ <class>Swipezoom_InternationalShipping_Model_Carrier_Swipezoom</class>
261
+ </swipezoom>
262
+ </carriers>
263
+ </shipping>
264
+ </sales>
265
+ <events>
266
+ <checkout_type_onepage_save_order_after>
267
+ <observers>
268
+ <bts_checkout_observer>
269
+ <type>singleton</type>
270
+ <class>internationalshipping/observer</class>
271
+ <method>confirmOrderInvoiceRequest</method>
272
+ </bts_checkout_observer>
273
+ </observers>
274
+ </checkout_type_onepage_save_order_after>
275
+
276
+ <controller_action_predispatch_adminhtml_sales_order_edit_start>
277
+ <observers>
278
+ <controller_action_layout_generate_blocks_before_handler>
279
+ <type>model</type>
280
+ <class>internationalshipping/observer</class>
281
+ <method>editorderdeleteentry</method>
282
+ <args></args>
283
+ </controller_action_layout_generate_blocks_before_handler>
284
+ </observers>
285
+ </controller_action_predispatch_adminhtml_sales_order_edit_start>
286
+
287
+ <controller_action_predispatch_shipping_tracking_popup>
288
+ <observers>
289
+ <controller_action_layout_generate_blocks_before_handler>
290
+ <type>model</type>
291
+ <class>internationalshipping/observer</class>
292
+ <method>trackingfetch</method>
293
+ <args></args>
294
+ </controller_action_layout_generate_blocks_before_handler>
295
+ </observers>
296
+ </controller_action_predispatch_shipping_tracking_popup>
297
+
298
+ <checkout_submit_all_after>
299
+ <observers>
300
+ <checkout_submit_all_after_handle>
301
+ <type>model</type>
302
+ <class>internationalshipping/observer</class>
303
+ <method>orderplaced</method>
304
+ <args></args>
305
+ </checkout_submit_all_after_handle>
306
+ </observers>
307
+ </checkout_submit_all_after>
308
+
309
+ <sales_order_grid_collection_load_before>
310
+ <observers>
311
+ <atwix_exgrid>
312
+ <model>internationalshipping/observer</model>
313
+ <method>salesOrderGridCollectionLoadBefore</method>
314
+ </atwix_exgrid>
315
+ </observers>
316
+ </sales_order_grid_collection_load_before>
317
+ </events>
318
+ </global>
319
+ <default>
320
+ <carriers>
321
+ <swipezoom>
322
+ <active>1</active>
323
+ <include_virtual_price>1</include_virtual_price>
324
+ <sallowspecific>0</sallowspecific>
325
+ <allow_free_shipping_promotions>1</allow_free_shipping_promotions>
326
+ <cutoff_cost>50</cutoff_cost>
327
+ <model>internationalshipping/carrier_swipezoom</model>
328
+ <name>Swipezoom Rates</name>
329
+ <title>International Shipping</title>
330
+ <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
331
+ <include_free_ship_items>0</include_free_ship_items>
332
+ <mode>0</mode>
333
+ <devadminurl>http://staging.swipezoom.com/GecaWs/services/GecaWsHandler?wsdl</devadminurl>
334
+ <devurl>http://staging.swipezoom.com/transaction/services/transaction?wsdl</devurl>
335
+ <adminurl></adminurl>
336
+ <url></url>
337
+ <paymentenabled>1</paymentenabled>
338
+ <merchantid>115</merchantid>
339
+ <merchantkey>TESTERLHYC100567PKI1001ENCYM12</merchantkey>
340
+ <showmethod>1</showmethod>
341
+ <debug>0</debug>
342
+ </swipezoom>
343
+ </carriers>
344
+ </default>
345
+ </config>
app/code/local/Swipezoom/InternationalShipping/etc/system.xml ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <carriers translate="label" module="shipping">
5
+ <groups>
6
+ <swipezoom translate="label">
7
+ <label>Swipezoom Shipping Rates</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>3</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <comment><![CDATA[ - This shipping method once enabled, will result in <strong>other shipping methods to be disabled</strong> for plugin enabled countries only. <br> - If the payment method is enabled, then it will also result in <strong>other payment methods to be disabled</strong> for plugin enabled countries.]]></comment>
14
+ <fields>
15
+ <active translate="label">
16
+ <label>Enabled</label>
17
+ <frontend_type>select</frontend_type>
18
+ <source_model>adminhtml/system_config_source_yesno</source_model>
19
+ <sort_order>10</sort_order>
20
+ <show_in_default>1</show_in_default>
21
+ <show_in_website>1</show_in_website>
22
+ <show_in_store>1</show_in_store>
23
+ </active>
24
+ <mode translate="label">
25
+ <label>Mode</label>
26
+ <frontend_type>select</frontend_type>
27
+ <source_model>internationalshipping/system_config_source_extmode</source_model>
28
+ <sort_order>15</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ </mode>
33
+ <url translate="label">
34
+ <label>Swipezoom URL</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>20</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <depends><mode>1</mode></depends>
41
+ </url>
42
+ <adminurl translate="label">
43
+ <label>Swipezoom Admin URL</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>20</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ <depends><mode>1</mode></depends>
50
+ </adminurl>
51
+ <devurl translate="label">
52
+ <label>Swipezoom URL</label>
53
+ <frontend_type>text</frontend_type>
54
+ <sort_order>20</sort_order>
55
+ <show_in_default>0</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ </devurl>
59
+ <devadminurl translate="label">
60
+ <label>Swipezoom Admin URL</label>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>20</sort_order>
63
+ <show_in_default>0</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ </devadminurl>
67
+ <paymentenabled translate="label">
68
+ <label>Payment Enabled</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>adminhtml/system_config_source_yesno</source_model>
71
+ <sort_order>22</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ </paymentenabled>
76
+ <title translate="label">
77
+ <label>Title</label>
78
+ <frontend_type>text</frontend_type>
79
+ <sort_order>20</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </title>
84
+ <merchantid translate="label">
85
+ <label>Merchant Id</label>
86
+ <frontend_type>text</frontend_type>
87
+ <sort_order>23</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ <show_in_store>1</show_in_store>
91
+ </merchantid>
92
+ <merchantkey translate="label">
93
+ <label>Merchant Key</label>
94
+ <frontend_type>password</frontend_type>
95
+ <sort_order>24</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>1</show_in_store>
99
+ </merchantkey>
100
+ <package_descritpion translate="label">
101
+ <label>Package Description</label>
102
+ <frontend_type>text</frontend_type>
103
+ <sort_order>30</sort_order>
104
+ <show_in_default>0</show_in_default>
105
+ <show_in_website>1</show_in_website>
106
+ <show_in_store>1</show_in_store>
107
+ </package_descritpion>
108
+ <showmethod translate="label">
109
+ <label>Show Method if Not Applicable</label>
110
+ <frontend_type>select</frontend_type>
111
+ <sort_order>320</sort_order>
112
+ <frontend_class>shipping-skip-hide</frontend_class>
113
+ <source_model>adminhtml/system_config_source_yesno</source_model>
114
+ <show_in_default>0</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>1</show_in_store>
117
+ </showmethod>
118
+ <debug translate="label">
119
+ <label>Debug Enabled</label>
120
+ <frontend_type>select</frontend_type>
121
+ <source_model>adminhtml/system_config_source_yesno</source_model>
122
+ <sort_order>325</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ </debug>
127
+ <specificerrmsg translate="label">
128
+ <label>Displayed Error Message</label>
129
+ <frontend_type>textarea</frontend_type>
130
+ <sort_order>330</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>1</show_in_store>
134
+ </specificerrmsg>
135
+ <sallowspecific translate="label">
136
+ <label>Ship to Applicable Countries</label>
137
+ <frontend_type>select</frontend_type>
138
+ <sort_order>350</sort_order>
139
+ <frontend_class>shipping-applicable-country</frontend_class>
140
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>1</show_in_website>
143
+ <show_in_store>1</show_in_store>
144
+ </sallowspecific>
145
+ <specificcountry translate="label">
146
+ <label>Ship to Specific Countries</label>
147
+ <frontend_type>multiselect</frontend_type>
148
+ <sort_order>1910</sort_order>
149
+ <source_model>adminhtml/system_config_source_country</source_model>
150
+ <show_in_default>1</show_in_default>
151
+ <show_in_website>1</show_in_website>
152
+ <show_in_store>0</show_in_store>
153
+ <can_be_empty>1</can_be_empty>
154
+ </specificcountry>
155
+ </fields>
156
+ </swipezoom>
157
+ </groups>
158
+ </carriers>
159
+ </sections>
160
+ </config>
app/code/local/Swipezoom/InternationalShipping/sql/internationalshipping_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+ $this->_conn->addColumn($this->getTable('sales_flat_quote'), 'swipezoom_order_number', 'text');
6
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_number', 'text');
7
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_number_temp', 'text');
8
+
9
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_shipping_charges', 'text');
10
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_duties_taxes', 'text');
11
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_insurance_charges', 'text');
12
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_duties_tax_prepaid', 'text');
13
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_insurance_paid', 'text');
14
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_confirmed', 'text');
15
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_confirmed_errormessage', 'text');
16
+
17
+ $this->_conn->addColumn($this->getTable('sales_flat_quote'), 'swipezoom_address_billing_string', 'text');
18
+ $this->_conn->addColumn($this->getTable('sales_flat_quote'), 'swipezoom_address_shipping_string', 'text');
19
+
20
+ $setup = new Mage_Eav_Model_Entity_Setup('Customer_setup');
21
+ $city = Mage::getModel('catalog/resource_eav_attribute')->load($setup->getAttributeId('customer_address','city'))->setData('is_required',0)->save();
22
+ $postcode = Mage::getModel('catalog/resource_eav_attribute')->load($setup->getAttributeId('customer_address','postcode'))->setData('is_required',0)->save();
23
+ $street = Mage::getModel('catalog/resource_eav_attribute')->load($setup->getAttributeId('customer_address','street'))->setData('is_required',0)->save();
24
+
25
+ $sql=<<<SQLTEXT
26
+ CREATE TABLE IF NOT EXISTS `packingdetail` (
27
+ `id` int(255) NOT NULL AUTO_INCREMENT,
28
+ `swipezoomorderid` int(255) NOT NULL,
29
+ `boxno` varchar(255) NOT NULL,
30
+ `boxcode` varchar(255) NOT NULL,
31
+ `productcode` varchar(255) NOT NULL,
32
+ `productqty` int(255) NOT NULL,
33
+ `productname` varchar(255) NOT NULL,
34
+ `magentoorderid` VARCHAR( 255 ) NOT NULL,
35
+ PRIMARY KEY (`id`)
36
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
37
+ SQLTEXT;
38
+
39
+ $installer->run($sql);
40
+
41
+ $sql=<<<SQLTEXT
42
+ CREATE TABLE IF NOT EXISTS `shipmentdetail` (
43
+ `id` int(255) NOT NULL AUTO_INCREMENT,
44
+ `swipezoomorderid` int(255) NOT NULL,
45
+ `couriername` varchar(255) NOT NULL,
46
+ `courierservicename` varchar(255) NOT NULL,
47
+ `courierwaybillno` varchar(255) NOT NULL,
48
+ `pickupdue` datetime NOT NULL,
49
+ PRIMARY KEY (`id`)
50
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
51
+ SQLTEXT;
52
+
53
+ $installer->run($sql);
54
+
55
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'swipezoom_order_creditmemo', 'text');
56
+
57
+ $sql=<<<SQLTEXT
58
+ CREATE TABLE IF NOT EXISTS `swipezoom_creditmemo` (
59
+ `id` int(255) NOT NULL AUTO_INCREMENT,
60
+ `swipezoomorderid` int(255) NOT NULL,
61
+ `realorderno` varchar(255) NOT NULL,
62
+ `refswipezoomorderid` int(255) NOT NULL,
63
+ `reforderno` varchar(255) NOT NULL,
64
+ `creditmemoitems` varchar(255) NOT NULL,
65
+ PRIMARY KEY (`id`)
66
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
67
+ SQLTEXT;
68
+
69
+ $installer->run($sql);
70
+
71
+ $sql=<<<SQLTEXT
72
+ CREATE TABLE IF NOT EXISTS `swipezoom_partshipreq` (
73
+ `id` int(255) NOT NULL AUTO_INCREMENT,
74
+ `realorderid` int(255) NOT NULL,
75
+ `swipezoomorderid` int(255) NOT NULL,
76
+ `newszorderid` int(255) NOT NULL,
77
+ `productprice` varchar(255) NOT NULL,
78
+ `pricecurrency` varchar(255) NOT NULL,
79
+ `salecurrency` varchar(255) NOT NULL,
80
+ `excrate` varchar(255) NOT NULL,
81
+ `ordertotal` double NOT NULL,
82
+ `couriercharges` double NOT NULL,
83
+ `insurancecharges` double NOT NULL,
84
+ `szmarkup` double NOT NULL,
85
+ PRIMARY KEY (`id`)
86
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
87
+ SQLTEXT;
88
+
89
+ $installer->run($sql);
90
+
91
+ $sql=<<<SQLTEXT
92
+ CREATE TABLE IF NOT EXISTS `swipezoom_partshipreqitems` (
93
+ `id` int(255) NOT NULL AUTO_INCREMENT,
94
+ `swipezoomorderid` int(255) NOT NULL,
95
+ `lineitemno` int(255) NOT NULL,
96
+ `productcode` varchar(255) NOT NULL,
97
+ `description` varchar(255) NOT NULL,
98
+ `price` float NOT NULL,
99
+ `qty` varchar(255) NOT NULL,
100
+ `salevalue` varchar(255) NOT NULL,
101
+ PRIMARY KEY (`id`)
102
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
103
+ SQLTEXT;
104
+
105
+ $installer->run($sql);
106
+
107
+ $sql=<<<SQLTEXT
108
+ ALTER TABLE `swipezoom_partshipreq` ADD `courierduties` DOUBLE NOT NULL AFTER `couriercharges`;
109
+ SQLTEXT;
110
+
111
+ $installer->run($sql);
112
+
113
+ $this->_conn->addColumn($this->getTable('sales_flat_quote_address'), 'vat_amount', 'DECIMAL( 10, 2 )');
114
+ $this->_conn->addColumn($this->getTable('sales_flat_quote_address'), 'base_vat_amount', 'DECIMAL( 10, 2 )');
115
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'vat_amount', 'DECIMAL( 10, 2 )');
116
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'base_vat_amount', 'DECIMAL( 10, 2 )');
117
+
118
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/internationalshipping.xml ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <adminhtml_system_config_edit>
5
+ <reference name="head">
6
+ <action method="addJs"><script>swipezoom/autocomplete/jquery-1.8.2.min.js</script></action>
7
+ <action method="addJs"><script>swipezoom/sz_admin.js</script></action>
8
+ </reference>
9
+ </adminhtml_system_config_edit>
10
+ <adminhtml_sales_order_index>
11
+ <reference name="head">
12
+ <action method="addJs"><script>swipezoom/order.js</script></action>
13
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
14
+ </reference>
15
+ </adminhtml_sales_order_index>
16
+ <adminhtml_sales_invoice_index>
17
+ <reference name="head">
18
+ <action method="addJs"><script>swipezoom/order.js</script></action>
19
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
20
+ </reference>
21
+ </adminhtml_sales_invoice_index>
22
+ <adminhtml_sales_shipment_index>
23
+ <reference name="head">
24
+ <action method="addJs"><script>swipezoom/order.js</script></action>
25
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
26
+ </reference>
27
+ </adminhtml_sales_shipment_index>
28
+
29
+ <adminhtml_sales_order_view>
30
+
31
+ <reference name="order_tab_info">
32
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
33
+ <template>internationalshipping/info.phtml</template>
34
+ </action>
35
+ </reference>
36
+ <reference name="order_info">
37
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
38
+ <template>internationalshipping/order/info.phtml</template>
39
+ </action>
40
+ </reference>
41
+ <reference name="order_items">
42
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
43
+ <template>internationalshipping/order/items.phtml</template>
44
+ </action>
45
+ </reference>
46
+ <reference name="order_history">
47
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
48
+ <template>internationalshipping/order/history.phtml</template>
49
+ </action>
50
+ </reference>
51
+
52
+ </adminhtml_sales_order_view>
53
+ <adminhtml_sales_order_invoice_view>
54
+ <reference name="form">
55
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
56
+ <template>internationalshipping/invoice/view/form.phtml</template>
57
+ </action>
58
+ <block type="adminhtml/sales_order_view_info" name="swipezoomordergrid" template="internationalshipping/invoice/grid.phtml"></block>
59
+ </reference>
60
+ <reference name="invoice_items">
61
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
62
+ <template>internationalshipping/invoice/view/items.phtml</template>
63
+ </action>
64
+ </reference>
65
+ <reference name="order_info">
66
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
67
+ <template>internationalshipping/invoice/info.phtml</template>
68
+ </action>
69
+ </reference>
70
+ <reference name="order_comments">
71
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
72
+ <template>internationalshipping/order/comment.phtml</template>
73
+ </action>
74
+ <action method="setParentType"><type>invoice</type></action>
75
+ </reference>
76
+ </adminhtml_sales_order_invoice_view>
77
+ <adminhtml_sales_order_invoice_new>
78
+ <reference name="form">
79
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
80
+ <template>internationalshipping/invoice/form.phtml</template>
81
+ </action>
82
+ <block type="adminhtml/sales_order_view_info" name="swipezoomordergrid" template="internationalshipping/invoice/grid.phtml"></block>
83
+ </reference>
84
+ <reference name="order_items">
85
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
86
+ <template>internationalshipping/invoice/items.phtml</template>
87
+ </action>
88
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>internationalshipping/invoice/rederer/default.phtml</template></action>
89
+ </reference>
90
+ <reference name="order_info">
91
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
92
+ <template>internationalshipping/invoice/info.phtml</template>
93
+ </action>
94
+ </reference>
95
+
96
+
97
+ </adminhtml_sales_order_invoice_new>
98
+ <adminhtml_sales_order_shipment_new>
99
+ <reference name="form">
100
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
101
+ <template>internationalshipping/shipment/form.phtml</template>
102
+ </action>
103
+ <block type="adminhtml/sales_order_view_info" name="swipezoomordergrid" template="internationalshipping/shipment/grid.phtml"></block>
104
+ </reference>
105
+ <reference name="order_items">
106
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
107
+ <template>internationalshipping/shipment/items.phtml</template>
108
+ </action>
109
+ </reference>
110
+
111
+ <reference name="order_info">
112
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
113
+ <template>internationalshipping/shipment/info.phtml</template>
114
+ </action>
115
+ </reference>
116
+
117
+ </adminhtml_sales_order_shipment_new>
118
+ <adminhtml_sales_order_shipment_view>
119
+ <reference name="form">
120
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
121
+ <template>internationalshipping/shipment/view/form.phtml</template>
122
+ </action>
123
+ <block type="adminhtml/sales_order_view_info" name="swipezoomordergrid" template="internationalshipping/shipment/view/grid.phtml"></block>
124
+ </reference>
125
+ <reference name="shipment_items">
126
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
127
+ <template>internationalshipping/shipment/view/items.phtml</template>
128
+ </action>
129
+ </reference>
130
+
131
+ <reference name="order_info">
132
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
133
+ <template>internationalshipping/shipment/info.phtml</template>
134
+ </action>
135
+ </reference>
136
+ <reference name="order_comments">
137
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
138
+ <template>internationalshipping/order/comment.phtml</template>
139
+ </action>
140
+ <action method="setParentType"><type>shipment</type></action>
141
+ </reference>
142
+
143
+ </adminhtml_sales_order_shipment_view>
144
+ <adminhtml_sales_order_creditmemo_view>
145
+ <reference name="form">
146
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
147
+ <template>internationalshipping/creditmemo/view/form.phtml</template>
148
+ </action>
149
+ </reference>
150
+ </adminhtml_sales_order_creditmemo_view>
151
+ <adminhtml_sales_order_creditmemo_new>
152
+ <reference name="form">
153
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
154
+ <template>internationalshipping/creditmemo/form.phtml</template>
155
+ </action>
156
+ <!-- <block type="adminhtml/sales_order_view_info" name="swipezoomordergrid" template="internationalshipping/creditmemo/grid.phtml"></block>-->
157
+ </reference>
158
+ <reference name="order_info">
159
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
160
+ <template>internationalshipping/shipment/info.phtml</template>
161
+ </action>
162
+ </reference>
163
+ <reference name="order_items">
164
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
165
+ <template>internationalshipping/creditmemo/items.phtml</template>
166
+ </action>
167
+ </reference>
168
+ <reference name="adjustments">
169
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
170
+ <template>internationalshipping/creditmemo/total/adjustments.phtml</template>
171
+ </action>
172
+ </reference>
173
+ <reference name="creditmemo_totals">
174
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
175
+ <template>internationalshipping/creditmemo/total/totals.phtml</template>
176
+ </action>
177
+ </reference>
178
+
179
+ </adminhtml_sales_order_creditmemo_new>
180
+ <adminhtml_sales_order_creditmemo_updateqty>
181
+ <reference name="order_items">
182
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
183
+ <template>internationalshipping/creditmemo/items.phtml</template>
184
+ </action>
185
+ </reference>
186
+ <reference name="adjustments">
187
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
188
+ <template>internationalshipping/creditmemo/total/adjustments.phtml</template>
189
+ </action>
190
+ </reference>
191
+ <reference name="creditmemo_totals">
192
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
193
+ <template>internationalshipping/creditmemo/total/totals.phtml</template>
194
+ </action>
195
+ </reference>
196
+
197
+ </adminhtml_sales_order_creditmemo_updateqty>
198
+ <adminhtml_sales_order_creditmemo_view>
199
+ <reference name="order_info">
200
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
201
+ <template>internationalshipping/invoice/info.phtml</template>
202
+ </action>
203
+ </reference>
204
+ </adminhtml_sales_order_creditmemo_view>
205
+
206
+ <adminhtml_sales_order_create_index>
207
+ <reference name="head">
208
+ <action method="addJs"><script>swipezoom/sales.js</script></action>
209
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/sales.js</name></action>
210
+ </reference>
211
+ <reference name="items_grid">
212
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
213
+ <template>internationalshipping/sales/order/create/items/sz_grid.phtml</template>
214
+ </action>
215
+ <block type="adminhtml/sales_order_create" name="parentdetail" template="internationalshipping/sales/order/create/parentdetail.phtml"></block>
216
+ </reference>
217
+ <reference name="items">
218
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
219
+ <template>internationalshipping/sales/order/create/items.phtml</template>
220
+ </action>
221
+
222
+ </reference>
223
+ <reference name="data">
224
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
225
+ <template>internationalshipping/sales/order/create/data.phtml</template>
226
+ </action>
227
+ <block type="adminhtml/sales_order_create_sidebar" template="internationalshipping/sales/order/create/sidebar.phtml" name="sidebar">
228
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="internationalshipping/sales/order/create/sidebar/items.phtml" name="reorder" ifconfig="carriers/swipezoom/active" />
229
+ </block>
230
+ </reference>
231
+ </adminhtml_sales_order_create_index>
232
+ <adminhtml_sales_order_create_load_block_sidebar>
233
+ <reference name="content">
234
+ <block type="adminhtml/sales_order_create_sidebar" template="internationalshipping/sales/order/create/sidebar.phtml" name="sidebar">
235
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="internationalshipping/sales/order/create/sidebar/items.phtml" name="reorder" ifconfig="carriers/swipezoom/active" />
236
+ </block>
237
+ </reference>
238
+ </adminhtml_sales_order_create_load_block_sidebar>
239
+ <adminhtml_sales_order_create_load_block_data>
240
+ <reference name="items_grid">
241
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
242
+ <template>internationalshipping/sales/order/create/items/sz_grid.phtml</template>
243
+ </action>
244
+ <block type="adminhtml/sales_order_create" name="parentdetail" template="internationalshipping/sales/order/create/parentdetail.phtml"></block>
245
+ </reference>
246
+ <reference name="items">
247
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
248
+ <template>internationalshipping/sales/order/create/items.phtml</template>
249
+ </action>
250
+
251
+ </reference>
252
+ <reference name="data">
253
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
254
+ <template>internationalshipping/sales/order/create/data.phtml</template>
255
+ </action>
256
+ <block type="adminhtml/sales_order_create_sidebar" template="internationalshipping/sales/order/create/sidebar.phtml" name="sidebar">
257
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="internationalshipping/sales/order/create/sidebar/items.phtml" name="reorder" ifconfig="carriers/swipezoom/active" />
258
+ </block>
259
+ </reference>
260
+ </adminhtml_sales_order_create_load_block_data>
261
+ <adminhtml_sales_order_create_load_block_items>
262
+ <reference name="items_grid">
263
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
264
+ <template>internationalshipping/sales/order/create/items/sz_grid.phtml</template>
265
+ </action>
266
+ <block type="adminhtml/sales_order_create" name="parentdetail" template="internationalshipping/sales/order/create/parentdetail.phtml"></block>
267
+ </reference>
268
+ <reference name="items">
269
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
270
+ <template>internationalshipping/sales/order/create/items.phtml</template>
271
+ </action>
272
+
273
+ </reference>
274
+ <reference name="data">
275
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active" >
276
+ <template>internationalshipping/sales/order/create/data.phtml</template>
277
+ </action>
278
+ <block type="adminhtml/sales_order_create_sidebar" template="internationalshipping/sales/order/create/sidebar.phtml" name="sidebar">
279
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="internationalshipping/sales/order/create/sidebar/items.phtml" name="reorder" ifconfig="carriers/swipezoom/active" />
280
+ </block>
281
+ </reference>
282
+
283
+ </adminhtml_sales_order_create_load_block_items>
284
+ </layout>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/form.phtml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
3
+ <?php echo $this->getBlockHtml('formkey')?>
4
+ <?php $_order = $this->getCreditmemo()->getOrder() ?>
5
+ <?php echo $this->getChildHtml('order_info') ?>
6
+
7
+ <?php if (!$_order->getIsVirtual()): ?>
8
+ <div class="box-left">
9
+ <?php else: ?>
10
+ <div class="box-right">
11
+ <?php endif; ?>
12
+ <!--Billing Address-->
13
+ <div class="entry-edit">
14
+ <div class="entry-edit-head">
15
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
16
+ </div>
17
+ <fieldset>
18
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
19
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
20
+ <?php /*if ($this->getCreditmemo()->canRefund()): ?>
21
+ <input type="checkbox" name="creditmemo[do_refund]" id="creditmemo_do_refund" value="1" checked/>
22
+ <label for="creditmemo_do_refund" class="normal"><?php echo Mage::helper('sales')->__('Refund Amount') ?></label>
23
+ <?php endif;*/ ?>
24
+ </fieldset>
25
+ </div>
26
+ </div>
27
+ <?php if (!$_order->getIsVirtual()): ?>
28
+ <div class="box-right">
29
+ <!--Shipping Address-->
30
+ <div class="entry-edit">
31
+ <div class="entry-edit-head">
32
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
33
+ </div>
34
+ <fieldset>
35
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
36
+ <?php // echo $this->helper('sales')->__('Total Shipping Charges'); ?>
37
+
38
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($this->getSource()->getStoreId())): ?>
39
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
40
+ <?php else: ?>
41
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
42
+ <?php endif; ?>
43
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
44
+ <br />
45
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
46
+ <?php echo $_excl; ?>
47
+ <?php if ($this->helper('tax')->displaySalesBothPrices($this->getSource()->getStoreId()) && $_incl != $_excl): ?>
48
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
49
+ <?php endif; ?>
50
+ <br />
51
+ <?php
52
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
53
+ if($szOrderId){
54
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
55
+ if(count($counts)){
56
+ foreach($counts as $sh) {
57
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
58
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
59
+ }
60
+ }
61
+ }
62
+
63
+ ?>
64
+ </fieldset>
65
+ </div>
66
+ </div>
67
+ <?php endif; ?>
68
+ <div class="clear"></div>
69
+ <?php
70
+ $shippingMethod = $_order->getData("shipping_method") ;
71
+ // if(strpos($shippingMethod,"swipezoom") !== FALSE){
72
+ if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
73
+ <div class="entry-edit">
74
+ <div class="entry-edit-head">
75
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
76
+ </div><fieldset>
77
+
78
+ <div class="swipezoom-container">
79
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
80
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
81
+ </div>
82
+ <div class="swipezoom-container">
83
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
84
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
85
+ </div>
86
+ <div class="swipezoom-container">
87
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
88
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
89
+ </div>
90
+
91
+ <div class="swipezoom-container">
92
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
93
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
94
+ </div>
95
+ <div class="swipezoom-container">
96
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
97
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
98
+ </div>
99
+ <div class="swipezoom-container">
100
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
101
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
102
+ </div>
103
+ <div class="swipezoom-container">
104
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
105
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
106
+ </span></span></label>
107
+ </div>
108
+
109
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
110
+ <div class="swipezoom-container">
111
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
112
+ </span></span></label>
113
+ </div>
114
+ <?php endif; ?>
115
+ </fieldset>
116
+ </div>
117
+
118
+ <?php } ?>
119
+ <div class="clear"></div>
120
+ <?php /*if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
121
+ <div class="clear"></div>
122
+ <div class="entry-edit">
123
+ <div class="entry-edit-head">
124
+ <?php
125
+ $_itemsGridLabel1 = 'Swipezoom package details';
126
+ ?>
127
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel1) ?></h4>
128
+ </div>
129
+ </div>
130
+
131
+ <div id="swipezoom_grid_container">
132
+ <?php echo $this->getChildHtml('swipezoomordergrid') ?>
133
+ </div>
134
+
135
+ <div class="clear"></div>
136
+ <?php }else{*/ ?>
137
+ <div class="entry-edit">
138
+ <div class="entry-edit-head">
139
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Refund') ?></h4>
140
+ </div>
141
+ </div>
142
+ <?php //} ?>
143
+
144
+ <div id="creditmemo_item_container">
145
+ <?php echo $this->getChildHtml('order_items') ?>
146
+ </div>
147
+ </form>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/grid.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="grid np">
3
+ <div class="hor-scroll">
4
+ <table cellspacing="0" class="data order-tables">
5
+ <col />
6
+ <col width="1" />
7
+ <col width="1" />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <thead>
14
+ <tr class="headings">
15
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
16
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
17
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
18
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
19
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
20
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
21
+ </tr>
22
+ </thead>
23
+ <?php
24
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
25
+ $order= Mage::getModel('sales/order')->load($orderid);
26
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
27
+
28
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder); ?>
29
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
30
+ <?php $_i=0;foreach ($_items as $_item): ?>
31
+ <?php $_i++; ?>
32
+ <tr class="border">
33
+ <td><?php echo $_i ?></td>
34
+ <td><?php echo $_item->getBoxcode() ?></td>
35
+ <td><?php echo $_item->getBoxno() ?></td>
36
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); //$productname = $_Pdetails->getName();
37
+ // $_item->getProductname() ?></td>
38
+ <td><?php echo $_item->getProductcode() ?></td>
39
+ <td><?php echo $_item->getProductqty() ?></td>
40
+ </tr>
41
+ <?php endforeach; ?>
42
+ </tbody>
43
+ </table>
44
+ </div>
45
+ </div>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/index.phtml ADDED
File without changes
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/items.phtml ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getCreditmemo()->getOrder() ?>
3
+ <?php $_items = $this->getCreditmemo()->getAllItems() ?>
4
+ <?php if (count($_items)) : ?>
5
+ <div class="grid np">
6
+ <div class="hor-scroll">
7
+ <table cellspacing="0" class="data order-tables">
8
+ <col />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <?php if ($this->canReturnToStock()) : ?><col width="1" /><?php endif; ?>
13
+ <col width="1" />
14
+ <col width="1" />
15
+ <col width="1" />
16
+ <col width="1" />
17
+ <thead>
18
+ <tr class="headings">
19
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
20
+ <th><?php echo $this->helper('sales')->__('Price') ?></th>
21
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
22
+ <?php if ($this->canReturnToStock()) : ?>
23
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Return to Stock') ?></span></th>
24
+ <?php endif; ?>
25
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Qty to Refund') ?></span></th>
26
+ <th><?php echo $this->helper('sales')->__('Subtotal') ?></th>
27
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Amount') ?></span></th>
28
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Discount Amount') ?></span></th>
29
+ <th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Row Total') ?></span></th>
30
+ </tr>
31
+ </thead>
32
+ <?php if(!$_order->getSwipezoomOrderNumberTemp()){ ?>
33
+ <?php if ($this->canEditQty()): ?>
34
+ <tfoot>
35
+ <tr>
36
+ <td colspan="3">&nbsp;</td>
37
+ <td colspan="3" class="a-center">
38
+ <?php echo $this->getUpdateButtonHtml() ?>
39
+ </td>
40
+ <td colspan="3" class="last">&nbsp;</td>
41
+ </tr>
42
+ </tfoot>
43
+ <?php endif; ?>
44
+ <?php } ?>
45
+ <?php $i=0;foreach ($_items as $_item): ?>
46
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
47
+ <tbody class="<?php echo $i%2?'even':'odd' ?>">
48
+ <?php echo $this->getItemHtml($_item) ?>
49
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
50
+ </tbody>
51
+ <?php endforeach; ?>
52
+ </table>
53
+ </div>
54
+ </div>
55
+
56
+ <br />
57
+ <?php else : ?>
58
+ <div class="entry-edit">
59
+ <fieldset><div class="a-center"><?php echo $this->helper('sales')->__('No Items To Refund') ?></div></fieldset>
60
+ </div>
61
+ <?php endif; ?>
62
+ <?php //} ?>
63
+ <br />
64
+ <div class="clear"></div>
65
+ <?php echo $this->getChildHtml('order_totalbar') ?>
66
+
67
+ <div class="clear"></div>
68
+
69
+ <input type="hidden" name="creditmemo[do_offline]" id="creditmemo_do_offline" value="0" />
70
+
71
+
72
+ <div class="box-left entry-edit">
73
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Credit Memo Comments') ?></h4></div>
74
+ <fieldset id="history_form">
75
+ <label class="normal" for="creditmemo_comment_text"><?php echo Mage::helper('sales')->__('Credit Memo Comments') ?></label><br/>
76
+ <textarea id="creditmemo_comment_text" name="creditmemo[comment_text]" rows="3" cols="5" style="width:98%;"><?php echo $this->getCreditmemo()->getCommentText(); ?></textarea>
77
+ </fieldset>
78
+ </div>
79
+ <div class="box-right entry-edit" id="updatethis">
80
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
81
+
82
+
83
+ <?php if($_order->getSwipezoomOrderCreditmemo() != NULL && $_order->getSwipezoomOrderCreditmemo() != 0){ ?>
84
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Refund Confimation') ?></h4></div>
85
+
86
+ <div class="order-totals">
87
+ <?php echo $this->getChildHtml('creditmemo_totals') ?>
88
+ <div class="order-totals-bottom">
89
+ <div class="divider"></div>
90
+ <p>
91
+ <label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
92
+ <input id="notify_customer" name="creditmemo[comment_customer_notify]" value="1" type="checkbox" />
93
+ </p>
94
+ <?php if ($this->canSendCreditmemoEmail() && !$_order->getSwipezoomOrderNumberTemp()):?>
95
+ <p>
96
+ <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Credit Memo') ?></label>
97
+ <input id="send_email" name="creditmemo[send_email]" value="1" type="checkbox" />
98
+ </p>
99
+ <?php endif; ?>
100
+ <?php echo $this->getChildHtml('submit_before') ?>
101
+ <?php echo $this->getChildHtml('submit_offline') ?>
102
+ <?php echo $this->getChildHtml('submit_button') ?>
103
+ <?php echo $this->getChildHtml('submit_after') ?>
104
+ </div>
105
+ </div>
106
+ <?php }else{ ?>
107
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Refund Request') ?></h4></div>
108
+ <div class="order-totals" id="refundrequest">
109
+ <?php echo $this->getChildHtml('creditmemo_totals') ?>
110
+ </div>
111
+ <br />
112
+ <?php } ?>
113
+
114
+ <?php }else{ ?>
115
+
116
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Refund Totals') ?></h4></div>
117
+
118
+ <div class="order-totals">
119
+ <?php echo $this->getChildHtml('creditmemo_totals') ?>
120
+ <div class="order-totals-bottom">
121
+ <div class="divider"></div>
122
+ <p>
123
+ <label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
124
+ <input id="notify_customer" name="creditmemo[comment_customer_notify]" value="1" type="checkbox" />
125
+ </p>
126
+ <?php if ($this->canSendCreditmemoEmail() && !$_order->getSwipezoomOrderNumberTemp()):?>
127
+ <p>
128
+ <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Credit Memo') ?></label>
129
+ <input id="send_email" name="creditmemo[send_email]" value="1" type="checkbox" />
130
+ </p>
131
+ <?php endif; ?>
132
+ <?php echo $this->getChildHtml('submit_before') ?>
133
+ <?php echo $this->getChildHtml('submit_offline') ?>
134
+ <?php echo $this->getChildHtml('submit_button') ?>
135
+ <?php echo $this->getChildHtml('submit_after') ?>
136
+ </div>
137
+ </div>
138
+
139
+ <?php } ?>
140
+ </div>
141
+ <div class="clear"></div>
142
+
143
+ <script type="text/javascript">
144
+ //<![CDATA[
145
+ var submitButtons = $$('.submit-button');
146
+ var updateButtons = $$('.update-button');
147
+ var fields = $$('.qty-input');
148
+
149
+ updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
150
+ <?php if($_order->getSwipezoomOrderCreditmemo() < 3){ ?>
151
+ for(var i=0;i<fields.length;i++){
152
+ fields[i].observe('change', checkButtonsRelation)
153
+ fields[i].baseValue = fields[i].value;
154
+ }
155
+
156
+ <?php }else{ ?>
157
+ Event.observe(document,"dom:loaded",function(){
158
+ // var fields = $$('.qty-input');
159
+ $$('.qty-input').each(function(el){
160
+ el.setAttribute("disabled", "true");
161
+ });
162
+ });
163
+ <?php } ?>
164
+
165
+
166
+
167
+
168
+ function checkButtonsRelation() {
169
+ var hasChanges = false;
170
+ fields.each(function (elem) {
171
+ if (elem.baseValue != elem.value) {
172
+ hasChanges = true;
173
+ }
174
+ }.bind(this));
175
+ if (hasChanges) {
176
+ submitButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
177
+ updateButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
178
+ }
179
+ else {
180
+ submitButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
181
+ updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
182
+ }
183
+ }
184
+
185
+ function submitCreditMemo() {
186
+ if ($('creditmemo_do_offline')) $('creditmemo_do_offline').value=0;
187
+ editForm.submit()
188
+ }
189
+ function submitCreditMemoOffline() {
190
+ if ($('creditmemo_do_offline')) $('creditmemo_do_offline').value=1;
191
+ editForm.submit()
192
+ }
193
+
194
+ var sendEmailCheckbox = $('send_email');
195
+ if (sendEmailCheckbox) {
196
+ var notifyCustomerCheckbox = $('notify_customer');
197
+ var creditmemoCommentText = $('creditmemo_comment_text');
198
+ Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
199
+ bindSendEmail();
200
+ }
201
+ function bindSendEmail()
202
+ {
203
+ if (sendEmailCheckbox.checked == true) {
204
+ notifyCustomerCheckbox.disabled = false;
205
+ //creditmemoCommentText.disabled = false;
206
+ }
207
+ else {
208
+ notifyCustomerCheckbox.disabled = true;
209
+ //creditmemoCommentText.disabled = true;
210
+ }
211
+ }
212
+ //]]>
213
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/total/adjustments.phtml ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getSource()->getOrder() ?>
3
+
4
+ <?php if($_order->getSwipezoomOrderCreditmemo() == NULL && $_order->getSwipezoomOrderNumberTemp()) { ?>
5
+ <?php
6
+ $length = 2;
7
+
8
+ $randomString = substr(str_shuffle("0123456789"), 0, $length);
9
+ ?>
10
+ <tr>
11
+ <td class="label"><?php echo $this->helper('sales')->__('RMA #') ?></td>
12
+ <td><input type="text" name="returnauthentication" value="<?php echo date('YmdHis').$randomString?>" maxlength="25" class="input-text not-negative-amount" style="width:144px;text-align:right" id="returnauthentication" /></td>
13
+ </tr>
14
+ <tr>
15
+ <td class="label"><?php echo $this->helper('sales')->__('Reason Code') ?></td>
16
+ <td>
17
+ <select name="reasoncode" class="input-select" style="width:150px;" >
18
+ <option value="">-- Select Any --</option>
19
+ <option value="RI">Wrong Item</option>
20
+ <option value="RS">Wrong Size</option>
21
+ <option value="RC">Wrong Color</option>
22
+ <option value="RD">Damaged</option>
23
+ <option value="RO">Other Quality</option>
24
+ <option value="RQ">Customer Discretion</option>
25
+
26
+
27
+ </select>
28
+ <style>
29
+ .entry-edit-head .tools a{display:none;}
30
+ .swipezoom-container .price-notice { float: right;}
31
+ .swipezoom-container { width: 50%;}
32
+ </style>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td></td><td>
37
+ <input type="hidden" name="dorefund" id="dorefund" class="dorefund" value="" />
38
+ <input type="hidden" name="swipeorder" id="swipeorder" class="swipeorder" value="<?php echo $_order->getSwipezoomOrderNumberTemp() ?>" />
39
+ <button style="" onclick="sendcreditmemorequest($('creditmemo_item_container'),'<?php echo $this->getUrl('adminhtml/sales_order_creditmemo/updateQtynew', array('order_id'=>$_order->getId())) ?>')" class="scalable" type="button" title="Refund Request"><span><span><span>Refund Request</span></span></span></button>
40
+ </td>
41
+ </tr>
42
+
43
+ <?php
44
+ }else{ ?>
45
+ <?php $_source = $this->getSource() ?>
46
+ <?php if ($_source): ?>
47
+
48
+ <?php if( $_order->getSwipezoomOrderCreditmemo() > 1 ){ ?>
49
+ <tr>
50
+ <td class="label"><?php echo $this->helper('sales')->__('Refund Option') ?></td>
51
+ <td>
52
+ <script type="text/javascript">
53
+ Event.observe(document,"dom:loaded",function(){
54
+ $$('[title="Refund Offline"]').each(function(el){
55
+ el.update('<span><span><span></span>Confirm</span></span>')
56
+ });
57
+ });
58
+ </script>
59
+ <select name="reasoncode" class="input-select" style="width:136px;" >
60
+ <option value="">-- Select Any --</option>
61
+ <option value="PV">Product Value</option>
62
+ <option value="FR">Product + Shipping</option>
63
+ <option value="NR">No Refund</option>
64
+ </select>
65
+ </td>
66
+ </tr>
67
+
68
+
69
+ <?php } ?>
70
+ <?php if(!$_order->getSwipezoomOrderNumberTemp()){ ?>
71
+ <tr>
72
+ <td class="label"><?php echo $this->getShippingLabel() ?></td>
73
+ <td><input type="text" name="creditmemo[shipping_amount]" value="<?php echo $this->getShippingAmount()?>" class="input-text not-negative-amount" style="width:60px;text-align:right" id="shipping_amount" /></td>
74
+ </tr>
75
+ <tr>
76
+ <td colspan="2"><div id="shipping_amount_adv"></div></td>
77
+ </tr>
78
+ <tr>
79
+ <td class="label"><?php echo $this->helper('sales')->__('Adjustment Refund') ?></td>
80
+ <td><input type="text" name="creditmemo[adjustment_positive]" value="<?php echo $_source->getBaseAdjustmentFeePositive()*1 ?>" class="input-text not-negative-amount" style="width:60px;text-align:right" id="adjustment_positive" /></td>
81
+ </tr>
82
+ <tr>
83
+ <td colspan="2"><div id="adjustment_positive_adv"></div></td>
84
+ </tr>
85
+ <tr>
86
+ <td class="label"><?php echo $this->helper('sales')->__('Adjustment Fee') ?></td>
87
+ <td><input type="text" name="creditmemo[adjustment_negative]" value="<?php echo $_source->getBaseAdjustmentFeeNegative()*1 ?>" class="input-text not-negative-amount" style="width:60px;text-align:right" id="adjustment_negative"/></td>
88
+ </tr>
89
+ <?php } ?>
90
+ <tr>
91
+ <td colspan="2"><div id="adjustment_negative_adv"></div></td>
92
+ </tr>
93
+ <script type="text/javascript">
94
+ //<![CDATA[
95
+ Validation.addAllThese([
96
+ ['not-negative-amount', '<?php echo $this->helper('sales')->__('Please enter positive number in this field.') ?>', function(v) {
97
+ if(v.length)
98
+ return /^\s*\d+([,.]\d+)*\s*%?\s*$/.test(v);
99
+ else
100
+ return true;
101
+ }]
102
+ ]);
103
+
104
+ if ($('shipping_amount')) {
105
+ $('shipping_amount').advaiceContainer = $('shipping_amount_adv');
106
+ unblockSubmit('shipping_amount');
107
+ }
108
+ if ($('adjustment_positive')) {
109
+ $('adjustment_positive').advaiceContainer = $('adjustment_positive_adv');
110
+ unblockSubmit('adjustment_positive');
111
+ }
112
+ if ($('adjustment_negative')) {
113
+ $('adjustment_negative').advaiceContainer = $('adjustment_negative_adv');
114
+ unblockSubmit('adjustment_negative');
115
+ }
116
+
117
+ function unblockSubmit(id) {
118
+ $(id).observe('focus', function(event) {
119
+ if ($$('button[class="scalable update-button disabled"]').size() > 0) {
120
+ enableElements('submit-button');
121
+ }
122
+ });
123
+ }
124
+ //]]>
125
+ </script>
126
+ <?php endif; ?>
127
+
128
+ <?php } ?>
129
+
130
+ <script type="text/javascript">
131
+ function sendcreditmemorequest(area, url) {
132
+ $('dorefund').value = 1;
133
+
134
+ if($(area)) {
135
+ var fields = $(area).select('input', 'select', 'textarea');
136
+ var data = Form.serializeElements(fields, true);
137
+ url = url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true');
138
+ new Ajax.Request(url, {
139
+ parameters: $H(data),
140
+ loaderArea: area,
141
+ onSuccess: function(transport) {
142
+ try {
143
+ if (transport.responseText.isJSON()) {
144
+ var response = transport.responseText.evalJSON()
145
+ if(response.ajaxExpired && response.ajaxRedirect) {
146
+ setLocation(response.ajaxRedirect);
147
+ }
148
+ } else {
149
+ $(area).update(transport.responseText);
150
+ }
151
+ }
152
+ catch (e) {
153
+ $(area).update(transport.responseText);
154
+ }
155
+ }
156
+ });
157
+ }
158
+ }
159
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/total/totals.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+
4
+ $_source = $this->getSource();
5
+
6
+ ?>
7
+
8
+ <table cellspacing="0" width="100%">
9
+ <col />
10
+ <col width="1" />
11
+ <?php $_totals = $this->getTotals('footer')?>
12
+ <?php if ($_totals):?>
13
+ <?php $_order = $this->getSource()->getOrder() ?>
14
+ <?php if(!$_order->getSwipezoomOrderNumberTemp()){//if($_order->getSwipezoomOrderCreditmemo() != NULL && $_order->getSwipezoomOrderCreditmemo() != 0 ){ ?>
15
+ <tfoot>
16
+ <?php foreach ($this->getTotals('footer') as $_code => $_total): ?>
17
+ <?php if ($_total->getBlockName()): ?>
18
+ <?php echo $this->getChildHtml($_total->getBlockName(), false); ?>
19
+ <?php else:?>
20
+ <tr class="<?php echo $_code?>">
21
+ <td <?php echo $this->getLabelProperties()?> class="label">
22
+ <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong>
23
+ </td>
24
+ <td <?php echo $this->getValueProperties()?> class="emph">
25
+ <strong><?php echo $this->formatValue($_total) ?></strong>
26
+ </td>
27
+ </tr>
28
+ <?php endif?>
29
+ <?php endforeach?>
30
+ </tfoot>
31
+ <?php } ?>
32
+ <?php endif?>
33
+
34
+ <?php $_totals = $this->getTotals('')?>
35
+ <?php if ($_totals):?>
36
+ <tbody>
37
+ <?php foreach ($_totals as $_code => $_total): ?>
38
+ <?php if ($_total->getBlockName()): ?>
39
+ <?php echo $this->getChildHtml($_total->getBlockName(), false); ?>
40
+ <?php else:?>
41
+ <?php if(!$_order->getSwipezoomOrderNumberTemp()){ ?>
42
+ <tr class="<?php echo $_code?>">
43
+ <td <?php echo $this->getLabelProperties()?> class="label">
44
+ <?php if ($_total->getStrong()):?>
45
+ <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong>
46
+ <?php else:?>
47
+ <?php echo $this->escapeHtml($_total->getLabel()); ?>
48
+ <?php endif?>
49
+ </td>
50
+ <?php if ($_total->getStrong()):?>
51
+ <td <?php echo $this->getValueProperties()?> class="emph">
52
+ <strong><?php echo $this->formatValue($_total) ?></strong>
53
+ <?php else:?>
54
+ <td <?php echo $this->getValueProperties()?>>
55
+ <?php echo $this->formatValue($_total) ?>
56
+ <?php endif?>
57
+ </td>
58
+ </tr>
59
+ <?php } ?>
60
+ <?php endif?>
61
+ <?php endforeach?>
62
+ </tbody>
63
+ <?php endif?>
64
+ </table>
app/design/adminhtml/default/default/template/internationalshipping/creditmemo/view/form.phtml ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getCreditmemo()->getOrder() ?>
3
+ <?php echo $this->getChildHtml('order_info') ?>
4
+ <?php if (!$_order->getIsVirtual()): ?>
5
+ <div class="box-left">
6
+ <?php else: ?>
7
+ <div class="box-right">
8
+ <?php endif; ?>
9
+ <!--Billing Address-->
10
+ <div class="entry-edit">
11
+ <div class="entry-edit-head">
12
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
13
+ </div>
14
+ <fieldset>
15
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
16
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
17
+ </fieldset>
18
+ </div>
19
+ </div>
20
+ <?php if (!$_order->getIsVirtual()): ?>
21
+ <div class="box-right">
22
+ <!--Shipping Address-->
23
+ <div class="entry-edit">
24
+ <div class="entry-edit-head">
25
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
26
+ </div>
27
+ <fieldset>
28
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
29
+ <?php //echo $this->helper('sales')->__('Total Shipping Charges'); ?>
30
+
31
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
32
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
33
+ <?php else: ?>
34
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
35
+ <?php endif; ?>
36
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
37
+ <br />
38
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
39
+ <?php echo $_excl; ?>
40
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
41
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
42
+ <?php endif; ?>
43
+ <br />
44
+ <?php
45
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
46
+ if($szOrderId){
47
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
48
+ if(count($counts)){
49
+ foreach($counts as $sh) {
50
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
51
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
52
+ }
53
+ }
54
+ }
55
+
56
+ ?>
57
+ </fieldset>
58
+ </div>
59
+ </div>
60
+ <?php endif; ?>
61
+ <div class="clear"></div>
62
+ <?php
63
+ $shippingMethod = $_order->getData("shipping_method") ;
64
+ if(strpos($shippingMethod,"swipezoom") !== FALSE){ ?>
65
+ <div class="entry-edit">
66
+ <div class="entry-edit-head">
67
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
68
+ </div><fieldset>
69
+
70
+ <div class="swipezoom-container">
71
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
72
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
73
+ </div>
74
+ <div class="swipezoom-container">
75
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
76
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
77
+ </div>
78
+ <div class="swipezoom-container">
79
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
80
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
81
+ </div>
82
+
83
+ <div class="swipezoom-container">
84
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
85
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
86
+ </div>
87
+ <div class="swipezoom-container">
88
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
89
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
90
+ </div>
91
+ <div class="swipezoom-container">
92
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
93
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
94
+ </div>
95
+ <div class="swipezoom-container">
96
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
97
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
98
+ </span></span></label>
99
+ </div>
100
+
101
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
102
+ <div class="swipezoom-container">
103
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
104
+ </span></span></label>
105
+ </div>
106
+ <?php endif; ?>
107
+ </fieldset>
108
+
109
+ <style>
110
+ .entry-edit-head .tools a{display:none;}
111
+ .swipezoom-container .price-notice { float: right;}
112
+ .swipezoom-container { width: 50%;}
113
+ </style>
114
+ </div>
115
+
116
+ <?php } ?>
117
+ <div class="clear"></div>
118
+ <?php $_items = $this->getCreditmemo()->getAllItems() ?>
119
+ <div class="entry-edit">
120
+ <div class="entry-edit-head">
121
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Refunded') ?></h4>
122
+ </div>
123
+ </div>
124
+ <?php if (count($_items)): ?>
125
+ <div id="creditmemo_items_container">
126
+ <?php echo $this->getChildHtml('creditmemo_items') ?>
127
+ </div>
128
+ <?php else: ?>
129
+ <div class="entry-edit">
130
+ <fieldset><center><?php echo $this->helper('sales')->__('No Items') ?></center></fieldset>
131
+ </div>
132
+ <?php endif; ?>
133
+ <br />
134
+ <div class="box-left entry-edit">
135
+ <div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo History') ?></h4></div>
136
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
137
+ </div>
138
+
139
+ <div class="box-right entry-edit" id="history_form">
140
+ <div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo Totals') ?></h4></div>
141
+ <div class="order-totals"><?php echo $this->getChildHtml('creditmemo_totals') ?></div>
142
+ </div>
143
+ <div class="clear"></div>
144
+ <?php if($_order->getSwipezoomOrderNumberTemp()){ ?>
145
+ <script type="text/javascript">
146
+
147
+ Event.observe(document,"dom:loaded",function(){
148
+ <?php if($_order->getSwipezoomOrderCreditmemo()<3 && $_order->getSwipezoomOrderNumberTemp()){ ?>
149
+
150
+ $$('[title="Print"]').each(function(el){
151
+ el.update('<span><span><span></span>Print Packing Instruction</span></span>');
152
+ <?php
153
+ if ($_order->hasInvoices()) {
154
+ foreach ($_order->getInvoiceCollection() as $inv) {
155
+ $invIncrementIDs = $inv->getId();
156
+ //other invoice details...
157
+ break;
158
+ }
159
+ }
160
+ ?>
161
+ el.setAttribute("onclick", "setLocation('<?php echo $this->getUrl('adminhtml/sales_order_invoice/print',array('invoice_id'=> $invIncrementIDs)) ?>')");
162
+
163
+ });
164
+ <?php }else{ ?>
165
+
166
+ $$('[title="Print"]').each(function(el){
167
+ el.remove();
168
+ });
169
+ <?php } ?>
170
+
171
+ });
172
+
173
+ </script>
174
+ <?php } ?>
app/design/adminhtml/default/default/template/internationalshipping/info.phtml ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+
4
+ <div>
5
+ <div id="order-messages"> <?php echo $this->getChildHtml('order_messages') ?> </div>
6
+ <?php echo $this->getChildHtml('order_info') ?>
7
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
8
+ <?php if ($_order->getIsVirtual()): ?>
9
+ <div class="box-right">
10
+ <?php else: ?>
11
+ <div class="box-left">
12
+ <?php endif; ?>
13
+ <!--Payment Method-->
14
+ <div class="entry-edit">
15
+ <div class="entry-edit-head">
16
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
17
+ </div>
18
+ <fieldset>
19
+ <?php echo $this->getPaymentHtml() ?>
20
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
21
+ </fieldset>
22
+ </div>
23
+ </div>
24
+ <?php if (!$_order->getIsVirtual()): ?>
25
+ <div class="box-right">
26
+ <!--Shipping Method-->
27
+ <div class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
30
+ </div>
31
+ <fieldset>
32
+ <?php if ($_order->getTracksCollection()->count()) : ?>
33
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a> <br/>
34
+ <?php endif; ?>
35
+ <?php if ($_order->getShippingDescription()): ?>
36
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong> <br />
37
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
38
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
39
+ <?php else: ?>
40
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
41
+ <?php endif; ?>
42
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
43
+ <?php echo "Total Shipping charges : ".$_excl; ?>
44
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
45
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
46
+ <?php endif; ?>
47
+ <br />
48
+ <?php
49
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
50
+ if($szOrderId){
51
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
52
+ if(count($counts)){
53
+ foreach($counts as $sh) {
54
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
55
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
56
+ }
57
+ }
58
+ }
59
+
60
+ ?>
61
+ <?php else: ?>
62
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
63
+ <?php endif; ?>
64
+ </fieldset>
65
+ </div>
66
+ </div>
67
+ <?php endif; ?>
68
+ <div class="clear"></div>
69
+ <?php
70
+ $shippingMethod = $_order->getData("shipping_method") ;
71
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
72
+
73
+
74
+ if($szOrderId){
75
+ // if(strpos($shippingMethod,"swipezoom") !== FALSE){ ?>
76
+ <!-- Swipezoom Order information -->
77
+ <?php if($szOrderId = $_order->getSwipezoomOrderNumberTemp()); ?>
78
+ <div class="entry-edit">
79
+ <div class="entry-edit-head">
80
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
81
+ </div>
82
+ <fieldset>
83
+ <div class="swipezoom-container">
84
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price"> <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
85
+ </div>
86
+ <div class="swipezoom-container">
87
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
88
+ </div>
89
+ <div class="swipezoom-container">
90
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
91
+ </div>
92
+ <div class="swipezoom-container">
93
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
94
+ </div>
95
+ <div class="swipezoom-container">
96
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price"> <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
97
+ </div>
98
+ <div class="swipezoom-container">
99
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price"> <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
100
+ </div>
101
+ <div class="swipezoom-container">
102
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price"> <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?> </span></span></label>
103
+ </div>
104
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
105
+ <div class="swipezoom-container">
106
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?> </span></span></label>
107
+ </div>
108
+ <?php endif; ?>
109
+ </fieldset>
110
+ <?php } ?>
111
+ <?php echo $this->getGiftOptionsHtml() ?>
112
+ <div class="clear"></div>
113
+ <div class="entry-edit">
114
+ <div class="entry-edit-head">
115
+ <?php
116
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
117
+
118
+
119
+ if($szOrderId){ ?>
120
+ <style type="text/css">
121
+
122
+ .swipezoom-container{width: 50%;}
123
+ .swipezoom-container .price-notice{float: right;}
124
+ </style>
125
+ <script type="text/javascript">
126
+ Event.observe(document,"dom:loaded",function(){
127
+ $$('[title="Cancel"]').each(function(el){
128
+ el.removeAttribute("onclick");
129
+ el.setAttribute("onclick", "openMyPopup('<?php echo $this->getUrl('internationalshipping/index/cancel',array('order_id'=> $_order->getId())) ?>')"); });
130
+ //
131
+ });
132
+
133
+ </script>
134
+ <?php $_order = Mage::getModel('sales/order')->load($_order->getId());
135
+ if($_order->hasInvoices() && !$_order->hasShipments()){ ?>
136
+ <script type="text/javascript">
137
+ Event.observe(document,"dom:loaded",function(){
138
+ $$('[title="Credit Memo"]').each(function(el){
139
+ el.addClassName("disabled");
140
+ el.removeAttribute("onclick");
141
+ });
142
+ });
143
+ </script>
144
+ <?php }else{ ?>
145
+ <script type="text/javascript">
146
+ Event.observe(document,"dom:loaded",function(){
147
+ $$('[title="Ship"]').each(function(el){
148
+ el.addClassName("disabled");
149
+ el.removeAttribute("onclick");
150
+ });
151
+ });
152
+ </script>
153
+ <?php } ?>
154
+ <?php $counts = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
155
+ if(count($counts)){ ?>
156
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Packing Detail') ?></h4>
157
+ <?php
158
+ }else{ ?>
159
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
160
+ <?php }?>
161
+ <style>
162
+ .entry-edit-head .tools a{display:none;}
163
+ </style>
164
+ <?php }else{ ?>
165
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
166
+ <?php } ?>
167
+ </div>
168
+ </div>
169
+ <?php echo $this->getItemsHtml() ?>
170
+ <div class="clear"></div>
171
+ <div class="box-left">
172
+ <div class="entry-edit">
173
+ <div class="entry-edit-head">
174
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
175
+ </div>
176
+ <fieldset>
177
+ <?php echo $this->getChildHtml('order_history') ?>
178
+ </fieldset>
179
+ </div>
180
+ </div>
181
+ <div class="box-right entry-edit">
182
+ <div class="entry-edit-head">
183
+ <h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4>
184
+ </div>
185
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
186
+ </div>
187
+ <div class="clear"></div>
188
+ </div>
189
+ <?php echo $this->getChildHtml('popup_window');?>
190
+ <script type="text/javascript">
191
+ //<![CDATA[
192
+ /**
193
+ * Retrieve gift options tooltip content
194
+ */
195
+ function getGiftOptionsTooltipContent(itemId) {
196
+ var contentLines = [];
197
+ var headerLine = null;
198
+ var contentLine = null;
199
+
200
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
201
+ if (element.down(0)) {
202
+ headerLine = element.down(0).innerHTML;
203
+ contentLine = element.down(0).next().innerHTML;
204
+ if (contentLine.length > 30) {
205
+ contentLine = contentLine.slice(0,30) + '...';
206
+ }
207
+ contentLines.push(headerLine + ' ' + contentLine);
208
+ }
209
+ });
210
+ return contentLines.join('<br/>');
211
+ }
212
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
213
+
214
+ //]]>
215
+ </script>
216
+ <script type="text/javascript">
217
+
218
+ function hideloading(){
219
+ $('browser_window_close').show();
220
+ $('loading-mask').removeAttribute("style");
221
+ $('loading-mask').hide();
222
+ }
223
+
224
+ function openMyPopup(url) {
225
+ if ($('browser_window') && typeof(Windows) != 'undefined') {
226
+ Windows.focus('browser_window');
227
+ return;
228
+ }
229
+
230
+
231
+ $('loading-mask').show();
232
+ $('loading-mask').setAttribute("style", " z-index: 10003;");
233
+
234
+ var dialogWindow = Dialog.info(null, {
235
+ closable:true,
236
+ resizable:false,
237
+ draggable:true,
238
+ className:'magento',
239
+ windowClassName:'popup-window',
240
+ title:'Popup Dialog',
241
+ top:20,
242
+ width:800,
243
+ height:550,
244
+ zIndex:1000,
245
+ recenterAuto:true,
246
+ hideEffect:Element.hide,
247
+ showEffect:Element.show,
248
+ id:'browser_window',
249
+ url:url,
250
+ onClose:function (param, el) {
251
+ // alert('onClose');
252
+ }
253
+ });
254
+
255
+ $('browser_window_close').hide();
256
+ }
257
+ function closePopup() {
258
+ Windows.close('browser_window');
259
+ }
260
+ function cancelOrder() {
261
+ setLocation('<?php echo $this->getUrl('adminhtml/sales_order/cancel',array('order_id'=> $_order->getId())) ?>');
262
+ }
263
+
264
+ </script>
265
+ <style>
266
+ #browser_window {position:absolute;}
267
+ #overlay_modal{background:#000;opacity:0.5;}
268
+ .magento_close{background:url('<?php echo Mage::getDesign()->getSkinUrl('internationalshipping/images',array('_area'=>'adminhtml')) ?>/popupclose.png') no-repeat; height: 28px;left: 792px; position: absolute;top: 7px;width: 28px;cursor:pointer;}
269
+ </style>
270
+ <?php if(Mage::app()->getRequest()->getParam('showpopup')){ ?>
271
+ <script type="text/javascript">
272
+ Event.observe(document,"dom:loaded",function(){
273
+ $$('[title="Print"]').each(function(el){
274
+ el.update('<span><span><span></span>Print Packing Instruction</span></span>')
275
+ });
276
+ openMyPopup('<?php echo $this->getUrl('internationalshipping/index/printpack',array('order_id'=> $_order->getId())) ?>');
277
+ });
278
+
279
+ </script>
280
+ <?php } ?>
app/design/adminhtml/default/default/template/internationalshipping/invoice/form.phtml ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
3
+ <?php echo $this->getBlockHtml('formkey')?>
4
+ <?php $_order = $this->getInvoice()->getOrder() ?>
5
+ <?php echo $this->getChildHtml('order_info') ?>
6
+ <?php if (!$_order->getIsVirtual()): ?>
7
+ <div class="box-left">
8
+ <?php else: ?>
9
+ <div class="box-right">
10
+ <?php endif; ?>
11
+
12
+ <div class="entry-edit">
13
+ <div class="entry-edit-head">
14
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
15
+ </div>
16
+ <fieldset>
17
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
18
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
19
+ </fieldset>
20
+ </div>
21
+ </div>
22
+ <?php if (!$_order->getIsVirtual()): ?>
23
+ <div class="box-right">
24
+ <!--Shipping Address-->
25
+ <div class="entry-edit">
26
+ <div class="entry-edit-head">
27
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
28
+ </div>
29
+ <fieldset>
30
+ <div>
31
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
32
+
33
+
34
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
35
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
36
+ <?php else: ?>
37
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
38
+ <?php endif; ?>
39
+
40
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
41
+ <br />
42
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
43
+ <?php echo $_excl; ?>
44
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
45
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
46
+ <?php endif; ?>
47
+
48
+
49
+ <br />
50
+ <?php
51
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
52
+ if($szOrderId){
53
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
54
+ if(count($counts)){
55
+ foreach($counts as $sh) {
56
+ echo "Pickup Due : ".$sh->getPickupdue();
57
+ }
58
+ }
59
+ }
60
+
61
+ ?>
62
+ </div>
63
+
64
+
65
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
66
+
67
+ <style>
68
+ .entry-edit-head .tools a{display:none;}
69
+ .swipezoom-container .price-notice { float: right;}
70
+ .swipezoom-container { width: 50%;}
71
+ </style>
72
+ <?php }else{ ?>
73
+ <?php if ($this->canCreateShipment() && $this->canShipPartiallyItem()): ?>
74
+ <p class="nm">
75
+ <label for="invoice_do_shipment" class="normal"><?php echo Mage::helper('sales')->__('Create Shipment') ?></label>
76
+ <input type="checkbox" name="invoice[do_shipment]" id="invoice_do_shipment" value="1" <?php echo $this->hasInvoiceShipmentTypeMismatch()?' disabled="disabled"':'' ?> />
77
+ </p>
78
+ <?php if ($this->hasInvoiceShipmentTypeMismatch()): ?>
79
+ <small><?php echo $this->__('Some items in this order have different invoice and shipment types. You can create shipment only after the invoice is created.') ?></small>
80
+ <?php endif; ?>
81
+ <?php endif; ?>
82
+ <?php } ?>
83
+
84
+
85
+
86
+ <div id="tracking" style="display:none;"><?php echo $this->getChildHtml('tracking',false) ?></div>
87
+ </fieldset>
88
+ </div>
89
+ </div>
90
+ <?php endif; ?>
91
+ <div class="clear"></div>
92
+ <?php
93
+ $shippingMethod = $_order->getData("shipping_method") ;
94
+ // if(strpos($shippingMethod,"swipezoom") !== FALSE){
95
+ if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){?>
96
+ <div class="entry-edit">
97
+ <div class="entry-edit-head">
98
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
99
+ </div><fieldset>
100
+
101
+ <div class="swipezoom-container">
102
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
103
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
104
+ </div>
105
+ <div class="swipezoom-container">
106
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
107
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
108
+ </div>
109
+ <div class="swipezoom-container">
110
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
111
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
112
+ </div>
113
+
114
+ <div class="swipezoom-container">
115
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
116
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
117
+ </div>
118
+ <div class="swipezoom-container">
119
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
120
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
121
+ </div>
122
+ <div class="swipezoom-container">
123
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
124
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
125
+ </div>
126
+ <div class="swipezoom-container">
127
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
128
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
129
+ </span></span></label>
130
+ </div>
131
+
132
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
133
+ <div class="swipezoom-container">
134
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
135
+ </span></span></label>
136
+ </div>
137
+ <?php endif; ?>
138
+ </fieldset>
139
+ </div>
140
+
141
+ <?php } ?>
142
+ <div class="clear"></div>
143
+
144
+ <div class="entry-edit">
145
+ <div class="entry-edit-head">
146
+ <?php
147
+ $_itemsGridLabel = $this->getForcedShipmentCreate()?'Items to Invoice and Ship':'Items to Invoice';
148
+ ?>
149
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel) ?></h4>
150
+ </div>
151
+ </div>
152
+
153
+ <div id="invoice_item_container">
154
+ <?php echo $this->getChildHtml('order_items') ?>
155
+ </div>
156
+ </form>
157
+ <script type="text/javascript">
158
+ //<![CDATA[
159
+ var createShipment = $('invoice_do_shipment');
160
+ createShipment.observe('click', function(e){
161
+ if (createShipment.checked) {
162
+ document.getElementById('tracking').style.display = 'block';
163
+ } else {
164
+ document.getElementById('tracking').style.display = 'none'
165
+ }
166
+ })
167
+
168
+ /*forced creating of shipment*/
169
+ var forcedShipmentCreate = <?php echo $this->getForcedShipmentCreate() ?>;
170
+ var shipmentElement = $('invoice_do_shipment');
171
+ if (forcedShipmentCreate && shipmentElement) {
172
+ shipmentElement.checked = true;
173
+ shipmentElement.disabled = true;
174
+ document.getElementById('tracking').style.display = 'block';
175
+ }
176
+ //]]>
177
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/invoice/grid.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="grid np">
3
+ <div class="hor-scroll">
4
+ <table cellspacing="0" class="data order-tables">
5
+ <col />
6
+ <col width="1" />
7
+ <col width="1" />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <thead>
14
+ <tr class="headings">
15
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
16
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
17
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
18
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
19
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
20
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
21
+ </tr>
22
+ </thead>
23
+ <?php
24
+ $invoiceid = Mage::app()->getRequest()->getParam('invoice_id');
25
+ $invoice= Mage::getModel('sales/order_invoice')->load($invoiceid);
26
+ $order= Mage::getModel('sales/order')->load($invoice->getOrder()->getId());
27
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
28
+
29
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder); ?>
30
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
31
+ <?php $_i=0;foreach ($_items as $_item): ?>
32
+ <?php $_i++; ?>
33
+ <tr class="border">
34
+ <td><?php echo $_i ?></td>
35
+ <td><?php echo $_item->getBoxcode() ?></td>
36
+ <td><?php echo $_item->getBoxno() ?></td>
37
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); //$productname = $_Pdetails->getName();
38
+ // $_item->getProductname() ?></td>
39
+ <td><?php echo $_item->getProductcode() ?></td>
40
+ <td><?php echo $_item->getProductqty() ?></td>
41
+ </tr>
42
+ <?php endforeach; ?>
43
+ </tbody>
44
+ </table>
45
+ </div>
46
+ </div>
47
+ <script type="text/javascript">
48
+ Event.observe(document,"dom:loaded",function(){
49
+ <?php if($order->getSwipezoomOrderCreditmemo()<3 && $order->getSwipezoomOrderNumberTemp()){ ?>
50
+ $$('[title="Print"]').each(function(el){
51
+ el.update('<span><span><span></span>Print Packing Instruction</span></span>');
52
+ });
53
+ <?php }else{ ?>
54
+ $$('[title="Print"]').each(function(el){
55
+ el.remove();
56
+ });
57
+ <?php } ?>
58
+
59
+ });
60
+
61
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/invoice/info.phtml ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php
4
+ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
5
+ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
6
+ ?>
7
+ <div class="box-left">
8
+ <!--Order Information-->
9
+ <div class="entry-edit">
10
+
11
+ <?php if ($_order->getEmailSent()):
12
+ $_email = Mage::helper('sales')->__('the order confirmation email was sent');
13
+ else:
14
+ $_email = Mage::helper('sales')->__('the order confirmation email is not sent');
15
+ endif; ?>
16
+ <div class="entry-edit-head">
17
+ <?php if ($this->getNoUseOrderLink()): ?>
18
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?><?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?> (<?php echo $_email ?>) <?php } ?></h4>
19
+ <?php else: ?>
20
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
21
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
22
+ <style>
23
+ .entry-edit-head .tools a{display:none;}
24
+ </style>
25
+ <?php }else{ ?> <strong>(<?php echo $_email ?>)</strong><?php } ?>
26
+ <?php endif; ?>
27
+ </div>
28
+ <div class="fieldset">
29
+ <table cellspacing="0" class="form-list">
30
+ <tr>
31
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
32
+ <td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
33
+ </tr>
34
+ <?php if ($orderAdminDate != $orderStoreDate):?>
35
+ <tr>
36
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
37
+ <td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
38
+ </tr>
39
+ <?php endif;?>
40
+ <tr>
41
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
42
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
46
+ <td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
47
+ </tr>
48
+ <?php if($_order->getRelationChildId()): ?>
49
+ <tr>
50
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
51
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
52
+ <?php echo $_order->getRelationChildRealId() ?>
53
+ </a></td>
54
+ </tr>
55
+ <?php endif; ?>
56
+ <?php if($_order->getRelationParentId()): ?>
57
+ <tr>
58
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
59
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
60
+ <?php echo $_order->getRelationParentRealId() ?>
61
+ </a></td>
62
+ </tr>
63
+ <?php endif; ?>
64
+ <?php if($_order->getRemoteIp() && $this->shouldDisplayCustomerIp()): ?>
65
+ <tr>
66
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
67
+ <td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?></strong></td>
68
+ </tr>
69
+ <?php endif; ?>
70
+ <?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
71
+ <tr>
72
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
73
+ <td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
74
+ </tr>
75
+ <?php endif; ?>
76
+ <?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
77
+ <tr>
78
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
79
+ <td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
80
+ </tr>
81
+ <?php endif; ?>
82
+ <?php
83
+ if($_order->getSwipezoomOrderNumberTemp()){
84
+ $swipezoomparentorder = Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('swipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
85
+ $swipezoomparentorder1= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('refswipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
86
+ if(count($swipezoomparentorder)){
87
+ foreach($swipezoomparentorder as $parentorder){
88
+ $paretorderid = $parentorder->getReforderno();
89
+ break;
90
+ }
91
+ $incrementid = Mage::getModel('sales/order')->load($paretorderid)->getIncrementId(); ?>
92
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Refund Order: ') ?></label></td>
93
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$paretorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
94
+
95
+ <?php
96
+ }elseif(count($swipezoomparentorder1)){
97
+
98
+ foreach($swipezoomparentorder1 as $parentorder){
99
+ $childorderid = $parentorder->getRealorderno();
100
+ break;
101
+ }
102
+ $incrementid = Mage::getModel('sales/order')->load($childorderid)->getIncrementId(); ?>
103
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Parent Order: ') ?></label></td>
104
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$childorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
105
+ <tr>
106
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Swipezoom Rog Order No: ') ?></label></td>
107
+ <td class="value"><strong><?php echo $_order->getSwipezoomOrderNumberTemp(); ?></strong></td>
108
+ </tr>
109
+ <?php } } ?>
110
+ </table>
111
+ </div>
112
+ </div>
113
+ </div>
114
+ <div class="box-right">
115
+ <!--Account Information-->
116
+ <div class="entry-edit">
117
+ <div class="entry-edit-head">
118
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
119
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
120
+ </div>
121
+ <div class="fieldset">
122
+ <div class="hor-scroll">
123
+ <table cellspacing="0" class="form-list">
124
+ <tr>
125
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
126
+ <td class="value">
127
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
128
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></a>
129
+ <?php else: ?>
130
+ <strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong>
131
+ <?php endif; ?>
132
+ </td>
133
+ </tr>
134
+ <tr>
135
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
136
+ <td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
137
+ </tr>
138
+ <?php if ($_groupName = $this->getCustomerGroupName()) : ?>
139
+ <tr>
140
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
141
+ <td class="value"><strong><?php echo $_groupName ?></strong></td>
142
+ </tr>
143
+ <?php endif; ?>
144
+ <?php foreach ($this->getCustomerAccountData() as $data):?>
145
+ <tr>
146
+ <td class="label"><label><?php echo $data['label'] ?></label></td>
147
+ <td class="value"><strong><?php echo $data['value'] ?></strong></td>
148
+ </tr>
149
+ <?php endforeach;?>
150
+ </table>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <div class="clear"></div>
156
+
157
+ <div class="box-left">
158
+ <!--Billing Address-->
159
+ <div class="entry-edit">
160
+ <div class="entry-edit-head">
161
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
162
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
163
+ </div>
164
+ <fieldset>
165
+ <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
166
+ </fieldset>
167
+ </div>
168
+ </div>
169
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
170
+ <div class="box-right">
171
+ <!--Shipping Address-->
172
+ <div class="entry-edit">
173
+ <div class="entry-edit-head">
174
+ <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
175
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
176
+ </div>
177
+ <fieldset>
178
+ <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
179
+ </fieldset>
180
+ </div>
181
+ </div>
182
+ <div class="clear"></div>
183
+ <?php endif; ?>
app/design/adminhtml/default/default/template/internationalshipping/invoice/items.phtml ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getInvoice()->getOrder() ?>
3
+ <div class="grid np">
4
+ <div class="hor-scroll">
5
+ <table cellspacing="0" class="data order-tables">
6
+ <col />
7
+ <col width="1" />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <col width="1" />
14
+ <thead>
15
+ <tr class="headings">
16
+ <th><?php echo Mage::helper('sales')->__('Product') ?></th>
17
+ <th><?php echo Mage::helper('sales')->__('Price') ?></th>
18
+ <th class="a-center"><?php echo Mage::helper('sales')->__('Qty') ?></th>
19
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?> <th><span class="nobr"><?php echo Mage::helper('sales')->__('Qty to Invoice') ?></span></th><?php } ?>
20
+ <th><?php echo Mage::helper('sales')->__('Subtotal') ?></th>
21
+ <th><span class="nobr"><?php echo Mage::helper('sales')->__('Tax Amount') ?></span></th>
22
+ <th><span class="nobr"><?php echo Mage::helper('sales')->__('Discount Amount') ?></span></th>
23
+ <th class="last"><span class="nobr"><?php echo Mage::helper('sales')->__('Row Total') ?></span></th>
24
+ </tr>
25
+ </thead>
26
+ <?php if ($this->canEditQty()): ?>
27
+
28
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?>
29
+ <tfoot>
30
+ <tr>
31
+ <td colspan="2">&nbsp;</td>
32
+ <td colspan="3" class="a-center"><?php echo $this->getUpdateButtonHtml() ?></td>
33
+ <td colspan="3">&nbsp;</td>
34
+ </tr>
35
+ </tfoot><?php } ?>
36
+ <?php endif; ?>
37
+ <?php $_items = $this->getInvoice()->getAllItems() ?>
38
+ <?php $_i=0;foreach ($_items as $_item): ?>
39
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; else $_i++; ?>
40
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
41
+ <?php echo $this->getItemHtml($_item) ?>
42
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
43
+ </tbody>
44
+ <?php endforeach; ?>
45
+ </table>
46
+ </div>
47
+ </div>
48
+
49
+ <br />
50
+ <div class="clear"></div>
51
+ <?php echo $this->getChildHtml('order_totalbar') ?>
52
+ <div class="clear"></div>
53
+
54
+ <div class="box-left entry-edit">
55
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
56
+ <fieldset>
57
+ <div id="history_form" class="order-history-form">
58
+ <span class="field-row">
59
+ <label class="normal" for="invoice_comment_text"><?php echo Mage::helper('sales')->__('Invoice Comments') ?></label>
60
+ <textarea id="invoice_comment_text" name="invoice[comment_text]" rows="3" cols="5" style="height:10em; width:98%;"><?php echo $this->getInvoice()->getCommentText(); ?></textarea>
61
+ </span>
62
+ <div class="clear"></div>
63
+ </div>
64
+ </fieldset>
65
+ </div>
66
+
67
+ <div class="box-right entry-edit" id="invoice_totals">
68
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
69
+ <div class="order-totals">
70
+ <?php echo $this->getChildHtml('invoice_totals') ?>
71
+ <div class="order-totals-bottom">
72
+ <div class="divider"></div>
73
+ <?php if ($this->isCaptureAllowed()): ?>
74
+ <?php if ($this->canCapture()):?>
75
+ <p>
76
+ <!--
77
+ <label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount') ?></label>
78
+ <input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
79
+ -->
80
+ <label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Amount') ?></label>
81
+ <select name="invoice[capture_case]">
82
+ <option value="online"><?php echo Mage::helper('sales')->__('Capture Online') ?></option>
83
+ <option value="offline"><?php echo Mage::helper('sales')->__('Capture Offline') ?></option>
84
+ <option value="not_capture"><?php echo Mage::helper('sales')->__('Not Capture') ?></option>
85
+ </select>
86
+ </p>
87
+ <?php elseif ($this->isGatewayUsed()):?>
88
+ <input type="hidden" name="invoice[capture_case]" value="offline"/>
89
+ <p><?php echo Mage::helper('sales')->__('Invoice will be created without communication with payment gateway.') ?></p>
90
+ <?php endif?>
91
+ <?php endif; ?>
92
+ <p>
93
+ <label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
94
+ <input id="notify_customer" name="invoice[comment_customer_notify]" value="1" type="checkbox" />
95
+ </p>
96
+ <?php if ($this->canSendInvoiceEmail() && !$_order->getSwipezoomOrderNumberTemp()): ?>
97
+ <p>
98
+ <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Invoice') ?></label>
99
+ <input id="send_email" name="invoice[send_email]" value="1" type="checkbox" />
100
+ </p>
101
+ <?php endif; ?>
102
+ <div class="a-right">
103
+ <?php echo $this->getChildHtml('submit_button') ?>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ <div class="clear"></div>
109
+
110
+ <table class="order-info-foot" cellpadding="10" cellspacing="0" width="100%">
111
+ <tbody>
112
+ <tr>
113
+ <td class="section">
114
+ <table id="comments_block" cellpadding="0" width="100%">
115
+ <tbody>
116
+ <tr>
117
+ <td style="padding-right:30px; width:50%;">&nbsp;</td>
118
+ <td>&nbsp;</td>
119
+ </tr>
120
+ </tbody>
121
+ </table>
122
+ </td>
123
+ <td class="document-totals section">&nbsp;</td>
124
+ </tr>
125
+ </tbody>
126
+ </table>
127
+
128
+ <script type="text/javascript">
129
+ //<![CDATA[
130
+ var submitButtons = $$('.submit-button');
131
+ var updateButtons = $$('.update-button');
132
+ var enableSubmitButtons = <?php echo (int) !$this->getDisableSubmitButton() ?>;
133
+ var fields = $$('.qty-input');
134
+
135
+ updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
136
+
137
+ for(var i=0;i<fields.length;i++){
138
+ fields[i].observe('change', checkButtonsRelation)
139
+ fields[i].baseValue = fields[i].value;
140
+ }
141
+
142
+ function checkButtonsRelation() {
143
+ var hasChanges = false;
144
+ fields.each(function (elem) {
145
+ if (elem.baseValue != elem.value) {
146
+ hasChanges = true;
147
+ }
148
+ }.bind(this));
149
+ if (hasChanges) {
150
+ submitButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
151
+ updateButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
152
+ }
153
+ else {
154
+ if (enableSubmitButtons) {
155
+ submitButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
156
+ }
157
+ updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
158
+ }
159
+ }
160
+
161
+ var sendEmailCheckbox = $('send_email');
162
+ if (sendEmailCheckbox) {
163
+ var notifyCustomerCheckbox = $('notify_customer');
164
+ var invoiceCommentText = $('invoice_comment_text');
165
+ Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
166
+ bindSendEmail();
167
+ }
168
+ function bindSendEmail()
169
+ {
170
+ if (sendEmailCheckbox.checked == true) {
171
+ notifyCustomerCheckbox.disabled = false;
172
+ //invoiceCommentText.disabled = false;
173
+ }
174
+ else {
175
+ notifyCustomerCheckbox.disabled = true;
176
+ //invoiceCommentText.disabled = true;
177
+ }
178
+ }
179
+ //]]>
180
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/invoice/rederer/default.phtml ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_item = $this->getItem() ?>
3
+ <?php $this->setPriceDataObject($_item)?>
4
+ <tr class="border">
5
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?></td>
6
+ <td class="a-right">
7
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
8
+ <span class="price-excl-tax">
9
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
10
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
11
+ <?php endif; ?>
12
+
13
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
14
+ <?php
15
+ echo $this->displayPrices(
16
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
17
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
18
+ );
19
+ ?>
20
+ <?php else: ?>
21
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
22
+ <?php endif; ?>
23
+
24
+
25
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
26
+ <br />
27
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
28
+ <small>
29
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
30
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
31
+ <?php endforeach; ?>
32
+ </small>
33
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
34
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
35
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
36
+ <?php endforeach; ?>
37
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
38
+ <small>
39
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
40
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
41
+ <?php endforeach; ?>
42
+ </small>
43
+ <?php endif; ?>
44
+
45
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
46
+ <br />
47
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
48
+ <?php
49
+ echo $this->displayPrices(
50
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
51
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
52
+ );
53
+ ?>
54
+ </span>
55
+ <?php endif; ?>
56
+ <?php endif; ?>
57
+ </span>
58
+ <br />
59
+ <?php endif; ?>
60
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
61
+ <span class="price-incl-tax">
62
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
63
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
64
+ <?php endif; ?>
65
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
66
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
67
+
68
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
69
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?>
70
+ <?php else: ?>
71
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
72
+ <?php endif; ?>
73
+
74
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
75
+ <br />
76
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
77
+ <small>
78
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
79
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
80
+ <?php endforeach; ?>
81
+ </small>
82
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
83
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
84
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
85
+ <?php endforeach; ?>
86
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
87
+ <small>
88
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
89
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
90
+ <?php endforeach; ?>
91
+ </small>
92
+ <?php endif; ?>
93
+
94
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
95
+ <br />
96
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
97
+ <?php endif; ?>
98
+ <?php endif; ?>
99
+ </span>
100
+ <?php endif; ?>
101
+
102
+ </td>
103
+ <td class="a-center"><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
104
+ <?php $_order = $this->getInvoice()->getOrder() ?>
105
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?>
106
+ <td class="a-center">
107
+ <?php if ($this->canEditQty()) : ?>
108
+ <input type="text" class="input-text qty-input" name="invoice[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>"/>
109
+ <?php else : ?>
110
+ <?php echo $_item->getQty()*1 ?>
111
+ <?php endif; ?>
112
+ </td><?php } ?>
113
+ <td class="a-right">
114
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
115
+ <span class="price-excl-tax">
116
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
117
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
118
+ <?php endif; ?>
119
+
120
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
121
+ <?php
122
+ echo $this->displayPrices(
123
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
124
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
125
+ );
126
+ ?>
127
+ <?php else: ?>
128
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
129
+ <?php endif; ?>
130
+
131
+
132
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
134
+ <small>
135
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
136
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
137
+ <?php endforeach; ?>
138
+ </small>
139
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
140
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
141
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
142
+ <?php endforeach; ?>
143
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
144
+ <small>
145
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
146
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
147
+ <?php endforeach; ?>
148
+ </small>
149
+ <?php endif; ?>
150
+
151
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
152
+ <br />
153
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
154
+ <?php
155
+ echo $this->displayPrices(
156
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
157
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
158
+ );
159
+ ?>
160
+ </span>
161
+ <?php endif; ?>
162
+ <?php endif; ?>
163
+ </span>
164
+ <br />
165
+ <?php endif; ?>
166
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
167
+ <span class="price-incl-tax">
168
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
169
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
170
+ <?php endif; ?>
171
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
172
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
173
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
174
+ <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
175
+ <?php else: ?>
176
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
177
+ <?php endif; ?>
178
+
179
+
180
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
181
+
182
+ <br />
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
184
+ <small>
185
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
186
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
187
+ <?php endforeach; ?>
188
+ </small>
189
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
190
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
191
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
192
+ <?php endforeach; ?>
193
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
194
+ <small>
195
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
196
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
197
+ <?php endforeach; ?>
198
+ </small>
199
+ <?php endif; ?>
200
+
201
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
202
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
203
+ <?php endif; ?>
204
+ <?php endif; ?>
205
+ </span>
206
+ <?php endif; ?>
207
+ </td>
208
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
209
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
210
+ <td class="a-right last">
211
+ <?php echo $this->displayPrices(
212
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount() - $_item->getBaseDiscountAmount(),
213
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount() - $_item->getDiscountAmount()
214
+ ) ?>
215
+ </td>
216
+ </tr>
app/design/adminhtml/default/default/template/internationalshipping/invoice/view/form.phtml ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_invoice = $this->getInvoice() ?>
3
+ <?php $_order = $_invoice->getOrder() ?>
4
+ <?php echo $this->getChildHtml('order_info') ?>
5
+ <?php if (!$_order->getIsVirtual()): ?>
6
+ <div class="box-left">
7
+ <?php else: ?>
8
+ <div class="box-right">
9
+ <?php endif; ?>
10
+ <!--Billing Address-->
11
+ <div class="entry-edit">
12
+ <div class="entry-edit-head">
13
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
14
+ </div>
15
+ <fieldset>
16
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
17
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
18
+ </fieldset>
19
+ </div>
20
+ </div>
21
+ <?php if (!$_order->getIsVirtual()): ?>
22
+ <div class="box-right">
23
+ <!--Shipping Address-->
24
+ <div class="entry-edit">
25
+ <div class="entry-edit-head">
26
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
27
+ </div>
28
+ <fieldset>
29
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
30
+
31
+
32
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
33
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
34
+ <?php else: ?>
35
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
36
+ <?php endif; ?>
37
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
38
+ <br />
39
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
40
+ <?php echo $_excl; ?>
41
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
42
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
43
+ <?php endif; ?>
44
+ <br />
45
+ <?php
46
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
47
+ if($szOrderId){
48
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
49
+ if(count($counts)){
50
+ foreach($counts as $sh) {
51
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
52
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
53
+ }
54
+ }
55
+ }
56
+
57
+ ?>
58
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
59
+ </fieldset>
60
+ </div>
61
+ <?php endif; ?>
62
+ </div>
63
+ <div class="clear"></div>
64
+ <?php
65
+ $shippingMethod = $_order->getData("shipping_method") ;
66
+ if(strpos($shippingMethod,"swipezoom") !== FALSE){ ?>
67
+ <div class="entry-edit">
68
+ <div class="entry-edit-head">
69
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
70
+ </div><fieldset>
71
+
72
+ <div class="swipezoom-container">
73
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
74
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
75
+ </div>
76
+ <div class="swipezoom-container">
77
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
78
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
79
+ </div>
80
+ <div class="swipezoom-container">
81
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
82
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
83
+ </div>
84
+
85
+ <div class="swipezoom-container">
86
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
87
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
88
+ </div>
89
+ <div class="swipezoom-container">
90
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
91
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
92
+ </div>
93
+ <div class="swipezoom-container">
94
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
95
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
96
+ </div>
97
+ <div class="swipezoom-container">
98
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
99
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
100
+ </span></span></label>
101
+ </div>
102
+
103
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
104
+ <div class="swipezoom-container">
105
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
106
+ </span></span></label>
107
+ </div>
108
+ <?php endif; ?>
109
+ </fieldset>
110
+ </div>
111
+
112
+ <?php } ?>
113
+ <div class="entry-edit">
114
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && $_order->getSwipezoomOrderCreditmemo() < 3){ ?>
115
+
116
+ <style>
117
+ .entry-edit-head .tools a{display:none;}
118
+ .swipezoom-container .price-notice { float: right;}
119
+ .swipezoom-container { width: 50%;}
120
+ </style>
121
+ <div class="clear"></div>
122
+ <div class="entry-edit">
123
+ <div class="entry-edit-head">
124
+ <?php
125
+ $_itemsGridLabel1 = 'Items Packing Detail';
126
+ ?>
127
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel1) ?></h4>
128
+ </div>
129
+
130
+ </div>
131
+ <div id="swipezoom_grid_container">
132
+
133
+ <?php echo $this->getChildHtml('swipezoomordergrid') ?>
134
+ </div>
135
+ <div class="clear" style="margin-bottom:15px;"></div>
136
+
137
+ <?php }else{?>
138
+ <div class="entry-edit-head">
139
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Invoiced') ?></h4>
140
+ </div>
141
+ <?php } ?>
142
+ <div id="invoice_item_container">
143
+ <?php echo $this->getChildHtml('invoice_items') ?>
144
+ </div>
145
+ </div>
146
+
147
+ <div class="box-left entry-edit">
148
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
149
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
150
+ </div>
151
+
152
+ <div class="box-right entry-edit" id="history_form">
153
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
154
+ <div class="order-totals"><?php echo $this->getChildHtml('invoice_totals') ?></div>
155
+ </div>
156
+ <div class="clear"></div>
157
+
158
+
159
+ <script type="text/javascript">
160
+ function openMyPopup(url) {
161
+ if ($('browser_window') && typeof(Windows) != 'undefined') {
162
+ Windows.focus('browser_window');
163
+ return;
164
+ }
165
+ var dialogWindow = Dialog.info(null, {
166
+ closable:true,
167
+ resizable:false,
168
+ draggable:true,
169
+ className:'magento',
170
+ windowClassName:'popup-window',
171
+ title:'Popup Dialog',
172
+ top:50,
173
+ width:800,
174
+ height:550,
175
+ zIndex:1000,
176
+ recenterAuto:false,
177
+ hideEffect:Element.hide,
178
+ showEffect:Element.show,
179
+ id:'browser_window',
180
+ url:url,
181
+ onClose:function (param, el) {
182
+ // alert('onClose');
183
+ }
184
+ });
185
+ }
186
+ function closePopup() {
187
+ Windows.close('browser_window');
188
+ }
189
+ function cancelOrder() {
190
+ //setLocation('<?php echo $this->getUrl('adminhtml/sales_order/cancel',array('order_id'=> $_order->getId())) ?>');
191
+ }
192
+
193
+
194
+ </script>
195
+ <style>
196
+ #browser_window {position:absolute;}
197
+ #overlay_modal{background:#000;opacity:0.5;}
198
+ .magento_close{background:url('<?php echo Mage::getDesign()->getSkinUrl('internationalshipping/images',array('_area'=>'adminhtml')) ?>/popupclose.png') no-repeat; height: 28px;left: 790px; position: absolute;top: 7px;width: 28px;cursor:pointer;}
199
+ </style>
app/design/adminhtml/default/default/template/internationalshipping/invoice/view/items.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getInvoice()->getOrder() ?>
3
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && $_order->getSwipezoomOrderCreditmemo() < 3){ }else{ ?>
4
+ <div class="grid np">
5
+ <div class="hor-scroll">
6
+ <table cellspacing="0" class="data order-tables">
7
+ <col />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <col width="1" />
14
+ <thead>
15
+ <tr class="headings">
16
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
17
+ <th><?php echo $this->helper('sales')->__('Price') ?></th>
18
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
19
+ <th><?php echo $this->helper('sales')->__('Subtotal') ?></th>
20
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Amount') ?></span></th>
21
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Discount Amount') ?></span></th>
22
+ <th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Row Total') ?></span></th>
23
+ </tr>
24
+ </thead>
25
+ <?php $_items = $this->getInvoice()->getAllItems() ?>
26
+ <?php $i=0;foreach ($_items as $_item): ?>
27
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
28
+ <tbody class="<?php echo $i%2?'even':'odd' ?>">
29
+ <?php echo $this->getItemHtml($_item) ?>
30
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
31
+ </tbody>
32
+ <?php endforeach; ?>
33
+ </table>
34
+ </div>
35
+ </div>
36
+ <br />
37
+ <?php } ?>
app/design/adminhtml/default/default/template/internationalshipping/order/comment.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getEntity()->getOrder();
3
+
4
+ ?>
5
+ <?php if ($_entity = $this->getEntity()): ?>
6
+ <div id="comments_block">
7
+ <span class="field-row">
8
+ <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment Text') ?></label>
9
+ <textarea name="comment[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
10
+ </span>
11
+ <div class="f-left">
12
+ <?php if ($this->canSendCommentEmail() && !$_order->getSwipezoomOrderNumberTemp()): ?>
13
+ <input name="comment[is_customer_notified]" type="checkbox" id="history_notify" value="1" />
14
+ <label class="normal" for="history_notify"><?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
15
+ <?php endif; ?>
16
+ <input name="comment[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
17
+ </div>
18
+ <div class="f-right">
19
+ <?php echo $this->getChildHtml('submit_button') ?>
20
+ </div>
21
+ <div class="clear"></div>
22
+ <ul class="note-list">
23
+ <?php foreach ($_entity->getCommentsCollection(true) as $_comment): ?>
24
+ <li>
25
+ <strong><?php echo $this->helper('core')->formatDate($_comment->getCreatedAtDate(), 'medium') ?></strong>
26
+ <?php echo $this->helper('core')->formatTime($_comment->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><small><?php echo $this->helper('sales')->__('Customer') ?>
27
+ <strong class="subdue">
28
+ <?php if ($_comment->getIsCustomerNotified()): ?>
29
+ <?php echo $this->helper('sales')->__('Notified') ?>
30
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
31
+ <?php else: ?>
32
+ <?php echo $this->helper('sales')->__('Not Notified') ?>
33
+ <?php endif; ?>
34
+ </strong></small>
35
+ <br/>
36
+ <?php echo $this->escapeHtml($_comment->getComment(), array('b','br','strong','i','u')) ?>
37
+ </li>
38
+ <?php endforeach; ?>
39
+ </ul>
40
+ <script type="text/javascript">
41
+ function submitComment() {
42
+ submitAndReloadArea($('comments_block').parentNode, '<?php echo $this->getSubmitUrl() ?>')
43
+ }
44
+
45
+ if ($('submit_comment_button')) {
46
+ $('submit_comment_button').observe('click', submitComment);
47
+ }
48
+ </script>
49
+ </div>
50
+ <?php endif; ?>
app/design/adminhtml/default/default/template/internationalshipping/order/history.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+ <div id="order_history_block">
4
+ <?php if ($this->canAddComment()):?>
5
+ <div id="history_form" class="order-history-form">
6
+ <div><?php echo Mage::helper('sales')->__('Add Order Comments') ?></div>
7
+ <span class="field-row">
8
+ <label class="normal" for="history_status"><?php echo Mage::helper('sales')->__('Status') ?></label><br/>
9
+ <select name="history[status]" class="select" id="history_status">
10
+ <?php foreach ($this->getStatuses() as $_code=>$_label): ?>
11
+ <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
12
+ <?php endforeach; ?>
13
+ </select>
14
+ </span>
15
+ <span class="field-row">
16
+ <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment') ?></label>
17
+ <textarea name="history[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
18
+ </span>
19
+ <div class="f-left">
20
+ <?php if ($this->canSendCommentEmail() && ! $this->getOrder()->getSwipezoomOrderNumberTemp()): ?>
21
+ <input name="history[is_customer_notified]" type="checkbox" id="history_notify" value="1" /><label class="normal" for="history_notify"> <?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
22
+ <?php endif; ?>
23
+ <input name="history[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
24
+ </div>
25
+ <div class="f-right">
26
+ <?php echo $this->getChildHtml('submit_button') ?>
27
+ </div>
28
+ <div class="clear"></div>
29
+ </div>
30
+ <div class="divider"></div>
31
+ <?php endif;?>
32
+ <ul class="note-list">
33
+ <?php foreach ($this->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
34
+ <li>
35
+ <strong><?php echo $this->helper('core')->formatDate($_item->getCreatedAtDate(), 'medium') ?></strong>
36
+ <?php echo $this->helper('core')->formatTime($_item->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><strong><?php echo $_item->getStatusLabel() ?></strong><br/><small><?php echo $this->helper('sales')->__('Customer') ?>
37
+ <strong class="subdue">
38
+ <?php if ($this->isCustomerNotificationNotApplicable($_item)): ?>
39
+ <?php echo $this->helper('sales')->__('Notification Not Applicable') ?>
40
+ <?php elseif ($_item->getIsCustomerNotified()): ?>
41
+ <?php echo $this->helper('sales')->__('Notified') ?>
42
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
43
+ <?php else: ?>
44
+ <?php echo $this->helper('sales')->__('Not Notified') ?>
45
+ <?php endif; ?>
46
+ </strong></small>
47
+ <?php if ($_item->getComment()): ?>
48
+ <br/><?php echo $this->escapeHtml($_item->getComment(), array('b','br','strong','i','u')) ?>
49
+ <?php endif; ?>
50
+ </li>
51
+ <?php endforeach; ?>
52
+ </ul>
53
+ <script type="text/javascript">
54
+ if($('order_status'))$('order_status').update('<?php echo $this->getOrder()->getStatusLabel() ?>');
55
+ </script>
56
+ </div>
app/design/adminhtml/default/default/template/internationalshipping/order/info.phtml ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php
4
+ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
5
+ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
6
+ ?>
7
+ <div class="box-left">
8
+ <!--Order Information-->
9
+ <div class="entry-edit">
10
+ <?php if ($_order->getEmailSent()):
11
+ $_email = Mage::helper('sales')->__('the order confirmation email was sent');
12
+ else:
13
+ $_email = Mage::helper('sales')->__('the order confirmation email is not sent');
14
+ endif; ?>
15
+ <div class="entry-edit-head">
16
+ <?php if ($this->getNoUseOrderLink()): ?>
17
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?><?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?> (<?php echo $_email ?>) <?php } ?></h4>
18
+ <?php else: ?>
19
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
20
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?> <strong>(<?php echo $_email ?>)</strong><?php } ?>
21
+ <?php endif; ?>
22
+ </div>
23
+ <div class="fieldset">
24
+ <table cellspacing="0" class="form-list">
25
+ <tr>
26
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
27
+ <td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
28
+ </tr>
29
+ <?php if ($orderAdminDate != $orderStoreDate):?>
30
+ <tr>
31
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
32
+ <td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
33
+ </tr>
34
+ <?php endif;?>
35
+ <tr>
36
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
37
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
38
+ </tr>
39
+ <tr>
40
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
41
+ <td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
42
+ </tr>
43
+ <?php if($_order->getRelationChildId()): ?>
44
+ <tr>
45
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
46
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
47
+ <?php echo $_order->getRelationChildRealId() ?>
48
+ </a></td>
49
+ </tr>
50
+ <?php endif; ?>
51
+ <?php if($_order->getRelationParentId()): ?>
52
+ <tr>
53
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
54
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
55
+ <?php echo $_order->getRelationParentRealId() ?>
56
+ </a></td>
57
+ </tr>
58
+ <?php endif; ?>
59
+ <?php if($_order->getRemoteIp() && $this->shouldDisplayCustomerIp()): ?>
60
+ <tr>
61
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
62
+ <td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?></strong></td>
63
+ </tr>
64
+ <?php endif; ?>
65
+ <?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
66
+ <tr>
67
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
68
+ <td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
69
+ </tr>
70
+ <?php endif; ?>
71
+ <?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
72
+ <tr>
73
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
74
+ <td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
75
+ </tr>
76
+ <?php endif; ?>
77
+ <?php
78
+ $newszorderid = $_order->getSwipezoomOrderNumberTemp();
79
+ $partshipreqcolleciotn1 = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('newszorderid',$newszorderid);
80
+ if(count($partshipreqcolleciotn1)){
81
+ foreach($partshipreqcolleciotn1 as $part){
82
+ $neworder = Mage::getModel('sales/order')->load($part->getRealorderid());
83
+ $incrementid = $neworder->getIncrementId();
84
+ $parentorderid = $neworder->getId();
85
+
86
+ ?>
87
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Original Order: ') ?></label></td>
88
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$parentorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
89
+ <?php }
90
+ }
91
+
92
+
93
+
94
+
95
+
96
+ if($_order->getSwipezoomOrderNumberTemp()){
97
+ $swipezoomparentorder = Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('swipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
98
+ $swipezoomparentorder1= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('refswipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
99
+ if(count($swipezoomparentorder)){
100
+ foreach($swipezoomparentorder as $parentorder){
101
+ $paretorderid = $parentorder->getReforderno();
102
+ break;
103
+ }
104
+ $incrementid = Mage::getModel('sales/order')->load($paretorderid)->getIncrementId(); ?>
105
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Refund Order: ') ?></label></td>
106
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$paretorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
107
+
108
+ <?php
109
+ }elseif(count($swipezoomparentorder1)){
110
+
111
+ foreach($swipezoomparentorder1 as $parentorder){
112
+ $childorderid = $parentorder->getRealorderno();
113
+ break;
114
+ }
115
+ $incrementid = Mage::getModel('sales/order')->load($childorderid)->getIncrementId(); ?>
116
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Parent Order: ') ?></label></td>
117
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$childorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
118
+ <tr>
119
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Swipezoom Rog Order No: ') ?></label></td>
120
+ <td class="value"><strong><?php echo $_order->getSwipezoomOrderNumberTemp(); ?></strong></td>
121
+ </tr>
122
+
123
+ <?php
124
+ }
125
+ }
126
+
127
+
128
+
129
+
130
+ $partshipreqcolleciotn = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid',$_order->getId());
131
+ if(count($partshipreqcolleciotn)){
132
+ foreach($partshipreqcolleciotn as $part){
133
+ $neworder = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('swipezoom_order_number_temp',$part->getNewszorderid());
134
+ foreach($neworder as $neworderincrementid){
135
+ $incrementid = $neworderincrementid->getIncrementId();
136
+ $childorderid = $neworderincrementid->getId();
137
+ }
138
+ if($incrementid){
139
+ ?>
140
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Updated Order: ') ?></label></td>
141
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$childorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
142
+ <?php }}
143
+ }
144
+
145
+
146
+ ?>
147
+ <?php if($_order->getSwipezoomOrderCreditmemo()>3){?>
148
+ <script type="text/javascript">
149
+ Event.observe(document,"dom:loaded",function(){
150
+ $$('[title="Credit Memo"]').each(function(el){
151
+ el.update('<span><span><span></span>Credit Memo Confirm</span></span>')
152
+ });
153
+ });
154
+ </script>
155
+ <?php } ?>
156
+ </table>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ <div class="box-right">
161
+ <!--Account Information-->
162
+ <div class="entry-edit">
163
+ <div class="entry-edit-head">
164
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
165
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
166
+ </div>
167
+ <div class="fieldset">
168
+ <div class="hor-scroll">
169
+ <table cellspacing="0" class="form-list">
170
+ <tr>
171
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
172
+ <td class="value">
173
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
174
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></a>
175
+ <?php else: ?>
176
+ <strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong>
177
+ <?php endif; ?>
178
+ </td>
179
+ </tr>
180
+ <tr>
181
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
182
+ <td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
183
+ </tr>
184
+ <?php if ($_groupName = $this->getCustomerGroupName()) : ?>
185
+ <tr>
186
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
187
+ <td class="value"><strong><?php echo $_groupName ?></strong></td>
188
+ </tr>
189
+ <?php endif; ?>
190
+ <?php foreach ($this->getCustomerAccountData() as $data):?>
191
+ <tr>
192
+ <td class="label"><label><?php echo $data['label'] ?></label></td>
193
+ <td class="value"><strong><?php echo $data['value'] ?></strong></td>
194
+ </tr>
195
+ <?php endforeach;?>
196
+ </table>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ <div class="clear"></div>
202
+
203
+ <div class="box-left">
204
+ <!--Billing Address-->
205
+ <div class="entry-edit">
206
+ <div class="entry-edit-head">
207
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
208
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
209
+ </div>
210
+ <fieldset>
211
+ <address>
212
+ <?php
213
+
214
+ $shippingMethod = $_order->getData("shipping_method") ;
215
+ if(strpos($shippingMethod,"swipezoom") !== FALSE):
216
+ $formater = new Varien_Filter_Template();
217
+ $attributes = Mage::helper('customer/address')->getAttributes();
218
+ $address = $_order->getBillingAddress();
219
+ $data = array();
220
+ foreach ($attributes as $attribute) {
221
+ /* @var $attribute Mage_Customer_Model_Attribute */
222
+ if (!$attribute->getIsVisible()) {
223
+ continue;
224
+ }
225
+ if ($attribute->getAttributeCode() == 'country_id') {
226
+ $data['country'] = $address->getCountryModel()->getName();
227
+ } else if ($attribute->getAttributeCode() == 'region') {
228
+ $data['region'] = $address->getRegion();
229
+ } else {
230
+ $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute,$address);
231
+ $value = $dataModel->outputValue($dataFormat);
232
+ if ($attribute->getFrontendInput() == 'multiline') {
233
+ $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
234
+ // explode lines
235
+ foreach ($values as $k => $v) {
236
+ $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
237
+ $data[$key] = $v;
238
+ }
239
+ }
240
+ $data[$attribute->getAttributeCode()] = $value;
241
+ }
242
+ }
243
+ $formater->setVariables($data);
244
+ $swipezoomString = Mage::getModel('sales/quote')->getCollection()->addFieldToFilter("entity_id", $_order->getQuoteId())->getData() ;
245
+ $swipezoomString = $swipezoomString[0]["swipezoom_address_billing_string"];
246
+
247
+ $format = "{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/>\n{{depend company}}{{var company}}<br />{{/depend}}\n".$swipezoomString."\n<br/>{{depend telephone}}T: {{var telephone}}{{/depend}}\n{{depend fax}}<br/>F: {{var fax}}{{/depend}}\n{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}";
248
+
249
+ echo $formater->filter($format);
250
+ else:
251
+ echo $_order->getBillingAddress()->getFormated(true);
252
+ endif;
253
+ ?></address>
254
+ </fieldset>
255
+ </div>
256
+ </div>
257
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
258
+ <div class="box-right">
259
+ <!--Shipping Address-->
260
+ <div class="entry-edit">
261
+ <div class="entry-edit-head">
262
+ <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
263
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
264
+ </div>
265
+ <fieldset>
266
+ <address>
267
+ <?php
268
+ $shippingMethod = $_order->getData("shipping_method") ;
269
+ if(strpos($shippingMethod,"swipezoom") !== FALSE):
270
+
271
+ $formater = new Varien_Filter_Template();
272
+ $attributes = Mage::helper('customer/address')->getAttributes();
273
+ $address = $_order->getShippingAddress();
274
+ $data = array();
275
+ foreach ($attributes as $attribute) {
276
+ /* @var $attribute Mage_Customer_Model_Attribute */
277
+ if (!$attribute->getIsVisible()) {
278
+ continue;
279
+ }
280
+ if ($attribute->getAttributeCode() == 'country_id') {
281
+ $data['country'] = $address->getCountryModel()->getName();
282
+ } else if ($attribute->getAttributeCode() == 'region') {
283
+ $data['region'] = $address->getRegion();
284
+ } else {
285
+ $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute,$address);
286
+ $value = $dataModel->outputValue($dataFormat);
287
+ if ($attribute->getFrontendInput() == 'multiline') {
288
+ $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
289
+ // explode lines
290
+ foreach ($values as $k => $v) {
291
+ $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
292
+ $data[$key] = $v;
293
+ }
294
+ }
295
+ $data[$attribute->getAttributeCode()] = $value;
296
+ }
297
+ }
298
+ $formater->setVariables($data);
299
+ $swipezoomString = Mage::getModel('sales/quote')->getCollection()->addFieldToFilter("entity_id", $_order->getQuoteId())->getData() ;
300
+ $swipezoomString = $swipezoomString[0]["swipezoom_address_shipping_string"];
301
+
302
+ $format = "{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/>\n{{depend company}}{{var company}}<br />{{/depend}}\n".$swipezoomString."\n<br/>{{depend telephone}}T: {{var telephone}}{{/depend}}\n{{depend fax}}<br/>F: {{var fax}}{{/depend}}\n{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}";
303
+
304
+ echo $formater->filter($format);
305
+
306
+ else:
307
+ echo $_order->getShippingAddress()->getFormated(true);
308
+ endif;
309
+ ?>
310
+ </address>
311
+ </fieldset>
312
+ </div>
313
+ </div>
314
+ <div class="clear"></div>
315
+ <?php endif; ?>
app/design/adminhtml/default/default/template/internationalshipping/order/items.phtml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder()
3
+
4
+ ?>
5
+ <?php $swipwzoomorder = $_order->getSwipezoomOrderNumberTemp();
6
+ $count = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
7
+ if(count($count)){ ?>
8
+ <div class="grid np">
9
+ <div class="hor-scroll">
10
+ <table cellspacing="0" class="data order-tables">
11
+ <col />
12
+ <col width="1" />
13
+ <col width="1" />
14
+ <col width="1" />
15
+ <col width="1" />
16
+ <col width="1" />
17
+ <col width="1" />
18
+ <col width="1" />
19
+ <thead>
20
+ <tr class="headings">
21
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
22
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
23
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
24
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
25
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
26
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
27
+ </tr>
28
+ </thead>
29
+ <?php
30
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
31
+ $order= Mage::getModel('sales/order')->load($orderid);
32
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
33
+
34
+
35
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
36
+ //print_r($_items->getData());
37
+ if(count($_items)){
38
+ ?>
39
+
40
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
41
+ <?php $_i=0;foreach ($_items as $_item): ?>
42
+ <?php if(!$_item->getProductcode()){break;}
43
+ $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode());
44
+ if(!$products){ echo "<tr ><td colspan='6'>Somthing wrong Happen - Product not found.</td></tr>"; break;}
45
+ ?>
46
+ <?php $_i++; ?>
47
+ <tr class="border">
48
+ <td ><?php echo $_i ?></td>
49
+ <td><?php echo $_item->getBoxcode() ?></td>
50
+ <td><?php echo $_item->getBoxno() ?></td>
51
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); //$productname = $_Pdetails->getName();
52
+ // $_item->getProductname() ?></td>
53
+ <td><?php echo $_item->getProductcode() ?></td>
54
+ <td><?php echo $_item->getProductqty() ?></td>
55
+ </tr>
56
+ <?php endforeach; ?>
57
+ </tbody>
58
+ </table>
59
+ <?php }?>
60
+ </div>
61
+ </div>
62
+ <br />
63
+ <style>
64
+ .entry-edit-head .tools a{display:none;}
65
+ </style>
66
+ <?php }else{ ?>
67
+
68
+ <div class="grid np">
69
+ <div class="hor-scroll">
70
+ <table cellspacing="0" class="data order-tables">
71
+ <col />
72
+ <col width="1" />
73
+ <col width="1" />
74
+ <col width="1" />
75
+ <col width="1" />
76
+ <col width="1" />
77
+ <col width="1" />
78
+ <col width="1" />
79
+ <col width="1" />
80
+ <col width="1" />
81
+ <thead>
82
+ <tr class="headings">
83
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
84
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Item Status') ?></span></th>
85
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Original Price') ?></span></th>
86
+ <th><?php echo $this->helper('sales')->__('Price') ?></th>
87
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
88
+ <th><?php echo $this->helper('sales')->__('Subtotal') ?></th>
89
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Amount') ?></span></th>
90
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Percent') ?></span></th>
91
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Discount Amount') ?></span></th>
92
+ <th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Row Total') ?></span></th>
93
+ </tr>
94
+ </thead>
95
+ <?php $_items = $this->getItemsCollection() ?>
96
+ <?php $i=0;foreach ($_items as $_item):?>
97
+ <?php if ($_item->getParentItem()) continue; else $i++;?>
98
+ <tbody class="<?php echo $i%2?'even':'odd' ?>">
99
+ <?php echo $this->getItemHtml($_item) ?>
100
+ <?php echo $this->getItemExtraInfoHtml($_item) ?>
101
+ </tbody>
102
+ <?php endforeach; ?>
103
+ </table>
104
+ </div>
105
+ </div>
106
+ <br />
107
+ <?php } ?>
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/data.phtml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="page-create-order">
28
+ <p class="switcher">
29
+ <label for="currency_switcher"><?php echo Mage::helper('sales')->__('Order Currency:') ?></label>
30
+ <select id="currency_switcher" name="order[currency]" onchange="order.setCurrencyId(this.value); order.setCurrencySymbol(this.options[this.selectedIndex].getAttribute('symbol'));">
31
+ <?php foreach ($this->getAvailableCurrencies() as $_code): ?>
32
+ <option value="<?php echo $_code ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?> symbol="<?php echo $this->getCurrencySymbol($_code) ?>"><?php echo $this->getCurrencyName($_code) ?></option>
33
+ <?php endforeach; ?>
34
+ </select>
35
+ </p>
36
+ <?php if(Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId()){
37
+ $order = Mage::getSingleton('adminhtml/session_quote')->getOrder();
38
+ if($nu = $this->getRequest()->getPost('szorderid')){}else{$nu = $order->getSwipezoomOrderNumberTemp();}}
39
+ ?>
40
+ <script type="text/javascript">order.setCurrencySymbol('<?php echo $this->getCurrencySymbol($this->getCurrentCurrencyCode()) ?>')</script>
41
+ <table cellspacing="0" width="100%">
42
+ <tr>
43
+ <?php if($this->getCustomerId()): ?>
44
+ <td class="side-col" style="background:none; padding:0;">
45
+ <div id="order-sidebar"><?php echo $this->getChildHtml('sidebar') ?></div>
46
+ </td>
47
+ <?php else: ?>
48
+ <td class="side-col" style="background:none; padding:0;">
49
+ <div id="order-sidebar"><?php echo $this->getChildHtml('sidebar') ?></div>
50
+ </td>
51
+ <?php endif; ?>
52
+ <td <?php if($this->getCustomerId() || $nu): ?>class="main-col"<?php endif; ?>>
53
+ <div id="order-additional_area" style="display:none" class="order-additional-area"><?php echo $this->getChildHtml('additional_area') ?></div>
54
+ <div id="order-search" style="display:none" class="order-search-items"><?php echo $this->getChildHtml('search') ?></div>
55
+ <div id="order-items"><?php echo $this->getChildHtml('items') ?></div>
56
+ <div id="order-errors"><?php echo $this->getChildHtml('errors') ?></div>
57
+ <div id="order-form_account"><?php echo $this->getChildHtml('form_account') ?></div>
58
+ <div id="order-addresses">
59
+ <div id="order-billing_address" class="box-left"><?php echo $this->getChildHtml('billing_address') ?></div>
60
+ <div id="order-shipping_address" class="box-right"><?php echo $this->getChildHtml('shipping_address') ?></div>
61
+ </div>
62
+ <div class="clear"></div>
63
+ <div id="order-methods">
64
+ <div id="order-billing_method" class="box-left payments"><?php echo $this->getChildHtml('billing_method') ?></div>
65
+ <div id="order-shipping_method" class="box-right"><?php echo $this->getChildHtml('shipping_method') ?></div>
66
+ </div>
67
+ <?php if($this->getChild('card_validation')): ?>
68
+ <div class="clear"></div>
69
+ <div id="order-methods">
70
+ <div id="order-card_validation" class="box-left payments"><?php echo $this->getChildHtml('card_validation') ?></div>
71
+ </div>
72
+ <?php endif; ?>
73
+
74
+ <div class="clear"></div>
75
+ <?php echo $this->getChildHtml('gift_options') ?>
76
+
77
+ <div class="clear"></div>
78
+ <div class="box-left entry-edit">
79
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order History') ?></h4></div>
80
+ <fieldset id="order-comment"><?php echo $this->getChildHtml('comment') ?></fieldset>
81
+ </div>
82
+
83
+
84
+ <?php if($nu){ ?>
85
+
86
+ <style>
87
+ #order-form_account,#order-addresses,#order-methods,.box-left.entry-edit,.page-create-order .switcher{display:none;}
88
+ #order-sidebar_cart,#order-sidebar_wishlist,#order-sidebar_viewed,#order-sidebar_compared,#order-sidebar_pcompared,#order-sidebar_pviewed{display:none;}
89
+ </style>
90
+
91
+ <script type="text/javascript">
92
+ Event.observe(document,"dom:loaded",function(){
93
+ $$('[title="Submit Order"]').each(function(el){
94
+ // el.addClassName("disabled");
95
+ el.removeAttribute("onclick");
96
+ el.setAttribute('onclick',"$('sendrequest').setAttribute('value', '1');sendpartshipconfirm($('order-items_grid'),'<?php echo $this->getUrl('adminhtml/sales_order_edit/sendpartshiprq', array('order_id'=> Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId())) ?>')");
97
+ el.update('<span><span><span></span>Submit Order</span></span>');
98
+ });
99
+ });
100
+
101
+ </script>
102
+ <?php $newcoll = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid', Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId()); ?>
103
+
104
+ <?php }else{?>
105
+ <div class="box-right entry-edit">
106
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
107
+ <div id="order-totals" class="order-totals"><?php echo $this->getChildHtml('totals') ?></div>
108
+
109
+
110
+ </div> <?php }?>
111
+ <div class="clear"></div>
112
+ </td>
113
+ </tr>
114
+ </table>
115
+ </div>
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/form.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ var order = new AdminOrder(<?php echo $this->getOrderDataJson() ?>);
29
+ order.setLoadBaseUrl('<?php echo $this->getLoadBlockUrl() ?>');
30
+ var payment = {};
31
+ payment.switchMethod = order.switchPaymentMethod.bind(order);
32
+ </script>
33
+ <form id="edit_form" action="<?php echo $this->getSaveUrl() ?>" method="post" enctype="multipart/form-data">
34
+ <?php echo $this->getBlockHtml('formkey')?>
35
+ <div id="order-message">
36
+ <?php echo $this->getChildHtml('message') ?>
37
+ </div>
38
+ <div id="order-customer-selector" style="display:<?php echo $this->getCustomerSelectorDisplay() ?>">
39
+ <?php echo $this->getChildHtml('customer') ?>
40
+ </div>
41
+ <div id="order-store-selector" style="display:<?php echo $this->getStoreSelectorDisplay() ?>">
42
+ <?php echo $this->getChildHtml('store') ?>
43
+ </div>
44
+ <div id="order-data" style="display:<?php echo $this->getDataSelectorDisplay() ?>">
45
+ <?php echo $this->getChildHtml('data') ?>
46
+ </div>
47
+ </form>
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/items.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ if(Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId()){
4
+ $order = Mage::getSingleton('adminhtml/session_quote')->getOrder();
5
+ if($nu = $this->getRequest()->getPost('szorderid')){}else{$nu = $order->getSwipezoomOrderNumberTemp();}
6
+ }
7
+ ?>
8
+ <div class="entry-edit">
9
+ <div class="entry-edit-head">
10
+ <h4 class="icon-head head-cart"><?php echo $this->getHeaderText() ?></h4>
11
+ <?php if(!$nu){ ?> <div class="form-buttons"><?php echo $this->getButtonsHtml() ?></div> <?php } ?>
12
+ </div>
13
+ <?php echo $this->getChildHtml() ?>
14
+ </div>
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/items/sz_grid.phtml ADDED
@@ -0,0 +1,888 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Sales_Order_Create_Items_Grid
30
+ */
31
+ ?>
32
+ <?php if($sessionorde = Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId()){
33
+ $order = Mage::getSingleton('adminhtml/session_quote')->getOrder();
34
+ $ordered_items = $order->getAllItems();
35
+ $realitemqty = array();
36
+ foreach($ordered_items as $item2){
37
+ $realitemqty[$item2->getSku()] = $item2->getQtyOrdered();
38
+ }
39
+
40
+ if($nu = $this->getRequest()->getPost('szorderid')){}else{$nu = $order->getSwipezoomOrderNumberTemp();}}
41
+ ?>
42
+ <?php $_items = $this->getItems() ?>
43
+ <?php if (empty($_items)): ?>
44
+
45
+ <div class="grid" id="order-items_grid">
46
+ <table cellspacing="0" class="data order-tables">
47
+ <col />
48
+ <col width="100" />
49
+ <col width="40" />
50
+ <col width="100" />
51
+ <col width="80" />
52
+ <col width="100" />
53
+ <col width="80" />
54
+ <thead>
55
+ <tr class="headings">
56
+ <th class="no-link"><?php echo $this->helper('sales')->__('Product') ?></th>
57
+ <th class="no-link"><?php echo $this->helper('sales')->__('Price') ?></th>
58
+ <th class="no-link"><?php echo $this->helper('sales')->__('Qty') ?></th>
59
+ <th class="no-link"><?php echo $this->helper('sales')->__('Subtotal') ?></th>
60
+ <th class="no-link"><?php echo $this->helper('sales')->__('Discount') ?></th>
61
+ <th class="no-link"><?php echo $this->helper('sales')->__('Row Subtotal') ?></th>
62
+ <th class="no-link last"><?php echo $this->helper('sales')->__('Action') ?></th>
63
+ </tr>
64
+ </thead>
65
+ <tbody>
66
+ <tr class="even">
67
+ <td class="empty-text a-center" colspan="100"><?php echo $this->helper('sales')->__('No ordered items') ?></td>
68
+ </tr>
69
+ </tbody>
70
+ </table>
71
+ </div>
72
+ <?php else: ?>
73
+ <div>
74
+ <?php if($nu){
75
+ $colection = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('swipezoomorderid',$nu);
76
+ if(!count($colection)){
77
+ ?>
78
+ <div class="grid" id="order-items_grid">
79
+ <table cellspacing="0" class="data order-tables">
80
+ <col />
81
+ <col width="100" />
82
+ <col width="100" />
83
+ <col width="40" />
84
+ <col width="100" />
85
+ <col width="80" />
86
+ <col width="100" />
87
+ <col width="80" />
88
+ <thead>
89
+ <tr class="headings">
90
+ <th class="no-link" colspan="2"><?php echo $this->helper('sales')->__('Product') ?></th>
91
+ <th class="no-link"><?php echo $this->helper('sales')->__('Price') ?></th>
92
+ <th class="no-link" colspan="2"><?php echo $this->helper('sales')->__('Qty') ?></th>
93
+ <th class="no-link"><?php echo $this->helper('sales')->__('Subtotal') ?></th>
94
+
95
+ <?php /*?><th class="no-link"><?php echo $this->helper('sales')->__('Row Subtotal') ?></th><?php */?>
96
+ <th class="no-link last" colspan="2"><?php echo $this->helper('sales')->__('Action') ?></th>
97
+ </tr>
98
+ </thead>
99
+ <?php $itemqty = 0; foreach ($_items as $_item){ ?>
100
+ <?php $itemqty += $_item->getQty();?>
101
+ <?php }?>
102
+ <tfoot>
103
+ <tr>
104
+ <td class="a-left" colspan="2"><?php echo $this->helper('sales')->__('Total %d product(s)', count($_items)) ?></td>
105
+ <td>&nbsp;</td>
106
+ <td colspan="2" class="a-left"><strong><?php echo $itemqty;//echo $this->helper('sales')->__('Subtotal:') ?></strong></td>
107
+ <td class="price" ><strong><?php echo $this->formatPrice($this->getSubtotal()) ?></strong></td>
108
+ <?php /*?><td class="price"><strong><?php // echo $this->formatPrice($this->getDiscountAmount()) ?></strong></td><?php */?>
109
+ <td class="price" colspan="2"><strong>
110
+ <?php
111
+ // echo $this->formatPrice($this->getSubtotal() + $this->getDiscountAmount());
112
+ ?>
113
+ </strong></td>
114
+
115
+ </tr>
116
+ </tfoot>
117
+ <?php $i=0 ?>
118
+ <?php foreach ($_items as $_item):$i++ ?>
119
+ <tbody class="<?php echo ($i%2)?'even':'odd' ?>">
120
+ <tr>
121
+ <td class="first"><h5 class="title"><span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span></h5>
122
+ <div> <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
123
+ <input name="item[<?php echo $_item->getId() ?>][sku]" class="input-text" value="<?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>" type="hidden" maxlength="12" />
124
+ </div>
125
+ <?php if($_item->getMessage(false)): ?>
126
+ <?php foreach ($_item->getMessage(false) as $message): ?>
127
+ <div class="<?php if($_item->getHasError()): ?>error<?php else: ?>notice<?php endif; ?>">
128
+ <div style="font-size:95%"><?php echo Mage::helper('core')->escapeHtml($message); ?></div>
129
+ </div>
130
+ <?php endforeach; ?>
131
+ <?php endif; ?></td>
132
+ <td class="a-center v-middle"><?php //echo $this->getConfigureButtonHtml($_item) ?></td>
133
+ <td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
134
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
135
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
136
+ <?php endif; ?>
137
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
138
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
139
+ <?php else: ?>
140
+ <?php echo $this->formatPrice($_item->getCalculationPrice()) ?>
141
+ <?php endif; ?>
142
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
143
+ <br />
144
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
145
+ <small>
146
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
147
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br />
148
+ <?php endforeach; ?>
149
+ </small>
150
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
151
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
152
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
153
+ <?php endforeach; ?>
154
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
155
+ <small>
156
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
157
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
158
+ <?php endforeach; ?>
159
+ </small>
160
+ <?php endif; ?>
161
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
162
+ <br />
163
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
164
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
165
+ <?php endif; ?>
166
+ <?php endif; ?>
167
+ <?php endif; ?>
168
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
169
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
170
+ <br />
171
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
172
+ <?php endif; ?>
173
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
174
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
175
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
176
+ <?php else: ?>
177
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
178
+ <?php endif; ?>
179
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
180
+ <br />
181
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
182
+ <small>
183
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
184
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br />
185
+ <?php endforeach; ?>
186
+ </small>
187
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
188
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
189
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
190
+ <?php endforeach; ?>
191
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
192
+ <small>
193
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
194
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
195
+ <?php endforeach; ?>
196
+ </small>
197
+ <?php endif; ?>
198
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
199
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
200
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
201
+ <?php endif; ?>
202
+ <?php endif; ?>
203
+ <?php endif; ?></td>
204
+ <td colspan="2"><input name="item[<?php echo $_item->getId() ?>][qty]" maxqty="<?php echo $realitemqty[$_item->getSku()] ?>" id="element<?php echo $_item->getSku() ?>" class="input-text item-qty validate-digits-range digits-range-0-<?php echo $realitemqty[$_item->getSku()] ?>" onblur="order.qtyvalidation('<?php echo $_item->getSku(); ?>')" value="<?php echo $_item->getQty()*1 ?>" maxlength="12" /></td>
205
+ <td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
206
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
207
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
208
+ <?php endif; ?>
209
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
210
+ <?php echo $this->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
211
+ <?php else: ?>
212
+ <?php echo $this->formatPrice($_item->getRowTotal()) ?>
213
+ <?php endif; ?>
214
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
215
+ <br />
216
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
217
+ <small>
218
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
219
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
220
+ <?php endforeach; ?>
221
+ </small>
222
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
223
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
224
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
225
+ <?php endforeach; ?>
226
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
227
+ <small>
228
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
229
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
230
+ <?php endforeach; ?>
231
+ </small>
232
+ <?php endif; ?>
233
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
234
+ <br />
235
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
236
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
237
+ <?php endif; ?>
238
+ <?php endif; ?>
239
+ <?php endif; ?>
240
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
241
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
242
+ <br />
243
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
244
+ <?php endif; ?>
245
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
247
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
248
+ <?php else: ?>
249
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
250
+ <?php endif; ?>
251
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
252
+ <br />
253
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
254
+ <small>
255
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
256
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
257
+ <?php endforeach; ?>
258
+ </small>
259
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
260
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
261
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
262
+ <?php endforeach; ?>
263
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
264
+ <small>
265
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
266
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
267
+ <?php endforeach; ?>
268
+ </small>
269
+ <?php endif; ?>
270
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
271
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
272
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
273
+ <?php endif; ?>
274
+ <?php endif; ?>
275
+ <?php endif; ?></td>
276
+ <?php /*?><td class="price"><?php echo $this->formatPrice(-$_item->getDiscountAmount()) ?><br />
277
+ <input id="item_use_discount_<?php echo $_item->getId() ?>" name="item[<?php echo $_item->getId() ?>][use_discount]"<?php if (!$_item->getNoDiscount()): ?>checked="checked"<?php endif; ?> value="1" type="checkbox" />
278
+ <label for="item_use_discount_<?php echo $_item->getId() ?>" class="normal"><?php echo $this->helper('sales')->__('Apply') ?></label></td><?php */?>
279
+ <?php /*?><td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
280
+ <?php $_rowTotalWithoutDiscount = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount() - $_item->getTaxAmount(); ?>
281
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
282
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
283
+ <?php endif; ?>
284
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
285
+ <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition())); ?>
286
+ <?php else: ?>
287
+ <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?>
288
+ <?php endif; ?>
289
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
290
+ <br />
291
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
292
+ <small>
293
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
294
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
295
+ <?php endforeach; ?>
296
+ </small>
297
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
298
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
299
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
300
+ <?php endforeach; ?>
301
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
302
+ <small>
303
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
304
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
305
+ <?php endforeach; ?>
306
+ </small>
307
+ <?php endif; ?>
308
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
309
+ <br />
310
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
311
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
312
+ <?php endif; ?>
313
+ <?php endif; ?>
314
+ <?php endif; ?>
315
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
316
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
317
+ <br />
318
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
319
+ <?php endif; ?>
320
+ <?php $_incl = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount(); ?>
321
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
322
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
323
+ <?php else: ?>
324
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
325
+ <?php endif; ?>
326
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
327
+ <br />
328
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
329
+ <small>
330
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
331
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
332
+ <?php endforeach; ?>
333
+ </small>
334
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
335
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
336
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
337
+ <?php endforeach; ?>
338
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
339
+ <small>
340
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
341
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
342
+ <?php endforeach; ?>
343
+ </small>
344
+ <?php endif; ?>
345
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
346
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
347
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
348
+ <?php endif; ?>
349
+ <?php endif; ?>
350
+ <?php endif; ?></td><?php */?>
351
+ <td class="last" colspan="2"><input type="hidden" name="item[<?php echo $_item->getId() ?>][action]" value="" />
352
+ <?php echo $this->getButtonHtml($this->helper('sales')->__('Remove'),"this.up().down('input').setAttribute('value', 'remove');order.itemsUpdate()"); ?></td>
353
+
354
+ </tr>
355
+ <?php //echo $this->getItemExtraInfo($_item)->toHtml(); ?>
356
+ </tbody>
357
+ <?php endforeach; ?>
358
+ </table>
359
+ <?php if(Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId()){
360
+ $order = Mage::getSingleton('adminhtml/session_quote')->getOrder(); ?>
361
+ <input type="hidden" name="realorderid" value="<?php echo Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId(); ?>" />
362
+ <input type="hidden" id="szorderid" name="szorderid" value="<?php echo $order->getSwipezoomOrderNumberTemp(); ?>" />
363
+ <input type="hidden" value="" name="sendrequest" id="sendrequest" />
364
+ <?php
365
+
366
+ $newcoll = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('realorderid', Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId());
367
+
368
+
369
+
370
+ } ?>
371
+
372
+
373
+ </div>
374
+ <table cellspacing="0" width="100%">
375
+ <col width="50%" />
376
+ <col width="50%" />
377
+ <tr>
378
+ <td class="a-left"><small><?php //echo $this->getInclExclTaxMessage(); ?></small></td>
379
+ <td class="a-right">
380
+
381
+ <button <?php if(count($newcoll)){ echo 'disabled="disabled"';} ?> onclick="$('sendrequest').setAttribute('value', '1');sendpartshipconfirm($('order-items_grid'),'<?php echo $this->getUrl('adminhtml/sales_order_edit/sendpartshiprq', array('order_id'=> Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId())) ?>')" class="<?php if(count($newcoll)){ echo 'disabled ';} ?> scalable save " type="button" title="Send Partship Req"><span><span><span>Submit Order</span></span></span></button>
382
+
383
+ <?php //echo $this->getButtonHtml($this->helper('sales')->__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?></td>
384
+ </tr>
385
+ </table>
386
+ <br />
387
+ <?php }else{ ?>
388
+ <?php
389
+ $newcoll = Mage::getModel('internationalshipping/partshipreqitems')->getCollection()->addFieldToFilter('swipezoomorderid', Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId());
390
+
391
+
392
+ ?>
393
+
394
+ <div class="grid" id="order-items_grid">
395
+ <table class="data order-tables" cellspacing="0">
396
+ <thead>
397
+ <tr class="headings">
398
+ <th class="no-link">Line Item no</th>
399
+ <th colspan="2" class="no-link">Product Code</th>
400
+ <th colspan="2" class="no-link">Product Description</th>
401
+ <th class="no-link">Price</th>
402
+ <th class="no-link">Qty</th>
403
+ <th class="no-link">Sale Value</th>
404
+
405
+ </tr>
406
+ </thead>
407
+
408
+ <?php $i=0;$subtota = 0; $itemqtty = 0;?>
409
+ <?php foreach ($newcoll as $item){ $i++; ?>
410
+ <tbody class="<?php echo ($i%2)?'even':'odd' ?>">
411
+ <tr><?php $subtota += $item->getSalevalue(); ?>
412
+ <td><?php echo $item->getLineitemno() ?></td>
413
+ <td colspan="2" ><?php echo $item->getProductcode() ?></td>
414
+ <td colspan="2" ><?php echo $item->getDescription() ?></td>
415
+ <td><?php echo $this->formatPrice($item->getPrice()) ?></td>
416
+ <td><?php echo $item->getQty(); $itemqtty += $item->getQty(); ?></td>
417
+ <td><?php echo $this->formatPrice($item->getSalevalue()) ?></td>
418
+
419
+ </tr>
420
+ </tbody>
421
+ <?php } ?>
422
+ <tfoot>
423
+ <tr>
424
+ <td class="a-left" colspan="5"><?php echo $this->helper('sales')->__('Total %d product(s)', count($newcoll)) ?></td>
425
+ <?php /*?><td colspan="2" class="a-right"></td>
426
+ <td class="price"><strong><?php //echo $this->formatPrice($subtota) ?></strong></td>
427
+ <td class="price"><strong></strong></td><?php */?>
428
+ <td class="price"><strong>
429
+
430
+ </strong></td>
431
+ <td class="price"><strong>
432
+ <?php echo $itemqtty; ?>
433
+ </strong></td>
434
+ <td class="a-left"><?php // echo $this->helper('sales')->__('Subtotal:') ?><strong><?php echo $this->formatPrice($subtota) ?></strong></td>
435
+ </tr>
436
+ </tfoot>
437
+ </table>
438
+ <br />
439
+
440
+ </div>
441
+
442
+ <?php }}else{ ?>
443
+ <?php if(count($_items)>10): ?>
444
+ <p class="a-right"> <?php echo $this->getButtonHtml($this->helper('sales')->__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?> </p>
445
+ <?php endif; ?>
446
+ <div class="grid" id="order-items_grid">
447
+ <table cellspacing="0" class="data order-tables">
448
+ <col />
449
+ <col width="100" />
450
+ <col width="100" />
451
+ <col width="40" />
452
+ <col width="100" />
453
+ <col width="80" />
454
+ <col width="100" />
455
+ <col width="80" />
456
+ <thead>
457
+ <tr class="headings">
458
+ <th class="no-link" colspan="2"><?php echo $this->helper('sales')->__('Product') ?></th>
459
+ <th class="no-link"><?php echo $this->helper('sales')->__('Price') ?></th>
460
+ <th class="no-link"><?php echo $this->helper('sales')->__('Qty') ?></th>
461
+ <th class="no-link"><?php echo $this->helper('sales')->__('Subtotal') ?></th>
462
+ <th class="no-link"><?php echo $this->helper('sales')->__('Discount') ?></th>
463
+ <th class="no-link"><?php echo $this->helper('sales')->__('Row Subtotal') ?></th>
464
+ <th class="no-link last"><?php echo $this->helper('sales')->__('Action') ?></th>
465
+ </tr>
466
+ </thead>
467
+ <tfoot>
468
+ <tr>
469
+ <td class="a-left" colspan="2"><?php echo $this->helper('sales')->__('Total %d product(s)', count($_items)) ?></td>
470
+ <td colspan="2" class="a-right"><?php echo $this->helper('sales')->__('Subtotal:') ?></td>
471
+ <td class="price"><strong><?php echo $this->formatPrice($this->getSubtotal()) ?></strong></td>
472
+ <td class="price"><strong><?php echo $this->formatPrice($this->getDiscountAmount()) ?></strong></td>
473
+ <td class="price"><strong>
474
+ <?php
475
+ echo $this->formatPrice($this->getSubtotal() + $this->getDiscountAmount());
476
+ ?>
477
+ </strong></td>
478
+ <td colspan="2">&nbsp;</td>
479
+ </tr>
480
+ </tfoot>
481
+ <?php $i=0 ?>
482
+ <?php foreach ($_items as $_item):$i++ ?>
483
+ <tbody class="<?php echo ($i%2)?'even':'odd' ?>">
484
+ <tr>
485
+ <td class="first"><h5 class="title"><span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span></h5>
486
+ <div> <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?> </div>
487
+ <?php if($_item->getMessage(false)): ?>
488
+ <?php foreach ($_item->getMessage(false) as $message): ?>
489
+ <div class="<?php if($_item->getHasError()): ?>error<?php else: ?>notice<?php endif; ?>">
490
+ <div style="font-size:95%"><?php echo Mage::helper('core')->escapeHtml($message); ?></div>
491
+ </div>
492
+ <?php endforeach; ?>
493
+ <?php endif; ?></td>
494
+ <td class="a-center v-middle"><?php echo $this->getConfigureButtonHtml($_item) ?></td>
495
+ <td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
496
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
497
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
498
+ <?php endif; ?>
499
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
500
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
501
+ <?php else: ?>
502
+ <?php echo $this->formatPrice($_item->getCalculationPrice()) ?>
503
+ <?php endif; ?>
504
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
505
+ <br />
506
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
507
+ <small>
508
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
509
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br />
510
+ <?php endforeach; ?>
511
+ </small>
512
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
513
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
514
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
515
+ <?php endforeach; ?>
516
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
517
+ <small>
518
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
519
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
520
+ <?php endforeach; ?>
521
+ </small>
522
+ <?php endif; ?>
523
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
524
+ <br />
525
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
526
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
527
+ <?php endif; ?>
528
+ <?php endif; ?>
529
+ <?php endif; ?>
530
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
531
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
532
+ <br />
533
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
534
+ <?php endif; ?>
535
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
536
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
537
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
538
+ <?php else: ?>
539
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
540
+ <?php endif; ?>
541
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
542
+ <br />
543
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
544
+ <small>
545
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
546
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br />
547
+ <?php endforeach; ?>
548
+ </small>
549
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
550
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
551
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
552
+ <?php endforeach; ?>
553
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
554
+ <small>
555
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
556
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
557
+ <?php endforeach; ?>
558
+ </small>
559
+ <?php endif; ?>
560
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
561
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
562
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
563
+ <?php endif; ?>
564
+ <?php endif; ?>
565
+ <?php endif; ?>
566
+ <?php $_isCustomPrice = $this->usedCustomPriceForItem($_item) ?>
567
+ <?php if($_tier = $this->getTierHtml($_item)): ?>
568
+ <div id="item_tier_block_<?php echo $_item->getId() ?>"<?php if ($_isCustomPrice): ?> style="display:none"<?php endif; ?>> <a href="#" onclick="$('item_tier_<?php echo $_item->getId() ?>').toggle();return false;"><?php echo $this->helper('sales')->__('Tier Pricing') ?></a>
569
+ <div style="display:none" id="item_tier_<?php echo $_item->getId() ?>"><?php echo $_tier ?></div>
570
+ </div>
571
+ <?php endif; ?>
572
+ <?php if ($this->canApplyCustomPrice($_item)): ?>
573
+ <div class="nobr">
574
+ <input type="checkbox" id="item_use_custom_price_<?php echo $_item->getId() ?>"<?php if ($_isCustomPrice): ?> checked="checked"<?php endif; ?> onclick="order.toggleCustomPrice(this, 'item_custom_price_<?php echo $_item->getId() ?>', 'item_tier_block_<?php echo $_item->getId() ?>');"/>
575
+ <label class="normal" for="item_use_custom_price_<?php echo $_item->getId() ?>"><?php echo $this->helper('sales')->__('Custom Price') ?>*</label>
576
+ </div>
577
+ <?php endif; ?>
578
+ <input id="item_custom_price_<?php echo $_item->getId() ?>" name="item[<?php echo $_item->getId() ?>][custom_price]" value="<?php echo sprintf("%.2f", $this->getOriginalEditablePrice($_item))?>"<?php if (!$_isCustomPrice): ?> style="display:none" disabled="disabled"<?php endif; ?> class="input-text item-price"/></td>
579
+ <td><input name="item[<?php echo $_item->getId() ?>][qty]" class="input-text item-qty" value="<?php echo $_item->getQty()*1 ?>" maxlength="12" /></td>
580
+ <td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
581
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
582
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
583
+ <?php endif; ?>
584
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
585
+ <?php echo $this->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
586
+ <?php else: ?>
587
+ <?php echo $this->formatPrice($_item->getRowTotal()) ?>
588
+ <?php endif; ?>
589
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
590
+ <br />
591
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
592
+ <small>
593
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
594
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
595
+ <?php endforeach; ?>
596
+ </small>
597
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
598
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
599
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
600
+ <?php endforeach; ?>
601
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
602
+ <small>
603
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
604
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
605
+ <?php endforeach; ?>
606
+ </small>
607
+ <?php endif; ?>
608
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
609
+ <br />
610
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
611
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
612
+ <?php endif; ?>
613
+ <?php endif; ?>
614
+ <?php endif; ?>
615
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
616
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
617
+ <br />
618
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
619
+ <?php endif; ?>
620
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
621
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
622
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
623
+ <?php else: ?>
624
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
625
+ <?php endif; ?>
626
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
627
+ <br />
628
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
629
+ <small>
630
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
631
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
632
+ <?php endforeach; ?>
633
+ </small>
634
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
635
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
636
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
637
+ <?php endforeach; ?>
638
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
639
+ <small>
640
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
641
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
642
+ <?php endforeach; ?>
643
+ </small>
644
+ <?php endif; ?>
645
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
646
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
647
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
648
+ <?php endif; ?>
649
+ <?php endif; ?>
650
+ <?php endif; ?></td>
651
+ <td class="price"><?php echo $this->formatPrice(-$_item->getDiscountAmount()) ?><br />
652
+ <input id="item_use_discount_<?php echo $_item->getId() ?>" name="item[<?php echo $_item->getId() ?>][use_discount]"<?php if (!$_item->getNoDiscount()): ?>checked="checked"<?php endif; ?> value="1" type="checkbox" />
653
+ <label for="item_use_discount_<?php echo $_item->getId() ?>" class="normal"><?php echo $this->helper('sales')->__('Apply') ?></label></td>
654
+ <td class="price"><?php if ($this->helper('tax')->displayCartPriceExclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
655
+ <?php $_rowTotalWithoutDiscount = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount() - $_item->getTaxAmount(); ?>
656
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
657
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
658
+ <?php endif; ?>
659
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
660
+ <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition())); ?>
661
+ <?php else: ?>
662
+ <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?>
663
+ <?php endif; ?>
664
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
665
+ <br />
666
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
667
+ <small>
668
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
669
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
670
+ <?php endforeach; ?>
671
+ </small>
672
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
673
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
674
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
675
+ <?php endforeach; ?>
676
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
677
+ <small>
678
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
679
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
680
+ <?php endforeach; ?>
681
+ </small>
682
+ <?php endif; ?>
683
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
684
+ <br />
685
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
686
+ <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
687
+ <?php endif; ?>
688
+ <?php endif; ?>
689
+ <?php endif; ?>
690
+ <?php if ($this->helper('tax')->displayCartPriceInclTax($this->getStore()) || $this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
691
+ <?php if ($this->helper('tax')->displayCartBothPrices($this->getStore())): ?>
692
+ <br />
693
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
694
+ <?php endif; ?>
695
+ <?php $_incl = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount(); ?>
696
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
697
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
698
+ <?php else: ?>
699
+ <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
700
+ <?php endif; ?>
701
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
702
+ <br />
703
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
704
+ <small>
705
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
706
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br />
707
+ <?php endforeach; ?>
708
+ </small>
709
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
710
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
711
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
712
+ <?php endforeach; ?>
713
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
714
+ <small>
715
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
716
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
717
+ <?php endforeach; ?>
718
+ </small>
719
+ <?php endif; ?>
720
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
721
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br />
722
+ <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
723
+ <?php endif; ?>
724
+ <?php endif; ?>
725
+ <?php endif; ?></td>
726
+ <td class="last"><select name="item[<?php echo $_item->getId() ?>][action]" style="width:100px;">
727
+ <option value=""></option>
728
+ <option value="remove"><?php echo $this->helper('sales')->__('Remove') ?></option>
729
+ <?php if($this->getCustomerId() && $this->getMoveToCustomerStorage()): ?>
730
+ <option value="cart"><?php echo $this->helper('sales')->__('Move to Shopping Cart') ?></option>
731
+ <?php if ($this->isMoveToWishlistAllowed($_item)): ?>
732
+ <?php $wishlists = $this->getCustomerWishlists();?>
733
+ <?php if (count($wishlists) <= 1):?>
734
+ <option value="wishlist"><?php echo $this->helper('sales')->__('Move to Wishlist') ?></option>
735
+ <?php else: ?>
736
+ <optgroup label="<?php echo $this->helper('sales')->__('Move to Wishlist') ?>">
737
+ <?php foreach ($wishlists as $wishlist):?>
738
+ <option value="wishlist_<?php echo $wishlist->getId();?>"><?php echo $this->escapeHtml($wishlist->getName());?></option>
739
+ <?php endforeach;?>
740
+ </optgroup>
741
+ <?php endif; ?>
742
+ <?php endif; ?>
743
+ <?php endif; ?>
744
+ </select></td>
745
+ </tr>
746
+ <?php echo $this->getItemExtraInfo($_item)->toHtml(); ?>
747
+ </tbody>
748
+ <?php endforeach; ?>
749
+ </table>
750
+ </div>
751
+ <table cellspacing="0" width="100%">
752
+ <col width="50%" />
753
+ <col width="50%" />
754
+ <tr>
755
+ <td class="a-left"><small><?php echo $this->getInclExclTaxMessage(); ?></small></td>
756
+ <td class="a-right"><?php echo $this->getButtonHtml($this->helper('sales')->__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?></td>
757
+ </tr>
758
+ </table>
759
+ <br />
760
+ <div id="order-coupons"><?php echo $this->getChildHtml();?></div>
761
+ <?php }?>
762
+
763
+ <div class="clear"></div>
764
+ <script type="text/javascript">order.itemsOnchangeBind()</script>
765
+ </div>
766
+ <?php if ($this->isGiftMessagesAvailable()) : ?>
767
+ <script type="text/javascript">
768
+ //<![CDATA[
769
+ /**
770
+ * Retrieve gift options tooltip content
771
+ */
772
+ function getGiftOptionsTooltipContent(itemId) {
773
+ var contentLines = [];
774
+ var headerLine = null;
775
+ var contentLine = null;
776
+
777
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
778
+ if (element.down(0)) {
779
+ headerLine = element.down(0).innerHTML;
780
+ contentLine = element.down(0).next().innerHTML;
781
+ if (contentLine.length > 30) {
782
+ contentLine = contentLine.slice(0,30) + '...';
783
+ }
784
+ contentLines.push(headerLine + ' ' + contentLine);
785
+ }
786
+ });
787
+ return contentLines.join('<br/>');
788
+ }
789
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
790
+
791
+ //]]>
792
+ </script>
793
+ <?php endif; ?>
794
+ <?php endif; ?>
795
+ <?php if($nu){
796
+ $colection = Mage::getModel('internationalshipping/partshipreq')->getCollection()->addFieldToFilter('swipezoomorderid',$nu);
797
+ if(count($colection)){ ?>
798
+
799
+ <script type="text/javascript">
800
+
801
+ $$('[title="Submit Order"]').each(function(el){
802
+ el.hide();
803
+ el.addClassName("disabled");
804
+ el.removeAttribute("onclick");
805
+ el.update('<span><span><span></span>Confirm Partship Req</span></span>');
806
+ });
807
+
808
+
809
+
810
+ </script>
811
+
812
+
813
+
814
+ <?php
815
+ foreach($colection as $ord){
816
+ ?>
817
+ <div class="entry-edit-head">
818
+ <h4 class="icon-head head-payment-method">Swipezoom Order Information</h4>
819
+ </div>
820
+ <fieldset>
821
+ <div class="swipezoom-container">
822
+ <label class="progress-rate-label" for="swipezoom_insurance_taxes">Swipezoom Order #<span class="price-notice"><span class="price"> <?php echo $ord->getNewszorderid(); ?></span></span></label>
823
+ </div>
824
+ <div class="swipezoom-container">
825
+ <label class="progress-rate-label" for="swipezoom_insurance_taxes">Shipping Charges : <span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($ord->getCouriercharges()*$ord->getExcrate(),true,false); ?></span></span></label>
826
+ </div>
827
+ <div class="swipezoom-container">
828
+ <label class="progress-rate-label" for="swipezoom_insurance_taxes">Prepaid duties &amp; taxes : <span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($ord->getCourierduties()*$ord->getExcrate(),true,false); ?></span></span></label>
829
+ </div>
830
+ <div class="swipezoom-container">
831
+ <label class="progress-rate-label" for="swipezoom_insurance_taxes">Insurance :<span class="price-notice"><span class="price"> <?php echo Mage::helper('core')->currency($ord->getInsurancecharges()*$ord->getExcrate(),true,false); ?></span></span></label>
832
+ </div>
833
+ </fieldset>
834
+ <div id="partshipconfirm">
835
+ <?php
836
+ $length = 2;
837
+
838
+ $randomString = substr(str_shuffle("0123456789"), 0, $length);
839
+ ?>
840
+ <div style="float:right">
841
+ <label class="progress-rate-label" for="swipezoom_insurance_taxes"><strong>Ref No : </strong><span class="price-notice"><span class="price"> <input type="text" name="refno" value="<?php echo date('YmdHis').$randomString?>" /></span></span></label>
842
+ </div>
843
+ </div>
844
+ <div class="clear"></div><br />
845
+ <style>
846
+ .side-col{display:none;}
847
+ .page-create-order .main-col{padding:0;}
848
+ .swipezoom-container .price-notice { float: right;}
849
+ .swipezoom-container { width: 50%;}
850
+ </style>
851
+
852
+ <button style="float: right;" title="Part ship Confirm" type="button" class="scalable save" onclick="sendpartshipconfirm($('partshipconfirm'),'<?php echo $this->getUrl('adminhtml/sales_order_edit/createnew', array('order_id'=> Mage::getSingleton('adminhtml/session_quote')->getOrder()->getId())) ?>')" style=""><span><span><span>Confirm</span></span></span></button>
853
+ <?php
854
+ break;
855
+ } }
856
+ } ?>
857
+
858
+ <script type="text/javascript">
859
+ function sendpartshipconfirm(area, url) {
860
+
861
+
862
+
863
+ if($(area)) {
864
+ var fields = $(area).select('input', 'select', 'textarea');
865
+ var data = Form.serializeElements(fields, true);
866
+ url = url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true');
867
+ new Ajax.Request(url, {
868
+ parameters: $H(data),
869
+ loaderArea: area,
870
+ onSuccess: function(transport) {
871
+ try {
872
+ if (transport.responseText.isJSON()) {
873
+ var response = transport.responseText.evalJSON()
874
+ if(response.ajaxExpired && response.ajaxRedirect) {
875
+ setLocation(response.ajaxRedirect);
876
+ }
877
+ } else {
878
+ $(area).update(transport.responseText);
879
+ }
880
+ }
881
+ catch (e) {
882
+ $(area).update(transport.responseText);
883
+ }
884
+ }
885
+ });
886
+ }
887
+ }
888
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/sidebar.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <div class="entry-edit"><div class="entry-edit-head"><h4><?php echo $this->helper('sales')->__('Customer\'s Current Activities') ?></h4></div></div>
4
+ <div class="create-order-sidebar-container">
5
+ <?php if($this->getCustomerId()): ?>
6
+ <?php echo $this->getChildHtml('top_button'); ?>
7
+ <?php foreach ($this->getChild() as $_child): ?>
8
+ <?php $_alias = $_child->getBlockAlias(); ?>
9
+ <?php if ($_alias != 'top_button' && $_alias != 'bottom_button'): ?>
10
+ <div id="order-sidebar_<?php echo $_alias ?>">
11
+ <?php if($this->canDisplay($_child)): ?>
12
+ <?php echo $this->getChildHtml($_alias) ?>
13
+ <?php endif; ?>
14
+ </div>
15
+ <?php endif; ?>
16
+ <?php endforeach; ?>
17
+ <?php echo $this->getChildHtml('bottom_button'); ?>
18
+ <?php else: ?>
19
+ <?php echo $this->getChildHtml('reorder') ?>
20
+ <?php endif; ?>
21
+ </div>
22
+ <script>
23
+ function addSidebarCompositeListType() {
24
+ productConfigure.addListType('sidebar', {
25
+ urlFetch: '<?php echo $this->getUrl('*/sales_order_create/configureProductToAdd') ?>',
26
+ urlConfirm: '<?php echo $this->getUrl('*/sales_order_create/addConfigured') ?>'
27
+ });
28
+ productConfigure.addListType('sidebar_wishlist', {
29
+ urlFetch: '<?php echo $this->getUrl('*/customer_wishlist_product_composite_wishlist/configure') ?>',
30
+ urlConfirm: '<?php echo $this->getUrl('*/sales_order_create/addConfigured') ?>'
31
+ });
32
+ }
33
+
34
+ if (typeof(sidebarListTypeWorkedOn) == 'undefined') {
35
+ sidebarListTypeWorkedOn = false;
36
+ }
37
+ if (!sidebarListTypeWorkedOn) {
38
+ if (typeof(productConfigure) == 'undefined') {
39
+ Event.observe(window, 'load', function(){
40
+ setTimeout(addSidebarCompositeListType, 10);
41
+ })
42
+ } else {
43
+ addSidebarCompositeListType();
44
+ }
45
+ sidebarListTypeWorkedOn = true;
46
+ }
47
+ </script>
48
+
app/design/adminhtml/default/default/template/internationalshipping/sales/order/create/sidebar/items.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if(!$this->getCustomerId()): ?>
3
+
4
+ <div class="sub-btn-set">
5
+ <button id="id_226e371490b940c6940aa1f17861695d" title="Update Changes" type="button" class="scalable " onclick="order.sidebarApplyChanges()" style=""><span><span><span>Update Changes</span></span></span></button>
6
+ </div>
7
+ <?php endif; ?>
8
+ <div id="order-sidebar_reorder">
9
+ <div class="create-order-sidebar-block" id="sidebar_data_<?php echo $this->getDataId() ?>">
10
+ <div class="head">
11
+ <h5><?php echo $this->getHeaderText() ?> <span class="normal">(<?php echo $this->getItemCount() ?>)</span></h5>
12
+ <a href="#" title="<?php echo Mage::helper('sales')->__('Refresh') ?>" onclick="order.loadArea('sidebar_<?php echo $this->getDataId() ?>', 'sidebar_data_<?php echo $this->getDataId() ?>');return false;">
13
+ <img src="<?php echo $this->getSkinUrl('images/fam_refresh.gif') ?>" alt="<?php echo Mage::helper('sales')->__('Refresh') ?>" width="16" height="16"/>
14
+ </a>
15
+ </div>
16
+ <div class="content">
17
+ <div class="auto-scroll">
18
+ <?php if($this->getItemCount()): ?>
19
+ <table style="width:100%">
20
+ <col />
21
+ <?php if ($this->canDisplayItemQty()): ?>
22
+ <col width="20" />
23
+ <?php endif; ?>
24
+ <?php if($this->canDisplayPrice()): ?>
25
+ <col width="60" />
26
+ <?php endif; ?>
27
+ <?php if($this->canRemoveItems()): ?>
28
+ <col width="16" />
29
+ <?php endif; ?>
30
+ <col width="16" />
31
+ <tr>
32
+ <th><?php echo Mage::helper('sales')->__('Item') ?></th>
33
+ <?php if ($this->canDisplayItemQty()): ?>
34
+ <th class="a-center"><?php echo Mage::helper('sales')->__('Qty') ?></th>
35
+ <?php endif; ?>
36
+ <?php if($this->canDisplayPrice()): ?>
37
+ <th><?php echo Mage::helper('sales')->__('Price') ?></th>
38
+ <?php endif; ?>
39
+ <?php if($this->canRemoveItems()): ?>
40
+ <th class="a-center"><img src="<?php echo $this->getSkinUrl('images/fam_bin.gif') ?>" alt="<?php echo Mage::helper('sales')->__('Remove') ?>" title="<?php echo Mage::helper('sales')->__('Remove') ?>" width="16" height="16"/></th>
41
+ <?php endif; ?>
42
+ <th class="a-center"><img src="<?php echo $this->getSkinUrl('images/fam_package_go.gif') ?>" alt="<?php echo Mage::helper('sales')->__('Add To Order') ?>" title="<?php echo Mage::helper('sales')->__('Add To Order') ?>" width="16" height="16"/></th>
43
+ </tr>
44
+ <?php foreach ($this->getItems() as $_item): ?>
45
+ <tr>
46
+ <td><?php echo $this->htmlEscape($_item->getName()) ?></td>
47
+ <?php if ($this->canDisplayItemQty()): ?>
48
+ <td class="a-center">
49
+ <?php if ($_item->getProduct()->getTypeId() != Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE): ?>
50
+ <?php echo $_item->getQty()*1 ? $_item->getQty()*1 : 1 ?>
51
+ <?php endif; ?>
52
+ </td>
53
+ <?php endif; ?>
54
+ <?php if($this->canDisplayPrice()): ?>
55
+ <td><?php echo $this->convertPrice($_item->getPrice()) ?></td>
56
+ <?php endif; ?>
57
+ <?php if($this->canRemoveItems()): ?>
58
+ <td class="a-center"><input type="checkbox" name="sidebar[remove][<?php echo $this->getItemId($_item) ?>]" value="<?php echo $this->getDataId() ?>" title="<?php echo Mage::helper('sales')->__('Remove') ?>"/></td>
59
+ <?php endif; ?>
60
+ <td class="a-center">
61
+ <?php if ($_item->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE && $this->getDataId() == 'wishlist'): ?>
62
+ <a href="#" onclick="order.sidebarConfigureProduct('<?php echo 'sidebar_wishlist' ?>', <?php echo $this->getProductId($_item) ?>, <?php echo $this->getItemId($_item) ?>); return false;"><img src="<?php echo $this->getSkinUrl('images/grouped_to_order_icon.png') ?>" class="v-middle" alt="<?php echo Mage::helper('sales')->__('Configure and Add to Order') ?>" title="<?php echo Mage::helper('sales')->__('Configure and Add to Order') ?>" width="16" height="16"/></a>
63
+ <?php elseif ($_item->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE): ?>
64
+ <a href="#" onclick="order.sidebarConfigureProduct('<?php echo 'sidebar' ?>', <?php echo $this->getProductId($_item) ?>); return false;"><img src="<?php echo $this->getSkinUrl('images/grouped_to_order_icon.png') ?>" class="v-middle" alt="<?php echo Mage::helper('sales')->__('Configure and Add to Order') ?>" title="<?php echo Mage::helper('sales')->__('Configure and Add to Order') ?>" width="16" height="16"/></a>
65
+ <?php else: ?>
66
+ <input type="checkbox" name="sidebar[<?php echo $this->getSidebarStorageAction() ?>][<?php echo $this->getIdentifierId($_item) ?>]" value="<?php echo $this->canDisplayItemQty() ? $_item->getQty()*1 : 1 ?>" title="<?php echo Mage::helper('sales')->__('Add To Order') ?>"/>
67
+ <?php endif; ?>
68
+ </td>
69
+ </tr>
70
+ <?php endforeach; ?>
71
+ </table>
72
+ <?php else: ?>
73
+ <p class="center"><?php echo Mage::helper('sales')->__('No items') ?></p>
74
+ <?php endif ?>
75
+ </div>
76
+ <?php if ($this->getItemCount() && $this->canRemoveItems()): ?>
77
+ <?php echo $this->getChildHtml('empty_customer_cart_button'); ?>
78
+ <?php endif; ?>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+
84
+
85
+ <?php if(!$this->getCustomerId()): ?>
86
+ <div class="sub-btn-set">
87
+ <button id="" title="Update Changes" type="button" class="scalable " onclick="order.sidebarApplyChanges()" style=""><span><span><span>Update Changes</span></span></span></button>
88
+ </div>
89
+
90
+
91
+ <?php endif; ?>
app/design/adminhtml/default/default/template/internationalshipping/shipment/form.phtml ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
3
+ <?php echo $this->getBlockHtml('formkey')?>
4
+ <?php $_order = $this->getShipment()->getOrder() ?>
5
+ <?php echo $this->getChildHtml('order_info') ?>
6
+
7
+
8
+ <div class="box-left">
9
+ <!--Billing Address-->
10
+ <div class="entry-edit">
11
+ <div class="entry-edit-head">
12
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
13
+ </div>
14
+ <fieldset>
15
+ <div><?php echo $this->getPaymentHtml() ?></div>
16
+ <div><?php echo Mage::helper('sales')->__('The order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
17
+ </fieldset>
18
+ </div>
19
+ </div>
20
+ <div class="box-right">
21
+ <!--Shipping Address-->
22
+ <div class="entry-edit">
23
+ <div class="entry-edit-head">
24
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
25
+ </div>
26
+ <fieldset>
27
+ <div>
28
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
29
+ <?php // echo $this->helper('sales')->__('Total Shipping Charges'); ?>
30
+
31
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
32
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
33
+ <?php else: ?>
34
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
35
+ <?php endif; ?>
36
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
37
+ <br />
38
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
39
+ <?php echo $_excl; ?>
40
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
41
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
42
+ <?php endif; ?>
43
+ <br />
44
+ <?php
45
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
46
+ if($szOrderId){
47
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
48
+ if(count($counts)){
49
+ foreach($counts as $sh) {
50
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
51
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
52
+ }
53
+ }
54
+ }
55
+
56
+ ?>
57
+ </div>
58
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){}else{?>
59
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
60
+ <?php } ?>
61
+ </fieldset>
62
+ </div>
63
+ </div>
64
+ <div class="clear"></div>
65
+ <?php
66
+ $shippingMethod = $_order->getData("shipping_method") ;
67
+ // if(strpos($shippingMethod,"swipezoom") !== FALSE){
68
+ if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
69
+ <div class="entry-edit">
70
+ <div class="entry-edit-head">
71
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
72
+ </div><fieldset>
73
+
74
+ <div class="swipezoom-container">
75
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
76
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
77
+ </div>
78
+ <div class="swipezoom-container">
79
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
80
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
81
+ </div>
82
+ <div class="swipezoom-container">
83
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
84
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
85
+ </div>
86
+
87
+ <div class="swipezoom-container">
88
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
89
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
90
+ </div>
91
+ <div class="swipezoom-container">
92
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
93
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
94
+ </div>
95
+ <div class="swipezoom-container">
96
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
97
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
98
+ </div>
99
+ <div class="swipezoom-container">
100
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
101
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
102
+ </span></span></label>
103
+ </div>
104
+
105
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
106
+ <div class="swipezoom-container">
107
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
108
+ </span></span></label>
109
+ </div>
110
+ <?php endif; ?>
111
+ </fieldset>
112
+ </div>
113
+
114
+ <?php } ?>
115
+ <?php
116
+ $swipwzoomorder = $_order->getSwipezoomOrderNumberTemp();
117
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
118
+ if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && count($_items)){ ?>
119
+ <div class="clear"></div>
120
+ <div class="entry-edit">
121
+ <div class="entry-edit-head">
122
+ <?php
123
+ $_itemsGridLabel1 = 'Items Packing Detail';
124
+ ?>
125
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel1) ?></h4>
126
+ </div>
127
+ </div>
128
+ <style>
129
+ .entry-edit-head .tools a{display:none;}
130
+ .swipezoom-container .price-notice { float: right;}
131
+ .swipezoom-container { width: 50%;}
132
+ </style>
133
+ <div id="swipezoom_grid_container">
134
+ <?php echo $this->getChildHtml('swipezoomordergrid') ?>
135
+ </div>
136
+
137
+ <div class="clear"></div>
138
+ <?php }else{ ?>
139
+ <div class="entry-edit">
140
+ <div class="entry-edit-head">
141
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Ship') ?></h4>
142
+ </div>
143
+ </div>
144
+ <?php } ?>
145
+ <div id="ship_items_container">
146
+ <?php echo $this->getItemsHtml() ?>
147
+ </div>
148
+ </form>
149
+ <?php echo $this->getChildHtml('shipment_packaging') ?>
150
+ <script type="text/javascript">
151
+ //<![CDATA[
152
+ document.observe("dom:loaded", function() {
153
+ setTimeout(function(){
154
+ packaging.setConfirmPackagingCallback(function(){
155
+ packaging.setParamsCreateLabelRequest($('edit_form').serialize(true));
156
+ packaging.sendCreateLabelRequest();
157
+ });
158
+ packaging.setLabelCreatedCallback(function(response){
159
+ setLocation("<?php echo $this->getUrl(
160
+ '*/sales_order/view',
161
+ array('order_id' => $this->getShipment()->getOrderId())
162
+ ); ?>");
163
+ });
164
+ packaging.setCancelCallback(function() {
165
+ packaging.cleanPackages();
166
+ $('create_shipping_label').checked = false;
167
+ toggleCreateLabelCheckbox();
168
+ });
169
+ packaging.setItemQtyCallback(function(itemId){
170
+ var item = $$('[name="shipment[items]['+itemId+']"]')[0];
171
+ if (item && !isNaN(item.value)) {
172
+ return item.value;
173
+ }
174
+ });
175
+ }, 500);
176
+ });
177
+
178
+ editForm = new varienForm('edit_form');
179
+ //]]>
180
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/shipment/grid.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="grid np">
3
+ <div class="hor-scroll">
4
+ <table cellspacing="0" class="data order-tables">
5
+ <col />
6
+ <col width="1" />
7
+ <col width="1" />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <thead>
14
+ <tr class="headings">
15
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
16
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
17
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
18
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
19
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
20
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
21
+ </tr>
22
+ </thead>
23
+ <?php
24
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
25
+ $order= Mage::getModel('sales/order')->load($orderid);
26
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
27
+
28
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder); ?>
29
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
30
+ <?php $_i=0;foreach ($_items as $_item): ?>
31
+ <?php if(!$_item->getProductcode()){break;}
32
+ $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode());
33
+ if(!$products){ echo "<tr ><td colspan='6'>Somthing wrong Happen - Product not found.</td></tr>"; break;}
34
+ ?>
35
+ <?php $_i++; ?>
36
+ <tr class="border">
37
+ <td><?php echo $_i ?></td>
38
+ <td><?php echo $_item->getBoxcode() ?></td>
39
+ <td><?php echo $_item->getBoxno() ?></td>
40
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); //$productname = $_Pdetails->getName();
41
+ // $_item->getProductname() ?></td>
42
+ <td><?php echo $_item->getProductcode() ?></td>
43
+ <td><?php echo $_item->getProductqty() ?></td>
44
+ </tr>
45
+ <?php endforeach; ?>
46
+ </tbody>
47
+ </table>
48
+ </div>
49
+ </div>
app/design/adminhtml/default/default/template/internationalshipping/shipment/info.phtml ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php
4
+ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
5
+ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
6
+ ?>
7
+ <div class="box-left">
8
+ <!--Order Information-->
9
+ <div class="entry-edit">
10
+
11
+ <?php if ($_order->getEmailSent()):
12
+ $_email = Mage::helper('sales')->__('the order confirmation email was sent');
13
+ else:
14
+ $_email = Mage::helper('sales')->__('the order confirmation email is not sent');
15
+ endif; ?>
16
+ <div class="entry-edit-head">
17
+ <?php if ($this->getNoUseOrderLink()): ?>
18
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?><?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ }else{ ?> (<?php echo $_email ?>) <?php } ?></h4>
19
+ <?php else: ?>
20
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
21
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?>
22
+ <style>
23
+ .entry-edit-head .tools a{display:none;}
24
+ </style>
25
+ <?php }else{ ?> <strong>(<?php echo $_email ?>)</strong><?php } ?>
26
+ <?php endif; ?>
27
+ </div>
28
+
29
+
30
+ <div class="fieldset">
31
+ <table cellspacing="0" class="form-list">
32
+ <tr>
33
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
34
+ <td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
35
+ </tr>
36
+ <?php if ($orderAdminDate != $orderStoreDate):?>
37
+ <tr>
38
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
39
+ <td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
40
+ </tr>
41
+ <?php endif;?>
42
+ <tr>
43
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
44
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
45
+ </tr>
46
+ <tr>
47
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
48
+ <td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
49
+ </tr>
50
+ <?php if($_order->getRelationChildId()): ?>
51
+ <tr>
52
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
53
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
54
+ <?php echo $_order->getRelationChildRealId() ?>
55
+ </a></td>
56
+ </tr>
57
+ <?php endif; ?>
58
+ <?php if($_order->getRelationParentId()): ?>
59
+ <tr>
60
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
61
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
62
+ <?php echo $_order->getRelationParentRealId() ?>
63
+ </a></td>
64
+ </tr>
65
+ <?php endif; ?>
66
+ <?php if($_order->getRemoteIp() && $this->shouldDisplayCustomerIp()): ?>
67
+ <tr>
68
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
69
+ <td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?></strong></td>
70
+ </tr>
71
+ <?php endif; ?>
72
+ <?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
73
+ <tr>
74
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
75
+ <td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
76
+ </tr>
77
+ <?php endif; ?>
78
+ <?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
79
+ <tr>
80
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
81
+ <td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
82
+ </tr>
83
+ <?php endif; ?>
84
+ <?php
85
+ if($_order->getSwipezoomOrderNumberTemp()){
86
+ $swipezoomparentorder = Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('swipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
87
+ $swipezoomparentorder1= Mage::getModel('internationalshipping/swipezoomcreditmemo')->getCollection()->addFieldToFilter('refswipezoomorderid',$_order->getSwipezoomOrderNumberTemp());
88
+ if(count($swipezoomparentorder)){
89
+ foreach($swipezoomparentorder as $parentorder){
90
+ $paretorderid = $parentorder->getReforderno();
91
+ break;
92
+ }
93
+ $incrementid = Mage::getModel('sales/order')->load($paretorderid)->getIncrementId(); ?>
94
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Refund Order: ') ?></label></td>
95
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$paretorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
96
+
97
+ <?php
98
+ }elseif(count($swipezoomparentorder1)){
99
+
100
+ foreach($swipezoomparentorder1 as $parentorder){
101
+ $childorderid = $parentorder->getRealorderno();
102
+ break;
103
+ }
104
+ $incrementid = Mage::getModel('sales/order')->load($childorderid)->getIncrementId(); ?>
105
+ <tr> <td class="label"><label><?php echo Mage::helper('sales')->__('Parent Order: ') ?></label></td>
106
+ <td class="value"><a href="<?php echo $this->getUrl('adminhtml/sales_order/view',array('order_id'=>$childorderid))?>"><strong># <?php echo $incrementid; ?></strong></a></td> </tr>
107
+ <tr>
108
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Swipezoom Rog Order No: ') ?></label></td>
109
+ <td class="value"><strong><?php echo $_order->getSwipezoomOrderNumberTemp(); ?></strong></td>
110
+ </tr>
111
+ <?php } } ?>
112
+ </table>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ <div class="box-right">
117
+ <!--Account Information-->
118
+ <div class="entry-edit">
119
+ <div class="entry-edit-head">
120
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
121
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
122
+ </div>
123
+ <div class="fieldset">
124
+ <div class="hor-scroll">
125
+ <table cellspacing="0" class="form-list">
126
+ <tr>
127
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
128
+ <td class="value">
129
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
130
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></a>
131
+ <?php else: ?>
132
+ <strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong>
133
+ <?php endif; ?>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
138
+ <td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
139
+ </tr>
140
+ <?php if ($_groupName = $this->getCustomerGroupName()) : ?>
141
+ <tr>
142
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
143
+ <td class="value"><strong><?php echo $_groupName ?></strong></td>
144
+ </tr>
145
+ <?php endif; ?>
146
+ <?php foreach ($this->getCustomerAccountData() as $data):?>
147
+ <tr>
148
+ <td class="label"><label><?php echo $data['label'] ?></label></td>
149
+ <td class="value"><strong><?php echo $data['value'] ?></strong></td>
150
+ </tr>
151
+ <?php endforeach;?>
152
+ </table>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ <div class="clear"></div>
158
+
159
+ <div class="box-left">
160
+ <!--Billing Address-->
161
+ <div class="entry-edit">
162
+ <div class="entry-edit-head">
163
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
164
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
165
+ </div>
166
+ <fieldset>
167
+ <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
168
+ </fieldset>
169
+ </div>
170
+ </div>
171
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
172
+ <div class="box-right">
173
+ <!--Shipping Address-->
174
+ <div class="entry-edit">
175
+ <div class="entry-edit-head">
176
+ <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
177
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
178
+ </div>
179
+ <fieldset>
180
+ <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
181
+ </fieldset>
182
+ </div>
183
+ </div>
184
+ <div class="clear"></div>
185
+ <?php endif; ?>
app/design/adminhtml/default/default/template/internationalshipping/shipment/items.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getShipment()->getOrder() ?>
3
+
4
+ <?php
5
+ $swipwzoomorder = $_order->getSwipezoomOrderNumberTemp();
6
+ $_items1 = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder);
7
+ if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && count($_items1)){ }else{ ?>
8
+ <div class="grid np">
9
+ <div class="hor-scroll">
10
+ <table cellspacing="0" class="data order-tables">
11
+ <col />
12
+ <col width="1" />
13
+ <col width="1" />
14
+ <?php if (!$this->canShipPartiallyItem()): ?>
15
+ <col width="20" />
16
+ <?php endif; ?>
17
+ <thead>
18
+ <tr class="headings">
19
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
20
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
21
+ <th<?php if ($this->isShipmentRegular()): ?> class="last"<?php endif; ?>><span class="nobr"><?php echo $this->helper('sales')->__('Qty to Ship') ?></span></th>
22
+
23
+ <?php if (!$this->canShipPartiallyItem()): ?>
24
+ <th class="a-center last"><span class="nobr"><?php echo $this->helper('sales')->__('Ship') ?></span></th>
25
+ <?php endif; ?>
26
+
27
+ </tr>
28
+ </thead>
29
+ <?php $_items = $this->getShipment()->getAllItems() ?>
30
+ <?php $_i=0;foreach ($_items as $_item): if ($_item->getOrderItem()->getIsVirtual() || $_item->getOrderItem()->getParentItem()): continue; endif; $_i++ ?>
31
+ <tbody class="<?php echo $_i%2?'odd':'even' ?>">
32
+ <?php echo $this->getItemHtml($_item) ?>
33
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
34
+ </tbody>
35
+ <?php endforeach; ?>
36
+ </table>
37
+ </div>
38
+ </div>
39
+ <?php } ?>
40
+ <br />
41
+ <div class="box-left entry-edit">
42
+ <div class="entry-edit-head"><h4><?php echo $this->__('Shipment Comments') ?></h4></div>
43
+ <fieldset>
44
+ <div id="order-history_form">
45
+ <span class="field-row">
46
+ <label class="normal" for="shipment_comment_text"><?php echo Mage::helper('sales')->__('Shipment Comments') ?></label>
47
+ <textarea id="shipment_comment_text" name="shipment[comment_text]" rows="3" cols="5" style="height:6em; width:99%;"><?php echo $this->getShipment()->getCommentText(); ?></textarea>
48
+ </span>
49
+ <div class="clear"></div>
50
+ </div>
51
+ </fieldset>
52
+ </div>
53
+
54
+ <div class="box-right entry-edit">
55
+ <div class="order-totals">
56
+ <div class="order-totals-bottom">
57
+ <?php if ($this->canCreateShippingLabel()): ?>
58
+ <p>
59
+ <label class="normal" for="create_shipping_label"><?php echo Mage::helper('sales')->__('Create Shipping Label') ?></label>
60
+ <input id="create_shipping_label" name="shipment[create_shipping_label]" value="1" type="checkbox" onclick="toggleCreateLabelCheckbox();" />
61
+ </p>
62
+ <?php endif ?>
63
+ <p>
64
+ <label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
65
+ <input id="notify_customer" name="shipment[comment_customer_notify]" value="1" type="checkbox" />
66
+ </p>
67
+ <?php if ($this->canSendShipmentEmail() && !$_order->getSwipezoomOrderNumberTemp()): ?>
68
+ <p>
69
+ <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Shipment') ?></label>
70
+ <input id="send_email" name="shipment[send_email]" value="1" type="checkbox" />
71
+ </p>
72
+ <?php endif; ?>
73
+ <div class="a-right">
74
+ <?php echo $this->getChildHtml('submit_button') ?>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <div class="clear"></div>
80
+ <script type="text/javascript">
81
+ //<![CDATA[
82
+ var sendEmailCheckbox = $('send_email');
83
+ if (sendEmailCheckbox) {
84
+ var notifyCustomerCheckbox = $('notify_customer');
85
+ var shipmentCommentText = $('shipment_comment_text');
86
+ Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
87
+ bindSendEmail();
88
+ }
89
+ function bindSendEmail()
90
+ {
91
+ if (sendEmailCheckbox.checked == true) {
92
+ notifyCustomerCheckbox.disabled = false;
93
+ //shipmentCommentText.disabled = false;
94
+ }
95
+ else {
96
+ notifyCustomerCheckbox.disabled = true;
97
+ //shipmentCommentText.disabled = true;
98
+ }
99
+ }
100
+ function toggleCreateLabelCheckbox(){
101
+ var checkbox = $('create_shipping_label');
102
+ var submitButton = checkbox.up('.order-totals').select('.submit-button span')[0];
103
+ if (checkbox.checked) {
104
+ submitButton.innerText += '...';
105
+ } else {
106
+ submitButton.innerText = submitButton.innerText.replace(/\.\.\.$/, '');
107
+ }
108
+ }
109
+ function submitShipment(btn){
110
+ var checkbox = $(btn).up('.order-totals').select('#create_shipping_label')[0];
111
+ if (checkbox && checkbox.checked) {
112
+ packaging.showWindow();
113
+ } else if(editForm.submit()) {
114
+ disableElements('submit-button');
115
+ }
116
+ }
117
+ //]]>
118
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/shipment/view/form.phtml ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getShipment()->getOrder() ?>
3
+ <?php echo $this->getChildHtml('order_info') ?>
4
+
5
+ <div class="box-left">
6
+ <!--Billing Address-->
7
+ <div class="entry-edit">
8
+ <div class="entry-edit-head">
9
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
10
+ </div>
11
+ <fieldset>
12
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
13
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
14
+ </fieldset>
15
+ </div>
16
+ </div>
17
+ <div class="box-right">
18
+ <!--Shipping Address-->
19
+ <div class="entry-edit">
20
+ <div class="entry-edit-head">
21
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping and Tracking Information') ?></h4>
22
+ </div>
23
+ <fieldset>
24
+ <div>
25
+ <?php if($this->getShipment()->getTracksCollection()->count()): ?>
26
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($this->getShipment()) ?>','trackshipment','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track this shipment') ?>"><?php echo $this->__('Track this shipment') ?></a>
27
+ <br/>
28
+ <?php endif; ?>
29
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
30
+
31
+
32
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
33
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
34
+ <?php else: ?>
35
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
36
+ <?php endif; ?>
37
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
38
+ <br />
39
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
40
+ <?php echo $_excl; ?>
41
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
42
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
43
+ <?php endif; ?>
44
+ <br />
45
+ <?php
46
+ $szOrderId = $_order->getSwipezoomOrderNumberTemp();
47
+ if($szOrderId){
48
+ $counts = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$szOrderId);
49
+ if(count($counts)){
50
+ foreach($counts as $sh) {
51
+ echo "Pickup Due : ".$sh->getPickupdue()."</br>";
52
+ echo "Airway Bill # : ".$sh->getCourierwaybillno()."</br>";
53
+ }
54
+ }
55
+ }
56
+
57
+ ?>
58
+ </div>
59
+ <?php if ($this->canCreateShippingLabel()): ?>
60
+ <div style="text-align: center; margin: 10px 0;">
61
+ <?php echo $this->getCreateLabelButton()?>
62
+ <?php if ($this->getShipment()->getShippingLabel()): ?>
63
+ <?php echo $this->getPrintLabelButton() ?>
64
+ <?php endif ?>
65
+ <?php if ($this->getShipment()->getPackages()): ?>
66
+ <?php echo $this->getShowPackagesButton() ?>
67
+ <?php endif ?>
68
+ </div>
69
+ <?php endif ?>
70
+ <?php if(!$szOrderId){ ?>
71
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
72
+ <?php } ?>
73
+ </fieldset>
74
+ <?php echo $this->getChildHtml('shipment_packaging') ?>
75
+ <script type="text/javascript">
76
+ //<![CDATA[
77
+ document.observe("dom:loaded", function() {
78
+ setTimeout(function(){
79
+ packaging.setConfirmPackagingCallback(function(){
80
+ packaging.sendCreateLabelRequest();
81
+ });
82
+ packaging.setLabelCreatedCallback(function(response){
83
+ setLocation("<?php echo $this->getUrl(
84
+ '*/sales_order_shipment/view',
85
+ array('shipment_id' => $this->getShipment()->getId())
86
+ ); ?>");
87
+ });
88
+ }, 500);
89
+ });
90
+ //]]>
91
+ </script>
92
+ </div>
93
+ </div>
94
+ <div class="clear"></div>
95
+ <?php
96
+ $shippingMethod = $_order->getData("shipping_method") ;
97
+ if(strpos($shippingMethod,"swipezoom") !== FALSE){ ?>
98
+ <div class="entry-edit">
99
+ <div class="entry-edit-head">
100
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Swipezoom Order Information') ?></h4>
101
+ </div><fieldset>
102
+
103
+ <div class="swipezoom-container">
104
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Swipezoom Order #') ?><span class="price-notice"><span class="price">
105
+ <?php echo $_order->getSwipezoomOrderNumberTemp(); ?></span></span></label>
106
+ </div>
107
+ <div class="swipezoom-container">
108
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Shipping Charges : ') ?><span class="price-notice"><span class="price">
109
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderShippingCharges(),true,false); ?></span></span></label>
110
+ </div>
111
+ <div class="swipezoom-container">
112
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes : ') ?><span class="price-notice"><span class="price">
113
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderDutiesTaxes(),true,false); ?></span></span></label>
114
+ </div>
115
+
116
+ <div class="swipezoom-container">
117
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance :') ?><span class="price-notice"><span class="price">
118
+ <?php echo Mage::helper('core')->currency($_order->getSwipezoomOrderInsuranceCharges(),true,false); ?></span></span></label>
119
+ </div>
120
+ <div class="swipezoom-container">
121
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Duties Taxes Prepaid :') ?><span class="price-notice"><span class="price">
122
+ <?php echo ($_order->getSwipezoomOrderDutiesTaxPrepaid() == "Y")?"Yes":"No"; ?></span></span></label>
123
+ </div>
124
+ <div class="swipezoom-container">
125
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance Paid :') ?><span class="price-notice"><span class="price">
126
+ <?php echo ($_order->getSwipezoomOrderInsurancePaid() == "Y")?"Yes":"No"; ?></span></span></label>
127
+ </div>
128
+ <div class="swipezoom-container">
129
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Confirmation Call :') ?><span class="price-notice"><span class="price">
130
+ <?php echo ($_order->getSwipezoomOrderConfirmed() == "1")?"Ok":"Error"; ?>
131
+ </span></span></label>
132
+ </div>
133
+
134
+ <?php if($_order->getSwipezoomOrderConfirmed() == 0): ?>
135
+ <div class="swipezoom-container">
136
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Error Message :') ?><span class="price-notice"><span class="price"><?php echo $_order->getSwipezoomOrderConfirmedErrormessage();; ?>
137
+ </span></span></label>
138
+ </div>
139
+ <?php endif; ?>
140
+ </fieldset>
141
+ <style>
142
+ .entry-edit-head .tools a{display:none;}
143
+ .swipezoom-container .price-notice { float: right;}
144
+ .swipezoom-container { width: 50%;}
145
+ </style>
146
+ </div>
147
+
148
+ <?php } ?>
149
+ <div class="clear"></div>
150
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && $_order->getSwipezoomOrderCreditmemo() < 3){ ?>
151
+ <div class="entry-edit">
152
+ <div class="entry-edit-head">
153
+ <?php
154
+ $_itemsGridLabel1 = 'Items Packing Detail';
155
+ ?>
156
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel1) ?></h4>
157
+ </div>
158
+ </div>
159
+
160
+ <div id="swipezoom_grid_container">
161
+ <?php echo $this->getChildHtml('swipezoomordergrid') ?>
162
+ </div>
163
+
164
+ <div class="clear"></div>
165
+ <?php }else{ ?>
166
+ <div class="entry-edit">
167
+ <div class="entry-edit-head">
168
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Shipped') ?></h4>
169
+ </div>
170
+ </div>
171
+ <?php } ?>
172
+ <?php echo $this->getChildHtml('shipment_items') ?>
173
+ <?php echo $this->getChildHtml('shipment_packed') ?>
174
+
175
+ <div class="box-left entry-edit">
176
+ <div class="entry-edit-head"><h4><?php echo $this->__('Shipment History') ?></h4></div>
177
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
178
+ </div>
179
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/internationalshipping/shipment/view/grid.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="grid np">
3
+ <div class="hor-scroll">
4
+ <table cellspacing="0" class="data order-tables">
5
+ <col />
6
+ <col width="1" />
7
+ <col width="1" />
8
+ <col width="1" />
9
+ <col width="1" />
10
+ <col width="1" />
11
+ <col width="1" />
12
+ <col width="1" />
13
+ <thead>
14
+ <tr class="headings">
15
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
16
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
17
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
18
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
19
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
20
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
21
+ </tr>
22
+ </thead>
23
+ <?php
24
+ $shipment_id = Mage::app()->getRequest()->getParam('shipment_id');
25
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipment_id);
26
+ // $orderid = Mage::app()->getRequest()->getParam('order_id');
27
+ $order= $shipment->getOrder(); //Mage::getModel('sales/order')->load($orderid);
28
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
29
+
30
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder); ?>
31
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
32
+ <?php $_i=0;foreach ($_items as $_item): ?>
33
+ <?php $_i++; ?>
34
+ <tr class="border">
35
+ <td><?php echo $_i ?></td>
36
+ <td><?php echo $_item->getBoxcode() ?></td>
37
+ <td><?php echo $_item->getBoxno() ?></td>
38
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); //$productname = $_Pdetails->getName();
39
+ // $_item->getProductname() ?></td>
40
+ <td><?php echo $_item->getProductcode() ?></td>
41
+ <td><?php echo $_item->getProductqty() ?></td>
42
+ </tr>
43
+ <?php endforeach; ?>
44
+ </tbody>
45
+ </table>
46
+ </div>
47
+ </div>
48
+ </br>
49
+
50
+ <script type="text/javascript">
51
+ Event.observe(document,"dom:loaded",function(){
52
+ <?php if($order->getSwipezoomOrderCreditmemo()<3 && $order->getSwipezoomOrderNumberTemp()){ ?>
53
+ $$('[title="Print"]').each(function(el){
54
+ el.update('<span><span><span></span>Print Packing Instruction</span></span>');
55
+ });
56
+ <?php }else{ ?>
57
+ $$('[title="Print"]').each(function(el){
58
+ el.remove();
59
+ });
60
+ <?php } ?>
61
+ });
62
+
63
+
64
+ </script>
app/design/adminhtml/default/default/template/internationalshipping/shipment/view/items.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getShipment()->getOrder() ?>
3
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp() && $_order->getSwipezoomOrderCreditmemo() < 3){ }else{ ?>
4
+ <div class="grid np">
5
+ <div class="hor-scroll">
6
+ <table cellspacing="0" class="data order-tables">
7
+ <col />
8
+ <col width="1" />
9
+ <thead>
10
+ <tr class="headings">
11
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
12
+ <th class="a-center last"><span class="nobr"><?php echo $this->helper('sales')->__('Qty Shipped') ?></span></th>
13
+ </tr>
14
+ </thead>
15
+ <?php $_items = $this->getShipment()->getAllItems() ?>
16
+ <?php $_i=0;foreach ($_items as $_item): if ($_item->getOrderItem()->getIsVirtual() || $_item->getOrderItem()->getParentItem()): continue; endif; $_i++ ?>
17
+ <tbody class="<?php echo $_i%2?'odd':'even' ?>">
18
+ <?php echo $this->getItemHtml($_item) ?>
19
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
20
+ </tbody>
21
+ <?php endforeach; ?>
22
+ </table>
23
+ </div>
24
+ </div>
25
+ <br />
26
+ <?php } ?>
app/design/frontend/base/default/layout/cardpayment.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <checkout_onepage_paymentmethod>
6
+ <remove name="right"/>
7
+ <remove name="left"/>
8
+
9
+ <block type="checkout/onepage_payment_methods" name="root" output="toHtml" template="cardpayment/onepage/payment/methods.phtml">
10
+ <action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
11
+ </block>
12
+ </checkout_onepage_paymentmethod>
13
+ </layout>
app/design/frontend/base/default/layout/internationalshipping.xml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <checkout_cart_index>
6
+ <remove name="checkout.cart.shipping" />
7
+ </checkout_cart_index>
8
+ <checkout_onepage_shippingmethod>
9
+ <!-- Mage_Checkout -->
10
+ <remove name="right"/>
11
+ <remove name="left"/>
12
+
13
+ <block type="checkout/onepage_shipping_method_available" name="root" output="toHtml" template="internationalshipping/onepage/shipping_method/available.phtml" />
14
+ </checkout_onepage_shippingmethod>
15
+ <checkout_onepage_index>
16
+ <reference name="head">
17
+ <action method="addCss"><stylesheet>internationalshipping/css/jquery.autocomplete.css</stylesheet></action>
18
+ <action method="addCss"><stylesheet>internationalshipping/css/sz_common.css</stylesheet></action>
19
+ <action method="addJs"><script>swipezoom/autocomplete/jquery-1.8.2.min.js</script></action>
20
+ <action method="addJs"><script>swipezoom/autocomplete/jquery.autocomplete.js</script></action>
21
+ <action method="addJs"><script>swipezoom/jquery.creditCardValidator.js</script></action>
22
+ <action method="addJs"><script>swipezoom/sz_common.js</script></action>
23
+ </reference>
24
+
25
+ <reference name="checkout.onepage.billing">
26
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active"><template>internationalshipping/checkout/onepage/billing.phtml</template></action>
27
+ </reference>
28
+ <reference name="checkout.onepage.shipping">
29
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active"><template>internationalshipping/checkout/onepage/shipping.phtml</template></action>
30
+ </reference>
31
+ </checkout_onepage_index>
32
+ <checkout_onepage_progress>
33
+ <!-- Mage_Checkout -->
34
+ <remove name="right"/>
35
+ <remove name="left"/>
36
+
37
+ <block type="checkout/onepage_progress" ifconfig="carriers/swipezoom/active" name="root" output="toHtml" template="internationalshipping/onepage/progress.phtml" >
38
+ <block type="checkout/onepage_payment_info" name="payment_info">
39
+ <action method="setInfoTemplate"><method></method><template></template></action>
40
+ </block>
41
+ </block>
42
+ </checkout_onepage_progress>
43
+
44
+
45
+ <checkout_onepage_success translate="label">
46
+ <block type="checkout/onepage_success" ifconfig="carriers/swipezoom/active" name="checkout.success" template="internationalshipping/success.phtml"/>
47
+ </checkout_onepage_success>
48
+ <internationalshipping_index_index>
49
+ <reference name="content">
50
+ <block type="checkout/onepage_billing" name="internationalshipping" template="internationalshipping/test.phtml" />
51
+ </reference>
52
+ </internationalshipping_index_index>
53
+ <internationalshipping_index_cancel>
54
+ <label>Cancel Order</label>
55
+ <reference name="root">
56
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
57
+ </reference>
58
+ <reference name="content">
59
+ <block type="checkout/onepage_billing" name="cancelorder" template="internationalshipping/cancel.phtml" />
60
+ </reference>
61
+ </internationalshipping_index_cancel>
62
+ <internationalshipping_index_printall>
63
+ <label>Cancel Order</label>
64
+ <reference name="root">
65
+ <action method="setTemplate"><template>page/popup.phtml</template></action>
66
+ </reference>
67
+ <reference name="content">
68
+ <block type="checkout/onepage_billing" name="printall" template="internationalshipping/printall.phtml" />
69
+ </reference>
70
+ </internationalshipping_index_printall>
71
+ <internationalshipping_index_openpdf>
72
+ <label>Cancel Order</label>
73
+ <reference name="root">
74
+ <action method="setTemplate"><template>page/popup.phtml</template></action>
75
+ </reference>
76
+ <reference name="content">
77
+ <block type="checkout/onepage_billing" name="openpdf" template="internationalshipping/openpdf.phtml" />
78
+ </reference>
79
+ </internationalshipping_index_openpdf>
80
+ <internationalshipping_index_printpack>
81
+ <label>Print packages</label>
82
+ <reference name="root">
83
+ <action method="setTemplate"><template>page/popup.phtml</template></action>
84
+ </reference>
85
+ <reference name="content">
86
+ <block type="sales/order_print" name="sales.order.print" template="internationalshipping/sales/order/print.phtml">
87
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>sales/order/items/renderer/default.phtml</template></action>
88
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>sales/order/items/renderer/default.phtml</template></action>
89
+ <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
90
+ <action method="setLabelProperties"><value>colspan="5" class="a-right"</value></action>
91
+ <action method="setValueProperties"><value>class="last a-right"</value></action>
92
+ <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
93
+ <action method="setIsPlaneMode"><value>1</value></action>
94
+ </block>
95
+ </block>
96
+ </block>
97
+ </reference>
98
+ <block type="core/text_list" name="additional.product.info" />
99
+ </internationalshipping_index_printpack>
100
+ <shipping_tracking_popup translate="label">
101
+ <reference name="shipping.tracking.popup">
102
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active"><template>internationalshipping/shipping/tracking/popup.phtml</template></action>
103
+ </reference>
104
+ </shipping_tracking_popup>
105
+ <sales_order_print translate="label">
106
+ <reference name="sales.order.print">
107
+ <action method="setTemplate" ifconfig="carriers/swipezoom/active"><template>internationalshipping/sales/order/print.phtml</template></action>
108
+ </reference>
109
+ </sales_order_print>
110
+ </layout>
app/design/frontend/base/default/template/cardpayment/ccsave.phtml ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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 design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ if (version_compare(Mage::getVersion(), '1.9', '<')) {
28
+ // if version older than 1.9 then apply a different css
29
+ ?>
30
+ <style type="text/css">
31
+ .sz_logo {
32
+ margin-right:208px;
33
+ }
34
+ form #cardpayment_cc_number {
35
+ width: 231px !important;
36
+ height: 28px !important;
37
+ }
38
+ form #cardpayment_cc_owner {
39
+ width: 282px !important;
40
+ height: 28px !important;
41
+ }
42
+
43
+ form #cardpayment_expiration,#cardpayment_expiration_yr {
44
+ height:26px !important;
45
+ }
46
+
47
+ form #cardpayment_cc_cid {
48
+ height: 28px !important;
49
+ }
50
+ </style>
51
+ <?php
52
+ }
53
+ ?>
54
+ <?php $_code=$this->getMethodCode() ?>
55
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
56
+
57
+ <li>
58
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/mastercard50.png") ?>" style="display:inline"/>
59
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/mastercardseecurecode50.png") ?>" style="display:inline" />
60
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/visa50.png") ?>" style="display:inline" />
61
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/vbv50.png") ?>" style="display:inline" />
62
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/visaelectron50.png") ?>" style="display:inline" />
63
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/maestro50.png") ?>" style="display:inline" /> <br>
64
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/cup50.png") ?>" style="display:inline" />
65
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/diners50.png") ?>" style="display:inline" />
66
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/discover50.png") ?>" style="display:inline" />
67
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/sepa50.png") ?>" style="display:inline" />
68
+ <img class="sz_card_payment" src="<?php echo $this->getSkinUrl("internationalshipping/images/payment_logos/jcb50.png") ?>" style="display:inline" />
69
+ <a href="http://swipezoom.com/" target="_blank"><img class="sz_logo" src="<?php echo $this->getSkinUrl("internationalshipping/images/sz.png") ?>" style="display:inline;float:right" /></a>
70
+ </li>
71
+ <li>
72
+ <span id="sw_card_errors"></span>
73
+ <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
74
+ <div class="input-box">
75
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Name on Card')) ?>" class="input-text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="" />
76
+ </div>
77
+ </li>
78
+ <li>
79
+ <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
80
+ <div class="input-box">
81
+ <input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Credit Card Number')) ?>" class="input-text validate-cc-number" value="" /><span style="font-size:11px" id="cardpayment_cc_text"></span>
82
+ </div>
83
+ </li>
84
+ <li>
85
+ <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
86
+ <div class="input-box">
87
+ <div class="v-fix" style="margin-right:0px">
88
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp" style="width:139px">
89
+ <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
90
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
91
+ <option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
92
+ <?php endforeach ?>
93
+ </select>
94
+ </div>
95
+ <div class="v-fix">
96
+ <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
97
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year" style="width:139px">
98
+ <option value="">Year</option>
99
+ <?php
100
+ for($i=0;$i<21;$i++){
101
+ echo "<option value='".(date('Y')+$i)."'>".(date('Y')+$i)."</option>";
102
+ }
103
+ ?>
104
+ </select>
105
+ </div>
106
+ </div>
107
+ </li>
108
+ <?php echo $this->getChildHtml() ?>
109
+ <?php if($this->hasVerification()): ?>
110
+ <li>
111
+ <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
112
+ <div class="input-box">
113
+ <div class="v-fix">
114
+ <input type="number" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Card Verification Number')) ?>" class="input-text cvv validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
115
+ </div>
116
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
117
+ </div>
118
+ </li>
119
+ <?php endif; ?>
120
+ <?php if ($this->hasSsCardType()): ?>
121
+ <li id="<?php echo $_code ?>_cc_type_ss_div">
122
+ <ul class="inner-form">
123
+ <li class="form-alt"><label for="<?php echo $_code ?>_cc_issue" class="required"><em>*</em><?php echo $this->__('Switch/Solo/Maestro Only') ?></label></li>
124
+ <li>
125
+ <label for="<?php echo $_code ?>_cc_issue"><?php echo $this->__('Issue Number') ?>:</label>
126
+ <span class="input-box">
127
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Issue Number')) ?>" class="input-text validate-cc-ukss cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" />
128
+ </span>
129
+ </li>
130
+
131
+ <li>
132
+ <label for="<?php echo $_code ?>_start_month"><?php echo $this->__('Start Date') ?>:</label>
133
+ <div class="input-box">
134
+ <div class="v-fix">
135
+ <select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="validate-cc-ukss month">
136
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
137
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
138
+ <?php endforeach ?>
139
+ </select>
140
+ </div>
141
+ <div class="v-fix">
142
+ <select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="validate-cc-ukss year">
143
+ <?php foreach ($this->getSsStartYears() as $k=>$v): ?>
144
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
145
+ <?php endforeach ?>
146
+ </select>
147
+ </div>
148
+ </div>
149
+ </li>
150
+ <li class="adv-container">&nbsp;</li>
151
+ </ul>
152
+ <script type="text/javascript">
153
+ //<![CDATA[
154
+ var SSChecked<?php echo $_code ?> = function() {
155
+ var elm = $('<?php echo $_code ?>_cc_type');
156
+ if (['SS','SM','SO'].indexOf(elm.value) != -1) {
157
+ $('<?php echo $_code ?>_cc_type_ss_div').show();
158
+ } else {
159
+ $('<?php echo $_code ?>_cc_type_ss_div').hide();
160
+ }
161
+ };
162
+
163
+ Event.observe($('<?php echo $_code ?>_cc_type'), 'change', SSChecked<?php echo $_code ?>);
164
+ SSChecked<?php echo $_code ?>();
165
+ //]]>
166
+
167
+
168
+ </script>
169
+ </li>
170
+ <?php endif; ?>
171
+ <script type="text/javascript">
172
+ //<![CDATA[
173
+ jQuery(document).ready(function(){
174
+
175
+ jQuery('#cardpayment_cc_number').validateCreditCard(function(result) {
176
+ if(result.card_type == null) {
177
+ var aryClasses = jQuery('#cardpayment_cc_number').attr('class').split(' ');
178
+ for(var i = 0; i < aryClasses.length; i++)
179
+ {
180
+ if(aryClasses[i].indexOf('sz_') != -1)
181
+ {
182
+ jQuery('#cardpayment_cc_number').removeClass(aryClasses[i]);
183
+ }
184
+ }
185
+ } else {
186
+ jQuery('#cardpayment_cc_number').addClass("sz_"+result.card_type.name);
187
+ }
188
+ if(!result.valid) {
189
+ jQuery('#cardpayment_cc_number').removeClass("valid");
190
+ } else {
191
+ jQuery('#cardpayment_cc_number').addClass("valid");
192
+ }
193
+ });
194
+ });
195
+ //]]>
196
+ </script>
197
+ </ul>
app/design/frontend/base/default/template/cardpayment/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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 design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+ <?php
36
+ $methods = $this->getMethods();
37
+ ?>
38
+ <?php if (empty($methods)): ?>
39
+ <dt>
40
+ <?php echo $this->__('No Payment Methods') ?>
41
+ </dt>
42
+ <?php else:
43
+
44
+ $sz_active = false;
45
+ foreach ($methods as $_method) {
46
+ if($_method->getCode() == 'cardpayment')
47
+ $sz_active = true;
48
+ }
49
+
50
+ if($sz_active == true) {
51
+ $sz_methods = $methods;
52
+ foreach ($methods as $key => $_method) {
53
+ if($_method->getCode() == 'cardpayment')
54
+ continue;
55
+
56
+ unset($sz_methods[$key]);
57
+ }
58
+ $methods = $sz_methods;
59
+ }
60
+
61
+ foreach ($methods as $_method):
62
+ $_code = $_method->getCode();
63
+
64
+ $oneMethod = count($methods) <= 1;
65
+
66
+ ?>
67
+ <dt id="dt_method_<?php echo $_code ?>">
68
+ <?php if(!$oneMethod): ?>
69
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
70
+ <?php else: ?>
71
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
72
+ <?php $oneMethod = $_code; ?>
73
+ <?php endif; ?>
74
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label><?php if($_code == 'cardpayment') { ?> <p class="required" style="float:right;font-weight:normal">* Required Fields</p> <?php } ?>
75
+ </dt>
76
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
77
+ <dd id="dd_method_<?php echo $_code ?>">
78
+ <?php echo $html; ?>
79
+ </dd>
80
+ <?php endif; ?>
81
+ <?php endforeach;
82
+ endif;
83
+ ?>
84
+ <?php echo $this->getChildChildHtml('additional'); ?>
85
+ <script type="text/javascript">
86
+ //<![CDATA[
87
+ <?php echo $this->getChildChildHtml('scripts'); ?>
88
+ payment.init();
89
+ <?php if (is_string($oneMethod)): ?>
90
+ payment.switchMethod('<?php echo $oneMethod ?>');
91
+ <?php endif; ?>
92
+ //]]>
93
+ </script>
app/design/frontend/base/default/template/cardpayment/redirect.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $_order = new Mage_Sales_Model_Order();
4
+ $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
5
+ $_order->loadByIncrementId($orderId);
6
+
7
+ $failureUrl = Mage::getBaseUrl().'/cardpayment/payment/process?status=failure&orderid='.$orderId;
8
+
9
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
10
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
11
+
12
+ $shippingMethod = $order->getData("shipping_method");
13
+ // If shipping method is Swipezoom and Payment is enabled
14
+ if(strpos($shippingMethod,"swipezoom") !== FALSE && $paymentmode == 1):
15
+
16
+ $order->getSwipezoomOrderConfirmed();
17
+ $result = $result = Mage::getModel("Swipezoom_InternationalShipping_Model_Carrier_Swipezoom")->confirmOrderInvoiceRequest($order->getData("shipping_method"),Mage::getSingleton('sales/quote')->load($order->getQuoteId())->getSwipezoomOrderNumber(),$orderId,0);
18
+ $read= Mage::getSingleton('core/resource')->getConnection('core_write');
19
+
20
+ if(is_array($result) && $result[0][0] == "000"){
21
+ // TransConfirm Successfully Processed
22
+ $order->setSwipezoomOrderConfirmed(1);
23
+ $response = $result[1];
24
+ $redirect_url = $response->OrderPaymentDetails->RedirectUrl;
25
+ $value=$read->query("update sales_flat_order SET swipezoom_order_confirmed = '1' where entity_id=".$order->getEntityId());
26
+ }else{
27
+ // error returned
28
+ $order->setSwipezoomOrderConfirmed(0);
29
+ $order->setSwipezoomOrderConfirmedErrormessage($result[0][1]);
30
+ $value=$read->query("update sales_flat_order SET swipezoom_order_confirmed = '0' , swipezoom_order_confirmed_errormessage='".$result[0][1]."' where entity_id=".$order->getEntityId());
31
+ }
32
+
33
+ endif;
34
+ ?>
35
+
36
+ <div style="text-align: center;width:100%;">
37
+ <span class="please-wait" style="float:none">
38
+ <img src="<?php echo $this->getSkinUrl('internationalshipping/css/indicator.gif') ?>" style="width:16px !important;margin-top:5px !important" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading...')) ?>" class="v-middle" /> <?php echo $this->__('Processing Payment...') ?>
39
+ </span>
40
+ <iframe src="<?php if(!empty($redirect_url)) {echo $redirect_url;}else{echo $failureUrl;} ?>" width="420px" height="400px" frameBorder="0" style="margin:0 auto;display:block;text-align:center"/>
41
+ </div>
42
+
app/design/frontend/base/default/template/internationalshipping/cancel.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="page-title title-buttons">
2
+ <h1>Cancel Order</h1>
3
+
4
+ </div>
5
+
6
+ <div class="content">
7
+ <h3>Reason to Cancel Order</h3>
8
+ <?php $orderid = Mage::app()->getRequest()->getParam('order_id'); ?>
9
+ <div id="order_history_block">
10
+ <form action="<?php echo $this->getUrl('internationalshipping/index/adcomment',array('order_id'=> $orderid)) ?>" method="post">
11
+ <?php /*?><textarea name="comment" style="width: 99%;height:150px;"></textarea><?php */?>
12
+ <select name="comment">
13
+ <option value="">-- Select reson --</option>
14
+ <option value="1">Goods out of stock</option>
15
+ <option value="2">Customer cancelled</option>
16
+ <option value="3">Merchant cancelled</option>
17
+ </select>
18
+ <input type="hidden" name="order_id" value="<?php echo Mage::app()->getRequest()->getParam('order_id') ?>" />
19
+ </form></div></div>
20
+ <div class="buttons-set">
21
+ <button onclick="submitAndReloadArea($('order_history_block').parentNode, '<?php echo $this->getUrl('internationalshipping/index/adcomment',array('order_id'=> $orderid,'key'=>Mage::getSingleton('core/session')->getFormKey())) ?>');" class="button" title="Cancel Order" type="button"><span><span>Cancel Oder</span></span></button>
22
+ <button onclick="window.parent.closePopup();" class="button" title="Close Window" type="button"><span><span>Close Window</span></span></button>
23
+ </div>
24
+ <script type="text/javascript">
25
+ function submitAndReloadArea(area, url) {
26
+ if($(area)) {
27
+ var fields = $(area).select('input', 'select', 'textarea');
28
+ var data = Form.serializeElements(fields, true);
29
+ url = url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true');
30
+ new Ajax.Request(url, {
31
+ parameters: $H(data),
32
+ loaderArea: area,
33
+ onSuccess: function(transport) {
34
+ try {
35
+
36
+ if (transport.responseText.isJSON()) {
37
+ var response = transport.responseText.evalJSON()
38
+ if (response.error) {
39
+ if(response.alertpopup){
40
+ location.reload();
41
+ }
42
+ if(response.ajaxExpired && response.ajaxRedirect && !response.alertpopup) {
43
+ location.reload();//setLocation(response.ajaxRedirect);
44
+ }
45
+ }else{
46
+ window.parent.cancelOrder();
47
+ }
48
+
49
+ } else {
50
+ // window.parent.cancelOrder();
51
+ }
52
+ }
53
+ catch (e) {
54
+
55
+ }
56
+ //
57
+
58
+ }
59
+ });
60
+ }
61
+ }
62
+ </script>
63
+ <script>
64
+ window.onload = function(){
65
+ window.parent.hideloading();
66
+ }
67
+ </script>
app/design/frontend/base/default/template/internationalshipping/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form id="co-billing-form" action="">
3
+ <fieldset>
4
+ <div id="test">
5
+ <?php
6
+ if (version_compare(Mage::getVersion(), '1.9', '<')) {
7
+ ?>
8
+ <style type="text/css">
9
+ .opc select {
10
+ height: 22px !important;
11
+ }
12
+ </style>
13
+ <?php
14
+ }
15
+ ?>
16
+
17
+ <?php
18
+ if (version_compare(Mage::getVersion(), '1.9', '>=')) {
19
+ ?>
20
+ <p class="required" style="float:right">* Required Fields</p>
21
+ <?php
22
+ }
23
+ ?>
24
+ <ul class="form-list">
25
+ <?php if ($this->customerHasAddresses()): ?>
26
+ <li class="wide">
27
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
28
+ <div class="input-box">
29
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
30
+ </div>
31
+ </li>
32
+ <?php endif; ?>
33
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
34
+
35
+
36
+ <fieldset>
37
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
38
+ <ul>
39
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
40
+ <li class="fields">
41
+ <div class="field">
42
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
43
+ <div class="input-box">
44
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
45
+ </div>
46
+ </div>
47
+ </li>
48
+ <li class="fields">
49
+ <?php
50
+
51
+ print "<ul id='billing-row32'>";
52
+ ?>
53
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
54
+ <li class="wide containers1" >
55
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
56
+ <div class="input-box">
57
+ <input type="text" maxlength="35" 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 ?>" />
58
+ </div>
59
+ </li>
60
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
61
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
62
+ <li class="wide">
63
+ <label for="billing:street<?php echo $_i;?>>" class=""><?php echo $this->__('Address '.$_i) ?></label>
64
+ <div class="input-box">
65
+ <input type="text" maxlength="35" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
66
+ </div>
67
+ </li>
68
+ <?php endfor; ?>
69
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
70
+ <li class="wide">
71
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
72
+ <div class="input-box">
73
+ <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" />
74
+ </div>
75
+ </li>
76
+ <?php endif; ?>
77
+ <li class="fields">
78
+ <div class="field">
79
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
80
+ <div class="input-box">
81
+ <input type="text" maxlength="30" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text required-entry validate-city <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
82
+ </div>
83
+ </div>
84
+ <div class="field containers3" >
85
+ <?php
86
+ //
87
+ ?>
88
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
89
+ <div class="input-box">
90
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
91
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
92
+ </select>
93
+ <script type="text/javascript">
94
+ //<![CDATA[
95
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
96
+ //]]>
97
+ </script>
98
+ <input type="text" maxlength="30" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
99
+ </div>
100
+ </div>
101
+ </li>
102
+ <li class="fields">
103
+ <div class="field">
104
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
105
+ <div class="input-box">
106
+ <input type="text" maxlength="10" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text" />
107
+ </div>
108
+ </div>
109
+ </li>
110
+ <?php
111
+ print "</ul>";
112
+ ?>
113
+ </li>
114
+ <li class="fields">
115
+ <div class="field">
116
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
117
+ <div class="input-box <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>">
118
+ <input type="text" maxlength="20" 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') ?> validate-digits" id="billing:telephone" />
119
+ </div>
120
+ </div>
121
+ <?php if(!$this->isCustomerLoggedIn()): ?>
122
+ <div class="field">
123
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
124
+ <div class="input-box">
125
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
126
+ </div>
127
+ </div>
128
+ <?php endif; ?>
129
+ </li>
130
+ <?php if(!$this->isCustomerLoggedIn()): ?>
131
+
132
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
133
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
134
+ <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
135
+ <li class="fields">
136
+ <?php if ($_dob->isEnabled()): ?>
137
+ <div class="field">
138
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
139
+ </div>
140
+ <?php endif; ?>
141
+ <?php if ($_gender->isEnabled()): ?>
142
+ <div class="field">
143
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
144
+ </div>
145
+ <?php endif ?>
146
+ </li>
147
+ <?php endif ?>
148
+
149
+ <?php if ($this->isTaxvatEnabled()):?>
150
+ <li><?php echo $this->getTaxvatHtml() ?></li>
151
+ <?php endif; ?>
152
+
153
+ <li class="fields" id="register-customer-password">
154
+ <div class="field">
155
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
156
+ <div class="input-box">
157
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text" />
158
+ </div>
159
+ </div>
160
+ <div class="field">
161
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
162
+ <div class="input-box">
163
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text" />
164
+ </div>
165
+ </div>
166
+ </li>
167
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
168
+ <?php endif; ?>
169
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
170
+ <li class="control">
171
+ <input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
172
+ </li>
173
+ <?php else:?>
174
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
175
+ <?php endif; ?>
176
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
177
+ </ul>
178
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
179
+ </fieldset>
180
+
181
+ </li>
182
+ <?php if ($this->canShip()): ?>
183
+ <li class="control">
184
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
185
+ <li class="control">
186
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
187
+ </li>
188
+ <?php endif; ?>
189
+ </ul>
190
+ </div>
191
+ <?php if (!$this->canShip()): ?>
192
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
193
+ <?php endif; ?>
194
+ <div class="buttons-set" id="billing-buttons-container">
195
+ <?php
196
+ if (version_compare(Mage::getVersion(), '1.9', '<')) {
197
+ ?>
198
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
199
+ <?php
200
+ }
201
+ ?>
202
+ <button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="validateAddress('billing');"><span><span><?php echo $this->__('Continue') ?></span></span></button>
203
+ <span class="please-wait" id="billing-please-wait" style="display:none;">
204
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
205
+ </span>
206
+ </div>
207
+
208
+ </fieldset>
209
+ </form>
210
+ <script type="text/javascript">
211
+ //<![CDATA[
212
+ var cache_values = [], cache_values_fail = [];
213
+ var cache_values_zip = [], cache_values_fail_zip = [];
214
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
215
+ var billingForm = new VarienForm('co-billing-form');
216
+
217
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
218
+
219
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
220
+ if ($('onepage-guest-register-button')) {
221
+ Event.observe($('onepage-guest-register-button'), 'click', function(event) {
222
+ var billingRememberMe = $('co-billing-form').select('#remember-me-box');
223
+ if (billingRememberMe.length > 0) {
224
+ if ($('login:guest') && $('login:guest').checked) {
225
+ billingRememberMe[0].hide();
226
+ } else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
227
+ billingRememberMe[0].show();
228
+ }
229
+ }
230
+ });
231
+ }
232
+ var countryArray = Array();
233
+ <?php
234
+ $specificCountry = Mage::getStoreConfig('carriers/swipezoom/sallowspecific',Mage::app()->getStore());
235
+
236
+ if($specificCountry == 1){
237
+ $specificCountryList = Mage::getStoreConfig('carriers/swipezoom/specificcountry',Mage::app()->getStore());
238
+ if(!empty($specificCountryList)){
239
+ $specificCountryList = ",".$specificCountryList.",";
240
+ }
241
+ }
242
+
243
+ ?>
244
+ var countryList = "<?php echo $specificCountryList ?>";
245
+
246
+ RegionUpdater.addMethods({
247
+ update: function()
248
+ {
249
+ // alert("new update");
250
+
251
+
252
+ var flag3 = false;
253
+
254
+ if(countryList == ""){
255
+ flag3 = true;
256
+ }
257
+ if(countryList != " "){
258
+ if(countryList.indexOf(this.countryEl.value) >= 0 ){
259
+ flag3 = true;
260
+ }
261
+ }
262
+
263
+ if (this.regions[this.countryEl.value]) {
264
+ var i, option, region, def;
265
+
266
+ def = this.regionSelectEl.getAttribute('defaultValue');
267
+ if (this.regionTextEl) {
268
+ if (!def) {
269
+ def = this.regionTextEl.value.toLowerCase();
270
+ }
271
+ this.regionTextEl.value = '';
272
+ }
273
+
274
+ this.regionSelectEl.options.length = 1;
275
+ for (regionId in this.regions[this.countryEl.value]) {
276
+ region = this.regions[this.countryEl.value][regionId];
277
+
278
+ option = document.createElement('OPTION');
279
+ option.value = regionId;
280
+ option.text = region.name.stripTags();
281
+ option.title = region.name;
282
+
283
+ if (this.regionSelectEl.options.add) {
284
+ this.regionSelectEl.options.add(option);
285
+ } else {
286
+ this.regionSelectEl.appendChild(option);
287
+ }
288
+
289
+ if (regionId==def || (region.name && region.name.toLowerCase()==def) ||
290
+ (region.name && region.code.toLowerCase()==def)
291
+ ) {
292
+ this.regionSelectEl.value = regionId;
293
+ }
294
+ }
295
+
296
+ if (this.disableAction=='hide') {
297
+ if (this.regionTextEl) {
298
+ this.regionTextEl.style.display = 'none';
299
+ }
300
+
301
+ this.regionSelectEl.style.display = '';
302
+ } else if (this.disableAction=='disable') {
303
+ if (this.regionTextEl) {
304
+ this.regionTextEl.disabled = true;
305
+ }
306
+ this.regionSelectEl.disabled = false;
307
+ }
308
+
309
+ if(flag3 == false){
310
+ this.setMarkDisplay(this.regionSelectEl, true);
311
+ }
312
+ } else {
313
+ if (this.disableAction=='hide') {
314
+ if (this.regionTextEl) {
315
+ this.regionTextEl.style.display = '';
316
+ }
317
+ this.regionSelectEl.style.display = 'none';
318
+ Validation.reset(this.regionSelectEl);
319
+ } else if (this.disableAction=='disable') {
320
+ if (this.regionTextEl) {
321
+ this.regionTextEl.disabled = false;
322
+ }
323
+ this.regionSelectEl.disabled = true;
324
+ } else if (this.disableAction=='nullify') {
325
+ this.regionSelectEl.options.length = 1;
326
+ this.regionSelectEl.value = '';
327
+ this.regionSelectEl.selectedIndex = 0;
328
+ this.lastCountryId = '';
329
+ }
330
+ if(flag3 == false){
331
+ // this.setMarkDisplay(this.regionSelectEl, false);
332
+ }
333
+ //
334
+ }
335
+
336
+ if(flag3 == false){
337
+ //alert("")
338
+ this._checkRegionRequired();
339
+ // Make Zip and its label required/optional
340
+ var zipUpdater = new ZipUpdater(this.countryEl.value, this.zipEl);
341
+ zipUpdater.update();
342
+ }
343
+ }
344
+
345
+ });
346
+
347
+ function formatAddress(type){
348
+
349
+ checkout.setLoadWaiting(type);
350
+ $(type+"-new-address-form").setStyle({opacity:"0.5"});
351
+ var countrycode=$(type+':country_id').value;
352
+
353
+ new Ajax.Request('<?php echo $this->getUrl('internationalshipping/index/index') ?>',{
354
+ type: "POST",
355
+ parameters: {countrycode:countrycode,type:type},
356
+ cache: false,
357
+ onSuccess: function(transport) {
358
+ var response = transport.responseText || "no response text";
359
+
360
+ $(type+"-row32").replace(response);
361
+ $(type+"-new-address-form").removeAttribute("style");
362
+
363
+ if($(type+':region')){
364
+ if(type == "billing"){
365
+ var billingRegionUpdater1 = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
366
+ billingRegionUpdater1.update();
367
+ }else{
368
+ var shippingRegionUpdater1 = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
369
+ shippingRegionUpdater1.update();
370
+
371
+ if($('shipping:same_as_billing').checked) {
372
+ arrElements = Form.getElements('co-shipping-form');
373
+ for (var elemIndex in arrElements) {
374
+ if (arrElements[elemIndex].id) {
375
+ var sourceField = $(arrElements[elemIndex].id.replace(/^shipping:/, 'billing:'));
376
+ if (sourceField){
377
+ arrElements[elemIndex].value = sourceField.value;
378
+ }
379
+ }
380
+ }
381
+
382
+ shippingRegionUpdater1.update();
383
+ $('shipping:region_id').value = $('billing:region_id').value;
384
+ $('shipping:region').value = $('billing:region').value;
385
+ }
386
+ }
387
+
388
+ }
389
+
390
+ checkout.setLoadWaiting(false);
391
+ },
392
+ onFailure: function() { alert('Something went wrong...');
393
+ checkout.setLoadWaiting(false);
394
+ }
395
+ });
396
+ }
397
+ Event.observe($('billing:country_id'), 'change', function(){
398
+ formatAddress("billing");
399
+ });
400
+
401
+ document.observe("dom:loaded", function() {
402
+ formatAddress("billing");
403
+ });
404
+
405
+
406
+ function validateAddress(type)
407
+ {
408
+ var flag = false;
409
+
410
+ if(countryList == ""){
411
+ flag = true;
412
+ }
413
+ if(countryList != " "){
414
+ if(countryList.indexOf($(type+':country_id').value) >= 0 ){
415
+ flag = true;
416
+ }
417
+ }
418
+
419
+ if(flag == false){
420
+
421
+ if(type == "billing"){
422
+ billing.save();
423
+ }else{
424
+ shipping.save();
425
+ }
426
+
427
+ }else{
428
+
429
+ var validator = new Validation("co-"+type+"-form");
430
+ if (validator.validate()) {
431
+ var region;
432
+ var regionname;
433
+ var postcode;
434
+ var city;
435
+
436
+ checkout.setLoadWaiting(type);
437
+ var country=$F(type+':country_id');
438
+
439
+ if($(type+':region_id'))
440
+ var region=$F(type+':region_id');
441
+
442
+ if($('billing:region'))
443
+ regionname=$F(type+':region');
444
+
445
+ if($(type+':postcode'))
446
+ postcode=$F(type+':postcode');
447
+
448
+ if($(type+':street1'))
449
+ var street1=$F(type+':street1');
450
+
451
+ if($(type+':street2'))
452
+ var street2=$F(type+':street2');
453
+
454
+ var sameasshipping = $('shipping:same_as_billing').checked;
455
+
456
+ if(sameasshipping == false && $("billing:use_for_shipping_yes").checked){
457
+ sameasshipping = "true"
458
+ }
459
+
460
+ if($(type+':city'))
461
+ city=$F(type+':city');
462
+
463
+ new Ajax.Request('<?php echo $this->getUrl("internationalshipping/index/CheckAddress") ?>',{
464
+ type: "POST",
465
+ parameters: {country:country,region:region,regionname:regionname,postcode:postcode,street1:street1,street2:street2,city:city,type:type,sameasshipping:sameasshipping},
466
+ cache: false,
467
+ onSuccess: function(transport) {
468
+
469
+ // validate
470
+ checkout.setLoadWaiting(false);
471
+
472
+ var response = transport.responseText || "no response text";
473
+ var json = response.evalJSON();
474
+ if(!json.success){
475
+ for(var i=0;i<json.length;i++){
476
+ if(json[i]["name"] == "region"){
477
+ if($(type+":region_id").getStyle("display") == "none")json[i]["name"] ="region";else json[i]["name"] = "region_id";
478
+ }
479
+ Validation.ajaxError($(type+":"+json[i]["name"]), json[i]["error"]);
480
+ }
481
+ }else{
482
+
483
+ if(type == "billing")
484
+ billing.save();
485
+ else
486
+ shipping.save();
487
+ }
488
+
489
+ },
490
+ onFailure: function() { alert('Something went wrong...');
491
+ checkout.setLoadWaiting(false);
492
+ }
493
+ });
494
+ }
495
+ }
496
+ }
497
+
498
+ //]]>
499
+ </script>
app/design/frontend/base/default/template/internationalshipping/checkout/onepage/login.phtml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <div class="col2-set">
4
+ <?php echo $this->getChildHtml('login_before')?>
5
+ <div class="col-1">
6
+ <h3><?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h3>
7
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
8
+ <p><?php echo $this->__('Register with us for future convenience:') ?></p>
9
+ <?php else: ?>
10
+ <p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
11
+ <?php echo $this->__('Register with us for future convenience:') ?></p>
12
+ <ul>
13
+ <li><?php echo $this->__('Fast and easy check out') ?></li>
14
+ <li><?php echo $this->__('Easy access to your order history and status') ?></li>
15
+ </ul>
16
+ <?php endif; ?>
17
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
18
+ <ul class="form-list">
19
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
20
+ <li class="control">
21
+ <input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" /><label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
22
+ </li>
23
+ <?php endif; ?>
24
+ <li class="control">
25
+ <input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
26
+ </li>
27
+ </ul>
28
+ <h4><?php echo $this->__('Register and save time!') ?></h4>
29
+ <p><?php echo $this->__('Register with us for future convenience:') ?></p>
30
+ <ul class="ul">
31
+ <li><?php echo $this->__('Fast and easy check out') ?></li>
32
+ <li><?php echo $this->__('Easy access to your order history and status') ?></li>
33
+ </ul>
34
+ <?php else: ?>
35
+ <input type="hidden" name="checkout_method" id="login:register" value="register" checked="checked" />
36
+ <?php endif; ?>
37
+ </div>
38
+ <div class="col-2">
39
+ <h3><?php echo $this->__('Login') ?></h3>
40
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
41
+ <form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
42
+ <fieldset>
43
+ <h4><?php echo $this->__('Already registered?') ?></h4>
44
+ <p><?php echo $this->__('Please log in below:') ?></p>
45
+ <ul class="form-list">
46
+ <li>
47
+ <label for="login-email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
48
+ <div class="input-box">
49
+ <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" />
50
+ </div>
51
+ </li>
52
+ <li>
53
+ <label for="login-password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
54
+ <div class="input-box">
55
+ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" />
56
+ </div>
57
+ </li>
58
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
59
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
60
+ </ul>
61
+ <input name="context" type="hidden" value="checkout" />
62
+ </fieldset>
63
+ </form>
64
+ </div>
65
+ </div>
66
+ <div class="col2-set">
67
+ <div class="col-1">
68
+ <div class="buttons-set">
69
+ <p class="required">&nbsp;</p>
70
+ <?php if ($this->getQuote()->isAllowedGuestCheckout()): ?>
71
+ <button id="onepage-guest-register-button" type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
72
+ <?php elseif ($this->helper('checkout')->isCustomerMustBeLogged()): ?>
73
+ <button id="onepage-guest-register-button" type="button" class="button" onclick="window.location='<?php echo $this->helper('checkout/url')->getRegistrationUrl();?>'"><span><span><?php echo $this->__('Register') ?></span></span></button>
74
+ <?php else: ?>
75
+ <form action="<?php echo $this->getUrl('persistent/index/saveMethod'); ?>">
76
+ <button id="onepage-guest-register-button" type="submit" class="button"><span><span><?php echo $this->__('Register') ?></span></span></button>
77
+ </form>
78
+ <?php endif; ?>
79
+ </div>
80
+ </div>
81
+ <div class="col-2">
82
+ <div class="buttons-set">
83
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
84
+ <a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>" class="f-left"><?php echo $this->__('Forgot your password?') ?></a>
85
+ <button type="submit" class="button" onclick="onepageLogin(this)"><span><span><?php echo $this->__('Login') ?></span></span></button>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ <script type="text/javascript">
90
+ //<![CDATA[
91
+ var loginForm = new VarienForm('login-form', true);
92
+ $('login-email').observe('keypress', bindLoginPost);
93
+ $('login-password').observe('keypress', bindLoginPost);
94
+ function bindLoginPost(evt){
95
+ if (evt.keyCode == Event.KEY_RETURN) {
96
+ loginForm.submit();
97
+ }
98
+ }
99
+ function onepageLogin(button)
100
+ {
101
+ if(loginForm.validator && loginForm.validator.validate()){
102
+ button.disabled = true;
103
+ loginForm.submit();
104
+ }
105
+ }
106
+ //]]>
107
+ </script>
108
+ <?php
109
+ $registerParam = $this->getRequest()->getParam('register');
110
+ if ($registerParam || $registerParam === ''):
111
+ ?>
112
+ <script type="text/javascript">
113
+ //<![CDATA[
114
+ document.observe("dom:loaded", function() {
115
+ if($('login:register')) {
116
+ $('login:register').checked = true;
117
+ checkout.setMethod();
118
+ }
119
+ })
120
+ //]]>
121
+ </script>
122
+ <?php endif; ?>
app/design/frontend/base/default/template/internationalshipping/checkout/onepage/shipping.phtml ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form action="" id="co-shipping-form">
3
+ <?php
4
+ if (version_compare(Mage::getVersion(), '1.9', '>=')) {
5
+ ?>
6
+ <p class="required" style="float:right">* Required Fields</p>
7
+ <?php
8
+ }
9
+ ?>
10
+ <ul class="form-list">
11
+ <?php if ($this->customerHasAddresses()): ?>
12
+ <li class="wide">
13
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
14
+ <div class="input-box">
15
+ <?php echo $this->getAddressesHtmlSelect('shipping') ?>
16
+ </div>
17
+ </li>
18
+ <?php endif ?>
19
+ <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
20
+ <fieldset>
21
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
22
+ <ul>
23
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
24
+ <li class="fields">
25
+ <div class="field">
26
+ <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
27
+ <div class="input-box">
28
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
29
+ </div>
30
+ </div>
31
+ </li>
32
+ <li class="fields">
33
+ <?php
34
+
35
+ print "<ul id='shipping-row32'>";
36
+ ?>
37
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
38
+ <li class="wide">
39
+ <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
40
+ <div class="input-box">
41
+ <input type="text" maxlength="35" 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);" />
42
+ </div>
43
+ </li>
44
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
45
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
46
+ <li class="wide">
47
+ <label for="billing:street<?php echo $_i;?>>" class=""><?php echo $this->__('Address '.$_i) ?></label>
48
+ <div class="input-box">
49
+ <input type="text" maxlength="35" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
50
+ </div>
51
+ </li>
52
+ <?php endfor; ?>
53
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
54
+ <li class="wide">
55
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
56
+ <div class="input-box">
57
+ <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
58
+ </div>
59
+ </li>
60
+ <?php endif; ?>
61
+ <li class="fields">
62
+ <div class="field">
63
+ <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
64
+ <div class="input-box">
65
+ <input type="text" maxlength="30" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text required-entry validate-city <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
66
+ </div>
67
+ </div>
68
+ <div class="field">
69
+ <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
70
+ <div class="input-box">
71
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
72
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
73
+ </select>
74
+ <script type="text/javascript">
75
+ //<![CDATA[
76
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
77
+ //]]>
78
+ </script>
79
+ <input type="text" maxlength="30" 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;" />
80
+ </div>
81
+ </div>
82
+ </li>
83
+ <li class="fields">
84
+ <div class="field">
85
+ <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
86
+ <div class="input-box">
87
+ <input type="text" maxlength="10" 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);" />
88
+ </div>
89
+ </div>
90
+
91
+ </li>
92
+ <?php
93
+ print "</ul>";
94
+ ?>
95
+ </li>
96
+ <li class="fields">
97
+ <div class="field">
98
+ <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
99
+ <div class="input-box">
100
+ <input type="text" maxlength="20" name="shipping[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') ?> validate-digits" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
101
+ </div>
102
+ </div>
103
+ </li>
104
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
105
+ <li class="control">
106
+ <input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
107
+ <?php else:?>
108
+ <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
109
+ <?php endif;?>
110
+ </ul>
111
+ </fieldset>
112
+ </li>
113
+ <li class="control">
114
+ <input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> title="<?php echo $this->__('Use Billing Address') ?>" onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" /><label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
115
+ </li>
116
+ </ul>
117
+ <div class="buttons-set" id="shipping-buttons-container">
118
+ <?php
119
+ if (version_compare(Mage::getVersion(), '1.9', '<')) {
120
+ ?>
121
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
122
+ <?php
123
+ }
124
+ ?>
125
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
126
+ <button type="button" class="button" title="<?php echo $this->__('Continue') ?>" onclick="validateAddress('shipping');"><span><span><?php echo $this->__('Continue') ?></span></span></button>
127
+ <span id="shipping-please-wait" class="please-wait" style="display:none;">
128
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
129
+ </span>
130
+ </div>
131
+ </form>
132
+ <script type="text/javascript">
133
+ //<![CDATA[
134
+ var cache_values = [], cache_values_fail = [];
135
+ var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
136
+ '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
137
+ var shippingForm = new VarienForm('co-shipping-form');
138
+
139
+ shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
140
+ $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
141
+
142
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
143
+
144
+ Event.observe($('shipping:country_id'), 'change', function(){
145
+ formatAddress("shipping");
146
+ });
147
+ Event.observe($('shipping:same_as_billing'), 'change', function(data){
148
+ if(this.checked) {
149
+ $('shipping:country_id').value = $('billing:country_id').value;
150
+ formatAddress("shipping");
151
+ }
152
+ });
153
+
154
+ document.observe("dom:loaded", function() {
155
+ formatAddress("shipping");
156
+ });
157
+
158
+ <?php
159
+ if (version_compare(Mage::getVersion(), '1.9', '>=')) {
160
+ ?>
161
+
162
+ Checkout.prototype.gotoSection = Checkout.prototype.gotoSection.wrap(
163
+ function(parentMethod, section, reloadProgressBlock) {
164
+ // Call parent method
165
+ parentMethod(section, reloadProgressBlock);
166
+
167
+ if(section == 'shipping' && $('shipping:same_as_billing').checked == true)
168
+ formatAddress("shipping");
169
+ }
170
+ );
171
+
172
+ <?php } ?>
173
+
174
+ //]]>
175
+ </script>
app/design/frontend/base/default/template/internationalshipping/onepage/progress.phtml ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="block block-progress opc-block-progress">
3
+ <div class="block-title">
4
+ <strong><span><?php echo $this->__('Your Checkout Progress') ?></span></strong>
5
+ </div>
6
+ <div class="block-content">
7
+ <dl>
8
+ <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?>
9
+ <?php if ($this->isStepComplete('billing')): ?>
10
+ <dt class="complete">
11
+ <?php echo $this->__('Billing Address') ?> <span class="separator">|</span>
12
+ <a href="#billing" onclick="checkout.gotoSection('billing'); return false;"><?php echo $this->__('Change') ?></a>
13
+ </dt>
14
+ <dd class="complete">
15
+ <address><?php
16
+ $countrycode = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getCountry();
17
+ $specificCountry = Mage::getStoreConfig('carriers/swipezoom/sallowspecific',Mage::app()->getStore());
18
+ $specificCountryList = Mage::getStoreConfig('carriers/swipezoom/specificcountry',Mage::app()->getStore());
19
+ if(Mage::getStoreConfig('carriers/swipezoom/active',Mage::app()->getStore()) == "0" || ($specificCountry == 1 && strpos($specificCountryList,$countrycode) === FALSE)){
20
+ echo $this->getBilling()->format('html');
21
+ }else{
22
+ $swipezoomStringBilling = Mage::getSingleton('checkout/session')->getQuote()->getSwipezoomAddressBillingString();
23
+ $swipezoomStringBilling = preg_replace("/(<br\s*\/?>\s*)+/", "<br/>", $swipezoomStringBilling);
24
+
25
+ $formater = new Varien_Filter_Template();
26
+ $attributes = Mage::helper('customer/address')->getAttributes();
27
+ $address = $this->getBilling();
28
+ $data = array();
29
+ foreach ($attributes as $attribute) {
30
+ /* @var $attribute Mage_Customer_Model_Attribute */
31
+ if (!$attribute->getIsVisible()) {
32
+ continue;
33
+ }
34
+ if ($attribute->getAttributeCode() == 'country_id') {
35
+ $data['country'] = $address->getCountryModel()->getName();
36
+ } else if ($attribute->getAttributeCode() == 'region') {
37
+ $data['region'] = $address->getRegion();
38
+ } else {
39
+ $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute,$address);
40
+ $value = $dataModel->outputValue($dataFormat);
41
+ if ($attribute->getFrontendInput() == 'multiline') {
42
+ $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
43
+ // explode lines
44
+ foreach ($values as $k => $v) {
45
+ $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
46
+ $data[$key] = $v;
47
+ }
48
+ }
49
+ $data[$attribute->getAttributeCode()] = $value;
50
+ }
51
+ }
52
+
53
+ $formater->setVariables($data);
54
+
55
+ $format = "{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/>\n{{depend company}}{{var company}}<br />{{/depend}}\n".$swipezoomStringBilling."\n <br/>{{depend telephone}}T: {{var telephone}}{{/depend}}\n{{depend fax}}<br/>F: {{var fax}}{{/depend}}\n{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}";
56
+
57
+ echo $formater->filter($format);
58
+ }
59
+ ?></address>
60
+ </dd>
61
+ <?php else: ?>
62
+ <dt>
63
+ <?php echo $this->__('Billing Address') ?>
64
+ </dt>
65
+ <?php endif; ?>
66
+ <?php endif; ?>
67
+
68
+ <?php if ($this->getCheckout()->getStepData('shipping', 'is_show')): ?>
69
+ <?php if ($this->isStepComplete('shipping')): ?>
70
+ <dt class="complete">
71
+ <?php echo $this->__('Shipping Address') ?> <span class="separator">|</span>
72
+ <a href="#payment" onclick="checkout.gotoSection('shipping');return false;"><?php echo $this->__('Change') ?></a>
73
+ </dt>
74
+ <dd class="complete">
75
+ <address>
76
+ <?php
77
+ $countrycode = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCountry();
78
+ $specificCountry = Mage::getStoreConfig('carriers/swipezoom/sallowspecific',Mage::app()->getStore());
79
+ $specificCountryList = Mage::getStoreConfig('carriers/swipezoom/specificcountry',Mage::app()->getStore());
80
+ if(Mage::getStoreConfig('carriers/swipezoom/active',Mage::app()->getStore()) == "0" || ($specificCountry == 1 && strpos($specificCountryList,$countrycode) === FALSE)){
81
+ echo $this->getShipping()->format('html');
82
+ }else{
83
+ $swipezoomString = Mage::getSingleton('checkout/session')->getQuote()->getSwipezoomAddressShippingString();
84
+ $swipezoomString = preg_replace("/(<br\s*\/?>\s*)+/", "<br/>", $swipezoomString);
85
+ $formater = new Varien_Filter_Template();
86
+ $attributes = Mage::helper('customer/address')->getAttributes();
87
+ $address = $this->getShipping();
88
+ $data = array();
89
+ foreach ($attributes as $attribute) {
90
+ /* @var $attribute Mage_Customer_Model_Attribute */
91
+ if (!$attribute->getIsVisible()) {
92
+ continue;
93
+ }
94
+ if ($attribute->getAttributeCode() == 'country_id') {
95
+ $data['country'] = $address->getCountryModel()->getName();
96
+ } else if ($attribute->getAttributeCode() == 'region') {
97
+ $data['region'] = $address->getRegion();
98
+ } else {
99
+ $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute,$address);
100
+ $value = $dataModel->outputValue($dataFormat);
101
+ if ($attribute->getFrontendInput() == 'multiline') {
102
+ $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
103
+ // explode lines
104
+ foreach ($values as $k => $v) {
105
+ $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
106
+ $data[$key] = $v;
107
+ }
108
+ }
109
+ $data[$attribute->getAttributeCode()] = $value;
110
+ }
111
+ }
112
+
113
+ $formater->setVariables($data);
114
+
115
+ $format = "{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/>\n{{depend company}}{{var company}}<br />{{/depend}}\n".$swipezoomString."\n<br/>{{depend telephone}}T: {{var telephone}}{{/depend}}\n{{depend fax}}<br/>F: {{var fax}}{{/depend}}\n{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}";
116
+
117
+ echo $formater->filter($format);
118
+ }
119
+ ?></address>
120
+ </dd>
121
+ <?php else: ?>
122
+ <dt>
123
+ <?php echo $this->__('Shipping Address') ?>
124
+ </dt>
125
+ <?php endif; ?>
126
+ <?php endif; ?>
127
+
128
+ <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?>
129
+ <?php if ($this->isStepComplete('shipping_method')): ?>
130
+ <dt class="complete">
131
+ <?php echo $this->__('Shipping Method') ?> <span class="separator">|</span>
132
+ <a href="#shipping_method" onclick="checkout.gotoSection('shipping_method'); return false;"><?php echo $this->__('Change') ?></a>
133
+ </dt>
134
+ <dd class="complete">
135
+ <?php if ($this->getShippingMethod()): ?>
136
+ <?php $swipeZoomRateTitles = explode('-', $this->getShippingDescription(), 2);?>
137
+
138
+ <?php echo $swipeZoomRateTitles[0]; ?>
139
+ <?php
140
+ /*
141
+ * Display swipezoom rates details
142
+ */
143
+
144
+ $shippingMethod = $this->getShippingMethod() ;
145
+ if(strpos($shippingMethod,"swipezoom") !== FALSE):
146
+ $extraRates = Mage::getSingleton('checkout/session')->getSwipezoomExtraRates();
147
+ ?>
148
+ <div class="progress-swipezoom-rates">
149
+ <div class="progress-rate">
150
+ <label class="progress-rate-label" ><?php echo $swipeZoomRateTitles[1];?></label>
151
+ <span class="price-notice"><span class="price">
152
+ <?php echo $this->formatPrice($extraRates["shipping"]); ?>
153
+ </span></span>
154
+ </div>
155
+ <div class="progress-rate">
156
+ <label for="swipezoom_duty_taxes" class="progress-rate-label"><?php echo $this->__('Prepaid duties &amp; taxes') ?> </label><span class="price-notice"><span class="price"><?php echo (strpos($shippingMethod,"withduties") !== FALSE && $extraRates["CustCourierDuties"] > 0 )? Mage::helper('core')->currency($extraRates["CustCourierDuties"],true,false): "N/A"; ?></span></span>
157
+ </div>
158
+ <div class="progress-rate">
159
+ <label for="swipezoom_insurance_taxes" class="progress-rate-label"><?php echo $this->__('Insurance') ?></label>
160
+ <span class="price-notice"><span class="price">
161
+ <?php echo (strpos($shippingMethod,"withinsurance") !== FALSE && $extraRates["CustInsuranceCharges"] > 0 )? Mage::helper('core')->currency($extraRates["CustInsuranceCharges"],true,false): "N/A"; ?></span></span>
162
+ </div>
163
+ <div class="progress-rate total-rate-block">
164
+
165
+ <label for="" class="progress-rate-label"><?php echo $this->__('Total'); ?></label>
166
+ <span class="price-notice"><?php $_excl = $this->getShippingPriceExclTax(); ?>
167
+ <?php $_incl = $this->getShippingPriceInclTax(); ?>
168
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
169
+ <?php echo $_incl; ?>
170
+ <?php else: ?>
171
+ <?php echo $_excl; ?>
172
+ <?php endif; ?>
173
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
174
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
175
+ <?php endif; ?></span>
176
+
177
+ </div>
178
+
179
+ </div>
180
+ <?php endif;
181
+ ?>
182
+
183
+ <?php else: ?>
184
+ <?php echo $this->__('Shipping method has not been selected yet') ?>
185
+ <?php endif; ?>
186
+ </dd>
187
+ <?php else: ?>
188
+ <dt>
189
+ <?php echo $this->__('Shipping Method') ?>
190
+ </dt>
191
+ <?php endif; ?>
192
+ <?php endif; ?>
193
+
194
+ <?php if ($this->getCheckout()->getStepData('payment', 'is_show')): ?>
195
+ <?php if ($this->isStepComplete('payment')): ?>
196
+ <dt class="complete">
197
+ <?php echo $this->__('Payment Method') ?> <span class="separator">|</span>
198
+ <a href="#payment" onclick="checkout.gotoSection('payment'); return false;"><?php echo $this->__('Change') ?></a>
199
+ </dt>
200
+ <dd class="complete">
201
+ <?php echo $this->getPaymentHtml() ?>
202
+ </dd>
203
+ <?php else: ?>
204
+ <dt>
205
+ <?php echo $this->__('Payment Method') ?>
206
+ </dt>
207
+ <?php endif; ?>
208
+ <?php endif; ?>
209
+ </dl>
210
+ </div>
211
+ </div>
app/design/frontend/base/default/template/internationalshipping/onepage/shipping_method/available.phtml ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <style type="text/css">
3
+ .rate-method-title .price-notice{padding-left: 45px;}
4
+ .poweredby { display: inline; font-size: 9px; padding-left: 0; font-weight: normal;}
5
+ .sz-total-block { background: none repeat scroll 0 0 #F2F2F2; color: black; margin-top: 10px; padding: 8px; width: 350px; }
6
+ .sz-total-title { color: black !important; font-size: 13px; width:340px !important;}
7
+ .sz-total-title .price { float: right; font-size: 12px;}
8
+ .progress-rate-label .price-notice { float: right; }
9
+ ul.swipezoom-rates-block { padding-left: 20px; width: 272px;}
10
+ ul.swipezoom-rates-block > li { width: 320px; }
11
+ label.shipping-label{ padding-left:19px; }
12
+ .swipezoom-rates-block label { font-weight: normal; }
13
+ .tool-tip-anchor{ cursor:help; margin-left:5px; }
14
+ .alert-content-duties { color: red; margin-top: 10px;}
15
+ .progress-rate .price-notice { float: right;}
16
+ .progress-rate-label { display: inline; width: 111px; float:left;}
17
+ .progress-rate{overflow: hidden;}
18
+ .progress-rate.total-rate-block{ border-top: 1px solid #999999;padding-top: 15px;}
19
+ .sz-rate-display-available {width: 340px;}
20
+ .sz-rate-display-available .price-notice, .swipezoom-rates-block .price-notice { float: right;}
21
+ .bold{font-weight: bold;}
22
+ </style>
23
+
24
+ <?php
25
+
26
+ if (version_compare(Mage::getVersion(), '1.9', '<')) {
27
+ ?>
28
+ <style>
29
+ .sz-total-block {width:333px;}
30
+ #cardpayment_expiration_yr {
31
+ width: 110px !important;
32
+ }
33
+ #cardpayment_expiration {
34
+ width: 130px !important;
35
+ }
36
+
37
+ </style>
38
+ <?php
39
+ }
40
+
41
+ ?>
42
+ <?php
43
+
44
+
45
+ $_shippingRateGroups = $this->getShippingRates();
46
+
47
+ $sz_enabled = false;
48
+ foreach ($_shippingRateGroups as $code => $_rates) {
49
+ foreach ($_rates as $_rate) {
50
+ if($code == 'swipezoom') {
51
+
52
+ $swAllowedCountries = Mage::getStoreConfig('carriers/swipezoom/sallowspecific',Mage::app()->getStore());
53
+ $swSpecificCountries = Mage::getStoreConfig('carriers/swipezoom/specificcountry',Mage::app()->getStore());
54
+ $swDestinationCountry = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCountry();
55
+ if($swAllowedCountries == 0) {
56
+ $sz_enabled = true;
57
+ } else {
58
+ $availableCountries = explode(',',$swSpecificCountries);
59
+ if ($availableCountries && in_array($swDestinationCountry, $availableCountries)) {
60
+ $sz_enabled = true;
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ if($sz_enabled == true) {
68
+ $ship_temp = $_shippingRateGroups;
69
+ foreach ($_shippingRateGroups as $code => $_rates) {
70
+ if($code == 'swipezoom') {
71
+ continue;
72
+ }
73
+ unset($ship_temp[$code]);
74
+ }
75
+ $_shippingRateGroups = $ship_temp;
76
+ } else {
77
+ $ship_temp = $_shippingRateGroups;
78
+ foreach ($_shippingRateGroups as $code => $_rates) {
79
+ if($code == 'swipezoom') {
80
+ unset($ship_temp[$code]);
81
+ }
82
+ }
83
+ $_shippingRateGroups = $ship_temp;
84
+ }
85
+ ?>
86
+ <?php if (!$_shippingRateGroups): ?>
87
+ <p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
88
+ <?php else: ?>
89
+ <dl class="sp-methods">
90
+ <?php $shippingCodePrice = array(); ?>
91
+ <?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
92
+ <dt <?php echo ($code == "swipezoom")? "style='font-size:16px'":""; ?>><?php echo $this->escapeHtml($this->getCarrierName($code)) ?> <?php if($code == "swipezoom"){?><p class="poweredby"><?php echo $this->__('Powered by ')?><span class="bold"><?php echo $this->__('Swipezoom')?></span></p><?php }?></dt>
93
+ <dd>
94
+ <ul>
95
+ <?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
96
+ <?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
97
+ <li>
98
+ <?php if ($_rate->getErrorMessage()): ?>
99
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
100
+ <?php else: ?>
101
+
102
+ <?php
103
+ if($code == "swipezoom"){
104
+ ?>
105
+
106
+ <?php if($_rate->getCode() == "swipezoom_custshippingcharges_noduties_noinsurance"):?>
107
+ <div class="sz-rate-display-available">
108
+ <?php if (count($_shippingRateGroups) == 1) : ?>
109
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo "swipezoom_custshippingcharges_withduties_withinsurance" ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" class="radio"/></span>
110
+ <?php else: ?>
111
+ <input name="shipping_method" type="radio" value="<?php echo "swipezoom_custshippingcharges_withduties_withinsurance" ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php $addresssShippingMethod = $this->getAddressShippingMethod(); if(strpos($this->getAddressShippingMethod(),"swipezoom") !== FALSE || empty($addresssShippingMethod)) echo ' checked="checked"' ?> class="radio"/>
112
+ <?php endif; ?>
113
+
114
+ <label id="label_s_method_<?php echo $_rate->getCode() ?>" for="s_method_<?php echo $_rate->getCode() ?>" class="rate-method-title"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
115
+
116
+ </label>
117
+ <span class="price-notice">
118
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
119
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
120
+ <?php echo $_excl; ?>
121
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
122
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
123
+ <?php endif; ?>
124
+ </span>
125
+ </div>
126
+ <?php
127
+ /*
128
+ * Swipezoom Insurance & taxes rates
129
+ */
130
+
131
+ if ($_rate->getCode() === "swipezoom_custshippingcharges_noduties_noinsurance"){
132
+
133
+ $ExtraRates = $_rate->getMethodDescription();
134
+ if(is_array($ExtraRates) && count($ExtraRates) > 0){
135
+ ?>
136
+ <ul class="swipezoom-rates-block">
137
+ <li <?php if($ExtraRates['PrepaidDutiesAllowed'] != 'Y') echo 'style="display:none"'; ?>>
138
+ <input type="checkbox" value="<?php echo $ExtraRates["CustCourierDuties"] ?>" id="duties" <?php echo ($ExtraRates["CustCourierDuties"] > 0 )? "": "disabled"; ?> <?php echo ($ExtraRates["CustCourierDuties"] > 0 )? "checked='true'": ""; ?> name="swipezoom" class="checkbox duties-checkbox" >
139
+ <label for="swipezoom_duty_taxes"><?php echo $this->__("Prepaid duties & taxes") ?>
140
+
141
+ <a href="#" id="tool-tip-duties" class="tool-tip-anchor tool-tip-duties" >
142
+ <img src="<?php echo $this->getSkinUrl("internationalshipping/images/que.png") ?>" title="<?php echo $this->__('For your convenience, we provide you the option to pre-pay Duties and Taxes. If you choose to pre-pay such Duties and Taxes, you may avoid customs delays and we guarantee that you will not be required to pay anything upon arrival of your shipment. If you do not choose the option to prepay the Duties and Taxes, you will be responsible for paying all Duties, Taxes and any related charges that may be due upon delivery. Duties and Taxes are calculated and charged as per the rules and regulations of the customs authority in your country.') ?>" class="fadeeffect"/></a>
143
+ <?php (!empty($ExtraRates["CustCourierDuties"]))?$dutiesRate = $ExtraRates["CustCourierDuties"]: $dutiesRate = "N/A";?>
144
+ </label>
145
+ <span class="price-notice"><span class="price"><?php echo ($ExtraRates["CustCourierDuties"] > 0 )? Mage::helper('core')->currency($ExtraRates["CustCourierDuties"],true,false): "N/A"; ?> </span></span>
146
+
147
+ <p id="alert-content-duties" class="alert-content-duties" style="display: none;"><?php echo $this->__('You have chosen to NOT prepay duties & taxes for this order and therefore will be responsible to pay these charges at the time of delivery.'); ?>
148
+ </p>
149
+ </li>
150
+ <li>
151
+ <input type="checkbox" value="<?php echo $ExtraRates["CustInsuranceCharges"] ?>" <?php echo ($ExtraRates["CustInsuranceCharges"] > 0 )? "": "disabled"; ?> <?php echo ($ExtraRates["CustInsuranceCharges"] > 0 )? "checked='true'": ""; ?> id="insurance" name="swipezoom" class="checkbox">
152
+ <label for="swipezoom_insurance"><?php echo $this->__("Insurance") ?>
153
+
154
+ <a href="#" id="tool-tip-insurance" class="tool-tip-anchor tool-tip-insurance" >
155
+ <img src="<?php echo $this->getSkinUrl("internationalshipping/images/que.png") ?>" title="<?php echo $this->__("If you wish to insure your shipment against damage or loss during transit, you may purchase shipment insurance by selecting this option. In the event of loss or damage during transit, you will be reimbursed the value of the goods and shipping costs only. you will not be reimbursed amounts paid towards customs duties or taxes. If insurance is not purchased, your shipment will not be covered for loss or damage during transit.");?>" class="fadeeffect"/></a>
156
+ <?php (!empty($ExtraRates["CustInsuranceCharges"]))?$insuranceRate = $ExtraRates["CustInsuranceCharges"]: $insuranceRate = "N/A";?>
157
+ </label>
158
+ <span class="price-notice"><span class="price"><?php echo ($ExtraRates["CustInsuranceCharges"] > 0 )? Mage::helper('core')->currency($ExtraRates["CustInsuranceCharges"],true,false): "N/A"; ?> </span></span>
159
+
160
+
161
+ </li>
162
+ </ul>
163
+
164
+
165
+ <?php
166
+ }
167
+ ?>
168
+ <div class="sz-total-block">
169
+ <label class="sz-total-title" id="sz-total-title"><?php echo $this->__('Shipping Total'); ?>
170
+ <span class="price-notice"><span class="price"><?php echo Mage::helper('core')->currency(($ExtraRates["CustCourierDuties"] + $ExtraRates["CustInsuranceCharges"] + $ExtraRates["shipping"] ),true,false); ?> </span></span>
171
+ </label>
172
+ </div>
173
+ <?php }
174
+ ?>
175
+ <?php else: ?>
176
+ <input name="c_shipping_method" type="checkbox" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio no-display"/>
177
+ <?php endif; ?>
178
+
179
+ <?php }else{?>
180
+
181
+ <?php if ($_sole) : ?>
182
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
183
+ <?php else: ?>
184
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
185
+
186
+ <?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
187
+ <script type="text/javascript">
188
+ //<![CDATA[
189
+ lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
190
+ //]]>
191
+ </script>
192
+ <?php endif; ?>
193
+
194
+ <?php endif; ?>
195
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
196
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
197
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
198
+ <?php echo $_excl; ?>
199
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
200
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
201
+ <?php endif; ?>
202
+ </label>
203
+ <?php } ?>
204
+ <?php endif ?>
205
+ </li>
206
+ <?php endforeach; ?>
207
+ </ul>
208
+ </dd>
209
+ <?php endforeach; ?>
210
+ </dl>
211
+ <script type="text/javascript">
212
+ //<![CDATA[
213
+ <?php if (!empty($shippingCodePrice)): ?>
214
+ var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
215
+ <?php endif; ?>
216
+
217
+ var datastorageurl = "<?php echo $ExtraRates['DataStorageUrl']; ?>";
218
+
219
+ if(datastorageurl) {
220
+ if($(".wirecard-datastorage"))
221
+ $(".wirecard-datastorage").remove();
222
+ var filename = datastorageurl;
223
+
224
+ var fileref = document.createElement('script');
225
+ fileref.setAttribute("type", "text/javascript");
226
+ fileref.setAttribute("src", filename);
227
+ fileref.setAttribute("class",'wirecard-datastorage')
228
+ document.getElementsByTagName("head")[0].appendChild(fileref);
229
+ }
230
+
231
+ $$('input[type="radio"][name="shipping_method"]').each(function(el){
232
+ Event.observe(el, 'click', function(){
233
+ if (el.checked == true) {
234
+ var getShippingCode = el.getValue();
235
+ <?php if (!empty($shippingCodePrice)): ?>
236
+ var newPrice = shippingCodePrice[getShippingCode];
237
+ if (!lastPrice) {
238
+ lastPrice = newPrice;
239
+ quoteBaseGrandTotal += newPrice;
240
+ }
241
+ if (newPrice != lastPrice) {
242
+ quoteBaseGrandTotal += (newPrice-lastPrice);
243
+ lastPrice = newPrice;
244
+ }
245
+ <?php endif; ?>
246
+ checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
247
+ return false;
248
+ }
249
+ });
250
+ });
251
+
252
+ // SwipeZoom Rates
253
+ $$('input[type="checkbox"][name="swipezoom"]').each(function(el){
254
+ Event.observe(el, 'click', function(){
255
+ var oldValue = ($("sz-total-title").down().down().innerHTML).replace(/[<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>]*/, '');
256
+ if(el.checked)
257
+ $("sz-total-title").down().down().innerHTML = '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>'+ (parseFloat(oldValue) + parseFloat(el.value)).toFixed(2)+'';
258
+ else
259
+ $("sz-total-title").down().down().innerHTML = '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>'+ (parseFloat(oldValue) - parseFloat(el.value)).toFixed(2)+'';
260
+
261
+ var id="swipezoom_custshippingcharges";
262
+ $$('input[type="checkbox"][name="swipezoom"]').each(function(el){
263
+ if(el.checked){
264
+ id+="_"+"with"+el.id;
265
+ }else{
266
+ id+="_"+"no"+el.id;
267
+ }
268
+ });
269
+ $("s_method_swipezoom_custshippingcharges_noduties_noinsurance").value = id;
270
+ $("s_method_swipezoom_custshippingcharges_noduties_noinsurance").checked= true;
271
+
272
+ });
273
+ });
274
+
275
+ function dutiesTest(el){
276
+ var oldValue = ($("sz-total-title").down().down().innerHTML).replace(/[<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>]*/, '');
277
+ if(el.checked)
278
+ $("sz-total-title").down().down().innerHTML = '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>'+ (parseFloat(oldValue) + parseFloat(el.value)).toFixed(2)+'';
279
+ else
280
+ $("sz-total-title").down().down().innerHTML = '<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>'+ (parseFloat(oldValue) - parseFloat(el.value)).toFixed(2)+'';
281
+
282
+ var id="swipezoom_custshippingcharges";
283
+ $$('input[type="checkbox"][name="swipezoom"]').each(function(el){
284
+ if(el.checked){
285
+ id+="_"+"with"+el.id;
286
+ }else{
287
+ id+="_"+"no"+el.id;
288
+ }
289
+ });
290
+ $("s_method_swipezoom_custshippingcharges_noduties_noinsurance").value = id;
291
+ $("s_method_swipezoom_custshippingcharges_noduties_noinsurance").checked= true;
292
+
293
+ }
294
+
295
+ $$('.duties-checkbox').each(function(ele){
296
+ Event.observe(ele, 'click', function(){
297
+ if (!ele.checked)
298
+ {
299
+ $('alert-content-duties').show();
300
+ }else
301
+ {
302
+ $('alert-content-duties').hide();
303
+ }
304
+ });
305
+ });
306
+
307
+ <?php if($ExtraRates["CustCourierDuties"] == 0){?>
308
+ dutiesTest($("duties"));
309
+ <?php }?>
310
+ <?php if($ExtraRates["CustInsuranceCharges"] == 0){?>
311
+ dutiesTest($("insurance"));
312
+ <?php }?>
313
+ //]]>
314
+ </script>
315
+ <?php endif; ?>
app/design/frontend/base/default/template/internationalshipping/openpdf.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $fileurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS.$this->getRequest()->getParam('file');
4
+ $folder = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS ;
5
+ foreach( glob( $folder.$this->getRequest()->getParam('file') ) as $filename ) {
6
+ $filename = $filename;
7
+ chmod($filename, 0777);
8
+ }
9
+ $f=fopen($filename,'r');
10
+ if($f){
11
+ header('Cache-Control: no-store, no-cache, must-revalidate');
12
+ header('Content-Type: application/octet-stream');//.mime_content_type($filename));
13
+ header('Content-Length: '.filesize($filename));
14
+ header('Content-Disposition: attachment; filename="'.$this->getRequest()->getParam('file').'"');
15
+ fpassthru($f);
16
+ }else{ die("Ops!"); }
17
+ fclose($f);
18
+ ?>
19
+
20
+
app/design/frontend/base/default/template/internationalshipping/order/info.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
4
+ <div class="page-title title-buttons">
5
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
6
+ <?php echo $this->getChildHtml('buttons') ?>
7
+ </div>
8
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
9
+ <dl class="order-info">
10
+ <dt><?php echo $this->__('About This Order:') ?></dt>
11
+ <dd>
12
+ <?php $_links = $this->getLinks(); ?>
13
+ <ul id="order-info-tabs">
14
+ <?php foreach ($_links as $_link): ?>
15
+ <?php if($_link->getUrl()): ?>
16
+ <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
17
+ <?php else: ?>
18
+ <li class="current"><?php echo $_link->getLabel() ?></li>
19
+ <?php endif; ?>
20
+ <?php endforeach; ?>
21
+ </ul>
22
+ <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
23
+ </dd>
24
+ </dl>
25
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
26
+ <?php if (!$_order->getIsVirtual()): ?>
27
+ <div class="col2-set order-info-box">
28
+ <div class="col-1">
29
+ <div class="box">
30
+ <div class="box-title">
31
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
32
+ </div>
33
+ <div class="box-content">
34
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <div class="col-2">
39
+ <div class="box">
40
+ <div class="box-title">
41
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
42
+ </div>
43
+ <div class="box-content">
44
+ <?php if ($_order->getShippingDescription()): ?>
45
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
46
+ <?php else: ?>
47
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
48
+ <?php endif; ?>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ <?php endif; ?>
54
+ <div class="col2-set order-info-box">
55
+ <div class="col-1">
56
+ <div class="box">
57
+ <div class="box-title">
58
+ <h2><?php echo $this->__('Billing Address') ?></h2>
59
+ </div>
60
+ <div class="box-content">
61
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ <div class="col-2">
66
+ <div class="box box-payment">
67
+ <div class="box-title">
68
+ <h2><?php echo $this->__('Payment Method') ?></h2>
69
+ </div>
70
+ <div class="box-content">
71
+ <?php echo $this->getPaymentInfoHtml() ?>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </div>
app/design/frontend/base/default/template/internationalshipping/order/invoice/rederer/default.phtml ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = Mage::registry('current_order')
3
+ ?>
4
+ <?php $_item = $this->getItem() ?>
5
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
6
+ <td><h3 class="product-name"><?php echo $this->htmlEscape($_item->getName()) ?></h3>
7
+ <?php if($_options = $this->getItemOptions()): ?>
8
+ <dl class="item-options">
9
+ <?php foreach ($_options as $_option) : ?>
10
+ <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
11
+ <?php if (!$this->getPrintStatus()): ?>
12
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
13
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
14
+ <?php echo $_formatedOptionValue['value'] ?>
15
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
16
+ <div class="truncated_full_value">
17
+ <dl class="item-options">
18
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
19
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
20
+ </dl>
21
+ </div>
22
+ <?php endif; ?>
23
+ </dd>
24
+ <?php else: ?>
25
+ <dd>
26
+ <?php echo nl2br($this->htmlEscape( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
27
+ </dd>
28
+ <?php endif; ?>
29
+ <?php endforeach; ?>
30
+ </dl>
31
+ <?php endif; ?>
32
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
33
+ <?php if ($addtInfoBlock) :?>
34
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
35
+ <?php endif; ?>
36
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
37
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
38
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
39
+ <?php endif; ?>
40
+ </td>
41
+ <td><?php echo $this->htmlEscape(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
42
+ <td class="a-right">
43
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
44
+ <span class="price-excl-tax">
45
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
46
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
47
+ <span class="cart-price">
48
+ <?php endif; ?>
49
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
50
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
51
+ </span>
52
+ <?php endif; ?>
53
+ <?php endif; ?>
54
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
55
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
56
+ <?php else: ?>
57
+ <span class="cart-price">
58
+ <?php endif; ?>
59
+
60
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
61
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
62
+ <?php else: ?>
63
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
64
+ <?php endif; ?>
65
+
66
+ </span>
67
+
68
+
69
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
70
+
71
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
72
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
73
+ <small>
74
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
75
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
76
+ <?php endforeach; ?>
77
+ </small>
78
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
79
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
80
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
81
+ <?php endforeach; ?>
82
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
83
+ <small>
84
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
85
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
86
+ <?php endforeach; ?>
87
+ </small>
88
+ <?php endif; ?>
89
+ </span>
90
+
91
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
92
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
93
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span>
94
+ </span>
95
+ <?php endif; ?>
96
+ <?php endif; ?>
97
+ </span>
98
+ <br />
99
+ <?php endif; ?>
100
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
101
+ <span class="price-incl-tax">
102
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
103
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
104
+ <span class="cart-price">
105
+ <?php endif; ?>
106
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
107
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
108
+ </span>
109
+ <?php endif; ?>
110
+ <?php endif; ?>
111
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
113
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
114
+ <?php else: ?>
115
+ <span class="cart-price">
116
+ <?php endif; ?>
117
+
118
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
119
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
120
+ <?php else: ?>
121
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
122
+ <?php endif; ?>
123
+
124
+ </span>
125
+
126
+
127
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
128
+
129
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
130
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
131
+ <small>
132
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
133
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
134
+ <?php endforeach; ?>
135
+ </small>
136
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
137
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
138
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
139
+ <?php endforeach; ?>
140
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
141
+ <small>
142
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
143
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
144
+ <?php endforeach; ?>
145
+ </small>
146
+ <?php endif; ?>
147
+ </span>
148
+
149
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
150
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
151
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span>
152
+ </span>
153
+ <?php endif; ?>
154
+ <?php endif; ?>
155
+ </span>
156
+ <?php endif; ?>
157
+ </td>
158
+ <td class="a-right">
159
+ <span class="nobr">
160
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
161
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
162
+ <?php endif; ?>
163
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
164
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
165
+ <?php endif; ?>
166
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
167
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
168
+ <?php endif; ?>
169
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
170
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
171
+ <?php endif; ?>
172
+ </span>
173
+ </td>
174
+ <td class="a-right">
175
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
176
+ <span class="price-excl-tax">
177
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
178
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
179
+ <span class="cart-price">
180
+ <?php endif; ?>
181
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
182
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
183
+ </span>
184
+ <?php endif; ?>
185
+ <?php endif; ?>
186
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
187
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
188
+ <?php else: ?>
189
+ <span class="cart-price">
190
+ <?php endif; ?>
191
+
192
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
193
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
194
+ <?php else: ?>
195
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
196
+ <?php endif; ?>
197
+
198
+ </span>
199
+
200
+
201
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
202
+
203
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
204
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
205
+ <small>
206
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
207
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
208
+ <?php endforeach; ?>
209
+ </small>
210
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
211
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
212
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
213
+ <?php endforeach; ?>
214
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
215
+ <small>
216
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
217
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
218
+ <?php endforeach; ?>
219
+ </small>
220
+ <?php endif; ?>
221
+ </span>
222
+
223
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
224
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
225
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span>
226
+ </span>
227
+ <?php endif; ?>
228
+ <?php endif; ?>
229
+ </span>
230
+ <br />
231
+ <?php endif; ?>
232
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
233
+ <span class="price-incl-tax">
234
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
235
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
236
+ <span class="cart-price">
237
+ <?php endif; ?>
238
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
239
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
240
+ </span>
241
+ <?php endif; ?>
242
+ <?php endif; ?>
243
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
244
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
245
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
246
+ <?php else: ?>
247
+ <span class="cart-price">
248
+ <?php endif; ?>
249
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
250
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
251
+ <?php else: ?>
252
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
253
+ <?php endif; ?>
254
+
255
+ </span>
256
+
257
+
258
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
259
+
260
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
261
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
262
+ <small>
263
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
264
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
265
+ <?php endforeach; ?>
266
+ </small>
267
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
268
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
269
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
270
+ <?php endforeach; ?>
271
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
272
+ <small>
273
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
274
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
275
+ <?php endforeach; ?>
276
+ </small>
277
+ <?php endif; ?>
278
+ </span>
279
+
280
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
281
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
282
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span>
283
+ </span>
284
+ <?php endif; ?>
285
+ <?php endif; ?>
286
+
287
+
288
+
289
+ </span>
290
+ <?php endif; ?>
291
+ </td>
292
+ <!--
293
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
294
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
295
+ <?php endif; ?>
296
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
297
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
298
+ <?php endif; ?>
299
+ -->
300
+ </tr>
app/design/frontend/base/default/template/internationalshipping/printall.phtml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div id="content" >
3
+ <?php
4
+ function getCallerArray(){
5
+ $merchantRefNo = "123";
6
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
7
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
8
+ "Version"=> "SW0101",
9
+ "Datetime" => date("Y-m-d h:i:s"),
10
+ "MerchantRefNo" => $merchantRefNo);
11
+ return $callerObj;
12
+ }
13
+
14
+ $folder1 = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS;
15
+ if (!(@is_dir($folder1) || @mkdir($folder1, 0777, true))) {
16
+ echo "Unable to create directory '{$folder1}'.";
17
+ }
18
+ $folder = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS ;
19
+ if (!(@is_dir($folder) || @mkdir($folder, 0777, true))) {
20
+ echo "Unable to create directory '{$folder}'.";
21
+ }
22
+ foreach( glob( $folder.'*.pdf' ) as $filename ) { chmod($filename, 0777); }
23
+ foreach( glob( $folder.'*.zip' ) as $filename ) {$filename;chmod($filename, 0777);}
24
+
25
+
26
+
27
+ if(!$filename){
28
+ try {
29
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
30
+ $params = array("Caller" => getCallerArray(),"OrderNo" => $this->getRequest()->getParam('szoomorder'));
31
+ $response = $client->ShipDoc($params);
32
+
33
+ if($response->ResponseStatusCode == '000'){
34
+ $imageFilename = basename($response->ShipDoc->FileName);
35
+ $image_type = substr(strrchr($imageFilename,"."),1); //find the image extension
36
+ $zipfile= $filename = $imageFilename; //give a new name, you can modify as per your requirement
37
+ $filepath = Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS . $filename; //path for temp storage folder: ./media/import/
38
+ $newImgUrl = file_put_contents($filepath, $response->ShipDoc->Contents); //store the image from external url to the temp storage folder
39
+ $zip = new ZipArchive;
40
+ if ($zip->open($filepath) === TRUE) {
41
+ $zip->extractTo(Mage::getBaseDir('media') . DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS);
42
+ $zip->close();
43
+ //echo 'ok';
44
+ }
45
+
46
+ } else {
47
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'ShipDoc');
48
+ }
49
+ } catch (Exception $e) {
50
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
51
+ Mage::log($debugData,null,'debug.log');
52
+ Mage::logException($e);
53
+ }
54
+ }
55
+ foreach( glob( $folder.'*.pdf' ) as $filename ) { chmod($filename, 0777); }
56
+ foreach( glob( $folder.'*.zip' ) as $filename ) {$filename;chmod($filename, 0777);}
57
+
58
+ //echo $zipfile;
59
+ $dir=$folder; // Directory where files are stored ?>
60
+ <?php
61
+ foreach( glob( $folder.'*.zip' ) as $filename ) {$filename;}
62
+ if($filename){
63
+
64
+ ?>
65
+ <h1> <?php echo $this->helper('sales')->__('Order Document') ?> </h1>
66
+ <?php
67
+
68
+ $zip = explode($this->getRequest()->getParam('szoomorder'),$filename,2);
69
+ ?>
70
+ <table width="100%" id="orderdocuments" class="data-table">
71
+ <tr>
72
+ <td colspan="2" align="right"><a style="float:right;" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'Swipzoom'. DS .$this->getRequest()->getParam('szoomorder').DS. $zip[1]; ?>">
73
+ <?php echo $this->helper('sales')->__('Donwload All') ?></a></td>
74
+ </tr>
75
+ <?php if ($dir_list = opendir($dir)) { ?>
76
+ <?php while(($filename = readdir($dir_list)) != false){
77
+ if('zip' != substr(strrchr($filename,"."),1) && strlen($filename) > 4){
78
+
79
+ $fileurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'Swipzoom'. DS . $this->getRequest()->getParam('szoomorder'). DS.$filename;
80
+ $fileurlview = $this->getUrl('internationalshipping/index/openpdf', array('szoomorder'=>$this->getRequest()->getParam('szoomorder'), 'file'=> $filename))
81
+ ?>
82
+ <tr>
83
+ <td><?php echo str_replace('_',' ', str_replace('SZ_','',$filename)); ?></td>
84
+ <td><a target="_blank" href="<?php echo "https://docs.google.com/gview?url=".$fileurl; ?>"><?php echo ' View '; ?></a>|<a href="<?php echo $fileurlview ?>"><?php echo ' Download '; ?></a></td>
85
+ </tr>
86
+ <?php } } ?>
87
+ </table>
88
+ <?php closedir($dir_list);} ?>
89
+ <script type="text/javascript">decorateTable('orderdocuments');</script>
90
+ <div class="buttons-set">
91
+ <button onclick="window.parent.closePopup();" class="button" title="Close Window" type="button"><span><span>Close Window</span></span></button>
92
+ </div>
93
+
94
+
95
+ <?php }
96
+
97
+
98
+ ?>
99
+
100
+ </div>
101
+
102
+ <script>
103
+ window.onload = function(){
104
+ window.parent.hideloading();
105
+ }
106
+ </script>
app/design/frontend/base/default/template/internationalshipping/printpack.phtml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="page-title title-buttons">
2
+ <h1>Print Packing Instruction</h1>
3
+ <button onclick="window.parent.closePopup();" class="button"><span><span>Close Window</span></span></button>
4
+ </div>
5
+ <div class="content">
6
+
7
+ </div>
8
+ <div class="buttons-set">
9
+
10
+ <button onclick="window.parent.closePopup();" class="button" title="Close Window" type="button"><span><span>Close Window</span></span></button>
11
+ </div>
app/design/frontend/base/default/template/internationalshipping/processformat.phtml ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ $type=Mage::app()->getRequest()->getParam("type");
4
+
5
+ $flag = $this->getFlag();
6
+
7
+ if($flag != "reset"):
8
+ $response = $this->getResponseArray();
9
+ $chk=json_decode(json_encode($response), true);
10
+
11
+
12
+
13
+ $key = "DisplayOrder";
14
+ $array=$response;
15
+ $chk2=$chk1['AddressFormat'];
16
+
17
+ foreach ($array as $ii => $va) {
18
+ // foreach ($array[$ii] as $i => $val) {
19
+ $sorter[$ii]=$va[$key];
20
+ //}
21
+ }
22
+ asort($sorter);
23
+ foreach ($sorter as $element => $value) {
24
+ $ret[$element]=$array[$element];
25
+ }
26
+ $array=$ret;
27
+
28
+ for($i=0;$i<count($chk2);$i++)
29
+ {
30
+ $labelcol[]=$chk2[$i];
31
+ }
32
+ // echo json_encode($labelcol);
33
+ //
34
+
35
+ ?>
36
+ <ul id="<?php echo $type?>-row32">
37
+ <?php
38
+ $regionFlag = false;
39
+ $cityFlag = false;
40
+ $zipFlag = false;
41
+ //
42
+ foreach($array as $data)
43
+ {
44
+
45
+ if(($data['FieldType'])=="D"){
46
+ $regionFlag = true;
47
+ }
48
+ if(($data['FieldType'])=="C"){
49
+ $cityFlag = true;
50
+ }
51
+ if(($data['FieldType'])=="P"){
52
+ $zipFlag = true;
53
+ }
54
+
55
+ if(($data['FieldType'])==1)
56
+ {
57
+ ?>
58
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
59
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
60
+ <li class="wide">
61
+ <label for="<?php echo $type?>:street1" class="<?php if(($data['IsMandatory'])=="Y"){ ?>required<?php } ?>"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__($data['FieldLabel']) ?></label>
62
+ <div class="input-box">
63
+ <input type="text" maxlength="35" title="<?php echo $this->__('Street Address') ?>" name="<?php echo $type?>[street][]" id="<?php echo $type?>:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="<?php if($data['IsMandatory'] == "Y"){ echo "required-entry" ?><?php } ?> input-text text" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> /></div>
64
+ </li>
65
+ <?php
66
+ }
67
+ if(($data['FieldType'])==2)
68
+ {
69
+ ?>
70
+ <li class="wide">
71
+ <div class="input-box">
72
+ <label for="<?php echo $type?>:street2"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__($data['FieldLabel']) ?></label>
73
+ <div class="input-box">
74
+
75
+
76
+ <input type="text" maxlength="35" title="<?php echo $this->__('Street Address %s', 2) ?>" name="<?php echo $type?>[street][]" id="<?php echo $type?>:street2" value="" class="input-text <?php if(($data['IsMandatory'])=="Y"){ echo "required-entry" ?><?php } ?>" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
77
+
78
+ </div>
79
+ </div>
80
+ </li>
81
+ <?php
82
+ }
83
+ if(($data['FieldType'])=="C")
84
+ {
85
+ ?>
86
+ <li class="fields">
87
+ <div class="field">
88
+ <label for="<?php echo $type?>:city" class="required"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__($data['FieldLabel']) ?></label>
89
+ <div class="input-box">
90
+ <input type="text" maxlength="30" title="<?php echo $this->__('City') ?>" name="<?php echo $type?>[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php if($data['IsMandatory']=="Y"){ echo "required-entry"; }?> validate-city" id="<?php echo $type?>:city" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
91
+
92
+ </div>
93
+ </div>
94
+ <?php }
95
+ ?>
96
+ <?php
97
+
98
+ if(($data['FieldType'])=="D")
99
+ {
100
+ //
101
+ ?>
102
+ <div class="field">
103
+ <label for="<?php echo $type?>:region_id" class="<?php if($data['IsMandatory']=="Y"){ echo "required"; }?>"><?php if($data['IsMandatory'] == "Y"){ ?><em>*</em><?php } ?><?php echo $this->__($data['FieldLabel']) ?></label>
104
+
105
+
106
+ <div class="input-box">
107
+ <select id="<?php echo $type?>:region_id" name="<?php echo $type?>[region_id]" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> title="<?php echo $this->__('Province/Territory') ?>" class="<?php if(($data['IsMandatory'])=="Y"){ ?>validate-select<?php } ?> " style="display:none;">
108
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
109
+ </select>
110
+ <script type="text/javascript">
111
+ //<![CDATA[
112
+ $('<?php echo $type?>:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
113
+ //]]>
114
+ </script>
115
+ <input type="text" maxlength="30" id="<?php echo $type?>:region" name="<?php echo $type?>[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php if(($data['IsMandatory'])=="Y"){ ?>required-entry<?php } ?>" style="display:none;" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
116
+ </div>
117
+ </div>
118
+ </li>
119
+ <?php
120
+ }
121
+ if(($data['FieldType'])=="P")
122
+ {
123
+ //
124
+ ?>
125
+ <div class="field">
126
+ <label for="<?php echo $type?>:postcode" class="required"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__($data['FieldLabel']) ?></label>
127
+ <div class="input-box">
128
+ <input type="text" maxlength="10" title="<?php echo $this->__('Postal Code') ?>" name="<?php echo $type?>[postcode]" id="<?php echo $type?>:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="<?php if(($data['IsMandatory'])=="Y"){ echo "required-entry"; } ?> input-text" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
129
+ </div>
130
+ </div> <?php
131
+ }
132
+
133
+ }
134
+
135
+ if(!$regionFlag) {
136
+ ?>
137
+ <div class="field" style="display: none;">
138
+ <label for="<?php echo $type?>:region_id" class="<?php if(($data['IsMandatory'])=="Y"){ ?>required<?php } ?>"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__('State') ?></label>
139
+
140
+
141
+ <div class="input-box">
142
+ <select id="<?php echo $type?>:region_id" name="<?php echo $type?>[region_id]" title="<?php echo $this->__('Province/Territory') ?>" class="<?php if(($data['IsMandatory'])=="Y"){ ?>validate-select<?php } ?> " style="display:none;" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?>>
143
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
144
+ </select>
145
+ <script type="text/javascript">
146
+ //<![CDATA[
147
+ $('<?php echo $type?>:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
148
+ //]]>
149
+ </script>
150
+ <input type="text" id="<?php echo $type?>:region" name="<?php echo $type?>[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php if(($data['IsMandatory'])=="Y"){ ?>required-entry<?php } ?>" style="display:none;" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
151
+ </div>
152
+ </div>
153
+ <?php
154
+ }
155
+ if(!$cityFlag){?>
156
+ <div class="field" style="display: none;">
157
+ <label for="<?php echo $type?>:city" class="required"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__("City") ?></label>
158
+ <div class="input-box">
159
+ <input type="text" title="<?php echo $this->__('City') ?>" name="<?php echo $type?>[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php if(($data['IsMandatory'])=="Y"){ echo "required-entry"?><?php } ?> validate-city" id="<?php echo $type?>:city" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
160
+
161
+ </div>
162
+ </div>
163
+ <?php
164
+ }
165
+
166
+ if(!$zipFlag){?>
167
+ <div class="field" style="display: none;">
168
+ <label for="<?php echo $type?>:postcode" class="required"><?php if(($data['IsMandatory'])=="Y"){ ?><em>*</em><?php } ?><?php echo $this->__("Postcode") ?></label>
169
+ <div class="input-box">
170
+ <input type="text" title="<?php echo $this->__('Postal Code') ?>" name="<?php echo $type?>[postcode]" id="<?php echo $type?>:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="<?php if(($data['IsMandatory'])=="Y"){ ?>required-entry<?php } ?> input-text " <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
171
+ </div>
172
+ </div>
173
+ <?php }
174
+ ?>
175
+ </ul>
176
+
177
+ <?php else: ?>
178
+ <ul id="<?php echo $type?>-row32">
179
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
180
+ <li class="wide containers1" >
181
+ <label for="<?php echo $type?>:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
182
+ <div class="input-box">
183
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="<?php echo $type?>[street][]" id="<?php echo $type?>:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
184
+ </div>
185
+ </li>
186
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
187
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
188
+ <li class="wide">
189
+ <label for="<?php echo $type?>:street<?php echo $_i;?>>" class=""></label>
190
+ <div class="input-box">
191
+ <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="<?php echo $type?>[street][]" id="<?php echo $type?>:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
192
+ </div>
193
+ </li>
194
+ <?php endfor; ?>
195
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
196
+ <li class="wide">
197
+ <label for="<?php echo $type?>:vat_id"><?php echo $this->__('VAT Number') ?></label>
198
+ <div class="input-box">
199
+ <input type="text" id="<?php echo $type?>:vat_id" name="<?php echo $type?>[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
200
+ </div>
201
+ </li>
202
+ <?php endif; ?>
203
+ <li class="fields">
204
+ <div class="field">
205
+ <label for="<?php echo $type?>:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
206
+ <div class="input-box">
207
+ <input type="text" title="<?php echo $this->__('City') ?>" name="<?php echo $type?>[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text required-entry <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?> validate-city" id="<?php echo $type?>:city" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
208
+ </div>
209
+ </div>
210
+ <div class="field containers3" >
211
+ <?php
212
+ //
213
+ ?>
214
+ <label for="<?php echo $type?>:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
215
+ <div class="input-box">
216
+ <select id="<?php echo $type?>:region_id" name="<?php echo $type?>[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?>>
217
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
218
+ </select>
219
+ <script type="text/javascript">
220
+ //<![CDATA[
221
+ $('<?php echo $type?>:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
222
+ //]]>
223
+ </script>
224
+ <input type="text" id="<?php echo $type?>:region" name="<?php echo $type?>[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
225
+ </div>
226
+ </div>
227
+ </li>
228
+ <li class="fields">
229
+ <div class="field">
230
+ <label for="<?php echo $type?>:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
231
+ <div class="input-box">
232
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="<?php echo $type?>[postcode]" id="<?php echo $type?>:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text" <?php if($type=='shipping') { ?> onchange="shipping.setSameAsBilling(false);" <?php } ?> />
233
+ </div>
234
+ </div>
235
+ </li>
236
+
237
+ </ul>
238
+ <?php endif;?>
239
+ <script type="text/javascript">
240
+ jQuery(document).ready(function(){
241
+ // here call autocomplete for city and state.
242
+ if('<?php echo $type?>' == 'billing') {
243
+
244
+ if(jQuery("input[name='billing[city]']").length) {
245
+ jQuery("input[name='billing[city]']").autocomplete('<?php echo $this->getUrl('internationalshipping/index/getCitiesForAutoComplete') ?>', {
246
+ extraParams: {
247
+ countrycode: function() { return jQuery('select[name="billing[country_id]"]').val();},
248
+ city: function() { return jQuery("input[name='billing[city]']").val(); }
249
+ },
250
+ minChars: 0,
251
+ max: 200,
252
+ multiple:false,
253
+ scrollHeight: 220,
254
+ autoFill: false,
255
+ mustMatch: false,
256
+ selectFirst:true,
257
+ cacheLength:1
258
+ }).focusout(function(){
259
+
260
+ });
261
+
262
+
263
+ }
264
+ } else if('<?php echo $type?>' == 'shipping'){
265
+
266
+ if(jQuery("input[name='shipping[city]']").length) {
267
+ if(jQuery("input[name='shipping[city]']").length) {
268
+ jQuery("input[name*='shipping[city]']").autocomplete('<?php echo $this->getUrl('internationalshipping/index/getCitiesForAutoComplete') ?>', {
269
+ extraParams: {
270
+ countrycode: function() { return jQuery('select[name="shipping[country_id]"]').val();},
271
+ city: function() { return jQuery("input[name='shipping[city]']").val(); }
272
+ },
273
+ minChars: 0,
274
+ max: 200,
275
+ multiple:false,
276
+ scrollHeight: 220,
277
+ autoFill: false,
278
+ mustMatch: false,
279
+ selectFirst:true,
280
+ cacheLength:1
281
+ }).focusout(function(){
282
+
283
+ });
284
+
285
+ }
286
+
287
+ }
288
+ }
289
+ });
290
+
291
+ </script>
app/design/frontend/base/default/template/internationalshipping/sales/order/print.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <button style="float:right;" onclick="window.print();" class="button"><span><span>Print Order</span></span></button>
3
+
4
+ <?php $_order = $this->getOrder() ?>
5
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
6
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
7
+ <div class="col2-set">
8
+ <?php if (!$_order->getIsVirtual()): ?>
9
+ <div class="col-1">
10
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
11
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
12
+ </div>
13
+ <div class="col-2">
14
+ <?php else: ?>
15
+ <div class="col-1">
16
+ <?php endif; ?>
17
+ <h2><?php echo $this->__('Billing Address') ?></h2>
18
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
19
+ </div>
20
+ <?php if (!$_order->getIsVirtual()): ?>
21
+ </div>
22
+ <div class="col2-set">
23
+
24
+ <?php endif; ?>
25
+
26
+ </div>
27
+
28
+
29
+ <style>
30
+ table,td,tr,th{border:2px solid #d9dde3}
31
+ </style>
32
+
33
+ <?php if($swipwzoomorder = $_order->getSwipezoomOrderNumberTemp()){ ?> <br />
34
+
35
+ <h2><?php echo $this->__('Items Packing Detail') ?></h2>
36
+ <table cellspacing="0" class="data-table" id="my-orders-table">
37
+ <col />
38
+ <col width="1" />
39
+ <col width="1" />
40
+ <col width="1" />
41
+ <col width="1" />
42
+ <col width="1" />
43
+ <col width="1" />
44
+ <col width="1" />
45
+ <thead>
46
+ <tr class="headings">
47
+ <th width="70"><?php echo Mage::helper('sales')->__('Item') ?></th>
48
+ <th width="120"><?php echo Mage::helper('sales')->__('Box Code') ?></th>
49
+ <th width="70"><?php echo Mage::helper('sales')->__('Box No.') ?></th>
50
+ <th width="500"><?php echo Mage::helper('sales')->__('Product Description') ?></th>
51
+ <th width="150"><?php echo Mage::helper('sales')->__('Product Code') ?></th>
52
+ <th width="70"><?php echo Mage::helper('sales')->__('Quantity') ?></th>
53
+ </tr>
54
+ </thead>
55
+
56
+ <?php
57
+ $orderid = Mage::app()->getRequest()->getParam('order_id');
58
+ $order= Mage::getModel('sales/order')->load($orderid);
59
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
60
+
61
+ $_items = Mage::getModel('internationalshipping/packingdetail')->getCollection()->addFieldToFilter('swipezoomorderid',$swipwzoomorder); ?>
62
+ <tbody class="<?php echo $_i%2?'even':'odd' ?>">
63
+ <?php $_i=0;foreach ($_items as $_item): ?>
64
+ <?php if(!$_item->getProductcode()){break;}
65
+ $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode());
66
+ if(!$products){ echo "<tr ><td colspan='6'>Somthing wrong Happen - Product not found.</td></tr>"; break;}
67
+ ?>
68
+ <?php $_i++; ?>
69
+ <tr class="border">
70
+ <td><?php echo $_i ?></td>
71
+ <td><?php echo $_item->getBoxcode() ?></td>
72
+ <td><?php echo $_item->getBoxno() ?></td>
73
+ <td><?php echo $products = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getProductcode())->getName(); ?></td>
74
+ <td><?php echo $_item->getProductcode() ?></td>
75
+ <td><?php echo $_item->getProductqty() ?></td>
76
+ </tr>
77
+ <?php endforeach; ?>
78
+ </tbody>
79
+
80
+ </table>
81
+ <?php }else{ ?>
82
+ <h2><?php echo $this->__('Items Ordered') ?></h2>
83
+ <table class="data-table" id="my-orders-table">
84
+ <col />
85
+ <col width="1" />
86
+ <col width="1" />
87
+ <col width="1" />
88
+ <col width="1" />
89
+ <thead>
90
+ <tr>
91
+ <th><?php echo $this->__('Product Name') ?></th>
92
+ <th><?php echo $this->__('SKU') ?></th>
93
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
94
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
95
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
96
+ </tr>
97
+ </thead>
98
+ <tfoot>
99
+ <?php echo $this->getChildHtml('order_totals') ?>
100
+ </tfoot>
101
+ <?php $_items = $_order->getItemsCollection(); ?>
102
+ <?php $_count = $_items->count(); ?>
103
+ <?php foreach ($_items as $_item): ?>
104
+ <?php if ($_item->getParentItem()) continue; ?>
105
+ <tbody>
106
+ <?php echo $this->getItemHtml($_item) ?>
107
+ </tbody>
108
+ <?php endforeach; ?>
109
+ </table>
110
+ <?php }?>
111
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
112
+
113
+
114
+ <script>
115
+ window.onload = function(){
116
+ window.parent.hideloading();
117
+ }
118
+ </script>
app/design/frontend/base/default/template/internationalshipping/shipping/tracking/popup.phtml ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div id="loading-mask">
3
+ <p id="loading_mask_loader" class="loader"><img alt="Loading..." src="<?php echo $this->getSkinUrl('internationalshipping/images/ajax-loader-tr.gif') ?>"><br>Please wait...</p>
4
+ </div>
5
+ <style>
6
+ #loading-mask {
7
+ color: #D85909;
8
+ font-size: 1.1em;
9
+ font-weight: bold;
10
+ opacity: 0.8;
11
+ position: absolute;
12
+ text-align: center;
13
+ z-index: 999999;
14
+ }
15
+ #loading-mask .loader {
16
+ background: none repeat scroll 0 0 #FFF4E9;
17
+ border: 2px solid #F1AF73;
18
+ color: #D85909;
19
+ font-weight: bold;
20
+ left: 50%;
21
+ margin-left: -105px;
22
+ padding: 15px 30px;
23
+ position: fixed;
24
+ text-align: center;
25
+ top: 45%;
26
+ width: 150px;
27
+ z-index: 1000;
28
+ }
29
+ </style>
30
+ <div id="content" style="display:none;">
31
+ <?php $_results = $this->getTrackingInfo(); ?>
32
+ <?php
33
+
34
+ function getCallerArray(){
35
+ $merchantRefNo = "123";
36
+
37
+ $callerObj = array("MerchantID" => Mage::getStoreConfig('carriers/swipezoom/merchantid',Mage::app()->getStore()),
38
+ "MerchantKey" => Mage::getStoreConfig('carriers/swipezoom/merchantkey',Mage::app()->getStore()),
39
+ "Version"=> "SW0101",
40
+ "Datetime" => date("Y-m-d h:i:s"),
41
+ "MerchantRefNo" => $merchantRefNo);
42
+ return $callerObj;
43
+ }
44
+
45
+
46
+ foreach($_results as $shipid => $_result){
47
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipid);
48
+ $shipmentorder = Mage::getModel('sales/order_shipment')->getCollection()->addFieldToFilter('increment_id', $shipid)->getFirstItem();
49
+ foreach($_result as $trackingdata){
50
+ $trackingnumber = $trackingdata['number'];
51
+ break;
52
+ }
53
+ $orderid = $shipmentorder->getOrderId();
54
+ $order = Mage::getModel('sales/order')->load($orderid);
55
+ $swipwzoomorder = $order->getSwipezoomOrderNumberTemp();
56
+ if($swipwzoomorder){
57
+ try {
58
+ $client = Mage::helper('internationalshipping')->_createSoapClient();
59
+ $params = array("Caller" => getCallerArray(),"OrderNumber" =>$swipwzoomorder,"TrackingNumber"=>$trackingnumber );
60
+ Mage::log($params,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
61
+ $response = $client->Track($params);
62
+ if($response->ResponseStatusCode != '000') {
63
+ Mage::helper('internationalshipping')->sendServiceFailureAlert($params,$response,'Track');
64
+ }
65
+ Mage::log($response,null,'SW_ShipTracking'.$swipwzoomorder.'.log');
66
+ } catch (Exception $e) {
67
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
68
+ Mage::log($debugData,null,'debug.log');
69
+ Mage::logException($e);
70
+ }
71
+ }
72
+ break;
73
+
74
+ }
75
+
76
+ if($response->ResponseStatusCode == '000'){ ?>
77
+ <?php if($shipid): ?>
78
+ <div class="page-title title-buttons">
79
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
80
+ <button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
81
+ </div>
82
+ <h2 class="sub-title"><?php echo $this->__('Shipment #').$shipid; ?></h2>
83
+ <?php endif; ?>
84
+ <table class="tracking-table-popup data-table" id="track-history-table1">
85
+ <tbody>
86
+ <?php if($response->Tracking->AirWayBillNumber){ ?>
87
+ <tr>
88
+ <td><strong>Airway Bil No.: </strong><?php echo $response->Tracking->AirWayBillNumber; ?></td>
89
+ </tr>
90
+ <?php } ?>
91
+ <?php if($response->Tracking->OriginServiceArea){ ?>
92
+ <tr>
93
+ <td><strong>From : </strong><?php echo $response->Tracking->OriginServiceArea; ?> <strong> To: </strong><?php echo $response->Tracking->DestinationServiceArea; ?></td>
94
+ </tr>
95
+ <?php } ?>
96
+ <?php $model = Mage::getModel('internationalshipping/shipmentdetail')->getCollection()->addFieldToFilter('courierwaybillno',$response->Tracking->AirWayBillNumber);
97
+ foreach($model as $mine){ ?>
98
+ <?php if($mine->getPickupdue()){ ?>
99
+ <tr>
100
+ <td><strong>Shipped Date: </strong><?php echo date('l,F j', strtotime($mine->getPickupdue())); ?></td>
101
+ </tr>
102
+ <?php } ?>
103
+ <?php } ?>
104
+ <?php if($response->Tracking->DeliveryDate){ ?>
105
+ <tr>
106
+ <td><strong>Delivery Date: </strong><?php echo $response->Tracking->DeliveryDate; ?></td>
107
+ </tr>
108
+ <?php } ?>
109
+ <?php if($response->Tracking->LastEvent->Description){ ?>
110
+ <tr>
111
+ <td><strong>Current Status: </strong><?php echo $response->Tracking->LastEvent->Description; ?></td>
112
+ </tr>
113
+ <?php } ?>
114
+ </tbody>
115
+ </table>
116
+ <br />
117
+ <script type="text/javascript">decorateTable('track-history-table1');</script>
118
+ <br />
119
+ <table class="data-table" id="track-history-table">
120
+ <thead>
121
+ <tr>
122
+ <th><?php echo $this->__('Location') ?></th>
123
+ <th><?php echo $this->__('Date') ?></th>
124
+ <th><?php echo $this->__('Local Time') ?></th>
125
+ <th><?php echo $this->__('Description') ?></th>
126
+ </tr>
127
+ </thead>
128
+ <?php if(is_array($response->Tracking->EventDates->EventDate)){
129
+ foreach($response->Tracking->EventDates->EventDate as $tracks){ ?>
130
+ <tr>
131
+ <td><?php echo $tracks->TrackingEvents->TrackingEvent->Location ?></td>
132
+ <td><?php echo $tracks->TrackingEvents->TrackingEvent->TransitionDate ?></td>
133
+ <td><?php echo $tracks->TrackingEvents->TrackingEvent->TransitionTime ?></td>
134
+ <td><?php echo $tracks->TrackingEvents->TrackingEvent->Description ?></td>
135
+
136
+ </tr>
137
+ <?php }
138
+ }else{ ?>
139
+ <tbody>
140
+ <tr>
141
+ <td><?php echo $response->Tracking->EventDates->EventDate->TrackingEvents->TrackingEvent->Location ?></td>
142
+ <td><?php echo $response->Tracking->EventDates->EventDate->TrackingEvents->TrackingEvent->TransitionDate ?></td>
143
+ <td><?php echo $response->Tracking->EventDates->EventDate->TrackingEvents->TrackingEvent->TransitionTime ?></td>
144
+ <td><?php echo $response->Tracking->EventDates->EventDate->TrackingEvents->TrackingEvent->Description ?></td>
145
+
146
+ </tr>
147
+ </tbody>
148
+ <?php } ?>
149
+ </table>
150
+ <script type="text/javascript">decorateTable('track-history-table');</script>
151
+ <div class="buttons-set">
152
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
153
+ </div>
154
+ <?php }else{ ?>
155
+ <div class="page-title title-buttons">
156
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
157
+
158
+ </div>
159
+ <div class="content-header">
160
+ <ul class="messages"><li class="error-msg"><ul><li><span><?php echo $this->__('There is no tracking available for this shipment.'); ?></span></li></ul></li></ul>
161
+ </div>
162
+ <div class="buttons-set">
163
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
164
+ </div>
165
+ <?php }
166
+ if(!$swipwzoomorder){
167
+ ?>
168
+ <div class="page-title title-buttons">
169
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
170
+ <button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
171
+ </div>
172
+ <?php if(sizeof($_results)>0): ?>
173
+ <?php foreach($_results as $shipid => $_result): ?>
174
+ <?php if($shipid): ?>
175
+ <h2 class="sub-title"><?php echo $this->__('Shipment #').$shipid; ?></h2>
176
+ <?php endif; ?>
177
+ <?php if(sizeof($_result)>0): ?>
178
+ <?php $rowCount = sizeof($_result); $counter = 1; ?>
179
+ <?php $_id = 0; foreach($_result as $track): ?>
180
+ <table class="tracking-table-popup data-table" id="tracking-table-popup-<?php echo $_id ?>">
181
+ <col width="15%" />
182
+ <col />
183
+ <tbody>
184
+ <?php if(is_object($track)): ?>
185
+ <tr>
186
+ <th class="label"><?php echo $this->__('Tracking Number:'); ?></th>
187
+ <td class="value"><?php echo $this->escapeHtml($track->getTracking()); ?></td>
188
+ </tr>
189
+ <?php if ($track->getCarrierTitle()): ?>
190
+ <tr>
191
+ <th class="label"><?php echo $this->__('Carrier:'); ?></th>
192
+ <td class="value"><?php echo $this->escapeHtml($track->getCarrierTitle()); ?></td>
193
+ </tr>
194
+ <?php endif; ?>
195
+ <?php if($track->getErrorMessage()): ?>
196
+ <tr>
197
+ <th class="label"><?php echo $this->__('Error:'); ?></th>
198
+ <td class="error"><?php echo $this->__('Tracking information is currently not available. Please '); if ($this->getContactUsEnabled()) : ?><a href="<?php echo $this->getContactUs() ?>" title="<?php echo $this->__('contact us') ?>" onclick="this.target='_blank'"><?php echo $this->__('contact us') ?></a><?php echo $this->__(' for more information or '); endif; echo $this->__('email us at '); ?><a href="mailto:<?php echo $this->getStoreSupportEmail() ?>"><?php echo $this->getStoreSupportEmail() ?></a></td>
199
+ </tr>
200
+ <?php elseif($track->getTrackSummary()): ?>
201
+ <tr>
202
+ <th class="label"><?php echo $this->__('Info:'); ?></th>
203
+ <td class="value"><?php echo $track->getTrackSummary(); ?></td>
204
+ </tr>
205
+ <?php elseif($track->getUrl()): ?>
206
+ <tr>
207
+ <th class="label"><?php echo $this->__('Track:'); ?></th>
208
+ <td class="value"><a href="<?php echo $this->escapeHtml($track->getUrl()); ?>" onclick="this.target='_blank'"><?php echo $this->escapeHtml($track->getUrl()); ?></a></td>
209
+ </tr>
210
+ <?php else: ?>
211
+ <?php if ($track->getStatus()): ?>
212
+ <tr>
213
+ <th class="label"><?php echo $this->__('Status:'); ?></th>
214
+ <td class="value"><?php echo $track->getStatus(); ?></td>
215
+ </tr>
216
+ <?php endif; ?>
217
+ <?php if ($track->getDeliverydate()): ?>
218
+ <tr>
219
+ <th class="label"><?php echo $this->__('Delivered on:'); ?></th>
220
+ <td class="value"><?php echo $this->formatDeliveryDateTime($track->getDeliverydate(),$track->getDeliverytime()); ?></td>
221
+ </tr>
222
+ <?php endif; ?>
223
+ <?php if ($track->getSignedby()): ?>
224
+ <tr>
225
+ <th class="label"><?php echo $this->__('Signed by:'); ?></th>
226
+ <td class="value"><?php echo $track->getSignedby(); ?></td>
227
+ </tr>
228
+ <?php endif; ?>
229
+ <?php if ($track->getDeliveryLocation()): ?>
230
+ <tr>
231
+ <th class="label"><?php echo $this->__('Delivered to:'); ?></th>
232
+ <td class="value"><?php echo $track->getDeliveryLocation(); ?></td>
233
+ </tr>
234
+ <?php endif; ?>
235
+ <?php if ($track->getShippedDate()): ?>
236
+ <tr>
237
+ <th class="label"><?php echo $this->__('Shipped or billed on:'); ?></th>
238
+ <td class="value"><?php echo $track->getShippedDate(); ?></td>
239
+ </tr>
240
+ <?php endif; ?>
241
+ <?php if ($track->getService()): ?>
242
+ <tr>
243
+ <th class="label"><?php echo $this->__('Service Type:'); ?></th>
244
+ <td class="value"><?php echo $track->getService(); ?></td>
245
+ </tr>
246
+ <?php endif; ?>
247
+ <?php if ($track->getWeight()): ?>
248
+ <tr>
249
+ <th class="label"><?php echo $this->__('Weight:'); ?></th>
250
+ <td class="value"><?php echo $track->getWeight(); ?></td>
251
+ </tr>
252
+ <?php endif; ?>
253
+ <?php endif; ?>
254
+ <?php elseif(isset($track['title']) && isset($track['number']) && $track['number']): ?>
255
+ <!--if the tracking is custom value-->
256
+ <tr>
257
+ <th class="label"><?php echo ($track['title'] ? $this->escapeHtml($track['title']) : $this->__('N/A')); ?>:</th>
258
+ <td class="value"><?php echo (isset($track['number']) ? $this->escapeHtml($track['number']) : ''); ?></td>
259
+ </tr>
260
+ <?php endif; ?>
261
+ </tbody>
262
+ </table>
263
+ <script type="text/javascript">decorateTable('tracking-table-popup-<?php echo $_id++ ?>');</script>
264
+ <?php if (is_object($track) && sizeof($track->getProgressdetail())>0): ?>
265
+ <br />
266
+ <table class="data-table" id="track-history-table-<?php echo $track->getTracking(); ?>">
267
+ <col />
268
+ <col width="1" />
269
+ <col width="1" />
270
+ <col />
271
+ <thead>
272
+ <tr>
273
+ <th><?php echo $this->__('Location') ?></th>
274
+ <th><?php echo $this->__('Date') ?></th>
275
+ <th><?php echo $this->__('Local Time') ?></th>
276
+ <th><?php echo $this->__('Description') ?></th>
277
+ </tr>
278
+ </thead>
279
+ <tbody>
280
+ <?php foreach($track->getProgressdetail() as $_detail): ?>
281
+ <?php $_detailDate = (isset($_detail['deliverydate']) ? $this->formatDeliveryDate($_detail['deliverydate']) : '') ?>
282
+ <?php $_detailTime = (isset($_detail['deliverytime']) ? $this->formatDeliveryTime($_detail['deliverytime'], $_detail['deliverydate']) : '') ?>
283
+ <tr>
284
+ <td><?php echo (isset($_detail['deliverylocation']) ? $_detail['deliverylocation'] : ''); ?></td>
285
+ <td><span class="nobr"><?php echo $_detailDate ?></span></td>
286
+ <td><span class="nobr"><?php echo $_detailTime ?></span></td>
287
+ <td><?php echo (isset($_detail['activity']) ? $_detail['activity'] : '') ?></td>
288
+ </tr>
289
+ <?php endforeach; ?>
290
+ </tbody>
291
+ </table>
292
+ <script type="text/javascript">decorateTable('track-history-table-<?php echo $track->getTracking(); ?>');</script>
293
+ <?php endif; ?>
294
+ <div class="divider"></div>
295
+ <?php if($counter!=$rowCount): ?>
296
+ <?php endif; ?>
297
+ <?php $counter++; ?>
298
+ <!--end for each tracking information-->
299
+ <?php endforeach; ?>
300
+ <?php else: ?>
301
+ <p><?php echo $this->__('There is no tracking available for this shipment.'); ?></p>
302
+ <?php endif; ?>
303
+ <?php endforeach; ?>
304
+ <?php else: ?>
305
+ <p><?php echo $this->__('There is no tracking available.'); ?></p>
306
+ <?php endif; ?>
307
+ <div class="buttons-set">
308
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
309
+ </div>
310
+ <?php } ?>
311
+
312
+
313
+ </div>
314
+ <script>
315
+ window.onload = function(){
316
+ setTimeout(function(){
317
+ $('loading-mask').hide();
318
+ $('content').show(); },4000);
319
+ }
320
+ </script>
app/design/frontend/base/default/template/internationalshipping/success.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
4
+ $paymentmode = Mage::getStoreConfig('carriers/swipezoom/paymentenabled',Mage::app()->getStore());
5
+
6
+ $shippingMethod = $order->getData("shipping_method");
7
+ if(strpos($shippingMethod,"swipezoom") !== FALSE && $paymentmode!=1):
8
+
9
+ $order->getSwipezoomOrderConfirmed();
10
+ $result = $result = Mage::getModel("Swipezoom_InternationalShipping_Model_Carrier_Swipezoom")->confirmOrderInvoiceRequest($order->getData("shipping_method"),Mage::getSingleton('sales/quote')->load($order->getQuoteId())->getSwipezoomOrderNumber(),$this->getOrderId(),0);
11
+ $read= Mage::getSingleton('core/resource')->getConnection('core_write');
12
+ if(is_array($result) && $result[0] == "000"){
13
+ $order->setSwipezoomOrderConfirmed(1);
14
+ $value=$read->query("update sales_flat_order SET swipezoom_order_confirmed = '1' where entity_id=".$order->getEntityId());
15
+ }else{
16
+ $order->setSwipezoomOrderConfirmed(0);
17
+ $order->setSwipezoomOrderConfirmedErrormessage($result[1]);
18
+ $value=$read->query("update sales_flat_order SET swipezoom_order_confirmed = '0' , swipezoom_order_confirmed_errormessage='".$result[1]."' where entity_id=".$order->getEntityId());
19
+ }
20
+
21
+ endif;
22
+
23
+ if(strpos($shippingMethod,"swipezoom") !== FALSE && $paymentmode==1 && $order->getPayment()->method == 'cardpayment'):
24
+
25
+ $payment_result = Mage::getModel("Swipezoom_InternationalShipping_Model_Carrier_Swipezoom")->setPaymentAdditionalData(Mage::getSingleton('sales/quote')->load($order->getQuoteId())->getSwipezoomOrderNumber(),$this->getOrderId(),'S');
26
+
27
+ endif;
28
+
29
+ ?>
30
+ <div class="page-title">
31
+ <h1><?php echo $this->__('Your order has been received.') ?></h1>
32
+ </div>
33
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
34
+ <h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
35
+
36
+ <?php if ($this->getOrderId()):?>
37
+ <?php if ($this->getCanViewOrder()) :?>
38
+ <p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
39
+ <?php else :?>
40
+ <p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
41
+ <?php endif;?>
42
+ <p><?php echo $this->__('You will receive an order confirmation email with details of your order.') ?></p>
43
+ <?php endif;?>
44
+
45
+ <?php if ($this->getAgreementRefId()): ?>
46
+ <p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
47
+ <?php endif;?>
48
+
49
+ <?php if ($profiles = $this->getRecurringProfiles()):?>
50
+ <p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
51
+ <ul class="disc">
52
+ <?php foreach($profiles as $profile):?>
53
+ <?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
54
+ <li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
55
+ <?php endforeach;?>
56
+ </ul>
57
+ <?php endif;?>
58
+
59
+ <div class="buttons-set">
60
+ <button type="button" class="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
61
+ </div>
app/etc/modules/Swipezoom_CardPayment.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Swipezoom_CardPayment>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <depends>
8
+ <Mage_Payment />
9
+ </depends>
10
+ </Swipezoom_CardPayment>
11
+ </modules>
12
+ </config>
app/etc/modules/Swipezoom_InternationalShipping.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Swipezoom
5
+ * @package Swipezoom_InternationalShipping
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Swipezoom_InternationalShipping>
13
+ <active>true</active>
14
+ <codePool>local</codePool>
15
+ </Swipezoom_InternationalShipping>
16
+ </modules>
17
+ </config>
js/swipezoom/autocomplete/jquery-1.8.2.min.js ADDED
@@ -0,0 +1,3 @@
 
 
1
+ /*! jQuery v1.8.2 jquery.com | jquery.org/license */
2
+ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,func