tig_postnl - Version 1.5.1

Version Notes

==== v1.5.1 ====
- Added a parcel dispenser filter to the delivery options location picker.

==== Improvements ====
- Improved the available filter options for the shipping date columns in the order and shipment grids.
- Improved the way parcel dispenser pick-up locations are shown in the delivery options interface.
- The chosen pick up location is now shown in Idev's OneStepCheckout's order preview pop-up.
- It is no longer possible to configure the extension to use split address lines when there is only 1 address line available.
- When using split address lines it is no longer possible to use the same address line for multiple fields.

==== Bug fixes ====
- Fixed a problem that prevented PostNL Checkout orders from being placed.
- Removed an unnecessary css link in the default Magento theme.
- Phone numbers are no longer mandatory for PostNL post office locations.

==== v1.5.0 ====
==== New features ====
- Added support for printing return labels and tracking return shipments.
- You may now change the number of parcels in a shipment as long as the shipment has not yet been confirmed with PostNL.
- Added the option to show the chosen delivery options and post office pick-up location in transactional e-mails.
- Added a new mass action to the shipment grid to update the shipping status of selected shipments.

==== Improvements ====
- The extension has been updated to CIF 1.10 specifications.
- Cut-off times now take the store's time zone into account.
- Improved performance in the webshop's backend.
- Reduced the risk of extension conflicts in the order and shipment grids.
- It is now possible to print GlobalPack shipping labels even when one of the products in the shipment is missing a country of origin value.
- Address lines on the PostNL packing slip now have a maximum size of 33 characters (up from 20).
- The selected post office location is now shown on the sales/guest/form pages in Magento.
- The confirm and delivery dates of a shipment are now stored in the UTC time zone in the database.
- The selected post office location is now shown on the OnePage Checkout progress bar during checkout.
- The schedules of several cronjobs related to background processes have been redistributed over the day to reduce the load on the sever's cron during peak hours.
- VAT and discounts are now taken into account when calculating a shipment's base grandtotal amount.
- The extension will now shown a proper error message when the sever's PHP version is below the minimum version required by the PostNL extension (PHP 5.3.0).
- Decimal values are now allowed in the alternative standard product option field.
- Shipping labels will now be deleted from the database 30 days after the shipment has been delivered in order to give the consumer enough time to return the shipments without allowing the database to become too bloated.

==== Bug fixes ====
- The Track & Trace URL for orders which are shipped to post office locations has been modified to correctly use the postcode of the intended recipient.
- PostNL mass actions in the order grid will no longer affect non-PostNL mass actions which may have been added by other extensions.
- Postcodes are no longer required in order to create a Track & Trace URL.
- It is no longer possible to modify the confirmation of letter box parcel shipments without Track & Trace.
- An issue in Magento CE 1.6 and EE 1.11 has been resolved by no longer relying on the 'DEFAULT_DEST_STREET' constant value.
- MijnPakket login and delivery options are now also compatible with Idev's OneStepCheckout when the shipping address form has been disabled.
- Letter box parcel configuration options are now also applied to grouped products.
- The chosen delivery day is no longer shown on the customer's account page when delivery days have been disabled in the extension's configuration.
- Product's alternative shipping duration values are now taken into account when calculating the probable delivery day for orders when no specific delivery day was chosen during checkout.
- Tuesday is no longer shown as a valid delivery day when monday is not a shipping day and it is already past saturday.

==== v1.4.1 ====
==== New features ====
- Completely redesigned the configuration page of the extension!
- The extension's configuration page has now been split into a wizard-style menu for the core settings and a separate advanced options menu.

==== Improvements ====
- Added forwards compatibility to Magento 1.6 for advanced configuration field dependencies and other features that were introduced in Magento 1.7.
- Only stated address fee will now be hidden if the fee is less than 1 cent.
- Delivery days will now show 'as soon as possible' as the delivery time when no delivery days are available.
- The status update cron will now run 3 times a day. Before it was only 2 times a day.
- Added additional transactional email parameters to the track & trace email.

==== Bug fixes ====
- Only stated address option is no longer available for letter box orders.
- Removed two legacy references to css files from the frontend's layout XML file.
- Fixed a problem where the delivery option fee would not be reset if delivery options became unavailable during checkout.
- Fixed the delivery options responsive design in OneStepCheckout on older versions of Magento.
- Fixed an issue that prevented the order grid from being filtered on the order ID column.
- International track & trace URL's now use PostNL's new track & trace URL syntax. The old syntax is no longer supported by PostNL.
- Fixed a PHP warning level error that could occur if no additional options were saved for a PostNL order.

==== v1.4.0 ====
==== New features ====
- Added a new responsive design for PostNL delivery options.
- Added the option to specify on which days of the week the merchant will ship orders.
- Added the option to print packing slips directly from the order detail page.
- Added the option for customers to choose whether their order can be delivered to their neighbours in case they are not home during the delivery.
- Added a new PostNL rate type that allows merchants to finely tune their shipping costs.
- Added the option to charge a separate shipping rate for letter box parcels.

==== Improvements ====
- Modified a lot of heavy loading functionality in order to improve performance.
- PostNL Checkout will now check if an order is a letter box parcel before deciding whether PostNL Checkout should be available.
- In order to decrease server load during the extension's installation or upgrade, modifying product attributes is now handled by a temporary cron job.
- A comment will now be added to the order and shipment page when the PostNL track & trace email is sent.
- Evening delivery will no longer be available for letter box parcel orders.

==== Bug fixes ====
- FIxed the filter functionality of the order grid's confirm date column.
- Fixed a problem where the extra cover amount was missing when extra cover was used as a default shipping option.
- Fixed a problem where adding coupon codes in OneStepCheckout would disable delivery options.
- PostNL Checkout's weight calculation will no longer assume all items are weightless when a free shipping cart rule is active.
- Fixed a problem in the CMS page source model causing errors.
- Fixed a problem where tax calculation would not work as expected when tax calculation was set to before discount.
- Fixed a problem where it would be impossible to use the create shipment mass action when certain product options were disabled.
- Fixed problem where shipping to EPS countries could cause errors.
- Fixed an issue where the COD payment method would be hidden for regular shipments.
- Fixed an issue where the print labels mass action would also confirm the shipment
- Adding a new address in multi-address checkout will no longer cause errors when postcode check has been enabled.
- Fixed a bug in the updatePostnlOrder observer that caused errors when ordering virtual orders.

==== v1.3.1 ====
==== Bug fixes ====
- Confirm dates will no longer be shown as always being in the future.
- Added additional checks to prevent deleted Magento orders and shipments from causing errors.
- Prevented VAT amounts from being shown twice on the checkout page.
- It is no longer impossible to create multi-parcel shipments when 'letter box calculation mode' is set to automatic.
- Prevented COD fees from causing errors on the invoice page in the backend.

==== v1.3.0 ====
==== New features ====
- Added the option to ship orders as letter box parcels. Letter box parcels are shipped using the regular mail service and can be shipped at a reduced rate. It's possible to let the PostNL extension determine when an order qualifies as a letter box parcel or to decide this manually when creating a shipment in Magento.
- Added a new PostNL COD payment method that is fully integrated in the other PostNL services offered by the extension. It's possible to charge an additional fee to customers for using PostNL COD. It's also possible to have the extension automatically invoice COD orders once they have been delivered to the customer.
- Added a new PostNL packing slip. This packing slip may contain the PostNL shipping label, allowing you to use the packing slip as the shipping label for the parcel.
- Added the option to enable or disable delivery options at the product level.
- Added the ability to convert existing shipments to a letter box parcel or to a regular parcel as long as they have not been received by PostNL.
- Added the ability to change the selected shipping option for a shipment as long as it has not yet been received by PostNL.
- Added the option to use additional shipping methods for PostNL.
- Added the option to create a shipment, confirm it and print it's shipping labels for an order straight from the order grid in a single click.

==== Improvements ====
- It's now possible to enable or disable time frames separately from delivery days.
- You can now specify the cut-off time in minutes as well as hours.
- You can now view an order's confirm date, confirm status and shipping phase in the order grid.
- Additional information regarding the chosen delivery option is now shown on the order detail page.
- Added a button to download all PostNL debug log files to the PostNL configuration page.
- The 'create shipments' massaction interface has been modified so that only valid options are displayed.
- Errors that occur whilst processing multiple shipments or orders will no longer stop the entire process. Instead the remaining orders and shipments will be processed and an error message specifying which orders or shipments caused an error will be displayed afterwards.
- The first and last name fields are no longer mandatory for the sender's address fields in the PostNL configuration.
- Spaces are now allowed in postcodes.

==== Bug fixes ====
- Deleting orders from Magento should no longer cause errors when processing PostNL shipments.
- The PostNL shipping method will no longer be selected by default.
- Greece will now be processed with EPS, instead of GlobalPack.
- Upgrade and install scripts will now check if certain columns and attributes exist before modifying them.
- The progress bar on the Onepage Checkout page will now correctly update the shipping costs when the customer has chosen a delivery option that charges an additional fee.
- Creating shipments for which no default shipping option is selected will no longer cause errors.

==== v1.2.2 ====
==== New features ====
- Added the option to send a copy of the track & trace email to a specified email address.

==== Improvements ====
- Performance of the entire extension has been improved. The extension will now attempt to cache several configuration values.
- Label printing will now always follow the 'label size' configuration setting.

==== Bug fixes ====
- Fixed several small html errors in the track & trace email template.
- Fixed an SQL error that could occur when filtering the 'store' column in the order and shipment grids.

==== v1.2.1 ====
==== Release highlights ====
- The extension now fully supports Magento 1.9 and 1.14!

==== Minor improvements ====
- Added additional checks to prevent errors when Magento's layout has been altered or PostNL's layout has not been uploaded properly.
- Added additional compatibility enhancements for MultiSafePay and other PSP extensions.
- Improved several minor texts and translations.

==== Bug fixes ====
- Fixed an issue that prevented MijnPakket login data from being cached.
- Fixed an issue where using PostNL-only features on non-PostNL shipments would cause an error.
- Fixed an issue where PostNL's feed messages would be loaded in the wrong order.
- Fixed an issue where several notifications would be added to Magento when installing an unsupported version of Magento with the PostNL extension.
- Fixed an issue with EPS comb-labels. EPS combi-labels were rotated by 90 degrees, causing overlapping issues with other labels being printed.

==== v1.2.0 =====
==== New features ====
- Added delivery options to the checkout flow. Customers can now choose where, when and how they want their order shipped when choosing their preferred shipping method.
- Added support for evening delivery, early pickup locations and parcel dispenser locations.
- Added Dutch postcode validation support.
- Added the option to create a parcelware export csv file directly from the Magento backend.
- Added a MijnPakket login feature. Customers who have a MijnPakket account can use this feature to automatically fill in their preferred billing and shipping address.

==== Minor improvements ====
- Refactored the label printing functionality. Shipping labels will now be opened in a separate window from where they may be printed or downloaded.
- Added the option to select where on an A4 page the shipping labels will start printing. This allows you to re-use partially used sticker-sheets.
- Added many new customization options for the shipment grid in the Magento backend.
- Added the ability to view and edit a chosen post office delivery address from the Magento backend.
- Added the option to only show the PostNL Checkout feature to customers who have a MijnPakket account.
- Refactored many sections of the source code to improve readability and extensibility.
- Moved several configuration settings.
- Merged the 'test/live mode' settings of PostNl Checkout and Label Printing & Confirming functionality. There is now a single option to set the entire extension to test or live mode.
- Added the option to upload separate csv files for the PostNL shipping method in 'table rate' configuration.

==== Bug fixes ====
- Fixed an issue where it was not possible to choose to only manually send track & trace information.
- Fixed several typos and translation errors.

==== v1.1.5 =====

==== Bug fixes ====
- Fixed a problem with account validation only using test mode account credentials
- Made a minor security improvement to the notification system.
- Fixed an issue where shipments could not be confirmed if the shipping address did not have an email address.
- Fixed an issue where PostNl Checkout would incorrectly identify a product as being out of stock.
- Fixed an issue where for some shops PostNl Checkout would not function due to incorrect usage of https in an http environment.

==== v1.1.4 =====

==== New features ====
- Added a default test account to the extension. New installation will automatically have a PostNL test account pre-configured.
- Added the option to undo a confirmation as long as the shipment has not been received by PostNL.
- Added the option to delete shipping labels. This allows you to correct an address after a shipping label has been printed. Before this change if you noticed an error in the address after you had already printed a shipping label, you had to place en entire new order to correct it. Now you can simply delete the shipping label, edit the address and print a new shipping label with the new address.

==== Minor change ====
- The validate settings button in the extension’s configuration page now also validates settings while the extension is set to test mode.
- Removed the 'EU Pack Standard (Belgium only, no signature)' product option. If you use this option, please contact the Total Internet Group servicedesk.
- The extension's test mode is now available by default. In earlier versions you had to allow test mode through a setting under advanced options.
- When a confirmation expires, the barcode's track & trace link will now also be removed.
- Improved various texts and translations.

==== Bug fixes ====
- Solved an issue where certain configurations of the PostNL shipping method would only appear if the Magento tablerates shipping method was also active.
- Solved an issue where filtering the order and shipment grids in the Magento backend on certain columns would cause an error.
- Solved an issue where the shipment status cron would stop as soon as it encountered an error, rather than continue processing the remaining shipments.
- Solved an issue where you could not confirm a shipment without a barcode due to process locking when developer mode is active.
- Solved issue in Safari where labels would be printed as .pdf.html, rather than just .pdf files.

==== v1.1.3 ====

- FIxed an issue with the extension's activation procedure.

==== v1.1.2 ====

- Updated manual.

==== v1.1.1 ====

- Fixed issue where filtering the first column of the shipment grid could cause errors.
- Removed PHP extension dependencies from the PostNL extension packages. Magento connect would sometimes falsely report a PHP extension as missing preventing the PostNL extension from being installed.

==== v1.1.0 ====

- First public release.

==== v1.0.8 ====

- Improved compatibility with Magento 1.6 and 1.11.

==== v1.0.7 ====

- Improved configuration fields.
- Improved translations.

==== v1.0.6 ====

- Improved shipment grid interface. It shoulod now be more clear which shipments have been confirmed and when they should be handed over to PostNL.
- Improved PostNL Checkout payment method handling. The Checkout summary page should now remember your chosen bank when you attempt to pay using iDEAL. 100% support for all payment methods is not guaranteed.

==== v1.0.5 ====

- Several bug fixes.
- Improved configuration interface.

==== v1.0.4 ====

- Several minor bug fixes.
- Improved Dutch translations.
- Added additional information to several fields in system/config.

==== v1.0.3 ====

- Several bug fixes. Including an issue preventing the extension from functioning properly with the compiler active.
- Several improvements to the Dutch translations.
- Improved the extension's system > config interface
- Added the Klarna payment method to PostNL Checkout

==== v1.0.2 ====

- A large number of bug fixes and general improvements
- Improved error handling. Almost all errors will now automatically provide you with a link where you can find more information and a possible solution.

==== v1.0.1 ====

- Added a filter to the possible product options you may select, based on the selected orders when mass-creating shipments from the order grid.
- Improved several translations.
- Fixed several minor bugs.

==== v1.0.0 ====

This is the initial beta release of the extension. If you have any questions, please contact the Total Internet Group Servicedesk

Download this release

Release Info

Developer TIG
Extension tig_postnl
Version 1.5.1
Comparing to
See all releases


Code changes from version 1.4.1 to 1.5.1

Files changed (134) hide show
  1. app/code/community/TIG/PostNL/Block/Adminhtml/IntegrityNotification.php +100 -0
  2. app/code/community/TIG/PostNL/Block/Adminhtml/LogNotification.php +4 -0
  3. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/DeliveryOptions.php +125 -16
  4. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/ShippingStatus.php +42 -0
  5. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/Tab/StatusHistory.php +38 -11
  6. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/View/DeliveryOptions.php +48 -0
  7. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns.php +52 -0
  8. app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns/Grid.php +337 -0
  9. app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form.php +24 -0
  10. app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/AddressLines.php +171 -0
  11. app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/HourMinute.php +4 -1
  12. app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Tooltip/HourMinute.php +56 -0
  13. app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Fieldset.php +3 -2
  14. app/code/community/TIG/PostNL/Block/Adminhtml/UpgradeNotification.php +11 -2
  15. app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Filter/ConfirmDate.php +229 -0
  16. app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ConfirmDate.php +10 -6
  17. app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/DeliveryDate.php +8 -3
  18. app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/OrderConfirmDate.php +10 -2
  19. app/code/community/TIG/PostNL/Block/Core/Order/Returns/Info.php +81 -0
  20. app/code/community/TIG/PostNL/Block/Core/Order/Returns/Shipment/Items.php +80 -0
  21. app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/DeliveryOptions.php +2 -7
  22. app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/Progress.php +86 -0
  23. app/code/community/TIG/PostNL/Block/DeliveryOptions/Js.php +4 -1
  24. app/code/community/TIG/PostNL/Block/Mijnpakket/LoginButton.php +4 -2
  25. app/code/community/TIG/PostNL/Controller/Adminhtml/Config.php +3 -0
  26. app/code/community/TIG/PostNL/Controller/Adminhtml/Shipment.php +225 -18
  27. app/code/community/TIG/PostNL/Controller/Sales.php +333 -0
  28. app/code/community/TIG/PostNL/Helper/AddressValidation.php +157 -4
  29. app/code/community/TIG/PostNL/Helper/Carrier.php +22 -14
  30. app/code/community/TIG/PostNL/Helper/Checkout.php +1 -0
  31. app/code/community/TIG/PostNL/Helper/Cif.php +51 -0
  32. app/code/community/TIG/PostNL/Helper/Data.php +273 -10
  33. app/code/community/TIG/PostNL/Helper/DeliveryOptions.php +312 -100
  34. app/code/community/TIG/PostNL/Model/Admin/Logging/Handler/Postnl.php +13 -0
  35. app/code/community/TIG/PostNL/Model/Adminhtml/Observer/OrderGrid.php +28 -14
  36. app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentGrid.php +98 -15
  37. app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentView.php +178 -74
  38. app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridColumns.php +8 -0
  39. app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridMassaction.php +8 -0
  40. app/code/community/TIG/PostNL/Model/Carrier/Postnl.php +10 -17
  41. app/code/community/TIG/PostNL/Model/Checkout/Service.php +16 -7
  42. app/code/community/TIG/PostNL/Model/Core/Cif.php +137 -65
  43. app/code/community/TIG/PostNL/Model/Core/Cif/Abstract.php +3 -1
  44. app/code/community/TIG/PostNL/Model/Core/Label.php +29 -2
  45. app/code/community/TIG/PostNL/Model/Core/Observer/Barcode.php +21 -4
  46. app/code/community/TIG/PostNL/Model/Core/Observer/Cron.php +525 -24
  47. app/code/community/TIG/PostNL/Model/Core/Observer/Returns.php +171 -0
  48. app/code/community/TIG/PostNL/Model/Core/Order.php +31 -0
  49. app/code/community/TIG/PostNL/Model/Core/PackingSlip.php +3 -3
  50. app/code/community/TIG/PostNL/Model/Core/Resource/Integrity.php +88 -0
  51. app/code/community/TIG/PostNL/Model/Core/Resource/Integrity/Collection.php +60 -0
  52. app/code/community/TIG/PostNL/Model/Core/Resource/Order.php +18 -0
  53. app/code/community/TIG/PostNL/Model/Core/Resource/Shipment.php +18 -0
  54. app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Status/History/Collection.php +2 -1
  55. app/code/community/TIG/PostNL/Model/Core/Service.php +8 -1
  56. app/code/community/TIG/PostNL/Model/Core/Service/IntegrityCheck.php +312 -0
  57. app/code/community/TIG/PostNL/Model/Core/Service/PaymentDummy.php +101 -0
  58. app/code/community/TIG/PostNL/Model/Core/Service/PaymentMethodDummy.php +120 -0
  59. app/code/community/TIG/PostNL/Model/Core/Shipment.php +1247 -260
  60. app/code/community/TIG/PostNL/Model/Core/Shipment/Barcode.php +22 -9
  61. app/code/community/TIG/PostNL/Model/Core/Shipment/Label.php +17 -0
  62. app/code/community/TIG/PostNL/Model/Core/Shipment/Status/History.php +8 -8
  63. app/code/community/TIG/PostNL/Model/Core/System/Config/Source/AllProductOptions.php +12 -5
  64. app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CommentType.php +1 -1
  65. app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingDays.php +8 -1
  66. app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StaticBlocks.php +137 -0
  67. app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StreetField.php +3 -73
  68. app/code/community/TIG/PostNL/Model/DeliveryOptions/Cif.php +18 -11
  69. app/code/community/TIG/PostNL/Model/DeliveryOptions/Product/Attribute/Source/ShippingDuration.php +52 -0
  70. app/code/community/TIG/PostNL/Model/DeliveryOptions/Service.php +98 -20
  71. app/code/community/TIG/PostNL/Model/ExtensionControl/Config.php +154 -0
  72. app/code/community/TIG/PostNL/Model/ExtensionControl/Observer/Cron.php +44 -4
  73. app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices.php +27 -4
  74. app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices/Abstract.php +9 -5
  75. app/code/community/TIG/PostNL/Model/Resource/Order/Shipment.php +58 -0
  76. app/code/community/TIG/PostNL/Model/Resource/Setup.php +135 -0
  77. app/code/community/TIG/PostNL/controllers/Adminhtml/ConfigController.php +4 -0
  78. app/code/community/TIG/PostNL/controllers/Adminhtml/ExtensionControlController.php +5 -1
  79. app/code/community/TIG/PostNL/controllers/Adminhtml/ReturnsController.php +56 -0
  80. app/code/community/TIG/PostNL/controllers/Adminhtml/ShipmentController.php +572 -32
  81. app/code/community/TIG/PostNL/controllers/CheckoutController.php +19 -19
  82. app/code/community/TIG/PostNL/controllers/DeliveryOptionsController.php +77 -2
  83. app/code/community/TIG/PostNL/controllers/GuestController.php +88 -0
  84. app/code/community/TIG/PostNL/controllers/OrderController.php +45 -0
  85. app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.4.1-1.5.0.php +124 -0
  86. app/code/community/TIG/PostNL/etc/adminhtml.xml +36 -0
  87. app/code/community/TIG/PostNL/etc/config.xml +208 -35
  88. app/code/community/TIG/PostNL/etc/jstranslator.xml +12 -3
  89. app/code/community/TIG/PostNL/etc/logging.xml +153 -17
  90. app/code/community/TIG/PostNL/etc/system.xml +308 -60
  91. app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.4.1-1.5.0.php +240 -0
  92. app/design/adminhtml/default/default/layout/TIG/postnl.xml +4 -0
  93. app/design/adminhtml/default/default/template/TIG/PostNL/integrity_notification.phtml +54 -0
  94. app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/delivery_options.phtml +74 -1
  95. app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/shipping_status.phtml +51 -20
  96. app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/view/delivery_options.phtml +12 -0
  97. app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/customize_link.phtml +1 -0
  98. app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/js.phtml +1 -0
  99. app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/info_box.phtml +3 -1
  100. app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/js.phtml +8 -1
  101. app/design/adminhtml/default/default/template/TIG/PostNL/upgrade_notification.phtml +1 -1
  102. app/design/frontend/base/default/layout/TIG/postnl.xml +186 -3
  103. app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/postcode_check.phtml +7 -7
  104. app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/info.phtml +67 -0
  105. app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/shipment/items.phtml +107 -0
  106. app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/delivery_options.phtml +52 -0
  107. app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/pakjegemak_address.phtml +60 -0
  108. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/addlocation.phtml +9 -0
  109. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/js.phtml +1 -1
  110. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/deliveryoptions.phtml +1 -0
  111. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/progress/pakje_gemak.phtml +48 -0
  112. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/progress/shipping_method.phtml +43 -15
  113. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml +171 -3
  114. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/progress.phtml +57 -0
  115. app/design/frontend/base/default/template/TIG/PostNL/delivery_options/sales/order/delivery_options_info.phtml +1 -1
  116. app/design/frontend/base/default/template/TIG/PostNL/mijnpakket/onestepcheckout/login_button.phtml +3 -1
  117. app/design/frontend/rwd/default/layout/TIG/postnl.xml +178 -0
  118. app/locale/en_US/TIG_PostNL.csv +79 -43
  119. app/locale/en_US/template/email/TIG/PostNL/return_label.html +43 -0
  120. app/locale/nl_NL/TIG_PostNL.csv +92 -56
  121. app/locale/nl_NL/template/email/TIG/PostNL/return_label.html +43 -0
  122. package.xml +55 -5
  123. skin/adminhtml/default/default/css/TIG/PostNL/shipping_status.css +28 -2
  124. skin/adminhtml/default/default/css/TIG/PostNL/styles.css +2 -1
  125. skin/adminhtml/default/default/css/TIG/PostNL/system_config_edit_postnl.css +4 -2
  126. skin/adminhtml/default/default/images/TIG/PostNL/bkg_progress_sprite_reverse.png +0 -0
  127. skin/adminhtml/default/default/js/TIG/PostNL/form.js +7 -1
  128. skin/adminhtml/default/default/js/TIG/PostNL/mass_action_filter.js +10 -0
  129. skin/adminhtml/default/default/js/TIG/PostNL/validate.js +66 -0
  130. skin/frontend/base/default/css/TIG/PostNL/deliveryoptions/default.css +0 -2
  131. skin/frontend/base/default/css/TIG/PostNL/deliveryoptions/mediaqueries.css +19 -5
  132. skin/frontend/base/default/css/TIG/PostNL/returns.css +3 -0
  133. skin/frontend/base/default/js/TIG/PostNL/deliveryOptions.js +107 -4
  134. skin/frontend/base/default/js/TIG/PostNL/mijnpakketLogin.js +18 -8
app/code/community/TIG/PostNL/Block/Adminhtml/IntegrityNotification.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Adminhtml_IntegrityNotification extends TIG_PostNL_Block_Adminhtml_Template
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_eventPrefix = 'postnl_adminhtml_integritynotification';
45
+
46
+ /**
47
+ * @var TIG_PostNL_Model_Core_Resource_Integrity_Collection
48
+ */
49
+ protected $_collection;
50
+
51
+ /**
52
+ * @return TIG_PostNL_Model_Core_Resource_Integrity_Collection
53
+ */
54
+ public function getCollection()
55
+ {
56
+ $collection = $this->_collection;
57
+ if (!$collection) {
58
+ $collection = Mage::getResourceModel('postnl_core/integrity_collection');
59
+ $this->setCollection($collection);
60
+ }
61
+
62
+ return $collection;
63
+ }
64
+
65
+ /**
66
+ * @param TIG_PostNL_Model_Core_Resource_Integrity_Collection $collection
67
+ *
68
+ * @return $this
69
+ */
70
+ public function setCollection(TIG_PostNL_Model_Core_Resource_Integrity_Collection $collection)
71
+ {
72
+ $this->_collection = $collection;
73
+
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * Check if there are any integrity errors.
79
+ *
80
+ * @return bool
81
+ */
82
+ public function hasIntegrityErrors()
83
+ {
84
+ if ($this->getIntegrityErrorsSize() > 0) {
85
+ return true;
86
+ }
87
+
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * get the size of the integrity errors collection.
93
+ *
94
+ * @return int
95
+ */
96
+ public function getIntegrityErrorsSize()
97
+ {
98
+ return $this->getCollection()->getSize();
99
+ }
100
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/LogNotification.php CHANGED
@@ -87,6 +87,10 @@ class TIG_PostNL_Block_Adminhtml_LogNotification extends TIG_PostNL_Block_Adminh
87
  */
88
  $logs = glob($logFolder . DS . '*.log');
89
 
 
 
 
 
90
  /**
91
  * Calculate the sum of the file sizes of all logs in the PostNL log folder.
92
  */
87
  */
88
  $logs = glob($logFolder . DS . '*.log');
89
 
90
+ if (!is_array($logs) || empty($logs)) {
91
+ return 0;
92
+ }
93
+
94
  /**
95
  * Calculate the sum of the file sizes of all logs in the PostNL log folder.
96
  */
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/DeliveryOptions.php CHANGED
@@ -67,19 +67,34 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_DeliveryOptions
67
  */
68
  protected function _prepareLayout()
69
  {
70
- $onclick = "changeProductCode('{$this->getChangeProductCodeUrl()}')";
 
71
 
72
- $block = $this->getLayout()
73
- ->createBlock('adminhtml/widget_button')
74
- ->setData(
75
- array(
76
- 'label' => $this->__('Change'),
77
- 'class' => 'btn-reset',
78
- 'onclick' => $onclick
79
- )
80
- );
81
-
82
- $this->setChild('change_product_code_button', $block);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  return parent::_prepareLayout();
85
  }
@@ -157,11 +172,11 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_DeliveryOptions
157
  break;
158
  case $postnlShipment::SHIPMENT_TYPE_AVOND:
159
  $shipmentType = $this->__('Domestic');
160
- $this->setSubType('Evening Delivery');
161
  break;
162
  case $postnlShipment::SHIPMENT_TYPE_AVOND_COD:
163
  $shipmentType = $this->__('Domestic');
164
- $this->setSubType('Evening Delivery');
165
  $this->setIsCod(true);
166
  break;
167
  case $postnlShipment::SHIPMENT_TYPE_PG:
@@ -173,11 +188,11 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_DeliveryOptions
173
  break;
174
  case $postnlShipment::SHIPMENT_TYPE_PGE:
175
  $shipmentType = $this->__('Post Office');
176
- $this->setSubType('Early Pickup');
177
  break;
178
  case $postnlShipment::SHIPMENT_TYPE_PGE_COD:
179
  $shipmentType = $this->__('Post Office');
180
- $this->setSubType('Early Pickup');
181
  $this->setIsCod(true);
182
  break;
183
  case $postnlShipment::SHIPMENT_TYPE_PA:
@@ -309,4 +324,98 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_DeliveryOptions
309
 
310
  return $formattedOptions;
311
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
67
  */
68
  protected function _prepareLayout()
69
  {
70
+ $productCodeOnclick = "changeProductCode('{$this->getChangeProductCodeUrl()}')";
71
+ $parcelCountOnclick = "changeParcelCount('{$this->getChangeParcelCountUrl()}')";
72
 
73
+ /**
74
+ * @var Mage_Adminhtml_Block_Widget_Button $changeProductCodeButton
75
+ * @var Mage_Adminhtml_Block_Widget_Button $changeParcelCountButton
76
+ */
77
+ $changeProductCodeButton = $this->getLayout()
78
+ ->createBlock('adminhtml/widget_button')
79
+ ->setData(
80
+ array(
81
+ 'label' => $this->__('Change'),
82
+ 'class' => 'btn-reset',
83
+ 'onclick' => $productCodeOnclick
84
+ )
85
+ );
86
+ $changeParcelCountButton = $this->getLayout()
87
+ ->createBlock('adminhtml/widget_button')
88
+ ->setData(
89
+ array(
90
+ 'label' => $this->__('Change'),
91
+ 'class' => 'btn-reset',
92
+ 'onclick' => $parcelCountOnclick
93
+ )
94
+ );
95
+
96
+ $this->setChild('change_product_code_button', $changeProductCodeButton);
97
+ $this->setChild('change_parcel_count_button', $changeParcelCountButton);
98
 
99
  return parent::_prepareLayout();
100
  }
172
  break;
173
  case $postnlShipment::SHIPMENT_TYPE_AVOND:
174
  $shipmentType = $this->__('Domestic');
175
+ $this->setSubType($this->__('Evening Delivery'));
176
  break;
177
  case $postnlShipment::SHIPMENT_TYPE_AVOND_COD:
178
  $shipmentType = $this->__('Domestic');
179
+ $this->setSubType($this->__('Evening Delivery'));
180
  $this->setIsCod(true);
181
  break;
182
  case $postnlShipment::SHIPMENT_TYPE_PG:
188
  break;
189
  case $postnlShipment::SHIPMENT_TYPE_PGE:
190
  $shipmentType = $this->__('Post Office');
191
+ $this->setSubType($this->__('Early Pickup'));
192
  break;
193
  case $postnlShipment::SHIPMENT_TYPE_PGE_COD:
194
  $shipmentType = $this->__('Post Office');
195
+ $this->setSubType($this->__('Early Pickup'));
196
  $this->setIsCod(true);
197
  break;
198
  case $postnlShipment::SHIPMENT_TYPE_PA:
324
 
325
  return $formattedOptions;
326
  }
327
+
328
+ /**
329
+ * Get whether the PostNL shipment's parcel count may be changed.
330
+ *
331
+ * @return boolean
332
+ */
333
+ public function canChangeParcelCount()
334
+ {
335
+ $postnlShipment = $this->getPostnlShipment();
336
+
337
+ /**
338
+ * Check if the current user is allowed to perform this action.
339
+ */
340
+ if (!Mage::helper('postnl')->checkIsPostnlActionAllowed(array('change_parcel_count'))) {
341
+ return false;
342
+ }
343
+
344
+ return $postnlShipment->canChangeParcelCount();
345
+ }
346
+
347
+ /**
348
+ * Get the changeParcelCountUrl for this shipment.
349
+ *
350
+ * @return string
351
+ */
352
+ public function getChangeParcelCountUrl()
353
+ {
354
+ $url = $this->getUrl(
355
+ 'postnl_admin/adminhtml_shipment/changeParcelCount',
356
+ array(
357
+ 'shipment_id' => $this->getShipment()->getId()
358
+ )
359
+ );
360
+
361
+ return $url;
362
+ }
363
+
364
+ /**
365
+ * Retrieve the change_parcel_count_button html.
366
+ *
367
+ * @return string
368
+ */
369
+ public function getChangeParcelCountButtonHtml()
370
+ {
371
+ return $this->getChildHtml('change_parcel_count_button');
372
+ }
373
+
374
+ /**
375
+ * Get delivery time information for this PostNL shipment.
376
+ *
377
+ * @return array|false
378
+ */
379
+ public function getDeliveryTimeInfo()
380
+ {
381
+ $postnlShipment = $this->getPostnlShipment();
382
+ if (!$postnlShipment->hasExpectedDeliveryTimeStart()) {
383
+ return false;
384
+ }
385
+
386
+ $info = array(
387
+ 'delivery_time_start' => '',
388
+ 'delivery_time_end' => '',
389
+ 'store_delivery_time_start' => '',
390
+ 'store_delivery_time_end' => '',
391
+ 'timezone_differ' => false,
392
+ );
393
+
394
+ $dateModel = Mage::getSingleton('core/date');
395
+ $storeTimezone = Mage::getStoreConfig(
396
+ Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE,
397
+ $postnlShipment->getStoreId()
398
+ );
399
+ $storeTimezone = new DateTimeZone($storeTimezone);
400
+
401
+ $storeStartTime = new DateTime($postnlShipment->getExpectedDeliveryTimeStart());
402
+ $storeStartTime->setTimezone($storeTimezone);
403
+ $info['delivery_time_start'] = $dateModel->date('H:i', $postnlShipment->getExpectedDeliveryTimeStart());
404
+ $info['store_delivery_time_start'] = $storeStartTime->format('H:i');
405
+
406
+ if ($info['delivery_time_start'] != $info['store_delivery_time_start']) {
407
+ $info['timezone_differ'] = true;
408
+ }
409
+
410
+ if (!$postnlShipment->hasExpectedDeliveryTimeEnd()) {
411
+ return $info;
412
+ }
413
+
414
+ $storeEndTime = new DateTime($postnlShipment->getExpectedDeliveryTimeEnd());
415
+ $storeEndTime->setTimezone($storeTimezone);
416
+ $info['delivery_time_end'] = $dateModel->date('H:i', $postnlShipment->getExpectedDeliveryTimeEnd());
417
+ $info['store_delivery_time_end'] = $storeEndTime->format('H:i');
418
+
419
+ return $info;
420
+ }
421
  }
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/ShippingStatus.php CHANGED
@@ -95,6 +95,48 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus extend
95
  return $class;
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Checks if a given shipment has been confirmed with PostNL
100
  *
95
  return $class;
96
  }
97
 
98
+ /**
99
+ * Get the current shipping status for a shipment
100
+ *
101
+ * @param Mage_Sales_Model_Order_Shipment $shipment
102
+ *
103
+ * @return string
104
+ */
105
+ public function getReturnStatus($shipment)
106
+ {
107
+ /**
108
+ * @var TIG_PostnL_Model_Core_Shipment $postnlShipment
109
+ */
110
+ $postnlShipment = Mage::getModel('postnl_core/shipment')->load($shipment->getId(), 'shipment_id');
111
+
112
+ /**
113
+ * Check if the postnl shipment exists. Otherwise it was probably not shipped using PostNL.
114
+ * Even if it was, we would not be able to check the status of it anyway.
115
+ */
116
+ if (!$postnlShipment->getId()) {
117
+ return self::CLASS_NOT_POSTNL;
118
+ }
119
+
120
+ switch ($postnlShipment->getReturnPhase()) {
121
+ case 1:
122
+ $class = self::CLASS_COLLECTION;
123
+ break;
124
+ case 2:
125
+ $class = self::CLASS_DISTRIBUTION;
126
+ break;
127
+ case 3:
128
+ $class = self::CLASS_TRANSIT;
129
+ break;
130
+ case 4:
131
+ $class = self::CLASS_DELIVERED;
132
+ break;
133
+ default:
134
+ $class = self::CLASS_UNCONFIRMED;
135
+ break;
136
+ }
137
+ return $class;
138
+ }
139
+
140
  /**
141
  * Checks if a given shipment has been confirmed with PostNL
142
  *
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/Tab/StatusHistory.php CHANGED
@@ -35,6 +35,9 @@
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
 
 
 
38
  */
39
  class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory extends Mage_Adminhtml_Block_Widget_Grid
40
  {
@@ -54,7 +57,7 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory ext
54
  */
55
  $this->setEmptyText(Mage::helper('postnl')->__('No status history available.'));
56
  $this->setId('sales_order_shipment_status_history_grid');
57
- $this->setDefaultSort('timestamp');
58
  $this->setDefaultDir('DESC');
59
  $this->setUseAjax(true);
60
 
@@ -95,7 +98,8 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory ext
95
  {
96
  $helper = Mage::helper('postnl');
97
 
98
- $this->addColumn('date',
 
99
  array(
100
  'header' => $helper->__('Date'),
101
  'index' => 'timestamp',
@@ -104,9 +108,11 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory ext
104
  'width' => '150px',
105
  'renderer' => 'adminhtml/widget_grid_column_renderer_date',
106
  'filter_time' => true,
107
- ));
 
108
 
109
- $this->addColumn('timestamp',
 
110
  array(
111
  'header' => $helper->__('Time'),
112
  'index' => 'timestamp',
@@ -114,23 +120,44 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory ext
114
  'width' => '150px',
115
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_time',
116
  'filter' => false,
117
- 'sortable' => false,
118
- ));
119
 
120
- $this->addColumn('code',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  array(
122
  'header' => $helper->__('Status Code'),
123
  'index' => 'code',
124
  'width' => '100px',
125
- ));
 
126
 
127
- $this->addColumn('description',
 
128
  array(
129
  'header' => $helper->__('Description'),
130
  'index' => 'description',
131
  'align' => 'left',
132
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_translate',
133
- ));
 
134
 
135
  return parent::_prepareColumns();
136
  }
@@ -145,7 +172,7 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory ext
145
  $helper = Mage::helper('postnl');
146
 
147
  $postnlShipment = $this->getPostnlShipment();
148
- $url = $postnlShipment->getBarcodeUrl();
149
 
150
  $urlTitle = $helper->__('Mijnpakket');
151
  $urlText = $helper->__('View this shipment in mijnpakket');
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @method TIG_PostNL_Model_Core_Shipment getPostnlShipment()
40
+ * @method TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory setPostnlShipment(TIG_PostNL_Model_Core_Shipment $value)
41
  */
42
  class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tab_StatusHistory extends Mage_Adminhtml_Block_Widget_Grid
43
  {
57
  */
58
  $this->setEmptyText(Mage::helper('postnl')->__('No status history available.'));
59
  $this->setId('sales_order_shipment_status_history_grid');
60
+ $this->setDefaultSort('date');
61
  $this->setDefaultDir('DESC');
62
  $this->setUseAjax(true);
63
 
98
  {
99
  $helper = Mage::helper('postnl');
100
 
101
+ $this->addColumn(
102
+ 'date',
103
  array(
104
  'header' => $helper->__('Date'),
105
  'index' => 'timestamp',
108
  'width' => '150px',
109
  'renderer' => 'adminhtml/widget_grid_column_renderer_date',
110
  'filter_time' => true,
111
+ )
112
+ );
113
 
114
+ $this->addColumn(
115
+ 'timestamp',
116
  array(
117
  'header' => $helper->__('Time'),
118
  'index' => 'timestamp',
120
  'width' => '150px',
121
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_time',
122
  'filter' => false,
123
+ )
124
+ );
125
 
126
+ $postnlShipment = $this->getPostnlShipment();
127
+ if (Mage::helper('postnl/cif')->isReturnsEnabled() && $postnlShipment->hasReturnLabelsPrinted()) {
128
+ $this->addColumn(
129
+ 'shipment_type',
130
+ array(
131
+ 'header' => $helper->__('Type'),
132
+ 'index' => 'shipment_type',
133
+ 'width' => '150px',
134
+ 'type' => 'options',
135
+ 'options' => array(
136
+ 'shipment' => $helper->__('Shipment'),
137
+ 'return' => $helper->__('Return shipment')
138
+ ),
139
+ )
140
+ );
141
+ }
142
+
143
+ $this->addColumn(
144
+ 'code',
145
  array(
146
  'header' => $helper->__('Status Code'),
147
  'index' => 'code',
148
  'width' => '100px',
149
+ )
150
+ );
151
 
152
+ $this->addColumn(
153
+ 'description',
154
  array(
155
  'header' => $helper->__('Description'),
156
  'index' => 'description',
157
  'align' => 'left',
158
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_translate',
159
+ )
160
+ );
161
 
162
  return parent::_prepareColumns();
163
  }
172
  $helper = Mage::helper('postnl');
173
 
174
  $postnlShipment = $this->getPostnlShipment();
175
+ $url = $postnlShipment->getBarcodeUrl();
176
 
177
  $urlTitle = $helper->__('Mijnpakket');
178
  $urlText = $helper->__('View this shipment in mijnpakket');
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/View/DeliveryOptions.php CHANGED
@@ -217,4 +217,52 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_View_DeliveryOptions extends TIG_Po
217
 
218
  return $formattedOptions;
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
217
 
218
  return $formattedOptions;
219
  }
220
+
221
+ /**
222
+ * Get delivery time information for this PostNL shipment.
223
+ *
224
+ * @return array|false
225
+ */
226
+ public function getDeliveryTimeInfo()
227
+ {
228
+ $postnlOrder = $this->getPostnlOrder();
229
+ if (!$postnlOrder->hasExpectedDeliveryTimeStart()) {
230
+ return false;
231
+ }
232
+
233
+ $info = array(
234
+ 'delivery_time_start' => '',
235
+ 'delivery_time_end' => '',
236
+ 'store_delivery_time_start' => '',
237
+ 'store_delivery_time_end' => '',
238
+ 'timezone_differ' => false,
239
+ );
240
+
241
+ $dateModel = Mage::getSingleton('core/date');
242
+ $storeTimezone = Mage::getStoreConfig(
243
+ Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE,
244
+ $postnlOrder->getStoreId()
245
+ );
246
+ $storeTimezone = new DateTimeZone($storeTimezone);
247
+
248
+ $storeStartTime = new DateTime($postnlOrder->getExpectedDeliveryTimeStart());
249
+ $storeStartTime->setTimezone($storeTimezone);
250
+ $info['delivery_time_start'] = $dateModel->date('H:i', $postnlOrder->getExpectedDeliveryTimeStart());
251
+ $info['store_delivery_time_start'] = $storeStartTime->format('H:i');
252
+
253
+ if ($info['delivery_time_start'] != $info['store_delivery_time_start']) {
254
+ $info['timezone_differ'] = true;
255
+ }
256
+
257
+ if (!$postnlOrder->hasExpectedDeliveryTimeEnd()) {
258
+ return $info;
259
+ }
260
+
261
+ $storeEndTime = new DateTime($postnlOrder->getExpectedDeliveryTimeEnd());
262
+ $storeEndTime->setTimezone($storeTimezone);
263
+ $info['delivery_time_end'] = $dateModel->date('H:i', $postnlOrder->getExpectedDeliveryTimeEnd());
264
+ $info['store_delivery_time_end'] = $storeEndTime->format('H:i');
265
+
266
+ return $info;
267
+ }
268
  }
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Adminhtml_Sales_Returns extends Mage_Adminhtml_Block_Sales_Shipment
40
+ {
41
+ /**
42
+ * Constructor to set the title, block group and controller names as well as to remove the add button.
43
+ */
44
+ public function __construct()
45
+ {
46
+ $this->_blockGroup = 'postnl_adminhtml';
47
+ $this->_controller = 'sales_returns';
48
+ $this->_headerText = Mage::helper('postnl')->__('PostNL Returns');
49
+ Mage_Adminhtml_Block_Widget_Grid_Container::__construct();
50
+ $this->_removeButton('add');
51
+ }
52
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns/Grid.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Adminhtml_Sales_Returns_Grid extends Mage_Adminhtml_Block_Sales_Shipment_Grid
40
+ {
41
+ /**
42
+ * Initialization
43
+ */
44
+ public function __construct()
45
+ {
46
+ parent::__construct();
47
+ $this->setDefaultSort('confirm_date');
48
+ $this->setId('postnl_returns_grid');
49
+ }
50
+
51
+ /**
52
+ * Prepare and set collection of grid
53
+ *
54
+ * @return Mage_Adminhtml_Block_Widget_Grid
55
+ */
56
+ protected function _prepareCollection()
57
+ {
58
+ /** @var Mage_Sales_Model_Resource_Order_Shipment_Collection $collection */
59
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
60
+
61
+ $resource = Mage::getSingleton('core/resource');
62
+
63
+ $select = $collection->getSelect();
64
+
65
+ /**
66
+ * Join sales_flat_order table.
67
+ */
68
+ $select->joinInner(
69
+ array('order' => $resource->getTableName('sales/order')),
70
+ '`main_table`.`order_id`=`order`.`entity_id`',
71
+ array(
72
+ 'shipping_method' => 'order.shipping_method',
73
+ )
74
+ );
75
+
76
+ /**
77
+ * Join sales_flat_order_address table.
78
+ */
79
+ $select->joinLeft(
80
+ array('shipping_address' => $resource->getTableName('sales/order_address')),
81
+ "`main_table`.`order_id`=`shipping_address`.`parent_id` AND `shipping_address`.`address_type`='shipping'",
82
+ array(
83
+ 'postcode' => 'shipping_address.postcode',
84
+ 'country_id' => 'shipping_address.country_id',
85
+ )
86
+ );
87
+
88
+ /**
89
+ * Join tig_postnl_shipment table.
90
+ */
91
+ $select->joinLeft(
92
+ array('postnl_shipment' => $resource->getTableName('postnl_core/shipment')),
93
+ '`main_table`.`entity_id`=`postnl_shipment`.`shipment_id`',
94
+ array(
95
+ 'confirm_date' => 'postnl_shipment.confirm_date',
96
+ 'main_barcode' => 'postnl_shipment.main_barcode',
97
+ 'confirm_status' => 'postnl_shipment.confirm_status',
98
+ 'return_labels_printed' => 'postnl_shipment.return_labels_printed',
99
+ 'return_phase' => 'postnl_shipment.return_phase',
100
+ 'shipment_type' => 'postnl_shipment.shipment_type',
101
+ )
102
+ );
103
+
104
+ /** @var $postnlShipmentModelClass TIG_PostNL_Model_Core_Shipment */
105
+ $postnlShipmentModelClass = Mage::getConfig()->getModelClassName('postnl_core/shipment');
106
+ $confirmedStatus = $postnlShipmentModelClass::CONFIRM_STATUS_CONFIRMED;
107
+ $colloNotFoundStatus = $postnlShipmentModelClass::SHIPPING_PHASE_NOT_APPLICABLE;
108
+
109
+ $collection->addFieldToFilter(
110
+ 'return_labels_printed',
111
+ array('eq' => 1)
112
+ )
113
+ ->addFieldToFilter(
114
+ 'confirm_status',
115
+ array('eq' => $confirmedStatus)
116
+ )
117
+ ->addFieldToFilter(
118
+ 'return_phase',
119
+ array(
120
+ 'neq' => $colloNotFoundStatus,
121
+ 'notnull' => true,
122
+ )
123
+ )
124
+ ->addFieldToFilter(
125
+ 'shipment_id',
126
+ array(
127
+ 'notnull' => true
128
+ )
129
+ );
130
+
131
+ $this->setCollection($collection);
132
+ return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
133
+ }
134
+
135
+ /**
136
+ * Prepare and add columns to grid
137
+ *
138
+ * @return $this
139
+ */
140
+ protected function _prepareColumns()
141
+ {
142
+ $salesHelper = Mage::helper('sales');
143
+ $postnlHelper = Mage::helper('postnl/cif');
144
+
145
+ $this->addColumn(
146
+ 'increment_id',
147
+ array(
148
+ 'header' => $salesHelper->__('Shipment #'),
149
+ 'index' => 'increment_id',
150
+ 'type' => 'text',
151
+ )
152
+ );
153
+
154
+ $this->addColumn(
155
+ 'order_increment_id',
156
+ array(
157
+ 'header' => $salesHelper->__('Order #'),
158
+ 'index' => 'order_increment_id',
159
+ 'type' => 'text',
160
+ )
161
+ );
162
+
163
+ $this->addColumn(
164
+ 'order_created_at',
165
+ array(
166
+ 'header' => $salesHelper->__('Order Date'),
167
+ 'index' => 'order_created_at',
168
+ 'type' => 'datetime',
169
+ )
170
+ );
171
+
172
+ $this->addColumn(
173
+ 'shipping_name',
174
+ array(
175
+ 'header' => $salesHelper->__('Ship to Name'),
176
+ 'index' => 'shipping_name',
177
+ )
178
+ );
179
+
180
+ $this->addColumn(
181
+ 'shipment_type',
182
+ array(
183
+ 'header' => $postnlHelper->__('Shipment type'),
184
+ 'align' => 'left',
185
+ 'index' => 'shipment_type',
186
+ 'type' => 'options',
187
+ 'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_shipmentType',
188
+ 'width' => '75px',
189
+ 'sortable' => false,
190
+ 'options' => array(
191
+ 'nl' => $postnlHelper->__('Domestic'),
192
+ 'pakje_gemak' => $postnlHelper->__('PakjeGemak'),
193
+ 'eu' => $postnlHelper->__('EPS'),
194
+ 'global' => $postnlHelper->__('GlobalPack'),
195
+ 'pakketautomaat' => $postnlHelper->__('Parcel Dispenser'),
196
+ 'avond' => $postnlHelper->__('Evening Delivery'),
197
+ 'pakje_gemak_express' => $postnlHelper->__('Early Pickup'),
198
+ 'buspakje' => $postnlHelper->__('Letter Box Parcel'),
199
+ ),
200
+ )
201
+ );
202
+
203
+ $this->addColumn(
204
+ 'confirm_date',
205
+ array(
206
+ 'type' => 'date',
207
+ 'header' => $postnlHelper->__('Send Date'),
208
+ 'index' => 'confirm_date',
209
+ 'filter_index' => 'postnl_shipment.confirm_date',
210
+ )
211
+ );
212
+
213
+ $this->addColumn(
214
+ 'barcode',
215
+ array(
216
+ 'header' => $postnlHelper->__('Track & Trace'),
217
+ 'align' => 'left',
218
+ 'index' => 'main_barcode',
219
+ 'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_barcode',
220
+ )
221
+ );
222
+
223
+ $this->addColumn(
224
+ 'return_phase',
225
+ array(
226
+ 'header' => $postnlHelper->__('Return Phase'),
227
+ 'align' => 'left',
228
+ 'index' => 'return_phase',
229
+ 'type' => 'options',
230
+ 'options' => $postnlHelper->getShippingPhases(),
231
+ 'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_shippingPhase',
232
+ 'frame_callback' => array($this, 'decorateShippingPhase'),
233
+ )
234
+ );
235
+
236
+ $this->addColumn(
237
+ 'action',
238
+ array(
239
+ 'header' => $salesHelper->__('Action'),
240
+ 'width' => '50px',
241
+ 'type' => 'action',
242
+ 'getter' => 'getId',
243
+ 'actions' => array(
244
+ array(
245
+ 'caption' => $salesHelper->__('View'),
246
+ 'url' => array('base'=>'adminhtml/sales_shipment/view'),
247
+ 'field' => 'shipment_id'
248
+ )
249
+ ),
250
+ 'filter' => false,
251
+ 'sortable' => false,
252
+ 'is_system' => true
253
+ )
254
+ );
255
+
256
+ return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();
257
+ }
258
+
259
+ /**
260
+ * Decorates the shipping_phase column
261
+ *
262
+ * @param string | null $value
263
+ * @param Mage_Sales_Model_Order_Shipment $row
264
+ * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
265
+ * @param boolean $isExport
266
+ *
267
+ * @return string
268
+ */
269
+ public function decorateShippingPhase($value, $row, $column, $isExport)
270
+ {
271
+ if ($isExport) {
272
+ return $value;
273
+ }
274
+
275
+ /**
276
+ * @var TIG_PostNL_Model_Core_Shipment $postnlShipmentClass
277
+ */
278
+ $postnlShipmentClass = Mage::getConfig()->getModelClassName('postnl_core/shipment');
279
+
280
+ switch ($row->getData($column->getIndex())) {
281
+ case null: //rows with no value (non-PostNL shipments) or unconfirmed shipments.
282
+ $class = '';
283
+ break;
284
+ case $postnlShipmentClass::SHIPPING_PHASE_DELIVERED:
285
+ $class = 'grid-severity-notice';
286
+ break;
287
+ case $postnlShipmentClass::SHIPPING_PHASE_SORTING: //no break;
288
+ case $postnlShipmentClass::SHIPPING_PHASE_DISTRIBUTION: //no break;
289
+ case $postnlShipmentClass::SHIPPING_PHASE_COLLECTION:
290
+ $class = 'grid-severity-minor';
291
+ break;
292
+ case $postnlShipmentClass::SHIPPING_PHASE_NOT_APPLICABLE:
293
+ $class = 'grid-severity-critical';
294
+ break;
295
+ default:
296
+ $class = '';
297
+ break;
298
+ }
299
+
300
+ if (!empty($class) && empty($value)) {
301
+ $class = '';
302
+ }
303
+
304
+ return '<span class="'.$class.'"><span>'.$value.'</span></span>';
305
+ }
306
+
307
+ /**
308
+ * Prepare and set options for massaction
309
+ *
310
+ * @return $this
311
+ */
312
+ protected function _prepareMassaction()
313
+ {
314
+ return $this;
315
+ }
316
+
317
+ /**
318
+ * Get url for row
319
+ *
320
+ * @param Mage_Sales_Model_Order_Shipment $row
321
+ *
322
+ * @return string
323
+ */
324
+ public function getRowUrl($row)
325
+ {
326
+ if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
327
+ return false;
328
+ }
329
+
330
+ return $this->getUrl('adminhtml/sales_shipment/view',
331
+ array(
332
+ 'shipment_id' => $row->getId(),
333
+ 'come_from' => Mage::helper('core')->urlEncode('postnl_admin/adminhtml_returns')
334
+ )
335
+ );
336
+ }
337
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form.php CHANGED
@@ -386,6 +386,9 @@ class TIG_PostNL_Block_Adminhtml_System_Config_Form extends Mage_Adminhtml_Block
386
  if (isset($dependent->separator)) {
387
  $dependentValue = explode((string) $dependent->separator, $dependentValue);
388
  }
 
 
 
389
  $dependentFieldName = $fieldPrefix . $dependent->getName();
390
  $dependentField = $dependentFieldGroup->fields->$dependentFieldName;
391
  /*
@@ -529,4 +532,25 @@ class TIG_PostNL_Block_Adminhtml_System_Config_Form extends Mage_Adminhtml_Block
529
  }
530
  return $this->getChild('element_dependense');
531
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  }
386
  if (isset($dependent->separator)) {
387
  $dependentValue = explode((string) $dependent->separator, $dependentValue);
388
  }
389
+ if (isset($dependent->eval)) {
390
+ $dependentValue = array('eval' => (string) $dependent->eval);
391
+ }
392
  $dependentFieldName = $fieldPrefix . $dependent->getName();
393
  $dependentField = $dependentFieldGroup->fields->$dependentFieldName;
394
  /*
532
  }
533
  return $this->getChild('element_dependense');
534
  }
535
+
536
+ /**
537
+ * Prepare additional comment for field like tooltip
538
+ *
539
+ * @param Mage_Core_Model_Config_Element $element
540
+ * @param string $helper
541
+ * @return string
542
+ */
543
+ protected function _prepareFieldTooltip($element, $helper)
544
+ {
545
+ if ($element->tooltip_block) {
546
+ return $this->getLayout()
547
+ ->createBlock((string)$element->tooltip_block)
548
+ ->setElement($element)
549
+ ->toHtml();
550
+ } elseif ($element->tooltip) {
551
+ return Mage::helper($helper)->__((string)$element->tooltip);
552
+ }
553
+
554
+ return '';
555
+ }
556
  }
app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/AddressLines.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2015 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_AddressLines
40
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
41
+ {
42
+ /**
43
+ * Decorate field row html
44
+ *
45
+ * @param Varien_Data_Form_Element_Abstract $element
46
+ * @param string $html
47
+ * @return string
48
+ */
49
+ protected function _decorateRowHtml($element, $html)
50
+ {
51
+ return '<tr id="row_' . $element->getHtmlId() . '" style="display:none;">' . $html . '</tr>';
52
+ }
53
+
54
+ /**
55
+ * Overloaded for forwards compatibility for Magento 1.6.
56
+ *
57
+ * @param Varien_Data_Form_Element_Abstract $element
58
+ * @return string
59
+ */
60
+ public function render(Varien_Data_Form_Element_Abstract $element)
61
+ {
62
+ $id = $element->getHtmlId();
63
+
64
+ $html = '<td class="label"><label for="'.$id.'">'.$element->getLabel().'</label></td>';
65
+
66
+ //$isDefault = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
67
+ $isMultiple = $element->getExtType()==='multiple';
68
+
69
+ // replace [value] with [inherit]
70
+ $namePrefix = preg_replace('#\[value\](\[\])?$#', '', $element->getName());
71
+
72
+ $options = $element->getValues();
73
+
74
+ $addInheritCheckbox = false;
75
+ if ($element->getCanUseWebsiteValue()) {
76
+ $addInheritCheckbox = true;
77
+ $checkboxLabel = $this->__('Use Website');
78
+ }
79
+ elseif ($element->getCanUseDefaultValue()) {
80
+ $addInheritCheckbox = true;
81
+ $checkboxLabel = $this->__('Use Default');
82
+ }
83
+
84
+ if ($addInheritCheckbox) {
85
+ $inherit = $element->getInherit()==1 ? 'checked="checked"' : '';
86
+ if ($inherit) {
87
+ $element->setDisabled(true);
88
+ }
89
+ }
90
+
91
+ if ($element->getTooltip()) {
92
+ $html .= '<td class="value with-tooltip">';
93
+ $html .= $this->_getElementHtml($element);
94
+ $html .= '<div class="field-tooltip"><div>' . $element->getTooltip() . '</div></div>';
95
+ } else {
96
+ $html .= '<td class="value">';
97
+ $html .= $this->_getElementHtml($element);
98
+ };
99
+ if ($element->getComment()) {
100
+ $html.= '<p class="note"><span>'.$element->getComment().'</span></p>';
101
+ }
102
+ $html.= '</td>';
103
+
104
+ if ($addInheritCheckbox) {
105
+
106
+ $defText = $element->getDefaultValue();
107
+ if ($options) {
108
+ $defTextArr = array();
109
+ foreach ($options as $k=>$v) {
110
+ if ($isMultiple) {
111
+ if (is_array($v['value']) && in_array($k, $v['value'])) {
112
+ $defTextArr[] = $v['label'];
113
+ }
114
+ } elseif (isset($v['value'])) {
115
+ if ($v['value'] == $defText) {
116
+ $defTextArr[] = $v['label'];
117
+ break;
118
+ }
119
+ } elseif (!is_array($v)) {
120
+ if ($k == $defText) {
121
+ $defTextArr[] = $v;
122
+ break;
123
+ }
124
+ }
125
+ }
126
+ $defText = join(', ', $defTextArr);
127
+ }
128
+
129
+ // default value
130
+ $html.= '<td class="use-default">';
131
+ $html.= '<input id="' . $id . '_inherit" name="'
132
+ . $namePrefix . '[inherit]" type="checkbox" value="1" class="checkbox config-inherit" '
133
+ . $inherit . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> ';
134
+ $html.= '<label for="' . $id . '_inherit" class="inherit" title="'
135
+ . htmlspecialchars($defText) . '">' . $checkboxLabel . '</label>';
136
+ $html.= '</td>';
137
+ }
138
+
139
+ $html.= '<td class="scope-label">';
140
+ if ($element->getScope()) {
141
+ $html .= $element->getScopeLabel();
142
+ }
143
+ $html.= '</td>';
144
+
145
+ $html.= '<td class="">';
146
+ if ($element->getHint()) {
147
+ $html.= '<div class="hint" >';
148
+ $html.= '<div style="display: none;">' . $element->getHint() . '</div>';
149
+ $html.= '</div>';
150
+ }
151
+ $html.= '</td>';
152
+
153
+ return $this->_decorateRowHtml($element, $html);
154
+ }
155
+
156
+ /**
157
+ * Get the element's HTML.
158
+ *
159
+ * @param Varien_Data_Form_Element_Abstract $element
160
+ * @return string
161
+ */
162
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
163
+ {
164
+ $value = Mage::helper('postnl/addressValidation')->getAddressLineCount();
165
+
166
+ $html = '<input id="'.$element->getHtmlId().'" name="'.$element->getName()
167
+ .'" value="' . $value . '" '.$this->serialize($element->getHtmlAttributes()).'/>'."\n";
168
+ $html.= $element->getAfterElementHtml();
169
+ return $html;
170
+ }
171
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/HourMinute.php CHANGED
@@ -40,7 +40,7 @@ class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_HourMinute
40
  extends Mage_Adminhtml_Block_System_Config_Form_Field
41
  {
42
  /**
43
- * Enter description here...
44
  *
45
  * @param Varien_Data_Form_Element_Abstract $element
46
  * @return string
@@ -75,15 +75,18 @@ class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_HourMinute
75
 
76
  if ($element->getTooltip()) {
77
  $html .= '<td class="value with-tooltip">';
 
78
  $html .= $this->_getElementHtml($element);
79
  $html .= '<div class="field-tooltip"><div>' . $element->getTooltip() . '</div></div>';
80
  } else {
81
  $html .= '<td class="value">';
 
82
  $html .= $this->_getElementHtml($element);
83
  };
84
  if ($element->getComment()) {
85
  $html.= '<p class="note"><span>'.$element->getComment().'</span></p>';
86
  }
 
87
  $html.= '</td>';
88
 
89
  if ($addInheritCheckbox) {
40
  extends Mage_Adminhtml_Block_System_Config_Form_Field
41
  {
42
  /**
43
+ * Render the hour/minute field type.
44
  *
45
  * @param Varien_Data_Form_Element_Abstract $element
46
  * @return string
75
 
76
  if ($element->getTooltip()) {
77
  $html .= '<td class="value with-tooltip">';
78
+ $html .= '<div id="' . $element->getHtmlId() . '">';
79
  $html .= $this->_getElementHtml($element);
80
  $html .= '<div class="field-tooltip"><div>' . $element->getTooltip() . '</div></div>';
81
  } else {
82
  $html .= '<td class="value">';
83
+ $html .= '<div id="' . $element->getHtmlId() . '">';
84
  $html .= $this->_getElementHtml($element);
85
  };
86
  if ($element->getComment()) {
87
  $html.= '<p class="note"><span>'.$element->getComment().'</span></p>';
88
  }
89
+ $html .= '</div>';
90
  $html.= '</td>';
91
 
92
  if ($addInheritCheckbox) {
app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Tooltip/HourMinute.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @method Mage_Core_Model_Config_Element getElement()
40
+ */
41
+ class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_Tooltip_HourMinute extends Mage_Adminhtml_Block_Abstract
42
+ {
43
+ /**
44
+ * @return string
45
+ */
46
+ protected function _toHtml()
47
+ {
48
+ $element = $this->getElement();
49
+ $tooltipText = $this->__(
50
+ $element->tooltip,
51
+ Mage::helper('postnl')->getStoreTimeZone(Mage_Core_Model_App::ADMIN_STORE_ID)
52
+ );
53
+
54
+ return $tooltipText;
55
+ }
56
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Fieldset.php CHANGED
@@ -155,8 +155,9 @@ class TIG_PostNL_Block_Adminhtml_System_Config_Form_Fieldset extends Mage_Adminh
155
  protected function _getHeaderTitleHtml($element)
156
  {
157
  return '<div class="entry-edit-head collapseable" ><a id="' . $element->getHtmlId()
158
- . '-head" href="#" onclick="Fieldset.toggleCollapse(\'' . $element->getHtmlId() . '\', \''
159
- . $this->getUrl('*/*/state') . '\'); return false;">' . $element->getLegend() . '</a></div>';
 
160
  }
161
 
162
  /**
155
  protected function _getHeaderTitleHtml($element)
156
  {
157
  return '<div class="entry-edit-head collapseable" ><a id="' . $element->getHtmlId()
158
+ . '-head" rel="' . $element->getHtmlId() . '-head" href="#" onclick="Fieldset.toggleCollapse(\''
159
+ . $element->getHtmlId() . '\', \'' . $this->getUrl('*/*/state') . '\'); return false;">'
160
+ . $element->getLegend() . '</a></div>';
161
  }
162
 
163
  /**
app/code/community/TIG/PostNL/Block/Adminhtml/UpgradeNotification.php CHANGED
@@ -55,13 +55,22 @@ class TIG_PostNL_Block_Adminhtml_UpgradeNotification extends TIG_PostNL_Block_Ad
55
  */
56
  public function isUpgradeActive()
57
  {
 
 
58
  /**
59
  * Check if the cron job has an expression. This will indicate if it is still working or if it has already
60
  * finished.
61
  */
62
- $cronjob = Mage::getStoreConfig(self::XPATH_POSTNL_UPDADE_PRODUCT_ATTRIBUTE_CRON_EXPR);
 
 
 
 
 
 
 
63
 
64
- if (empty($cronjob)) {
65
  return false;
66
  }
67
 
55
  */
56
  public function isUpgradeActive()
57
  {
58
+ $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
59
+
60
  /**
61
  * Check if the cron job has an expression. This will indicate if it is still working or if it has already
62
  * finished.
63
  */
64
+ $attributeCronjob = Mage::getStoreConfig(
65
+ TIG_PostNL_Model_Resource_Setup::UPDATE_PRODUCT_ATTRIBUTE_STRING_PATH,
66
+ $storeId
67
+ );
68
+ $dateTimeZoneCronjob = Mage::getStoreConfig(
69
+ TIG_PostNL_Model_Resource_Setup::UPDATE_DATE_TIME_ZONE_STRING_PATH,
70
+ $storeId
71
+ );
72
 
73
+ if (empty($cronjob) && empty($dateTimeZoneCronjob)) {
74
  return false;
75
  }
76
 
app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Filter/ConfirmDate.php ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Filter_ConfirmDate
40
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Date
41
+ {
42
+ /**
43
+ * Generate HTML for this filter.
44
+ *
45
+ * @return string
46
+ */
47
+ public function getHtml()
48
+ {
49
+ $html = '<select name="'
50
+ . $this->_getHtmlName()
51
+ . '[select]" id="'
52
+ . $this->_getHtmlId()
53
+ . '" class="no-changes" style="width:122px;">';
54
+
55
+ $value = $this->getValue();
56
+
57
+ $todaySelected = '';
58
+ $tomorrowSelected = '';
59
+ $chooseDateSelected = '';
60
+ if (isset($value['select'])) {
61
+ switch ($value['select']) {
62
+ case null:
63
+ break;
64
+ case 'today':
65
+ $todaySelected = ' selected="selected"';
66
+ break;
67
+ case 'tomorrow':
68
+ $tomorrowSelected = ' selected="selected"';
69
+ break;
70
+ case 'pick_date': //no break
71
+ default:
72
+ $chooseDateSelected = ' selected="selected"';
73
+ break;
74
+ }
75
+ }
76
+
77
+ $html .= '<option value=""></option>';
78
+ $html .= '<option value="today"' . $todaySelected . '>' . $this->__('Today') . '</option>';
79
+ $html .= '<option value="tomorrow"' . $tomorrowSelected . '>' . $this->__('Tomorrow') . '</option>';
80
+ $html .= '<option value="pick_date"' . $chooseDateSelected . '>' . $this->__('Choose date') . '</option>';
81
+
82
+ $html .='</select>';
83
+
84
+ $htmlId = $this->_getHtmlId() . '_date_' . microtime(true);
85
+ $format = $this->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
86
+ $html .= '<div class="range" id="' . $htmlId . '"><div class="range-line date">'
87
+ . '<span class="label">' . Mage::helper('adminhtml')->__('From') . ':</span>'
88
+ . '<input type="text" name="' . $this->_getHtmlName() . '[from]" id="' . $htmlId . '_from"'
89
+ . ' value="' . $this->getEscapedValue('from') . '" class="input-text no-changes"/>'
90
+ . '<img src="' . Mage::getDesign()->getSkinUrl('images/grid-cal.gif') . '" alt="" class="v-middle"'
91
+ . ' id="' . $htmlId . '_from_trig"'
92
+ . ' title="' . $this->escapeHtml(Mage::helper('adminhtml')->__('Date selector')) . '"/>'
93
+ . '</div>';
94
+ $html.= '<div class="range-line date">'
95
+ . '<span class="label">' . Mage::helper('adminhtml')->__('To') . ' :</span>'
96
+ . '<input type="text" name="' . $this->_getHtmlName() . '[to]" id="' . $htmlId . '_to"'
97
+ . ' value="' . $this->getEscapedValue('to') . '" class="input-text no-changes"/>'
98
+ . '<img src="' . Mage::getDesign()->getSkinUrl('images/grid-cal.gif') . '" alt="" class="v-middle"'
99
+ . ' id="' . $htmlId . '_to_trig"'
100
+ . ' title="' . $this->escapeHtml(Mage::helper('adminhtml')->__('Date selector')) . '"/>'
101
+ . '</div></div>';
102
+ $html.= '<input type="hidden" name="' . $this->_getHtmlName() . '[locale]"'
103
+ . 'value="' . $this->getLocale()->getLocaleCode() . '"/>';
104
+ $html.= '<script type="text/javascript">
105
+ Calendar.setup({
106
+ inputField : "' . $htmlId . '_from",
107
+ ifFormat : "' . $format . '",
108
+ button : "' . $htmlId . '_from_trig",
109
+ align : "Bl",
110
+ singleClick : true
111
+ });
112
+ Calendar.setup({
113
+ inputField : "' . $htmlId . '_to",
114
+ ifFormat : "' . $format . '",
115
+ button : "' . $htmlId . '_to_trig",
116
+ align : "Bl",
117
+ singleClick : true
118
+ });
119
+
120
+ $("' . $htmlId . '_to_trig").observe("click", showCalendar);
121
+ $("' . $htmlId . '_from_trig").observe("click", showCalendar);
122
+
123
+ function showCalendar(event){
124
+ var element = event.element(event);
125
+ var offset = $(element).viewportOffset();
126
+ var scrollOffset = $(element).cumulativeScrollOffset();
127
+ var dimensionsButton = $(element).getDimensions();
128
+ var index = $("widget-chooser").getStyle("zIndex");
129
+
130
+ $$("div.calendar").each(function(item){
131
+ if ($(item).visible()) {
132
+ var dimensionsCalendar = $(item).getDimensions();
133
+
134
+ $(item).setStyle({
135
+ "zIndex" : index + 1,
136
+ "left" : offset[0] + scrollOffset[0] - dimensionsCalendar.width
137
+ + dimensionsButton.width + "px",
138
+ "top" : offset[1] + scrollOffset[1] + dimensionsButton.height + "px"
139
+ });
140
+ };
141
+ });
142
+ };
143
+
144
+ var confirmDateDatePicker = function() {
145
+ if ($("' . $this->_getHtmlId() . '").getValue() == "pick_date") {
146
+ $("' . $htmlId . '").show();
147
+ } else {
148
+ $("' . $htmlId . '").hide();
149
+ }
150
+ };
151
+
152
+ $("' . $this->_getHtmlId() . '").observe("change", confirmDateDatePicker);
153
+ confirmDateDatePicker();
154
+ </script>';
155
+
156
+ return $html;
157
+ }
158
+
159
+ /**
160
+ * Get the filter's current value.
161
+ *
162
+ * @param null|string $index
163
+ *
164
+ * @return array|mixed|null
165
+ */
166
+ public function getValue($index=null)
167
+ {
168
+ if ($index) {
169
+ $data = $this->getData('value', 'orig_' . $index);
170
+ if ($data) {
171
+ return $data;//date('d-m-Y', strtotime($data));
172
+ }
173
+ return null;
174
+ }
175
+
176
+ $value = $this->getData('value');
177
+ if (is_array($value)) {
178
+ $value['date'] = true;
179
+ }
180
+
181
+ return $value;
182
+ }
183
+
184
+ /**
185
+ * Set the filter's value.
186
+ *
187
+ * @param array $value
188
+ *
189
+ * @return $this
190
+ */
191
+ public function setValue($value)
192
+ {
193
+ /**
194
+ * Set the value for the 'today' and 'tomorrow' filter options.
195
+ */
196
+ if (isset($value['select'])) {
197
+ if ($value['select'] == 'today') {
198
+ $today = new DateTime('today');
199
+ $value['from'] = $today->format('d-m-Y');
200
+ $value['to'] = $today->format('d-m-Y');
201
+ } elseif ($value['select'] == 'tomorrow') {
202
+ $tomorrow = new DateTime('tomorrow');
203
+ $value['from'] = $tomorrow->format('d-m-Y');
204
+ $value['to'] = $tomorrow->format('d-m-Y');
205
+ }
206
+ } else {
207
+ $value['from'] = null;
208
+ $value['to'] = null;
209
+ }
210
+
211
+ if (isset($value['locale'])) {
212
+ if (!empty($value['from'])) {
213
+ $value['orig_from'] = $value['from'];
214
+ $value['from'] = $this->_convertDate($value['from'], $value['locale']);
215
+ }
216
+ if (!empty($value['to'])) {
217
+ $value['orig_to'] = $value['to'];
218
+ $value['to'] = $this->_convertDate($value['to'], $value['locale']);
219
+ }
220
+ }
221
+
222
+ if (empty($value['from']) && empty($value['to']) && empty($value['select'])) {
223
+ $value = null;
224
+ }
225
+
226
+ $this->setData('value', $value);
227
+ return $this;
228
+ }
229
+ }
app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ConfirmDate.php CHANGED
@@ -40,7 +40,7 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
40
  extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date
41
  {
42
  /**
43
- * Additional column name used
44
  */
45
  const SHIPPING_METHOD_COLUMN = 'shipping_method';
46
 
@@ -58,11 +58,11 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
58
  return '';
59
  }
60
 
61
- $value = $row->getData($this->getColumn()->getIndex());
62
- $origDate = new DateTime($value);
63
- $now = new DateTime(Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s'));
64
 
65
- $interval = $now->diff($origDate);
66
 
67
  /**
68
  * Check if the shipment should be confirmed somewhere in the future.
@@ -71,7 +71,7 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
71
  (($interval->days > 0 || $interval->h > 0) && !$interval->invert)
72
  || ($interval->days == 0 && $interval->h < 24) && $interval->invert
73
  ) {
74
- $confirmDate = new DateTime($value);
75
  $diff = $now->diff($confirmDate);
76
 
77
  /**
@@ -110,6 +110,10 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
110
  return $renderedValue;
111
  }
112
 
 
 
 
 
113
  /**
114
  * Finally, simply render the date.
115
  */
40
  extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date
41
  {
42
  /**
43
+ * Additional column names used.
44
  */
45
  const SHIPPING_METHOD_COLUMN = 'shipping_method';
46
 
58
  return '';
59
  }
60
 
61
+ $value = $row->getData($this->getColumn()->getIndex());
62
+ $value = new DateTime($value);
63
+ $now = new DateTime(Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s'));
64
 
65
+ $interval = $now->diff($value);
66
 
67
  /**
68
  * Check if the shipment should be confirmed somewhere in the future.
71
  (($interval->days > 0 || $interval->h > 0) && !$interval->invert)
72
  || ($interval->days == 0 && $interval->h < 24) && $interval->invert
73
  ) {
74
+ $confirmDate = clone $value;
75
  $diff = $now->diff($confirmDate);
76
 
77
  /**
110
  return $renderedValue;
111
  }
112
 
113
+ $timeZone = Mage::helper('postnl')->getStoreTimeZone($row->getData('store_id'), true);
114
+ $value = $value->setTimezone($timeZone)->format('Y-m-d H:i:s');
115
+ $row->setData($this->getColumn()->getIndex(), $value);
116
+
117
  /**
118
  * Finally, simply render the date.
119
  */
app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/DeliveryDate.php CHANGED
@@ -69,11 +69,16 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_DeliveryDate
69
  $confirmDate = new DateTime($confirmDate);
70
  $confirmDate->add(new DateInterval('P1D'));
71
 
72
- $deliveryDate = $confirmDate->format('Y-m-d H:i:s');
73
-
74
- $row->setData($this->getColumn()->getIndex(), $deliveryDate);
75
  }
76
 
 
 
 
 
 
77
  /**
78
  * Finally, simply render the date
79
  */
69
  $confirmDate = new DateTime($confirmDate);
70
  $confirmDate->add(new DateInterval('P1D'));
71
 
72
+ $deliveryDate = $confirmDate;
73
+ } else {
74
+ $deliveryDate = new DateTime($value);
75
  }
76
 
77
+ $timeZone = Mage::helper('postnl')->getStoreTimeZone($row->getData('store_id'), true);
78
+ $deliveryDate = $deliveryDate->setTimezone($timeZone)->format('Y-m-d H:i:s');
79
+
80
+ $row->setData($this->getColumn()->getIndex(), $deliveryDate);
81
+
82
  /**
83
  * Finally, simply render the date
84
  */
app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/OrderConfirmDate.php CHANGED
@@ -53,6 +53,7 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderConfirmDate
53
  */
54
  public function render(Varien_Object $row)
55
  {
 
56
  $shippingMethod = $row->getData(self::SHIPPING_METHOD_COLUMN);
57
  if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shippingMethod)) {
58
  return '';
@@ -66,9 +67,14 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderConfirmDate
66
  * order could be shipped.
67
  */
68
  if (!$value) {
 
69
  $deliveryDate = $helper->getDeliveryDate(
70
  $row->getCreatedAt(),
71
- $row->getStoreId()
 
 
 
 
72
  );
73
 
74
  $value = $helper->getValidDeliveryDate($deliveryDate)
@@ -138,7 +144,9 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderConfirmDate
138
  * Finally, simply render the date
139
  */
140
  $format = $this->_getFormat();
141
- $value = $value->format('Y-m-d H:i:s');
 
 
142
  try {
143
  if($this->getColumn()->getGmtoffset()) {
144
  $data = Mage::app()->getLocale()
53
  */
54
  public function render(Varien_Object $row)
55
  {
56
+ /** @var Mage_Sales_Model_Order $row */
57
  $shippingMethod = $row->getData(self::SHIPPING_METHOD_COLUMN);
58
  if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shippingMethod)) {
59
  return '';
67
  * order could be shipped.
68
  */
69
  if (!$value) {
70
+ $shippingDuration = $helper->getOrderShippingDuration($row);
71
  $deliveryDate = $helper->getDeliveryDate(
72
  $row->getCreatedAt(),
73
+ $row->getStoreId(),
74
+ false,
75
+ true,
76
+ true,
77
+ $shippingDuration
78
  );
79
 
80
  $value = $helper->getValidDeliveryDate($deliveryDate)
144
  * Finally, simply render the date
145
  */
146
  $format = $this->_getFormat();
147
+
148
+ $timeZone = Mage::helper('postnl')->getStoreTimeZone($row->getData('store_id'), true);
149
+ $value = $value->setTimezone($timeZone)->format('Y-m-d H:i:s');
150
  try {
151
  if($this->getColumn()->getGmtoffset()) {
152
  $data = Mage::app()->getLocale()
app/code/community/TIG/PostNL/Block/Core/Order/Returns/Info.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_Core_Order_Returns_Info extends Mage_Sales_Block_Order_Info
40
+ {
41
+ /**
42
+ * Xpath to the 'return_label_instructions_block' setting.
43
+ */
44
+ const XPATH_RETURN_LABEL_INSTRUCTIONS_BLOCK = 'postnl/returns/return_label_instructions_block';
45
+
46
+ /**
47
+ * @var string
48
+ */
49
+ protected $_template = 'TIG/PostNL/core/order/returns/info.phtml';
50
+
51
+ /**
52
+ * Class constructor.
53
+ */
54
+ protected function _construct()
55
+ {
56
+ Mage_Core_Block_Template::_construct();
57
+ }
58
+
59
+ /**
60
+ * Get the configured return info block HTML if available.
61
+ *
62
+ * @return string
63
+ */
64
+ public function getReturnInfoBlockHtml()
65
+ {
66
+ $infoBlockId = Mage::getStoreConfig(self::XPATH_RETURN_LABEL_INSTRUCTIONS_BLOCK);
67
+
68
+ if (!is_numeric($infoBlockId) || '' === $infoBlockId) {
69
+ return '';
70
+ }
71
+
72
+ /**
73
+ * @var Mage_Cms_Block_Block $infoBlock
74
+ */
75
+ $infoBlock = $this->getLayout()
76
+ ->createBlock('cms/block')
77
+ ->setBlockId($infoBlockId);
78
+
79
+ return $infoBlock->toHtml();
80
+ }
81
+ }
app/code/community/TIG/PostNL/Block/Core/Order/Returns/Shipment/Items.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @method boolean hasPostnlShipmentCollection()
40
+ * @method TIG_PostNL_Block_Core_Order_Returns_Info setPostnlShipmentCollection(TIG_PostNL_Model_Core_Resource_Shipment_Collection $value)
41
+ */
42
+ class TIG_PostNL_Block_Core_Order_Returns_Shipment_Items extends Mage_Sales_Block_Order_Shipment_Items
43
+ {
44
+ /**
45
+ * Get the PostNL shipment collection for the current order.
46
+ *
47
+ * @return TIG_PostNL_Model_Core_Resource_Shipment_Collection
48
+ */
49
+ public function getPostnlShipmentCollection()
50
+ {
51
+ if ($this->hasPostnlShipmentCollection()) {
52
+ return $this->_getData('postnl_shipment_collection');
53
+ }
54
+
55
+ $order = Mage::registry('current_order');
56
+ $postnlShipmentCollection = Mage::getResourceModel('postnl_core/shipment_collection');
57
+ $postnlShipmentCollection->addFieldToFilter('order_id', array('eq' => $order->getid()));
58
+
59
+ $this->setPostnlShipmentCollection($postnlShipmentCollection);
60
+ return $postnlShipmentCollection;
61
+ }
62
+
63
+ /**
64
+ * Get the URL for the print return label action.
65
+ *
66
+ * @param string $shipmentId
67
+ *
68
+ * @return string
69
+ */
70
+ public function getPrintLabelUrl($shipmentId)
71
+ {
72
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
73
+ $url = $this->getUrl('postnl/order/printReturnLabel', array('shipment_id' => $shipmentId));
74
+ } else {
75
+ $url = $this->getUrl('postnl/guest/printReturnLabel', array('shipment_id' => $shipmentId));
76
+ }
77
+
78
+ return $url;
79
+ }
80
+ }
app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/DeliveryOptions.php CHANGED
@@ -297,13 +297,8 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
297
  } catch (Exception $e) {
298
  Mage::helper('postnl')->logException($e);
299
 
300
- $shippingDuration = Mage::helper('postnl/deliveryOptions')->getDeliveryDate(null, null, true);
301
-
302
- $nextDeliveryDay = new DateTime();
303
- $nextDeliveryDay->setTimestamp(Mage::getModel('core/date')->timestamp());
304
- $nextDeliveryDay->add(new DateInterval("P{$shippingDuration}D"));
305
-
306
- $deliveryDate = $nextDeliveryDay->format('d-m-Y');
307
  }
308
 
309
  $this->setDeliveryDate($deliveryDate);
297
  } catch (Exception $e) {
298
  Mage::helper('postnl')->logException($e);
299
 
300
+ $deliveryDate = Mage::helper('postnl/deliveryOptions')->getDeliveryDate(null, null, false, true)
301
+ ->format('d-m-Y');
 
 
 
 
 
302
  }
303
 
304
  $this->setDeliveryDate($deliveryDate);
app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/Progress.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Block_DeliveryOptions_Checkout_Progress extends TIG_PostNL_Block_DeliveryOptions_Template
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_eventPrefix = 'postnl_deliveryoptions_checkout_progress';
45
+
46
+ /**
47
+ * @var Mage_Checkout_Model_Session
48
+ */
49
+ protected $_checkout;
50
+
51
+ /**
52
+ * Retrieve checkout session model
53
+ *
54
+ * @return Mage_Checkout_Model_Session
55
+ */
56
+ public function getCheckout()
57
+ {
58
+ if (empty($this->_checkout)) {
59
+ $this->_checkout = Mage::getSingleton('checkout/session');
60
+ }
61
+ return $this->_checkout;
62
+ }
63
+
64
+ /**
65
+ * @return string|false
66
+ */
67
+ public function getPakjeGemakAddress()
68
+ {
69
+ $quote =$this->getCheckout()->getQuote();
70
+
71
+ $pakjeGemakAddress = false;
72
+ /** @var Mage_Sales_Model_Quote_Address $address */
73
+ foreach ($quote->getAllAddresses() as $address) {
74
+ if ($address->getAddressType() == 'pakje_gemak') {
75
+ $pakjeGemakAddress = $address;
76
+ break;
77
+ }
78
+ }
79
+
80
+ if (!$pakjeGemakAddress) {
81
+ return false;
82
+ }
83
+
84
+ return $pakjeGemakAddress->format('html');
85
+ }
86
+ }
app/code/community/TIG/PostNL/Block/DeliveryOptions/Js.php CHANGED
@@ -62,7 +62,10 @@ class TIG_PostNL_Block_DeliveryOptions_Js extends TIG_PostNL_Block_DeliveryOptio
62
  return $this->_getData('api_key');
63
  }
64
 
65
- $apiKey = Mage::getStoreConfig('postnl/google_maps/api_key', Mage::app()->getStore()->getId());
 
 
 
66
 
67
  $this->setApiKey($apiKey);
68
  return $apiKey;
62
  return $this->_getData('api_key');
63
  }
64
 
65
+ $apiKey = Mage::getStoreConfig(
66
+ TIG_PostNL_Helper_DeliveryOptions::XPATH_GOOGLE_MAPS_API_KEY,
67
+ Mage::app()->getStore()->getId()
68
+ );
69
 
70
  $this->setApiKey($apiKey);
71
  return $apiKey;
app/code/community/TIG/PostNL/Block/Mijnpakket/LoginButton.php CHANGED
@@ -100,10 +100,12 @@ class TIG_PostNL_Block_Mijnpakket_LoginButton extends TIG_PostNL_Block_Core_Temp
100
  }
101
 
102
  $isTestMode = $this->getIsTestMode();
 
 
103
  if ($isTestMode) {
104
- $baseUrl = Mage::getStoreConfig(self::TEST_BASE_URL_XPATH);
105
  } else {
106
- $baseUrl = Mage::getStoreConfig(self::LIVE_BASE_URL_XPATH);
107
  }
108
 
109
  $this->setBaseUrl($baseUrl);
100
  }
101
 
102
  $isTestMode = $this->getIsTestMode();
103
+
104
+ $baseUrl = Mage::app()->getRequest()->getScheme() . '://';
105
  if ($isTestMode) {
106
+ $baseUrl .= Mage::getStoreConfig(self::TEST_BASE_URL_XPATH);
107
  } else {
108
+ $baseUrl .= Mage::getStoreConfig(self::LIVE_BASE_URL_XPATH);
109
  }
110
 
111
  $this->setBaseUrl($baseUrl);
app/code/community/TIG/PostNL/Controller/Adminhtml/Config.php CHANGED
@@ -47,6 +47,9 @@ class TIG_PostNL_Controller_Adminhtml_Config extends Mage_Adminhtml_Controller_A
47
  */
48
  protected function _saveCurrentWizardStep($step)
49
  {
 
 
 
50
  $adminUser = Mage::getSingleton('admin/session')->getUser();
51
  $extra = $adminUser->getExtra();
52
 
47
  */
48
  protected function _saveCurrentWizardStep($step)
49
  {
50
+ /**
51
+ * @var Mage_Admin_Model_User $adminUser
52
+ */
53
  $adminUser = Mage::getSingleton('admin/session')->getUser();
54
  $extra = $adminUser->getExtra();
55
 
app/code/community/TIG/PostNL/Controller/Adminhtml/Shipment.php CHANGED
@@ -38,6 +38,11 @@
38
  */
39
  class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller_Action
40
  {
 
 
 
 
 
41
  /**
42
  * Used module name in current adminhtml controller.
43
  */
@@ -227,12 +232,13 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
227
  * Create shipments for an array of order IDs
228
  *
229
  * @param array $orderIds
230
- * @param boolean $loadExisting Flag to determine if existing shipments should be loaded. If set to false, an error
231
- * will be thrown for shipments that have already been shipped.
 
232
  *
233
  * @return array
234
  */
235
- protected function _createShipments(array $orderIds, $loadExisting = false)
236
  {
237
  $helper = Mage::helper('postnl');
238
 
@@ -267,6 +273,7 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
267
  * @var Mage_Sales_Model_Order $order
268
  */
269
  $shipmentIds = array();
 
270
  foreach ($orders as $order) {
271
  try {
272
  $shipmentIds[] = $this->_createShipment($order);
@@ -291,8 +298,14 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
291
  $shipmentCollection->addFieldToSelect('entity_id')
292
  ->addFieldToFilter('order_id', $order->getId());
293
 
 
 
294
  if ($shipmentCollection->getSize() > 0) {
295
- $shipmentIds = array_merge($shipmentCollection->getColumnValues('entity_id'), $shipmentIds);
 
 
 
 
296
  } else {
297
  /**
298
  * If no shipments exist, add a warning message indicating the process failed for this order.
@@ -320,6 +333,11 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
320
  }
321
  }
322
 
 
 
 
 
 
323
  return $shipmentIds;
324
  }
325
 
@@ -360,7 +378,11 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
360
  $labels = array();
361
  foreach ($shipments as $shipment) {
362
  try {
363
- $shipmentLabels = $this->_getLabels($shipment, true);
 
 
 
 
364
  $labels = array_merge($labels, $shipmentLabels);
365
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
366
  Mage::helper('postnl/cif')->parseCifException($e);
@@ -455,7 +477,11 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
455
  );
456
  }
457
 
458
- $shipmentLabels = $this->_getLabels($shipment, true);
 
 
 
 
459
  $packingSlipModel->createPdf($shipmentLabels, $shipment, $pdf);
460
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
461
  Mage::helper('postnl/cif')->parseCifException($e);
@@ -501,20 +527,88 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
501
  return $output;
502
  }
503
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  /**
505
  * Retrieves the shipping label for a given shipment ID.
506
  *
507
  * If the shipment has a stored label, it is returned. Otherwise a new one is generated.
508
  *
509
  * @param Mage_Sales_Model_Order_Shipment|TIG_PostNL_Model_Core_Shipment $shipment
510
- * @param boolean $confirm Optional parameter to also confirm the shipment
 
 
511
  *
512
- * @return array
513
  *
514
  * @throws TIG_PostNL_Exception
515
  */
516
- protected function _getLabels($shipment, $confirm = false)
517
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  /**
519
  * Load the PostNL shipment.
520
  */
@@ -532,10 +626,42 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
532
  if ($confirm === true && !$postnlShipment->isConfirmed() && $postnlShipment->canConfirm()) {
533
  $this->_confirmShipment($postnlShipment);
534
  }
 
 
 
 
 
 
 
 
535
 
536
- return $postnlShipment->getlabels();
 
537
  }
538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  /**
540
  * If the PostNL shipment is new, set the magento shipment ID.
541
  */
@@ -550,7 +676,12 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
550
  $postnlShipment->generateBarcodes();
551
  }
552
 
553
- if ($confirm === true
 
 
 
 
 
554
  && !$postnlShipment->hasLabels()
555
  && !$postnlShipment->isConfirmed()
556
  && $postnlShipment->canConfirm(true)
@@ -573,8 +704,7 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
573
  ->save();
574
  }
575
 
576
- $labels = $postnlShipment->getLabels();
577
- return $labels;
578
  }
579
 
580
  /**
@@ -625,6 +755,11 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
625
  $postnlShipment->generateBarcodes();
626
  }
627
 
 
 
 
 
 
628
  if ($postnlShipment->getConfirmStatus() === $postnlShipment::CONFIRM_STATUS_CONFIRMED) {
629
  /**
630
  * The shipment is already confirmed.
@@ -662,6 +797,57 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
662
  return $this;
663
  }
664
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  /**
666
  * Load an array of shipments based on an array of shipmentIds and check if they're shipped using PostNL
667
  *
@@ -949,7 +1135,7 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
949
  /**
950
  * Warnings must have a description.
951
  */
952
- if (!array_key_exists('description', $warning)) {
953
  continue;
954
  }
955
 
@@ -957,17 +1143,38 @@ class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller
957
  * Codes are optional for warnings, but must be present in the array. If no code is found in the warning we
958
  * add an empty one.
959
  */
960
- if (!array_key_exists('code', $warning)) {
961
- $warning['code'] = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
  }
963
 
964
  /**
965
  * Get the formatted warning message.
966
  */
967
  $warningText = $helper->getSessionMessage(
968
- $warning['code'],
969
  'warning',
970
- $this->__($warning['description'])
971
  );
972
 
973
  /**
38
  */
39
  class TIG_PostNL_Controller_Adminhtml_Shipment extends Mage_Adminhtml_Controller_Action
40
  {
41
+ /**
42
+ * Xpath to the 'print_return_and_shipping_label' setting.
43
+ */
44
+ const XPATH_PRINT_RETURN_AND_SHIPPING_LABEL = 'postnl/returns/print_return_and_shipping_label';
45
+
46
  /**
47
  * Used module name in current adminhtml controller.
48
  */
232
  * Create shipments for an array of order IDs
233
  *
234
  * @param array $orderIds
235
+ * @param boolean $loadExisting Flag to determine if existing shipments should be loaded. If set to false, an error
236
+ * will be thrown for shipments that have already been shipped.
237
+ * @param boolean $registerExisting
238
  *
239
  * @return array
240
  */
241
+ protected function _createShipments(array $orderIds, $loadExisting = false, $registerExisting = true)
242
  {
243
  $helper = Mage::helper('postnl');
244
 
273
  * @var Mage_Sales_Model_Order $order
274
  */
275
  $shipmentIds = array();
276
+ $existingShipmentsLoaded = array();
277
  foreach ($orders as $order) {
278
  try {
279
  $shipmentIds[] = $this->_createShipment($order);
298
  $shipmentCollection->addFieldToSelect('entity_id')
299
  ->addFieldToFilter('order_id', $order->getId());
300
 
301
+ $orderShipmentIds = $shipmentCollection->getColumnValues('entity_id');
302
+
303
  if ($shipmentCollection->getSize() > 0) {
304
+ $shipmentIds = array_merge($orderShipmentIds, $shipmentIds);
305
+
306
+ if ($registerExisting) {
307
+ $existingShipmentsLoaded = array_merge($orderShipmentIds, $existingShipmentsLoaded);
308
+ }
309
  } else {
310
  /**
311
  * If no shipments exist, add a warning message indicating the process failed for this order.
333
  }
334
  }
335
 
336
+ if ($registerExisting) {
337
+ Mage::unregister('postnl_existing_shipments_loaded');
338
+ Mage::register('postnl_existing_shipments_loaded', $existingShipmentsLoaded);
339
+ }
340
+
341
  return $shipmentIds;
342
  }
343
 
378
  $labels = array();
379
  foreach ($shipments as $shipment) {
380
  try {
381
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
382
+ $shipment->getStoreId()
383
+ );
384
+
385
+ $shipmentLabels = $this->_getLabels($shipment, true, $printReturnLabels);
386
  $labels = array_merge($labels, $shipmentLabels);
387
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
388
  Mage::helper('postnl/cif')->parseCifException($e);
477
  );
478
  }
479
 
480
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
481
+ $shipment->getStoreId()
482
+ );
483
+
484
+ $shipmentLabels = $this->_getLabels($shipment, true, $printReturnLabels);
485
  $packingSlipModel->createPdf($shipmentLabels, $shipment, $pdf);
486
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
487
  Mage::helper('postnl/cif')->parseCifException($e);
527
  return $output;
528
  }
529
 
530
+ /**
531
+ * Get all return labels for a shipment.
532
+ *
533
+ * @param Mage_Sales_Model_Order_Shipment|TIG_PostNL_Model_Core_Shipment $shipment
534
+ *
535
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]|false
536
+ */
537
+ protected function _getReturnLabels($shipment)
538
+ {
539
+ /**
540
+ * Load the PostNL shipment.
541
+ */
542
+ if ($shipment instanceof Mage_Sales_Model_Order_Shipment) {
543
+ $postnlShipment = $this->_getPostnlShipment($shipment->getId());
544
+ } else {
545
+ $postnlShipment = $shipment;
546
+ }
547
+
548
+ if (!$postnlShipment->hasReturnBarcode() && !$postnlShipment->canGenerateReturnBarcode()) {
549
+ return false;
550
+ }
551
+
552
+ if ($postnlShipment->hasReturnLabels()) {
553
+ return $postnlShipment->getReturnLabels();
554
+ }
555
+
556
+ $postnlShipment = $this->_generateLabels($shipment, $postnlShipment, false);
557
+
558
+ $labels = $postnlShipment->getReturnLabels();
559
+
560
+ if (!$postnlShipment->getLabelsPrinted()) {
561
+ $postnlShipment->setLabelsPrinted(true);
562
+ }
563
+
564
+ if (!$postnlShipment->getReturnLabelsPrinted()) {
565
+ $postnlShipment->setReturnLabelsPrinted(true);
566
+ }
567
+
568
+ if ($postnlShipment->hasDataChanges()) {
569
+ $postnlShipment->save();
570
+ }
571
+
572
+ return $labels;
573
+ }
574
+
575
  /**
576
  * Retrieves the shipping label for a given shipment ID.
577
  *
578
  * If the shipment has a stored label, it is returned. Otherwise a new one is generated.
579
  *
580
  * @param Mage_Sales_Model_Order_Shipment|TIG_PostNL_Model_Core_Shipment $shipment
581
+ * @param boolean $confirm Optional parameter to also
582
+ * confirm the shipment
583
+ * @param boolean|null $includeReturnLabels
584
  *
585
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]
586
  *
587
  * @throws TIG_PostNL_Exception
588
  */
589
+ protected function _getLabels($shipment, $confirm = false, $includeReturnLabels = null)
590
  {
591
+ if (is_null($includeReturnLabels)) {
592
+ $includeReturnLabels = Mage::getStoreConfigFlag(
593
+ self::XPATH_PRINT_RETURN_AND_SHIPPING_LABEL,
594
+ $shipment->getStoreId()
595
+ );
596
+
597
+ /**
598
+ * Return labels may only be included if the current admin user is allowed to print them.
599
+ */
600
+ if (!$this->_checkIsAllowed(array('print_return_labels'))) {
601
+ $includeReturnLabels = false;
602
+ }
603
+ }
604
+
605
+ /**
606
+ * Check if printing return labels is allowed.
607
+ */
608
+ if (!Mage::helper('postnl')->isReturnsEnabled($shipment->getStoreId())) {
609
+ $includeReturnLabels = false;
610
+ }
611
+
612
  /**
613
  * Load the PostNL shipment.
614
  */
626
  if ($confirm === true && !$postnlShipment->isConfirmed() && $postnlShipment->canConfirm()) {
627
  $this->_confirmShipment($postnlShipment);
628
  }
629
+ } else {
630
+ /**
631
+ * Generate the required labels.
632
+ */
633
+ $postnlShipment = $this->_generateLabels($shipment, $postnlShipment, $confirm);
634
+ }
635
+
636
+ $labels = $postnlShipment->getlabels($includeReturnLabels);
637
 
638
+ if (!$postnlShipment->getLabelsPrinted()) {
639
+ $postnlShipment->setLabelsPrinted(true);
640
  }
641
 
642
+ if ($includeReturnLabels && !$postnlShipment->getReturnLabelsPrinted()) {
643
+ $postnlShipment->setReturnLabelsPrinted(true);
644
+ }
645
+
646
+ if ($postnlShipment->hasDataChanges()) {
647
+ $postnlShipment->save();
648
+ }
649
+
650
+ return $labels;
651
+ }
652
+
653
+ /**
654
+ * Generate shipping labels for this given shipment. This method includes the functionality required to prepare the
655
+ * shipment for generating labels if required.
656
+ *
657
+ * @param Mage_Sales_Model_Order_Shipment $shipment
658
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
659
+ * @param boolean $confirm
660
+ *
661
+ * @return TIG_PostNL_Model_Core_Shipment
662
+ */
663
+ protected function _generateLabels($shipment, $postnlShipment, $confirm = false)
664
+ {
665
  /**
666
  * If the PostNL shipment is new, set the magento shipment ID.
667
  */
676
  $postnlShipment->generateBarcodes();
677
  }
678
 
679
+ $printReturnLabel = Mage::helper('postnl/cif')->isReturnsEnabled($postnlShipment->getStoreId());
680
+ if ($printReturnLabel && $postnlShipment->canGenerateReturnBarcode()) {
681
+ $postnlShipment->generateReturnBarcode();
682
+ }
683
+
684
+ if (true === $confirm
685
  && !$postnlShipment->hasLabels()
686
  && !$postnlShipment->isConfirmed()
687
  && $postnlShipment->canConfirm(true)
704
  ->save();
705
  }
706
 
707
+ return $postnlShipment;
 
708
  }
709
 
710
  /**
755
  $postnlShipment->generateBarcodes();
756
  }
757
 
758
+ $printReturnLabel = Mage::helper('postnl/cif')->isReturnsEnabled($shipment->getStoreId());
759
+ if ($printReturnLabel && !$postnlShipment->hasReturnBarcode() && $postnlShipment->canGenerateReturnBarcode()) {
760
+ $postnlShipment->generateReturnBarcode();
761
+ }
762
+
763
  if ($postnlShipment->getConfirmStatus() === $postnlShipment::CONFIRM_STATUS_CONFIRMED) {
764
  /**
765
  * The shipment is already confirmed.
797
  return $this;
798
  }
799
 
800
+ /**
801
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
802
+ *
803
+ * @return $this
804
+ * @throws Exception
805
+ * @throws TIG_PostNL_Exception
806
+ * @throws TIG_PostNL_Model_Core_Cif_Exception
807
+ */
808
+ protected function _updateShippingStatus(TIG_PostNL_Model_Core_Shipment $postnlShipment)
809
+ {
810
+ /**
811
+ * Only confirmed shipments cna be updated.
812
+ */
813
+ if (!$postnlShipment->isConfirmed()) {
814
+ throw new TIG_PostNL_Exception(
815
+ $this->__(
816
+ 'The shipping status of shipment #%s cannot be updated, because it has not yet been confirmed.',
817
+ $postnlShipment->getShipmentIncrementId()
818
+ ),
819
+ 'POSTNL-0206'
820
+ );
821
+ }
822
+
823
+ /**
824
+ * Check if the shipment's shipping status or return status may be updated.
825
+ */
826
+ if (!$postnlShipment->canUpdateShippingStatus() && !$postnlShipment->canUpdateReturnStatus()) {
827
+ throw new TIG_PostNL_Exception(
828
+ $this->__(
829
+ 'The shipping status of shipment #%s cannot be updated.',
830
+ $postnlShipment->getShipmentIncrementId()
831
+ ),
832
+ 'POSTNL-0220'
833
+ );
834
+ }
835
+
836
+ if ($postnlShipment->canUpdateShippingStatus()) {
837
+ $postnlShipment->updateShippingStatus(true);
838
+ }
839
+
840
+ if ($postnlShipment->canUpdateReturnStatus()) {
841
+ $postnlShipment->updateReturnStatus(true);
842
+ }
843
+
844
+ if ($postnlShipment->hasDataChanges()) {
845
+ $postnlShipment->save();
846
+ }
847
+
848
+ return $this;
849
+ }
850
+
851
  /**
852
  * Load an array of shipments based on an array of shipmentIds and check if they're shipped using PostNL
853
  *
1135
  /**
1136
  * Warnings must have a description.
1137
  */
1138
+ if (empty($warning['description'])) {
1139
  continue;
1140
  }
1141
 
1143
  * Codes are optional for warnings, but must be present in the array. If no code is found in the warning we
1144
  * add an empty one.
1145
  */
1146
+ if (!isset($warning['code'])) {
1147
+ continue;
1148
+ }
1149
+
1150
+ /**
1151
+ * Translate the individual parts of the message.
1152
+ */
1153
+ $descriptionMessages = explode(PHP_EOL, $warning['description']);
1154
+ $description = array();
1155
+ foreach ($descriptionMessages as $descriptionMessage) {
1156
+ if (empty($descriptionMessage)) {
1157
+ continue;
1158
+ }
1159
+
1160
+ $description[] = $this->__($descriptionMessage);
1161
+ }
1162
+
1163
+ /**
1164
+ * If the code is empty, replace it with a null value.
1165
+ */
1166
+ $code = $warning['code'];
1167
+ if (empty($code)) {
1168
+ $code = null;
1169
  }
1170
 
1171
  /**
1172
  * Get the formatted warning message.
1173
  */
1174
  $warningText = $helper->getSessionMessage(
1175
+ $code,
1176
  'warning',
1177
+ implode(' ', $description)
1178
  );
1179
 
1180
  /**
app/code/community/TIG/PostNL/Controller/Sales.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Controller_Sales extends Mage_Core_Controller_Front_Action
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_errorRedirect = '*/*/noroute';
45
+
46
+ /**
47
+ * @return string
48
+ */
49
+ public function getErrorRedirect()
50
+ {
51
+ return $this->_errorRedirect;
52
+ }
53
+
54
+ /**
55
+ * View the returns page.
56
+ *
57
+ * @return void
58
+ */
59
+ public function returnsAction()
60
+ {
61
+ if (!$this->_loadValidOrder()) {
62
+ return;
63
+ }
64
+
65
+ $order = Mage::registry('current_order');
66
+ if (!Mage::helper('postnl')->canPrintReturnLabelForOrder($order)) {
67
+ $this->_redirect($this->getErrorRedirect());
68
+ return;
69
+ }
70
+
71
+ $this->loadLayout();
72
+ $this->_initLayoutMessages('catalog/session');
73
+
74
+ /**
75
+ * @var Mage_Customer_Block_Account_Navigation $navigationBlock
76
+ */
77
+ $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
78
+ if ($navigationBlock) {
79
+ $navigationBlock->setActive('sales/order/history');
80
+ }
81
+ $this->renderLayout();
82
+ }
83
+
84
+ /**
85
+ * Print the return labels for the current shipment.
86
+ *
87
+ * @return $this
88
+ *
89
+ * @throws TIG_PostNL_Exception
90
+ */
91
+ public function printReturnLabelAction()
92
+ {
93
+ if (!$this->_loadValidPostnlShipment()) {
94
+ $this->_redirect($this->getErrorRedirect());
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * @var TIG_postNL_Model_Core_Shipment $postnlShipment
100
+ */
101
+ $helper = Mage::helper('postnl');
102
+ $postnlShipment = Mage::registry('current_postnl_shipment');
103
+
104
+ try {
105
+ /**
106
+ * Get the labels from CIF.
107
+ */
108
+ $labels = $this->_getReturnLabels($postnlShipment);
109
+ if (false === $labels) {
110
+ throw new TIG_PostNL_Exception(
111
+ $this->__(
112
+ 'Unable to retrieve return labels for this shipment.'
113
+ ),
114
+ 'POSTNL-0202'
115
+ );
116
+ }
117
+
118
+ /**
119
+ * Merge the labels and print them.
120
+ */
121
+ $labelModel = Mage::getModel('postnl_core/label');
122
+ $output = $labelModel->setLabelSize('A6')->createPdf($labels);
123
+
124
+ $filename = 'PostNL Return Labels-' . date('YmdHis') . '.pdf';
125
+
126
+ $this->_prepareDownloadResponse($filename, $output);
127
+ } catch (TIG_PostNL_Exception $e) {
128
+ $helper->logException($e);
129
+ $helper->addSessionMessage('core/session', $e->getCode(), 'error',
130
+ 'An error occurred while retrieving the return labels. Please try again.'
131
+ );
132
+
133
+ $this->_redirect('postnl/*/returns', array('order_id' => $postnlShipment->getOrderId()));
134
+ return $this;
135
+ } catch (Exception $e) {
136
+ $helper->logException($e);
137
+ $helper->addSessionMessage('core/session', null, 'error',
138
+ 'An error occurred while retrieving the return labels. Please try again.'
139
+ );
140
+
141
+ $this->_redirect('postnl/*/returns', array('order_id' => $postnlShipment->getOrderId()));
142
+ return $this;
143
+ }
144
+
145
+ return $this;
146
+ }
147
+
148
+ /**
149
+ * Init layout, messages and set active block for customer
150
+ *
151
+ * @return null
152
+ */
153
+ protected function _viewAction()
154
+ {
155
+ if (!$this->_loadValidOrder()) {
156
+ return;
157
+ }
158
+
159
+ $this->loadLayout();
160
+ $this->_initLayoutMessages('catalog/session');
161
+
162
+ /**
163
+ * @var Mage_Customer_block_Account_Navigation $navigationBlock
164
+ */
165
+ $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
166
+ if ($navigationBlock) {
167
+ $navigationBlock->setActive($this->getErrorRedirect());
168
+ }
169
+ $this->renderLayout();
170
+ }
171
+
172
+ /**
173
+ * Try to load valid order by order_id and register it.
174
+ *
175
+ * @param int|null $orderId
176
+ *
177
+ * @return boolean
178
+ */
179
+ protected function _loadValidOrder($orderId = null)
180
+ {
181
+ if (null === $orderId) {
182
+ $orderId = (int) $this->getRequest()->getParam('order_id');
183
+ }
184
+ if (!$orderId) {
185
+ $this->_redirect($this->getErrorRedirect());
186
+ return false;
187
+ }
188
+
189
+ $order = Mage::getModel('sales/order')->load($orderId);
190
+
191
+ if ($this->_canViewOrder($order)) {
192
+ Mage::register('current_order', $order);
193
+ return true;
194
+ } else {
195
+ $this->_redirect($this->getErrorRedirect());
196
+ }
197
+ return false;
198
+ }
199
+
200
+ /**
201
+ * Try to load valid PostNL shipment by order_id and register it.
202
+ *
203
+ * @param int|null $shipmentIncrementId
204
+ *
205
+ * @return boolean
206
+ */
207
+ protected function _loadValidPostnlShipment($shipmentIncrementId = null)
208
+ {
209
+ if (null === $shipmentIncrementId) {
210
+ $shipmentIncrementId = (int) $this->getRequest()->getParam('shipment_id');
211
+ }
212
+
213
+ if (!$shipmentIncrementId) {
214
+ $this->_forward('noRoute');
215
+ return false;
216
+ }
217
+
218
+ $shipmentId = Mage::getResourceModel('postnl/order_shipment')->getShipmentId($shipmentIncrementId);
219
+
220
+ $postnlShipment = Mage::getModel('postnl_core/shipment')->load($shipmentId, 'shipment_id');
221
+
222
+ if ($this->_canViewPostnlShipment($postnlShipment)) {
223
+ Mage::register('current_postnl_shipment', $postnlShipment);
224
+ return true;
225
+ } else {
226
+ $this->_redirect($this->getErrorRedirect());
227
+ }
228
+ return false;
229
+ }
230
+
231
+ /**
232
+ * Check order view availability
233
+ *
234
+ * @param Mage_Sales_Model_Order $order
235
+ * @return bool
236
+ */
237
+ protected function _canViewOrder($order)
238
+ {
239
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
240
+ $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
241
+ if ($order->getId() && $order->getCustomerId() && ($order->getCustomerId() == $customerId)
242
+ && in_array($order->getState(), $availableStates, $strict = true)
243
+ ) {
244
+ return true;
245
+ }
246
+ return false;
247
+ }
248
+
249
+ /**
250
+ * Check PostNL shipment view availability
251
+ *
252
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
253
+ *
254
+ * @return boolean
255
+ */
256
+ protected function _canViewPostnlShipment(TIG_PostNL_Model_Core_Shipment $postnlShipment)
257
+ {
258
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
259
+ $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
260
+ $order = $postnlShipment->getOrder();
261
+
262
+ if ($postnlShipment->getId()
263
+ && $postnlShipment->isConfirmed()
264
+ && $order->getId()
265
+ && $order->getCustomerId()
266
+ && ($order->getCustomerId() == $customerId)
267
+ && in_array($order->getState(), $availableStates, $strict = true)
268
+ ) {
269
+ return true;
270
+ }
271
+
272
+ return false;
273
+ }
274
+
275
+ /**
276
+ * Get all return labels for a shipment.
277
+ *
278
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
279
+ *
280
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]|false
281
+ */
282
+ protected function _getReturnLabels($postnlShipment)
283
+ {
284
+ if (!$postnlShipment->canPrintReturnLabels()) {
285
+ return false;
286
+ }
287
+
288
+ if ($postnlShipment->hasLabels()) {
289
+ return $postnlShipment->getReturnLabels();
290
+ }
291
+
292
+ $postnlShipment = $this->_generateLabels($postnlShipment);
293
+
294
+ $labels = $postnlShipment->getReturnLabels();
295
+
296
+ if (!$postnlShipment->getReturnLabelsPrinted()) {
297
+ $postnlShipment->setReturnLabelsPrinted(true)
298
+ ->save();
299
+ }
300
+
301
+ return $labels;
302
+ }
303
+
304
+ /**
305
+ * Generate shipping labels for this given shipment.
306
+ *
307
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
308
+ *
309
+ * @return TIG_PostNL_Model_Core_Shipment
310
+ */
311
+ protected function _generateLabels($postnlShipment)
312
+ {
313
+ /**
314
+ * If the shipment does not have a barcode, generate one.
315
+ */
316
+ if (!$postnlShipment->getMainBarcode() && $postnlShipment->canGenerateBarcode()) {
317
+ $postnlShipment->generateBarcodes();
318
+ }
319
+
320
+ $printReturnLabel = Mage::helper('postnl/cif')->isReturnsEnabled($postnlShipment->getStoreId());
321
+ if ($printReturnLabel && $postnlShipment->canGenerateReturnBarcode()) {
322
+ $postnlShipment->generateReturnBarcode();
323
+ }
324
+
325
+ /**
326
+ * Generate new shipping labels without confirming.
327
+ */
328
+ $postnlShipment->generateLabel()
329
+ ->save();
330
+
331
+ return $postnlShipment;
332
+ }
333
+ }
app/code/community/TIG/PostNL/Helper/AddressValidation.php CHANGED
@@ -87,11 +87,35 @@ class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
87
  const POSTCODE_CHECK_HOUSE_NUMBER_FIELD = 2;
88
  const POSTCODE_CHECK_HOUSE_NUMBER_EXTENSION_FIELD = 3;
89
 
 
 
 
 
 
90
  /**
91
  * @var null|string|int
92
  */
93
  protected $_oscStreetFieldSortOrder = null;
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  /**
96
  * Gets the current street field sort order for OSC.
97
  *
@@ -123,16 +147,40 @@ class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
123
  $storeId = Mage::app()->getStore()->getId();
124
  }
125
 
 
 
 
 
126
  if ($this->isPostcodeCheckEnabled($storeId)) {
 
127
  return true;
128
  }
129
 
 
 
 
 
 
 
130
  $useSplitStreet = Mage::getStoreConfigFlag(self::XPATH_SPLIT_STREET, $storeId);
131
- return $useSplitStreet;
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  }
133
 
134
  /**
135
- * Checks whether the given store uses split housenumber values.
136
  *
137
  * @param int|null $storeId
138
  *
@@ -144,12 +192,30 @@ class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
144
  $storeId = Mage::app()->getStore()->getId();
145
  }
146
 
 
 
 
 
147
  if ($this->isPostcodeCheckEnabled($storeId)) {
 
148
  return true;
149
  }
150
 
151
- $useSplitStreet = Mage::getStoreConfigFlag(self::XPATH_SPLIT_HOUSENUMBER, $storeId);
152
- return $useSplitStreet;
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
 
155
  /**
@@ -338,6 +404,93 @@ class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
338
 
339
  return $environmentAllowed;
340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
 
342
  /**
343
  * Logs a cendris request and response for debug purposes.
87
  const POSTCODE_CHECK_HOUSE_NUMBER_FIELD = 2;
88
  const POSTCODE_CHECK_HOUSE_NUMBER_EXTENSION_FIELD = 3;
89
 
90
+ /**
91
+ * XML path to community edition address lines configuration option
92
+ */
93
+ const XPATH_COMMUNITY_STREET_LINES = 'customer/address/street_lines';
94
+
95
  /**
96
  * @var null|string|int
97
  */
98
  protected $_oscStreetFieldSortOrder = null;
99
 
100
+ /**
101
+ * @var array
102
+ */
103
+ protected $_lineCount = array();
104
+
105
+ /**
106
+ * @var array
107
+ *
108
+ * @todo cache this value
109
+ */
110
+ protected $_useSplitStreet = array();
111
+
112
+ /**
113
+ * @var array
114
+ *
115
+ * @todo cache this value
116
+ */
117
+ protected $_useSplitHouseNumber = array();
118
+
119
  /**
120
  * Gets the current street field sort order for OSC.
121
  *
147
  $storeId = Mage::app()->getStore()->getId();
148
  }
149
 
150
+ if (isset($this->_useSplitStreet[$storeId])) {
151
+ return $this->_useSplitStreet[$storeId];
152
+ }
153
+
154
  if ($this->isPostcodeCheckEnabled($storeId)) {
155
+ $this->_useSplitStreet[$storeId] = true;
156
  return true;
157
  }
158
 
159
+ $addressLines = Mage::helper('postnl/addressValidation')->getAddressLineCount($storeId);
160
+ if ($addressLines < 2) {
161
+ $this->_useSplitStreet[$storeId] = false;
162
+ return false;
163
+ }
164
+
165
  $useSplitStreet = Mage::getStoreConfigFlag(self::XPATH_SPLIT_STREET, $storeId);
166
+ if (!$useSplitStreet) {
167
+ $this->_useSplitStreet[$storeId] = false;
168
+ return false;
169
+ }
170
+
171
+ $streetField = $this->getStreetnameField();
172
+ $houseNumberField = $this->getHousenumberField();
173
+ if ($streetField == $houseNumberField) {
174
+ $this->_useSplitStreet[$storeId] = false;
175
+ return false;
176
+ }
177
+
178
+ $this->_useSplitStreet[$storeId] = true;
179
+ return true;
180
  }
181
 
182
  /**
183
+ * Checks whether the given store uses split house number values.
184
  *
185
  * @param int|null $storeId
186
  *
192
  $storeId = Mage::app()->getStore()->getId();
193
  }
194
 
195
+ if (isset($this->_useSplitHouseNumber[$storeId])) {
196
+ return $this->_useSplitHouseNumber[$storeId];
197
+ }
198
+
199
  if ($this->isPostcodeCheckEnabled($storeId)) {
200
+ $this->_useSplitHouseNumber[$storeId] = true;
201
  return true;
202
  }
203
 
204
+ $useSplitHousenumber = Mage::getStoreConfigFlag(self::XPATH_SPLIT_HOUSENUMBER, $storeId);
205
+ if (!$useSplitHousenumber) {
206
+ $this->_useSplitHouseNumber[$storeId] = false;
207
+ return false;
208
+ }
209
+
210
+ $houseNumberField = $this->getHousenumberField();
211
+ $houseNumberExtensionField = $this->getHousenumberExtensionField();
212
+ if ($houseNumberField == $houseNumberExtensionField) {
213
+ $this->_useSplitHouseNumber[$storeId] = false;
214
+ return false;
215
+ }
216
+
217
+ $this->_useSplitHouseNumber[$storeId] = true;
218
+ return true;
219
  }
220
 
221
  /**
404
 
405
  return $environmentAllowed;
406
  }
407
+ /**
408
+ * Get the configured line count for the current, or specified, config scope.
409
+ *
410
+ * @param int|null $storeId
411
+ *
412
+ * @return int
413
+ */
414
+ public function getAddressLineCount($storeId = null)
415
+ {
416
+ if ($storeId) {
417
+ $addressLineCount = $this->_lineCount;
418
+ if (isset($addressLineCount[$storeId])) {
419
+ return $addressLineCount[$storeId];
420
+ }
421
+ }
422
+
423
+ if ($this->isEnterprise()) {
424
+ $lineCount = $this->_getEnterpriseAddressLineCount($storeId);
425
+ } else {
426
+ $lineCount = $this->_getCommunityAddressLineCount($storeId);
427
+ }
428
+
429
+ if ($storeId) {
430
+ $this->_lineCount[$storeId] = $lineCount;
431
+ }
432
+
433
+ return $lineCount;
434
+ }
435
+
436
+ /**
437
+ * Get the address line count for Magento Community.
438
+ *
439
+ * @param int|null $storeId
440
+ *
441
+ * @return int
442
+ */
443
+ protected function _getCommunityAddressLineCount($storeId = null)
444
+ {
445
+ /**
446
+ * Get the allowed number of address lines based on the current scope
447
+ */
448
+ if (is_null($storeId)) {
449
+ $request = Mage::app()->getRequest();
450
+
451
+ if ($request->getParam('store')) {
452
+ $lineCount = Mage::getStoreConfig(self::XPATH_COMMUNITY_STREET_LINES, $request->getParam('store'));
453
+ } elseif ($request->getParam('website')) {
454
+ $website = Mage::getModel('core/website')->load($request->getParam('website'), 'code');
455
+ $lineCount = $website->getConfig(self::XPATH_COMMUNITY_STREET_LINES, $website->getId());
456
+ } else {
457
+ $lineCount = Mage::getStoreConfig(
458
+ self::XPATH_COMMUNITY_STREET_LINES,
459
+ Mage_Core_Model_App::ADMIN_STORE_ID
460
+ );
461
+ }
462
+ return $lineCount;
463
+ }
464
+
465
+ $lineCount = Mage::getStoreConfig(self::XPATH_COMMUNITY_STREET_LINES, $storeId);
466
+ return $lineCount;
467
+ }
468
+
469
+ /**
470
+ * Get the address line count for Magento Enterprise.
471
+ *
472
+ * @param int|null $storeId
473
+ *
474
+ * @return int
475
+ */
476
+ protected function _getEnterpriseAddressLineCount($storeId = null)
477
+ {
478
+ if (is_null($storeId)) {
479
+ $request = Mage::app()->getRequest();
480
+
481
+ if ($request->getParam('store')) {
482
+ $storeId = $request->getParam('store');
483
+ } elseif ($request->getParam('website')) {
484
+ $website = Mage::getModel('core/website')->load($request->getParam('website'), 'code');
485
+ $storeId = $website->getDefaultStore()->getId();
486
+ } else {
487
+ $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
488
+ }
489
+ }
490
+
491
+ $lineCount = Mage::helper('customer/address')->getStreetLines($storeId);
492
+ return $lineCount;
493
+ }
494
 
495
  /**
496
  * Logs a cendris request and response for debug purposes.
app/code/community/TIG/PostNL/Helper/Carrier.php CHANGED
@@ -66,6 +66,11 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
66
  */
67
  const XPATH_POSTNL_SHIPPING_METHODS = 'postnl/advanced/postnl_shipping_methods';
68
 
 
 
 
 
 
69
  /**
70
  * Array of possible PostNL shipping methods.
71
  *
@@ -187,6 +192,7 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
187
  */
188
  public function getPostnlShippingMethod()
189
  {
 
190
  return $this->getCurrentPostnlShippingMethod();
191
  }
192
 
@@ -262,10 +268,9 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
262
  $request->setDestRegionCode($shippingAddress->getRegionCode());
263
 
264
  /**
265
- * need to call getStreet with -1
266
- * to get data in string instead of array
267
  */
268
- $request->setDestStreet($shippingAddress->getStreet($shippingAddress::DEFAULT_DEST_STREET));
269
  $request->setDestCity($shippingAddress->getCity());
270
  $request->setDestPostcode($shippingAddress->getPostcode());
271
  $request->setPackageValue($shippingAddress->getBaseSubtotal());
@@ -275,7 +280,7 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
275
  $request->setPackageQty($shippingAddress->getItemQty());
276
 
277
  /**
278
- * Need for shipping methods that use insurance based on price of physical products
279
  */
280
  $packagePhysicalValue = $shippingAddress->getBaseVirtualAmount();
281
  $request->setPackagePhysicalValue($packagePhysicalValue);
@@ -286,7 +291,7 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
286
  $request->setWebsiteId($store->getWebsiteId());
287
  $request->setFreeShipping($shippingAddress->getFreeShipping());
288
  /**
289
- * Currencies need to convert in free shipping
290
  */
291
  $request->setBaseCurrency($store->getBaseCurrency());
292
  $request->setPackageCurrency($store->getCurrentCurrency());
@@ -383,15 +388,15 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
383
  $countryCode = null;
384
  $postcode = null;
385
  if (is_array($destination)) {
386
- if (!isset($destination['countryCode']) || !isset($destination['postcode'])) {
387
- throw new InvalidArgumentException("Destination must contain the 'countryCode' and 'postcode' keys.");
388
  }
389
 
390
  $countryCode = $destination['countryCode'];
391
  $postcode = $destination['postcode'];
392
  } elseif (is_object($destination) && $destination instanceof Varien_Object) {
393
- if (!$destination->getCountry() || !$destination->getPostcode()) {
394
- throw new InvalidArgumentException('Destination must have a country and a postcode.');
395
  }
396
 
397
  $countryCode = $destination->getCountry();
@@ -401,7 +406,7 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
401
  }
402
 
403
  /**
404
- * Get the dutch track & trace URL for dutch shipments or for the admin
405
  */
406
  if ($forceNl
407
  || (!empty($countryCode)
@@ -411,7 +416,7 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
411
  $barcodeUrl = Mage::getStoreConfig(self::POSTNL_TRACK_AND_TRACE_NL_BASE_URL_XPATH)
412
  . '&b=' . $barcode;
413
  /**
414
- * For dutch shipments add the postcode. For international shipments add an 'international' flag
415
  */
416
  if (!empty($postcode)
417
  && !empty($countryCode)
@@ -426,12 +431,15 @@ class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
426
  }
427
 
428
  /**
429
- * Get a general track & trace URL for all other destinations
430
  */
431
  $barcodeUrl = Mage::getStoreConfig(self::POSTNL_TRACK_AND_TRACE_INT_BASE_URL_XPATH)
432
  . '/' . $barcode
433
- . '/' . $countryCode
434
- . '/' . $postcode;
 
 
 
435
 
436
  return $barcodeUrl;
437
  }
66
  */
67
  const XPATH_POSTNL_SHIPPING_METHODS = 'postnl/advanced/postnl_shipping_methods';
68
 
69
+ /**
70
+ * Default destination street. This is defined here, rather tha n in the address model for backwards compatibility.
71
+ */
72
+ const DEFAULT_DEST_STREET = '-1';
73
+
74
  /**
75
  * Array of possible PostNL shipping methods.
76
  *
192
  */
193
  public function getPostnlShippingMethod()
194
  {
195
+ trigger_error('This method is deprecated and may be removed in the future.', E_USER_NOTICE);
196
  return $this->getCurrentPostnlShippingMethod();
197
  }
198
 
268
  $request->setDestRegionCode($shippingAddress->getRegionCode());
269
 
270
  /**
271
+ * Need to call getStreet with -1 to get data in string instead of array.
 
272
  */
273
+ $request->setDestStreet($shippingAddress->getStreet(self::DEFAULT_DEST_STREET));
274
  $request->setDestCity($shippingAddress->getCity());
275
  $request->setDestPostcode($shippingAddress->getPostcode());
276
  $request->setPackageValue($shippingAddress->getBaseSubtotal());
280
  $request->setPackageQty($shippingAddress->getItemQty());
281
 
282
  /**
283
+ * Need for shipping methods that use insurance based on price of physical products.
284
  */
285
  $packagePhysicalValue = $shippingAddress->getBaseVirtualAmount();
286
  $request->setPackagePhysicalValue($packagePhysicalValue);
291
  $request->setWebsiteId($store->getWebsiteId());
292
  $request->setFreeShipping($shippingAddress->getFreeShipping());
293
  /**
294
+ * Currencies need to convert in free shipping.
295
  */
296
  $request->setBaseCurrency($store->getBaseCurrency());
297
  $request->setPackageCurrency($store->getCurrentCurrency());
388
  $countryCode = null;
389
  $postcode = null;
390
  if (is_array($destination)) {
391
+ if (!isset($destination['countryCode'])) {
392
+ throw new InvalidArgumentException("Destination must contain a country code.");
393
  }
394
 
395
  $countryCode = $destination['countryCode'];
396
  $postcode = $destination['postcode'];
397
  } elseif (is_object($destination) && $destination instanceof Varien_Object) {
398
+ if (!$destination->getCountry()) {
399
+ throw new InvalidArgumentException('Destination must contain a country code.');
400
  }
401
 
402
  $countryCode = $destination->getCountry();
406
  }
407
 
408
  /**
409
+ * Get the dutch track & trace URL for dutch shipments or for the admin.
410
  */
411
  if ($forceNl
412
  || (!empty($countryCode)
416
  $barcodeUrl = Mage::getStoreConfig(self::POSTNL_TRACK_AND_TRACE_NL_BASE_URL_XPATH)
417
  . '&b=' . $barcode;
418
  /**
419
+ * For dutch shipments add the postcode. For international shipments add an 'international' flag.
420
  */
421
  if (!empty($postcode)
422
  && !empty($countryCode)
431
  }
432
 
433
  /**
434
+ * Get a general track & trace URL for all other destinations.
435
  */
436
  $barcodeUrl = Mage::getStoreConfig(self::POSTNL_TRACK_AND_TRACE_INT_BASE_URL_XPATH)
437
  . '/' . $barcode
438
+ . '/' . $countryCode;
439
+
440
+ if (!empty($postcode)) {
441
+ $barcodeUrl .= '/' . $postcode;
442
+ }
443
 
444
  return $barcodeUrl;
445
  }
app/code/community/TIG/PostNL/Helper/Checkout.php CHANGED
@@ -331,6 +331,7 @@ class TIG_PostNL_Helper_Checkout extends TIG_PostNL_Helper_Data
331
  */
332
  public function quoteIsLetter($quoteItems, $storeId = null)
333
  {
 
334
  if ($quoteItems instanceof Mage_Sales_Model_Quote) {
335
  $quoteItems = $quoteItems->getAllItems();
336
  }
331
  */
332
  public function quoteIsLetter($quoteItems, $storeId = null)
333
  {
334
+ trigger_error('This method is deprecated and may be removed in the future.', E_USER_NOTICE);
335
  if ($quoteItems instanceof Mage_Sales_Model_Quote) {
336
  $quoteItems = $quoteItems->getAllItems();
337
  }
app/code/community/TIG/PostNL/Helper/Cif.php CHANGED
@@ -209,6 +209,13 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
209
  '4944' => '4952',
210
  );
211
 
 
 
 
 
 
 
 
212
  /**
213
  * @var null|array
214
  */
@@ -457,6 +464,14 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
457
  return $this->_combiLabelProductCodes;
458
  }
459
 
 
 
 
 
 
 
 
 
460
  /**
461
  * Checks if infinite label printing is enabled in the module configuration.
462
  *
@@ -706,6 +721,7 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
706
  */
707
  public function getDefaultProductOptions()
708
  {
 
709
  $storeId = Mage::app()->getStore()->getId();
710
 
711
  $defaultDutchOption = Mage::getStoreConfig(self::XPATH_DEFAULT_STANDARD_PRODUCT_OPTION, $storeId);
@@ -768,6 +784,39 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
768
  return $parcelCount;
769
  }
770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  /**
772
  * Checks if a given postnl shipment exists using Zend_Validate_Db_RecordExists.
773
  *
@@ -931,6 +980,8 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
931
  * @param Mage_Sales_Model_Order_Address $address
932
  *
933
  * @return array
 
 
934
  */
935
  protected function _getMultiLineStreetData($storeId, $address)
936
  {
209
  '4944' => '4952',
210
  );
211
 
212
+ /**
213
+ * @var array
214
+ */
215
+ protected $_returnLabelTypes = array(
216
+ 'Return Label'
217
+ );
218
+
219
  /**
220
  * @var null|array
221
  */
464
  return $this->_combiLabelProductCodes;
465
  }
466
 
467
+ /**
468
+ * @return array
469
+ */
470
+ public function getReturnLabelTypes()
471
+ {
472
+ return $this->_returnLabelTypes;
473
+ }
474
+
475
  /**
476
  * Checks if infinite label printing is enabled in the module configuration.
477
  *
721
  */
722
  public function getDefaultProductOptions()
723
  {
724
+ trigger_error('This method is deprecated and may be removed in the future.', E_USER_NOTICE);
725
  $storeId = Mage::app()->getStore()->getId();
726
 
727
  $defaultDutchOption = Mage::getStoreConfig(self::XPATH_DEFAULT_STANDARD_PRODUCT_OPTION, $storeId);
784
  return $parcelCount;
785
  }
786
 
787
+ /**
788
+ * Check if return labels may be printed.
789
+ *
790
+ * @param bool|int $storeId
791
+ *
792
+ * @return bool
793
+ */
794
+ public function isReturnsEnabled($storeId = false)
795
+ {
796
+ if (false === $storeId) {
797
+ $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
798
+ }
799
+
800
+ if (!$this->isEnabled($storeId)) {
801
+ return false;
802
+ }
803
+
804
+ $canPrintLabels = Mage::getStoreConfigFlag(self::XPATH_RETURN_LABELS_ACTIVE, $storeId);
805
+
806
+ if (!$canPrintLabels) {
807
+ return false;
808
+ }
809
+
810
+ $freePostNumber = Mage::getStoreConfig(self::XPATH_FREEPOST_NUMBER, $storeId);
811
+ $freePostNumber = trim($freePostNumber);
812
+
813
+ if (empty($freePostNumber)) {
814
+ return false;
815
+ }
816
+
817
+ return true;
818
+ }
819
+
820
  /**
821
  * Checks if a given postnl shipment exists using Zend_Validate_Db_RecordExists.
822
  *
980
  * @param Mage_Sales_Model_Order_Address $address
981
  *
982
  * @return array
983
+ *
984
+ * @todo make house number only required for countries that actually need it
985
  */
986
  protected function _getMultiLineStreetData($storeId, $address)
987
  {
app/code/community/TIG/PostNL/Helper/Data.php CHANGED
@@ -140,6 +140,15 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
140
  const BUSPAKJE_CALCULATION_MODE_AUTOMATIC = 'automatic';
141
  const BUSPAKJE_CALCULATION_MODE_MANUAL = 'manual';
142
 
 
 
 
 
 
 
 
 
 
143
  /**
144
  * Required configuration fields.
145
  *
@@ -247,6 +256,11 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
247
  */
248
  protected $_changelogUrl;
249
 
 
 
 
 
 
250
  /**
251
  * Get required fields array.
252
  *
@@ -413,6 +427,59 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
413
  return $this->_customBarcodes;
414
  }
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  /**
417
  * Get debug mode config setting.
418
  *
@@ -875,10 +942,18 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
875
  return false;
876
  }
877
 
 
 
 
 
 
 
 
 
878
  /**
879
  * The max qty attribute is only available on simple products.
880
  */
881
- if ($item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
882
  continue;
883
  }
884
 
@@ -948,6 +1023,10 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
948
  */
949
  public function standardizeWeight($weight, $storeId = null, $toGram = false)
950
  {
 
 
 
 
951
  if (is_null($storeId)) {
952
  $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
953
  }
@@ -1085,19 +1164,28 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
1085
  case 'print_packing_slips':
1086
  $aclPath = 'postnl/shipment/actions/print_label/print_packing_slips';
1087
  break;
 
 
 
 
 
 
 
 
1088
  case 'convert_to_buspakje':
1089
  $aclPath = 'postnl/shipment/actions/convert/to_buspakje';
1090
  break;
1091
  case 'convert_to_package':
1092
  $aclPath = 'postnl/shipment/actions/convert/to_package';
1093
  break;
1094
- case 'change_product_code':
1095
- $aclPath = 'postnl/shipment/actions/convert/change_product_code';
 
1096
  break;
1097
- case 'confirm': //no break
1098
- case 'print_label': //no break
1099
- case 'reset_confirmation': //no break
1100
- case 'delete_labels': //no break
1101
  case 'create_parcelware_export': //no break
1102
  case 'send_track_and_trace':
1103
  $aclPath = 'postnl/shipment/actions/' . $action;
@@ -1166,6 +1254,7 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
1166
  */
1167
  public function isTestModeAllowed()
1168
  {
 
1169
  return true;
1170
  }
1171
 
@@ -1226,7 +1315,22 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
1226
  */
1227
  protected function _isEnabled($storeId, $forceTestMode, $ignoreCache)
1228
  {
1229
- if (version_compare(phpversion(), self::MIN_PHP_VERSION, '<')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1230
  return false;
1231
  }
1232
 
@@ -1234,8 +1338,6 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
1234
  $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
1235
  }
1236
 
1237
- Mage::unregister('postnl_core_is_enabled_errors');
1238
-
1239
  /**
1240
  * Check if the module has been enabled
1241
  */
@@ -1676,6 +1778,167 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
1676
  return $message;
1677
  }
1678
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1679
  /**
1680
  * Check if debug logging is enabled
1681
  *
140
  const BUSPAKJE_CALCULATION_MODE_AUTOMATIC = 'automatic';
141
  const BUSPAKJE_CALCULATION_MODE_MANUAL = 'manual';
142
 
143
+ /**
144
+ * Xpaths to return label settings.
145
+ */
146
+ const XPATH_RETURN_LABELS_ACTIVE = 'postnl/returns/return_labels_active';
147
+ const XPATH_FREEPOST_NUMBER = 'postnl/returns/return_freepost_number';
148
+ const XPATH_CUSTOMER_PRINT_LABEL = 'postnl/returns/customer_print_label';
149
+ const XPATH_GUEST_PRINT_LABEL = 'postnl/returns/guest_print_label';
150
+ const XPATH_PRINT_RETURN_LABELS_WITH_SHIPPING_LABELS = 'postnl/returns/print_return_and_shipping_label';
151
+
152
  /**
153
  * Required configuration fields.
154
  *
256
  */
257
  protected $_changelogUrl;
258
 
259
+ /**
260
+ * @var string[]
261
+ */
262
+ protected $_storeTimeZones = array();
263
+
264
  /**
265
  * Get required fields array.
266
  *
427
  return $this->_customBarcodes;
428
  }
429
 
430
+ /**
431
+ * @return string[]
432
+ */
433
+ public function getStoreTimeZones()
434
+ {
435
+ return $this->_storeTimeZones;
436
+ }
437
+
438
+ /**
439
+ * @param string[] $storeTimeZones
440
+ *
441
+ * @return $this
442
+ */
443
+ public function setStoreTimeZones(array $storeTimeZones)
444
+ {
445
+ $this->_storeTimeZones = $storeTimeZones;
446
+
447
+ return $this;
448
+ }
449
+
450
+ /**
451
+ * Get the time zone of the specified store ID.
452
+ *
453
+ * @param int|string $storeId
454
+ * @param boolean $asDateTimeZone
455
+ *
456
+ * @return string|DateTimeZone
457
+ */
458
+ public function getStoreTimeZone($storeId, $asDateTimeZone = false)
459
+ {
460
+ $storeId = (int) $storeId;
461
+
462
+ $storeTimeZones = $this->getStoreTimeZones();
463
+ if (isset($storeTimeZones[$storeId])) {
464
+ $timeZone = $storeTimeZones[$storeId];
465
+ if ($asDateTimeZone) {
466
+ $timeZone = new DateTimeZone($timeZone);
467
+ }
468
+
469
+ return $timeZone;
470
+ }
471
+
472
+ $timeZone = Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE, $storeId);
473
+ $storeTimeZones[$storeId] = $timeZone;
474
+
475
+ $this->setStoreTimeZones($storeTimeZones);
476
+
477
+ if ($asDateTimeZone) {
478
+ $timeZone = new DateTimeZone($timeZone);
479
+ }
480
+ return $timeZone;
481
+ }
482
+
483
  /**
484
  * Get debug mode config setting.
485
  *
942
  return false;
943
  }
944
 
945
+ $product = $item->getProduct();
946
+ /**
947
+ * @todo optimize this code.
948
+ */
949
+ if (!$product) {
950
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
951
+ }
952
+
953
  /**
954
  * The max qty attribute is only available on simple products.
955
  */
956
+ if ($product->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
957
  continue;
958
  }
959
 
1023
  */
1024
  public function standardizeWeight($weight, $storeId = null, $toGram = false)
1025
  {
1026
+ if ($weight == 0) {
1027
+ return 0;
1028
+ }
1029
+
1030
  if (is_null($storeId)) {
1031
  $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
1032
  }
1164
  case 'print_packing_slips':
1165
  $aclPath = 'postnl/shipment/actions/print_label/print_packing_slips';
1166
  break;
1167
+ case 'print_return_label': //no break
1168
+ case 'print_return_labels':
1169
+ $aclPath = 'postnl/shipment/actions/print_label/print_return_labels';
1170
+ break;
1171
+ case 'send_return_label_email': //no break
1172
+ case 'send_return_labels_email':
1173
+ $aclPath = 'postnl/shipment/actions/print_label/print_return_labels/send_return_label_email';
1174
+ break;
1175
  case 'convert_to_buspakje':
1176
  $aclPath = 'postnl/shipment/actions/convert/to_buspakje';
1177
  break;
1178
  case 'convert_to_package':
1179
  $aclPath = 'postnl/shipment/actions/convert/to_package';
1180
  break;
1181
+ case 'change_product_code': //no break
1182
+ case 'change_parcel_count':
1183
+ $aclPath = 'postnl/shipment/actions/convert/' . $action;
1184
  break;
1185
+ case 'confirm': //no break
1186
+ case 'print_label': //no break
1187
+ case 'reset_confirmation': //no break
1188
+ case 'delete_labels': //no break
1189
  case 'create_parcelware_export': //no break
1190
  case 'send_track_and_trace':
1191
  $aclPath = 'postnl/shipment/actions/' . $action;
1254
  */
1255
  public function isTestModeAllowed()
1256
  {
1257
+ trigger_error('This method is deprecated and may be removed in the future.', E_USER_NOTICE);
1258
  return true;
1259
  }
1260
 
1315
  */
1316
  protected function _isEnabled($storeId, $forceTestMode, $ignoreCache)
1317
  {
1318
+ Mage::unregister('postnl_core_is_enabled_errors');
1319
+
1320
+ if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<')) {
1321
+ $errors = array(
1322
+ array(
1323
+ 'code' => 'POSTNL-0210',
1324
+ 'message' => $this->__(
1325
+ 'The installed version of PHP is too low. The installed PHP version is %s, the minimum ' .
1326
+ 'required PHP version is %s.',
1327
+ PHP_VERSION,
1328
+ self::MIN_PHP_VERSION
1329
+ ),
1330
+ )
1331
+ );
1332
+
1333
+ Mage::register('postnl_core_is_enabled_errors', $errors);
1334
  return false;
1335
  }
1336
 
1338
  $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
1339
  }
1340
 
 
 
1341
  /**
1342
  * Check if the module has been enabled
1343
  */
1778
  return $message;
1779
  }
1780
 
1781
+ /**
1782
+ * Check if return labels may be printed.
1783
+ *
1784
+ * @param boolean|int $storeId
1785
+ *
1786
+ * @return boolean
1787
+ */
1788
+ public function isReturnsEnabled($storeId = false)
1789
+ {
1790
+ if (false === $storeId) {
1791
+ $storeId = Mage::app()->getStore()->getId();
1792
+ }
1793
+
1794
+ if (!$this->isEnabled($storeId)) {
1795
+ return false;
1796
+ }
1797
+
1798
+ $canPrintLabels = Mage::getStoreConfigFlag(self::XPATH_RETURN_LABELS_ACTIVE, $storeId);
1799
+
1800
+ if (!$canPrintLabels) {
1801
+ return false;
1802
+ }
1803
+
1804
+ $freePostNumber = Mage::getStoreConfig(self::XPATH_FREEPOST_NUMBER, $storeId);
1805
+ $freePostNumber = trim($freePostNumber);
1806
+
1807
+ if (empty($freePostNumber)) {
1808
+ return false;
1809
+ }
1810
+
1811
+ return true;
1812
+ }
1813
+
1814
+ /**
1815
+ * Check if return labels can be printed along with shipping labels for the specified store view.
1816
+ *
1817
+ * @param boolean|int $storeId
1818
+ *
1819
+ * @return boolean
1820
+ */
1821
+ public function canPrintReturnLabelsWithShippingLabels($storeId = false)
1822
+ {
1823
+ if (false === $storeId) {
1824
+ $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
1825
+ }
1826
+
1827
+ if (!$this->isReturnsEnabled($storeId)) {
1828
+ return false;
1829
+ }
1830
+
1831
+ $printReturnLabels = Mage::getStoreConfigFlag(self::XPATH_PRINT_RETURN_LABELS_WITH_SHIPPING_LABELS, $storeId);
1832
+ return $printReturnLabels;
1833
+ }
1834
+
1835
+ /**
1836
+ * Check if return label printing is available for logged-in customers.
1837
+ *
1838
+ * @param boolean|int $storeId
1839
+ *
1840
+ * @return boolean
1841
+ */
1842
+ public function canPrintReturnLabelForCustomer($storeId = false)
1843
+ {
1844
+ if (false === $storeId) {
1845
+ $storeId = Mage::app()->getStore()->getId();
1846
+ }
1847
+
1848
+ if (!$this->isReturnsEnabled($storeId)) {
1849
+ return false;
1850
+ }
1851
+
1852
+ $canPrintReturnLabelForCustomer = Mage::getStoreConfigFlag(self::XPATH_CUSTOMER_PRINT_LABEL, $storeId);
1853
+ return $canPrintReturnLabelForCustomer;
1854
+ }
1855
+
1856
+ /**
1857
+ * Check if return label printing is available for guests.
1858
+ *
1859
+ * @param boolean|int $storeId
1860
+ *
1861
+ * @return boolean
1862
+ */
1863
+ public function canPrintReturnLabelForGuest($storeId = false)
1864
+ {
1865
+ if (false === $storeId) {
1866
+ $storeId = Mage::app()->getStore()->getId();
1867
+ }
1868
+
1869
+ if (!$this->canPrintReturnLabelForCustomer($storeId)) {
1870
+ return false;
1871
+ }
1872
+
1873
+ $canPrintReturnLabelForGuest = Mage::getStoreConfigFlag(self::XPATH_GUEST_PRINT_LABEL, $storeId);
1874
+ return $canPrintReturnLabelForGuest;
1875
+ }
1876
+
1877
+ /**
1878
+ * Check if printing return labels is allowed for this order.
1879
+ *
1880
+ * @param Mage_Sales_Model_Order|null $order
1881
+ *
1882
+ * @return bool
1883
+ */
1884
+ public function canPrintReturnLabelForOrder($order)
1885
+ {
1886
+ if (!$order || !$order->getId()) {
1887
+ return false;
1888
+ }
1889
+
1890
+ /**
1891
+ * Check if printing return labels is allowed for the order's store ID and if it's allowed for logged-in
1892
+ * customers or guests depending on who placed the order.
1893
+ */
1894
+ if ($order->getCustomerIsGuest()
1895
+ && !$this->canPrintReturnLabelForGuest($order->getStoreId())
1896
+ ) {
1897
+ return false;
1898
+ } elseif (!$this->canPrintReturnLabelForCustomer($order->getStoreId())) {
1899
+ return false;
1900
+ }
1901
+
1902
+ /**
1903
+ * Return labels are only available for orders that are shipped with PostNL.
1904
+ */
1905
+ $shippingMethod = $order->getShippingMethod();
1906
+ if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shippingMethod)) {
1907
+ return false;
1908
+ }
1909
+
1910
+ /**
1911
+ * Check if there are any confirmed PostNl shipments for this order.
1912
+ */
1913
+ $postnlShipmentsCollection = Mage::getResourceModel('postnl_core/shipment_collection');
1914
+ $postnlShipmentsCollection->addFieldToFilter('order_id', array('eq' => $order->getId()))
1915
+ ->addFieldToFilter(
1916
+ 'confirm_status',
1917
+ array(
1918
+ 'eq' => TIG_PostNL_Model_Core_Shipment::CONFIRM_STATUS_CONFIRMED
1919
+ )
1920
+ );
1921
+
1922
+ /**
1923
+ * We can only print return labels for confirmed shipments, so we need to make sure that at least one such
1924
+ * shipment is available.
1925
+ */
1926
+ if ($postnlShipmentsCollection->getSize() < 1) {
1927
+ return false;
1928
+ }
1929
+
1930
+ /**
1931
+ * Loop through all confirmed shipments. If at least one of them is able to print return labels, return true.
1932
+ */
1933
+ foreach ($postnlShipmentsCollection as $postnlShipment) {
1934
+ if ($postnlShipment->canPrintReturnLabels()) {
1935
+ return true;
1936
+ }
1937
+ }
1938
+
1939
+ return false;
1940
+ }
1941
+
1942
  /**
1943
  * Check if debug logging is enabled
1944
  *
app/code/community/TIG/PostNL/Helper/DeliveryOptions.php CHANGED
@@ -93,6 +93,11 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
93
  */
94
  const XPATH_RESPONSIVE = 'postnl/delivery_options/responsive';
95
 
 
 
 
 
 
96
  /**
97
  * The time we consider to be the start of the evening.
98
  */
@@ -384,7 +389,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
384
  * @param Mage_Core_Model_Abstract $entity
385
  * @param boolean $asVarienObject
386
  *
387
- * @return array|false
388
  */
389
  public function getDeliveryOptionsInfo(Mage_Core_Model_Abstract $entity, $asVarienObject = true)
390
  {
@@ -438,18 +443,24 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
438
  * This is the basic, empty array of delivery options info.
439
  */
440
  $deliveryOptionsInfo = array(
441
- 'type' => false,
442
- 'shipment_type' => false,
443
- 'formatted_type' => false,
444
- 'product_code' => false,
445
- 'product_option' => false,
446
- 'shipment_costs' => false,
447
- 'confirm_date' => false,
448
- 'delivery_date' => false,
449
- 'pakje_gemak_address' => false,
450
- 'confirm_status' => false,
451
- 'shipping_phase' => false,
452
- 'formatted_shipping_phase' => false,
 
 
 
 
 
 
453
  );
454
 
455
  /**
@@ -468,6 +479,38 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
468
  $deliveryOptionsInfo['shipment_costs'] = $shipmentCosts;
469
  }
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  /**
472
  * If we have a PostNL shipment, we can get some accurate data from it. Otherwise we need to get it from the
473
  * PostNL order.
@@ -517,14 +560,22 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
517
  * Add the delivery date.
518
  */
519
  if ($deliveryDate) {
520
- $deliveryOptionsInfo['delivery_date'] = $deliveryDate;
 
 
 
 
521
  }
522
 
523
  /**
524
  * Add the confirm date.
525
  */
526
  if ($confirmDate) {
527
- $deliveryOptionsInfo['confirm_date'] = $confirmDate;
 
 
 
 
528
  }
529
 
530
  /**
@@ -610,33 +661,90 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
610
  public function isPastCutOffTime($orderDate = null, $storeId = null)
611
  {
612
  if (!$orderDate) {
613
- $orderDate = new DateTime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
 
 
 
 
614
  }
615
 
616
  if ($storeId === null) {
617
  $storeId = Mage::app()->getStore()->getId();
618
  }
619
 
620
- if (is_string($orderDate)) {
621
- $orderDate = new DateTime($orderDate);
622
- }
 
623
 
624
  /**
625
- * Get the cut-off time. This is formatted as H:i:s.
626
  */
627
- $cutOffTime = Mage::getStoreConfig(self::XPATH_CUTOFF_TIME, $storeId);
628
- $orderTime = $orderDate->format('His');
 
 
 
 
 
 
 
 
629
 
630
  /**
631
  * Check if the current time (as His) is greater than the cut-off time.
632
  */
633
- if ($orderTime > str_replace(':', '', $cutOffTime)) {
634
  return true;
635
  }
636
 
637
  return false;
638
  }
639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  /**
641
  * Get the delivery date for a specified order date.
642
  *
@@ -645,14 +753,18 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
645
  * @param boolean $asDays
646
  * @param boolean $asDateTime
647
  * @param boolean $withTime
 
648
  *
649
  * @return string|int|DateTime
650
  */
651
  public function getDeliveryDate($orderDate = null, $storeId = null, $asDays = false, $asDateTime = false,
652
- $withTime = true
653
  ) {
654
  if (!$orderDate) {
655
- $orderDate = new DateTime(Mage::getSingleton('core/date')->date('Y-m-d H:i:s'));
 
 
 
656
  }
657
 
658
  if ($storeId === null) {
@@ -660,24 +772,19 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
660
  }
661
 
662
  if (is_string($orderDate)) {
663
- $orderDate = new DateTime($orderDate);
 
 
 
 
 
 
 
664
  }
665
 
666
- /**
667
- * Get the base shipping duration for this order.
668
- */
669
- $shippingDuration = Mage::getStoreConfig(self::XPATH_SHIPPING_DURATION, $storeId);
670
  $deliveryTime = clone $orderDate;
671
  $deliveryTime->add(new DateInterval("P{$shippingDuration}D"));
672
 
673
- /**
674
- * Check if the current time is greater than the cut-off time.
675
- */
676
- if ($this->isPastCutOffTime($orderDate, $storeId)) {
677
- $deliveryTime->add(new DateInterval('P1D'));
678
- $shippingDuration++;
679
- }
680
-
681
  /**
682
  * Get the delivery day (1-7).
683
  */
@@ -696,15 +803,18 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
696
  * If the delivery day is a monday, we need to make sure that sunday sorting is allowed. Otherwise delivery on a
697
  * monday is not possible.
698
  */
699
- if ($deliveryDay == 1 && Mage::helper('postnl/deliveryOptions')->canUseSundaySorting()) {
700
- $orderTime = $orderDate->format('His');
701
- $sundayCutOffTime = Mage::getStoreConfig(self::XPATH_SUNDAY_CUTOFF_TIME, $storeId);
 
702
 
703
- if ($orderTime <= str_replace(':', '', $sundayCutOffTime)) {
704
- $deliveryTime->add(new DateInterval('P1D'));
705
- $shippingDuration++;
706
- }
707
- } elseif ($deliveryDay == 1) {
 
 
708
  $deliveryTime->add(new DateInterval('P1D'));
709
  $shippingDuration++;
710
  }
@@ -730,8 +840,6 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
730
  * @param string|DateTime $deliveryDate
731
  *
732
  * @return DateTime
733
- *
734
- * @todo implement sunday sorting
735
  */
736
  public function getValidDeliveryDate($deliveryDate)
737
  {
@@ -750,15 +858,9 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
750
  */
751
  $shippingDays = Mage::getStoreConfig(self::XPATH_SHIPPING_DAYS, Mage::app()->getStore()->getId());
752
  $shippingDays = explode(',', $shippingDays);
753
- $shippingDate = clone $deliveryDate;
754
 
 
755
  $shippingDay = (int) $shippingDate->sub(new DateInterval('P1D'))->format('N');
756
- /**
757
- * Shipping is only available on monday through saturday.
758
- */
759
- if ($shippingDay < 1 || $shippingDay > 6) {
760
- $shippingDay = 6;
761
- }
762
 
763
  /**
764
  * If the shipping day is allowed, return the date.
@@ -767,9 +869,20 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
767
  return $deliveryDate;
768
  }
769
 
 
 
 
 
 
 
 
 
 
 
770
  /**
771
  * If the delivery day is a tuesday, saturday is a valid shipping day and the first possible delivery day is the
772
- * date specified or before then, the specified date is allowed.
 
773
  *
774
  * If we have configured that we do not ship on mondays, the following will take place:
775
  * - If the order on friday or before, we can ship on saturday and it will be delivered on tuesday.
@@ -778,7 +891,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
778
  * - If we order on sunday or monday, we can only ship it the next saturday and it will be delivered on tuesday
779
  * the week after.
780
  */
781
- if ($deliveryDay == 2
782
  && in_array(6, $shippingDays)
783
  && $this->getDeliveryDate(null, null, false, true, false) <= $deliveryDate
784
  ) {
@@ -792,7 +905,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
792
  4 => 'thursday',
793
  5 => 'friday',
794
  6 => 'saturday',
795
- 7 => 'sunday'
796
  );
797
 
798
  /**
@@ -814,9 +927,15 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
814
  $availableDeliveryDay = $availableShippingDay + 1;
815
 
816
  /**
817
- * Monday and sunday are not available as delivery days.
818
  */
819
- if ($availableDeliveryDay < 2 || $availableDeliveryDay > 6) {
 
 
 
 
 
 
820
  $availableDeliveryDay = 2;
821
  }
822
 
@@ -835,9 +954,15 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
835
  $availableDeliveryDay = $shippingDays[0] + 1;
836
 
837
  /**
838
- * Monday and sunday are not available as delivery days.
839
  */
840
- if ($availableDeliveryDay < 2 || $availableDeliveryDay > 6) {
 
 
 
 
 
 
841
  $availableDeliveryDay = 2;
842
  }
843
 
@@ -855,15 +980,26 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
855
  * saturday.
856
  *
857
  * @param string|DateTime $date
 
858
  *
859
  * @return DateTime
860
  */
861
- public function getValidConfirmDate($date)
862
  {
 
 
 
 
 
863
  if (is_string($date)) {
864
- $date = new DateTime($date);
865
  }
866
 
 
 
 
 
 
867
  if (!($date instanceof DateTime)) {
868
  throw new InvalidArgumentException('Date parameter must be a valid date string or DateTime object.');
869
  }
@@ -891,6 +1027,8 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
891
  $date->modify('last saturday');
892
  }
893
 
 
 
894
  return $date;
895
  }
896
 
@@ -968,16 +1106,31 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
968
  return $response;
969
  }
970
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
971
  /**
972
  * Gets the shipping duration for the specified quote.
973
  *
974
- * @param bool|Mage_Sales_Model_Quote $quote
975
  *
976
- * @return int|bool
977
  *
978
  * @throws TIG_PostNL_Exception
979
  */
980
- public function getShippingDuration(Mage_Sales_Model_Quote $quote = null)
981
  {
982
  /**
983
  * If no quote was specified, try to load the quote.
@@ -998,7 +1151,6 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
998
  * Get the default config duration.
999
  */
1000
  $configDuration = (int) Mage::getStoreConfig(self::XPATH_SHIPPING_DURATION, $storeId);
1001
- $durationArray = array($configDuration);
1002
 
1003
  /**
1004
  * Get all items in the quote, so we can check the corresponding products.
@@ -1013,10 +1165,55 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
1013
  }
1014
  $productIds = $items->getColumnValues('product_id');
1015
 
1016
- if (!$productIds) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1017
  $duration = new Varien_Object(
1018
  array(
1019
- 'duration' => end($durationArray),
1020
  'productIds' => $productIds
1021
  )
1022
  );
@@ -1030,23 +1227,14 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
1030
  return $duration->getData('duration');
1031
  }
1032
 
1033
- /**
1034
- * Get all products.
1035
- */
1036
- $products = Mage::getResourceModel('catalog/product_collection')
1037
- ->setStoreId($quote->getStoreId())
1038
- ->addFieldToFilter('entity_id', array('in' => $productIds))
1039
- ->addAttributeToSelect('postnl_shipping_duration');
1040
 
1041
- /**
1042
- * Get the shipping duration of all products.
1043
- */
1044
- foreach ($products as $product) {
1045
- if ($product->hasData('postnl_shipping_duration')
1046
- && $product->getData('postnl_shipping_duration') !== ''
1047
- ) {
1048
- $durationArray[] = (int) $product->getData('postnl_shipping_duration');
1049
- }
1050
  }
1051
 
1052
  /**
@@ -1085,6 +1273,44 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
1085
  return $shippingDuration;
1086
  }
1087
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1088
  /**
1089
  * Convert a value to a formatted price.
1090
  *
@@ -2572,20 +2798,6 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
2572
  return $isOnlyStatedAddressOptionChecked;
2573
  }
2574
 
2575
- /**
2576
- * Check if the module is set to test mode
2577
- *
2578
- * @param bool $storeId
2579
- *
2580
- * @return boolean
2581
- *
2582
- * @deprecated v1.5.0
2583
- */
2584
- public function isTestMode($storeId = false)
2585
- {
2586
- return parent::isTestMode($storeId);
2587
- }
2588
-
2589
  /**
2590
  * Checks if PostNL delivery options are enabled.
2591
  *
93
  */
94
  const XPATH_RESPONSIVE = 'postnl/delivery_options/responsive';
95
 
96
+ /**
97
+ * Xpath to the Google Maps API key.
98
+ */
99
+ const XPATH_GOOGLE_MAPS_API_KEY = 'postnl/google_maps/api_key';
100
+
101
  /**
102
  * The time we consider to be the start of the evening.
103
  */
389
  * @param Mage_Core_Model_Abstract $entity
390
  * @param boolean $asVarienObject
391
  *
392
+ * @return array|Varien_Object|false
393
  */
394
  public function getDeliveryOptionsInfo(Mage_Core_Model_Abstract $entity, $asVarienObject = true)
395
  {
443
  * This is the basic, empty array of delivery options info.
444
  */
445
  $deliveryOptionsInfo = array(
446
+ 'type' => false,
447
+ 'shipment_type' => false,
448
+ 'formatted_type' => false,
449
+ 'product_code' => false,
450
+ 'product_option' => false,
451
+ 'shipment_costs' => false,
452
+ 'confirm_date' => false,
453
+ 'delivery_date' => false,
454
+ 'store_confirm_date' => false,
455
+ 'store_delivery_date' => false,
456
+ 'pakje_gemak_address' => false,
457
+ 'confirm_status' => false,
458
+ 'shipping_phase' => false,
459
+ 'formatted_shipping_phase' => false,
460
+ 'delivery_time_start' => false,
461
+ 'delivery_time_end' => false,
462
+ 'store_delivery_time_start' => false,
463
+ 'store_delivery_time_end' => false,
464
  );
465
 
466
  /**
479
  $deliveryOptionsInfo['shipment_costs'] = $shipmentCosts;
480
  }
481
 
482
+ /**
483
+ * Get the time zone used by the store in which the order was placed.
484
+ */
485
+ $storeTimezone = $this->getStoreTimeZone($postnlOrder->getStoreId(), true);
486
+
487
+ /**
488
+ * If the customer chose a specific delivery time, add that to the array.
489
+ */
490
+ if ($postnlOrder->hasExpectedDeliveryTimeStart()) {
491
+ $startTime = new DateTime($postnlOrder->getExpectedDeliveryTimeStart());
492
+
493
+ $storeStartTime = new DateTime($postnlOrder->getExpectedDeliveryTimeStart());
494
+ $storeStartTime->setTimezone($storeTimezone);
495
+
496
+ $deliveryOptionsInfo['delivery_time_start'] = $startTime->format('H:i');
497
+ $deliveryOptionsInfo['store_delivery_time_start'] = $storeStartTime->format('H:i');
498
+
499
+
500
+ /**
501
+ * In the case of PakjeGemak shipments there is only a start time and no end time.
502
+ */
503
+ if ($postnlOrder->hasExpectedDeliveryTimeEnd()) {
504
+ $endTime = new DateTime($postnlOrder->getExpectedDeliveryTimeEnd());
505
+
506
+ $storeEndTime = new DateTime($postnlOrder->getExpectedDeliveryTimeEnd());
507
+ $storeEndTime->setTimezone($storeTimezone);
508
+
509
+ $deliveryOptionsInfo['delivery_time_end'] = $endTime->format('H:i');
510
+ $deliveryOptionsInfo['store_delivery_time_end'] = $storeEndTime->format('H:i');
511
+ }
512
+ }
513
+
514
  /**
515
  * If we have a PostNL shipment, we can get some accurate data from it. Otherwise we need to get it from the
516
  * PostNL order.
560
  * Add the delivery date.
561
  */
562
  if ($deliveryDate) {
563
+ $deliveryDate = new DateTime($deliveryDate);
564
+
565
+ $deliveryOptionsInfo['delivery_date'] = $deliveryDate->format('Y-m-d H:i:s');
566
+ $deliveryOptionsInfo['store_delivery_date'] = $deliveryDate->setTimezone($storeTimezone)
567
+ ->format('Y-m-d H:i:s');
568
  }
569
 
570
  /**
571
  * Add the confirm date.
572
  */
573
  if ($confirmDate) {
574
+ $confirmDate = new DateTime($confirmDate);
575
+
576
+ $deliveryOptionsInfo['confirm_date'] = $confirmDate->format('Y-m-d H:i:s');
577
+ $deliveryOptionsInfo['store_confirm_date'] = $confirmDate->setTimezone($storeTimezone)
578
+ ->format('Y-m-d H:i:s');
579
  }
580
 
581
  /**
661
  public function isPastCutOffTime($orderDate = null, $storeId = null)
662
  {
663
  if (!$orderDate) {
664
+ $orderDate = new DateTime(Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s'));
665
+ }
666
+
667
+ if (is_string($orderDate)) {
668
+ $orderDate = new DateTime($orderDate);
669
  }
670
 
671
  if ($storeId === null) {
672
  $storeId = Mage::app()->getStore()->getId();
673
  }
674
 
675
+ /**
676
+ * Get the cut off time.
677
+ */
678
+ $cutOffTime = explode(':', $this->getCutOffTime($storeId, true, $orderDate));
679
 
680
  /**
681
+ * Create a DateTime object for the order date with the cut off time for comparison.
682
  */
683
+ $utcTimeZone = new DateTimeZone('UTC');
684
+
685
+ $cutOffDate = clone $orderDate;
686
+ $cutOffDate->setTime($cutOffTime[0], $cutOffTime[1], $cutOffTime[2])
687
+ ->setTimezone($utcTimeZone);
688
+
689
+ /**
690
+ * Convert the order date to UTC.
691
+ */
692
+ $orderDate->setTimezone($utcTimeZone);
693
 
694
  /**
695
  * Check if the current time (as His) is greater than the cut-off time.
696
  */
697
+ if ($orderDate > $cutOffDate) {
698
  return true;
699
  }
700
 
701
  return false;
702
  }
703
 
704
+ /**
705
+ * Get the cut off time for the specified store ID.
706
+ *
707
+ * If $checkForSunday is true, the sunday cut-off time will be checked if the order date is on a sunday. This is
708
+ * only done if sunday sorting is enabled.
709
+ *
710
+ * @param null|int $storeId
711
+ * @param bool $checkForSunday
712
+ * @param string|DateTime|null $orderDate
713
+ *
714
+ * @return mixed
715
+ */
716
+ public function getCutOffTime($storeId = null, $checkForSunday = true, $orderDate = null)
717
+ {
718
+ if ($checkForSunday && !$orderDate) {
719
+ $orderDate = new DateTime(Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s'));
720
+ }
721
+
722
+ if ($storeId === null) {
723
+ $storeId = Mage::app()->getStore()->getId();
724
+ }
725
+
726
+ if (is_string($orderDate)) {
727
+ $orderDate = new DateTime($orderDate);
728
+ }
729
+
730
+ /**
731
+ * Get the cut-off time. This is formatted as H:i:s.
732
+ */
733
+ if ($checkForSunday
734
+ && $orderDate->format('N') == 7
735
+ && $this->canUseSundaySorting()
736
+ ) {
737
+ $cutOffTime = Mage::getStoreConfig(self::XPATH_SUNDAY_CUTOFF_TIME, $storeId);
738
+ if (empty($cutOffTime)) {
739
+ $cutOffTime = Mage::getStoreConfig(self::XPATH_CUTOFF_TIME, $storeId);
740
+ }
741
+ } else {
742
+ $cutOffTime = Mage::getStoreConfig(self::XPATH_CUTOFF_TIME, $storeId);
743
+ }
744
+
745
+ return $cutOffTime;
746
+ }
747
+
748
  /**
749
  * Get the delivery date for a specified order date.
750
  *
753
  * @param boolean $asDays
754
  * @param boolean $asDateTime
755
  * @param boolean $withTime
756
+ * @param int|boolean $shippingDuration
757
  *
758
  * @return string|int|DateTime
759
  */
760
  public function getDeliveryDate($orderDate = null, $storeId = null, $asDays = false, $asDateTime = false,
761
+ $withTime = true, $shippingDuration = false
762
  ) {
763
  if (!$orderDate) {
764
+ $orderDate = new DateTime(
765
+ Mage::getSingleton('core/date')->date('Y-m-d H:i:s'),
766
+ $this->getStoreTimeZone($storeId, true)
767
+ );
768
  }
769
 
770
  if ($storeId === null) {
772
  }
773
 
774
  if (is_string($orderDate)) {
775
+ $orderDate = new DateTime($orderDate, $this->getStoreTimeZone($storeId, true));
776
+ }
777
+
778
+ if (false === $shippingDuration) {
779
+ /**
780
+ * Get the base shipping duration for this order.
781
+ */
782
+ $shippingDuration = Mage::getStoreConfig(self::XPATH_SHIPPING_DURATION, $storeId);
783
  }
784
 
 
 
 
 
785
  $deliveryTime = clone $orderDate;
786
  $deliveryTime->add(new DateInterval("P{$shippingDuration}D"));
787
 
 
 
 
 
 
 
 
 
788
  /**
789
  * Get the delivery day (1-7).
790
  */
803
  * If the delivery day is a monday, we need to make sure that sunday sorting is allowed. Otherwise delivery on a
804
  * monday is not possible.
805
  */
806
+ if ($deliveryDay == 1 && !$this->canUseSundaySorting()) {
807
+ $deliveryTime->add(new DateInterval('P1D'));
808
+ $shippingDuration++;
809
+ }
810
 
811
+ /**
812
+ * Check if the order time is greater than the cut-off time. We need to take yesterday as the requested date as
813
+ * the cut-off time is based on the confirm date and not the delivery date.
814
+ */
815
+ $confirmDate = clone $deliveryTime;
816
+ $confirmDate->sub(new DateInterval('P1D'));
817
+ if ($this->isPastCutOffTime($confirmDate, $storeId)) {
818
  $deliveryTime->add(new DateInterval('P1D'));
819
  $shippingDuration++;
820
  }
840
  * @param string|DateTime $deliveryDate
841
  *
842
  * @return DateTime
 
 
843
  */
844
  public function getValidDeliveryDate($deliveryDate)
845
  {
858
  */
859
  $shippingDays = Mage::getStoreConfig(self::XPATH_SHIPPING_DAYS, Mage::app()->getStore()->getId());
860
  $shippingDays = explode(',', $shippingDays);
 
861
 
862
+ $shippingDate = clone $deliveryDate;
863
  $shippingDay = (int) $shippingDate->sub(new DateInterval('P1D'))->format('N');
 
 
 
 
 
 
864
 
865
  /**
866
  * If the shipping day is allowed, return the date.
869
  return $deliveryDate;
870
  }
871
 
872
+ /**
873
+ * If sunday sorting is available, shipping on saturday will result in a monday delivery. it will arrive on
874
+ * tuesday otherwise.
875
+ */
876
+ if ($this->canUseSundaySorting()) {
877
+ $saturdayShippingDeliveryDay = 1;
878
+ } else {
879
+ $saturdayShippingDeliveryDay = 2;
880
+ }
881
+
882
  /**
883
  * If the delivery day is a tuesday, saturday is a valid shipping day and the first possible delivery day is the
884
+ * date specified or before then, the specified date is allowed. If sunday sorting is available, this applies to
885
+ * monday delivery, rather than tuesday.
886
  *
887
  * If we have configured that we do not ship on mondays, the following will take place:
888
  * - If the order on friday or before, we can ship on saturday and it will be delivered on tuesday.
891
  * - If we order on sunday or monday, we can only ship it the next saturday and it will be delivered on tuesday
892
  * the week after.
893
  */
894
+ if ($deliveryDay == $saturdayShippingDeliveryDay
895
  && in_array(6, $shippingDays)
896
  && $this->getDeliveryDate(null, null, false, true, false) <= $deliveryDate
897
  ) {
905
  4 => 'thursday',
906
  5 => 'friday',
907
  6 => 'saturday',
908
+ 7 => 'sunday',
909
  );
910
 
911
  /**
927
  $availableDeliveryDay = $availableShippingDay + 1;
928
 
929
  /**
930
+ * Sunday is not available as a delivery day. If sunday sorting is not allowed, neither is monday.
931
  */
932
+ if ($this->canUseSundaySorting()
933
+ && ($availableDeliveryDay < 1
934
+ || $availableDeliveryDay > 7
935
+ )
936
+ ) {
937
+ $availableDeliveryDay = 1;
938
+ } elseif ($availableDeliveryDay < 2 || $availableDeliveryDay > 6) {
939
  $availableDeliveryDay = 2;
940
  }
941
 
954
  $availableDeliveryDay = $shippingDays[0] + 1;
955
 
956
  /**
957
+ * Sunday is not available as a delivery day. If sunday sorting is not allowed, neither is monday.
958
  */
959
+ if ($this->canUseSundaySorting()
960
+ && ($availableDeliveryDay < 1
961
+ || $availableDeliveryDay > 7
962
+ )
963
+ ) {
964
+ $availableDeliveryDay = 1;
965
+ } elseif ($availableDeliveryDay < 2 || $availableDeliveryDay > 6) {
966
  $availableDeliveryDay = 2;
967
  }
968
 
980
  * saturday.
981
  *
982
  * @param string|DateTime $date
983
+ * @param string|boolean $timeZone
984
  *
985
  * @return DateTime
986
  */
987
+ public function getValidConfirmDate($date, $timeZone = false)
988
  {
989
+ if (!is_string($timeZone)) {
990
+ $timeZone = 'UTC';
991
+ }
992
+ $timeZone = new DateTimeZone($timeZone);
993
+
994
  if (is_string($date)) {
995
+ $date = new DateTime($date, $timeZone);
996
  }
997
 
998
+ /**
999
+ * Convert the date to PostNL's time zone.
1000
+ */
1001
+ $date->setTimezone(new DateTimeZone('Europe/Berlin'));
1002
+
1003
  if (!($date instanceof DateTime)) {
1004
  throw new InvalidArgumentException('Date parameter must be a valid date string or DateTime object.');
1005
  }
1027
  $date->modify('last saturday');
1028
  }
1029
 
1030
+ $date->setTimezone($timeZone);
1031
+
1032
  return $date;
1033
  }
1034
 
1106
  return $response;
1107
  }
1108
 
1109
+ /**
1110
+ * Alias for getQuoteShippingDuration() provided for backwards compatibility reasons.
1111
+ *
1112
+ * @param null|Mage_Sales_Model_Quote $quote
1113
+ *
1114
+ * @return bool|int
1115
+ *
1116
+ * @deprecated
1117
+ */
1118
+ public function getShippingDuration(Mage_Sales_Model_Quote $quote = null)
1119
+ {
1120
+ trigger_error('This method is deprecated and may be removed in the future.', E_USER_NOTICE);
1121
+ return $this->getQuoteShippingDuration($quote);
1122
+ }
1123
+
1124
  /**
1125
  * Gets the shipping duration for the specified quote.
1126
  *
1127
+ * @param null|Mage_Sales_Model_Quote $quote
1128
  *
1129
+ * @return int|false
1130
  *
1131
  * @throws TIG_PostNL_Exception
1132
  */
1133
+ public function getQuoteShippingDuration(Mage_Sales_Model_Quote $quote = null)
1134
  {
1135
  /**
1136
  * If no quote was specified, try to load the quote.
1151
  * Get the default config duration.
1152
  */
1153
  $configDuration = (int) Mage::getStoreConfig(self::XPATH_SHIPPING_DURATION, $storeId);
 
1154
 
1155
  /**
1156
  * Get all items in the quote, so we can check the corresponding products.
1165
  }
1166
  $productIds = $items->getColumnValues('product_id');
1167
 
1168
+ return $this->_getShippingDuration($configDuration, $productIds, $storeId);
1169
+ }
1170
+
1171
+ /**
1172
+ * Gets the shipping duration for the specified order.
1173
+ *
1174
+ * @param Mage_Sales_Model_Order $order
1175
+ *
1176
+ * @return int|false
1177
+ *
1178
+ * @throws TIG_PostNL_Exception
1179
+ */
1180
+ public function getOrderShippingDuration(Mage_Sales_Model_Order $order)
1181
+ {
1182
+ $storeId = $order->getStoreId();
1183
+
1184
+ /**
1185
+ * Get the default config duration.
1186
+ */
1187
+ $configDuration = (int) Mage::getStoreConfig(self::XPATH_SHIPPING_DURATION, $storeId);
1188
+
1189
+ /**
1190
+ * Get all items in the order, so we can check the corresponding products.
1191
+ *
1192
+ * @var Mage_Sales_Model_Resource_Order_Item_Collection $items
1193
+ * @var Mage_Sales_Model_Order_Item $item
1194
+ */
1195
+ $items = $order->getItemsCollection(array(), true);
1196
+ $productIds = $items->getColumnValues('product_id');
1197
+
1198
+ return $this->_getShippingDuration($configDuration, $productIds, $storeId);
1199
+ }
1200
+
1201
+ /**
1202
+ * Calculate the shipping duration for the specified products and default duration.
1203
+ *
1204
+ * @param int $defaultDuration
1205
+ * @param array $productIds
1206
+ * @param null $storeId
1207
+ *
1208
+ * @return int|false
1209
+ * @throws TIG_PostNL_Exception
1210
+ */
1211
+ protected function _getShippingDuration($defaultDuration, $productIds = array(), $storeId = null)
1212
+ {
1213
+ if (empty($productIds)) {
1214
  $duration = new Varien_Object(
1215
  array(
1216
+ 'duration' => $defaultDuration,
1217
  'productIds' => $productIds
1218
  )
1219
  );
1227
  return $duration->getData('duration');
1228
  }
1229
 
1230
+ if ($storeId === null) {
1231
+ $storeId = Mage::app()->getStore()->getId();
1232
+ }
 
 
 
 
1233
 
1234
+ $durationArray = $this->_getProductsShippingDuration($productIds, $defaultDuration, $storeId);
1235
+
1236
+ if (empty($durationArray)) {
1237
+ $durationArray = array($defaultDuration);
 
 
 
 
 
1238
  }
1239
 
1240
  /**
1273
  return $shippingDuration;
1274
  }
1275
 
1276
+ /**
1277
+ * Get the shipping duration for an array of product IDs.
1278
+ *
1279
+ * @param array $productIds
1280
+ * @param int $configDuration
1281
+ * @param null $storeId
1282
+ *
1283
+ * @return array
1284
+ * @throws Mage_Core_Exception
1285
+ */
1286
+ protected function _getProductsShippingDuration(array $productIds, $configDuration = 1, $storeId = null)
1287
+ {
1288
+ /**
1289
+ * Get all products.
1290
+ */
1291
+ $products = Mage::getResourceModel('catalog/product_collection')
1292
+ ->setStoreId($storeId)
1293
+ ->addFieldToFilter('entity_id', array('in' => $productIds))
1294
+ ->addAttributeToSelect('postnl_shipping_duration');
1295
+
1296
+ /**
1297
+ * Get the shipping duration of all products.
1298
+ */
1299
+ $durationArray = array();
1300
+ foreach ($products as $product) {
1301
+ if ($product->hasData('postnl_shipping_duration')
1302
+ && $product->getData('postnl_shipping_duration') !== ''
1303
+ && (int) $product->getData('postnl_shipping_duration') > 0
1304
+ ) {
1305
+ $durationArray[] = (int) $product->getData('postnl_shipping_duration');
1306
+ } else {
1307
+ $durationArray[] = $configDuration;
1308
+ }
1309
+ }
1310
+
1311
+ return $durationArray;
1312
+ }
1313
+
1314
  /**
1315
  * Convert a value to a formatted price.
1316
  *
2798
  return $isOnlyStatedAddressOptionChecked;
2799
  }
2800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2801
  /**
2802
  * Checks if PostNL delivery options are enabled.
2803
  *
app/code/community/TIG/PostNL/Model/Admin/Logging/Handler/Postnl.php CHANGED
@@ -67,4 +67,17 @@ class TIG_PostNL_Model_Admin_Logging_Handler_Postnl extends Enterprise_Logging_M
67
 
68
  return true;
69
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
67
 
68
  return true;
69
  }
70
+
71
+ /**
72
+ * PostNL mass action postDispatch handler.
73
+ *
74
+ * @param Varien_Simplexml_Element $config
75
+ * @param Enterprise_Logging_Model_Event $eventModel
76
+ *
77
+ * @return boolean
78
+ */
79
+ public function postDispatchAction($config, $eventModel)
80
+ {
81
+ return true;
82
+ }
83
  }
app/code/community/TIG/PostNL/Model/Adminhtml/Observer/OrderGrid.php CHANGED
@@ -233,10 +233,10 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
233
  * Join sales_flat_order table.
234
  */
235
  $select->joinInner(
236
- array('order' => $resource->getTableName('sales/order')),
237
- '`main_table`.`entity_id`=`order`.`entity_id`',
238
  array(
239
- 'shipping_method' => 'order.shipping_method',
240
  )
241
  );
242
 
@@ -244,10 +244,10 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
244
  * Join sales_flat_order_payment table.
245
  */
246
  $select->joinLeft(
247
- array('payment' => $resource->getTableName('sales/order_payment')),
248
- '`main_table`.`entity_id`=`payment`.`parent_id`',
249
  array(
250
- 'payment_method' => 'payment.method',
251
  )
252
  );
253
 
@@ -255,10 +255,11 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
255
  * Join sales_flat_order_address table.
256
  */
257
  $select->joinLeft(
258
- array('shipping_address' => $resource->getTableName('sales/order_address')),
259
- "`main_table`.`entity_id`=`shipping_address`.`parent_id` AND `shipping_address`.`address_type`='shipping'",
 
260
  array(
261
- 'country_id' => 'shipping_address.country_id',
262
  )
263
  );
264
 
@@ -439,6 +440,7 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
439
  'type' => 'date',
440
  'header' => $helper->__('Send date'),
441
  'index' => 'confirm_date',
 
442
  'filter_condition_callback' => array($this, '_filterConfirmDate'),
443
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_orderConfirmDate',
444
  'width' => '150px',
@@ -515,16 +517,22 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
515
  $class = $this->_getConfirmDateClass($value, $row, $column);
516
 
517
  $origValue = $row->getData($column->getIndex());
518
- $formattedDate = Mage::helper('core')->formatDate($origValue, 'full', false);
 
 
 
 
 
519
 
520
- return '<span class="'.$class.'" title="' . $formattedDate . '"><span>'.$value.'</span></span>';
 
521
  }
522
 
523
  /**
524
  * Gets class name for the confirmDate column of the current row.
525
  *
526
  * @param string|null $value
527
- * @param Mage_Sales_Model_Order_Shipment $row
528
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
529
  *
530
  * @return string
@@ -540,9 +548,15 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
540
  $now = new DateTime($dateModel->gmtDate());
541
 
542
  if (!$origValue) {
543
- $deliveryDate = Mage::helper('postnl/deliveryOptions')->getDeliveryDate(
 
 
544
  $row->getCreatedAt(),
545
- $row->getStoreId()
 
 
 
 
546
  );
547
  $origDate = new DateTime($deliveryDate);
548
  $origDate = $origDate->sub(new DateInterval('P1D'));
233
  * Join sales_flat_order table.
234
  */
235
  $select->joinInner(
236
+ array('postnl_join_order' => $resource->getTableName('sales/order')),
237
+ '`main_table`.`entity_id`=`postnl_join_order`.`entity_id`',
238
  array(
239
+ 'shipping_method' => 'postnl_join_order.shipping_method',
240
  )
241
  );
242
 
244
  * Join sales_flat_order_payment table.
245
  */
246
  $select->joinLeft(
247
+ array('postnl_join_payment' => $resource->getTableName('sales/order_payment')),
248
+ '`main_table`.`entity_id`=`postnl_join_payment`.`parent_id`',
249
  array(
250
+ 'payment_method' => 'postnl_join_payment.method',
251
  )
252
  );
253
 
255
  * Join sales_flat_order_address table.
256
  */
257
  $select->joinLeft(
258
+ array('postnl_join_shipping_address' => $resource->getTableName('sales/order_address')),
259
+ "`main_table`.`entity_id`=`postnl_join_shipping_address`.`parent_id` AND" .
260
+ " `postnl_join_shipping_address`.`address_type`='shipping'",
261
  array(
262
+ 'country_id' => 'postnl_join_shipping_address.country_id',
263
  )
264
  );
265
 
440
  'type' => 'date',
441
  'header' => $helper->__('Send date'),
442
  'index' => 'confirm_date',
443
+ 'filter' => 'postnl_adminhtml/widget_grid_column_filter_confirmDate',
444
  'filter_condition_callback' => array($this, '_filterConfirmDate'),
445
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_orderConfirmDate',
446
  'width' => '150px',
517
  $class = $this->_getConfirmDateClass($value, $row, $column);
518
 
519
  $origValue = $row->getData($column->getIndex());
520
+ $date = new DateTime($origValue);
521
+ $date->setTimezone(
522
+ Mage::helper('postnl')->getStoreTimeZone($row->getStoreId(), true)
523
+ );
524
+
525
+ $formattedDate = Mage::helper('core')->formatDate($date->format('Y-m-d H:i:s'), 'full', false);
526
 
527
+ $html = "<span class='{$class}' title='{$formattedDate}'><span>{$value}</span></span>";
528
+ return $html;
529
  }
530
 
531
  /**
532
  * Gets class name for the confirmDate column of the current row.
533
  *
534
  * @param string|null $value
535
+ * @param Mage_Sales_Model_Order $row
536
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
537
  *
538
  * @return string
548
  $now = new DateTime($dateModel->gmtDate());
549
 
550
  if (!$origValue) {
551
+ $helper = Mage::helper('postnl/deliveryOptions');
552
+ $shippingDuration = $helper->getOrderShippingDuration($row);
553
+ $deliveryDate = $helper->getDeliveryDate(
554
  $row->getCreatedAt(),
555
+ $row->getStoreId(),
556
+ false,
557
+ true,
558
+ true,
559
+ $shippingDuration
560
  );
561
  $origDate = new DateTime($deliveryDate);
562
  $origDate = $origDate->sub(new DateInterval('P1D'));
app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentGrid.php CHANGED
@@ -50,7 +50,8 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
50
  /**
51
  * The block we want to edit
52
  */
53
- const SHIPMENT_GRID_BLOCK_NAME = 'adminhtml/sales_shipment_grid';
 
54
 
55
  /**
56
  * variable name for shipment grid filter
@@ -145,9 +146,10 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
145
  * Unfortunately there is no unique event for this block
146
  */
147
  $block = $observer->getBlock();
148
- $shipmentGridClass = Mage::getConfig()->getBlockClassName(self::SHIPMENT_GRID_BLOCK_NAME);
 
149
 
150
- if (!($block instanceof $shipmentGridClass)) {
151
  return $this;
152
  }
153
 
@@ -213,6 +215,8 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
213
  * `postnl_shipment`.`is_parcelware_exported`,
214
  * `postnl_shipment`.`product_code`,
215
  * `postnl_shipment`.`extra_cover_amount`,
 
 
216
  * `postnl_order`.`is_pakje_gemak`,
217
  * `postnl_order`.`delivery_date`,
218
  * `postnl_order`.`is_pakketautomaat`,
@@ -247,11 +251,11 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
247
  * Join sales_flat_order table.
248
  */
249
  $select->joinInner(
250
- array('order' => $resource->getTableName('sales/order')),
251
- '`main_table`.`order_id`=`order`.`entity_id`',
252
  array(
253
- 'shipping_method' => 'order.shipping_method',
254
- 'shipping_description' => 'order.shipping_description',
255
  )
256
  );
257
 
@@ -259,11 +263,12 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
259
  * Join sales_flat_order_address table.
260
  */
261
  $select->joinLeft(
262
- array('shipping_address' => $resource->getTableName('sales/order_address')),
263
- "`main_table`.`order_id`=`shipping_address`.`parent_id` AND `shipping_address`.`address_type`='shipping'",
 
264
  array(
265
- 'postcode' => 'shipping_address.postcode',
266
- 'country_id' => 'shipping_address.country_id',
267
  )
268
  );
269
 
@@ -278,7 +283,9 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
278
  'main_barcode' => 'postnl_shipment.main_barcode',
279
  'confirm_status' => 'postnl_shipment.confirm_status',
280
  'labels_printed' => 'postnl_shipment.labels_printed',
 
281
  'shipping_phase' => 'postnl_shipment.shipping_phase',
 
282
  'parcel_count' => 'postnl_shipment.parcel_count',
283
  'is_parcelware_exported' => 'postnl_shipment.is_parcelware_exported',
284
  'product_code' => 'postnl_shipment.product_code',
@@ -449,6 +456,7 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
449
  'type' => 'date',
450
  'header' => $helper->__('Send Date'),
451
  'index' => 'confirm_date',
 
452
  'filter_index' => 'postnl_shipment.confirm_date',
453
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_confirmDate',
454
  'width' => '150px',
@@ -524,6 +532,26 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
524
  $after = 'labels_printed';
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  if (in_array('is_parcelware_exported', $columnsToDisplay)) {
528
  $block->addColumnAfter(
529
  'is_parcelware_exported',
@@ -574,6 +602,26 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
574
  ),
575
  $after
576
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  }
578
 
579
  $actionColumn = $block->getColumn('action');
@@ -632,9 +680,15 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
632
  }
633
 
634
  $origValue = $row->getData($column->getIndex());
635
- $formattedDate = Mage::helper('core')->formatDate($origValue, 'full', false);
 
 
 
 
 
636
 
637
- return '<span class="'.$class.'" title="' . $formattedDate . '"><span>'.$value.'</span></span>';
 
638
  }
639
 
640
  /**
@@ -691,7 +745,7 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
691
  /**
692
  * Decorates the confirm_status column
693
  *
694
- * @param string | null $value
695
  * @param Mage_Sales_Model_Order_Shipment $row
696
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
697
  * @param boolean $isExport
@@ -737,7 +791,7 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
737
  /**
738
  * Decorates the labels_printed column
739
  *
740
- * @param string | null $value
741
  * @param Mage_Sales_Model_Order_Shipment $row
742
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
743
  * @param boolean $isExport
@@ -842,6 +896,11 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
842
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massPrintLabelsAndConfirm'),
843
  );
844
 
 
 
 
 
 
845
  $printOptions = array(
846
  'label' => $helper->__('PostNL - Print shipping labels'),
847
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massPrintLabels'),
@@ -862,6 +921,11 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
862
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massCreateParcelwareExport')
863
  );
864
 
 
 
 
 
 
865
  /**
866
  * Add an additional option to the 'label printing' mass actions if the configured label size is A4.
867
  */
@@ -904,6 +968,9 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
904
  case 'postnl_print_labels_and_confirm':
905
  $printAndConfirmOptions['selected'] = true;
906
  break;
 
 
 
907
  case 'postnl_print_labels':
908
  $printOptions['selected'] = true;
909
  break;
@@ -916,6 +983,9 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
916
  case 'postnl_parcelware_export':
917
  $parcelWareOptions['selected'] = true;
918
  break;
 
 
 
919
  // no default
920
  }
921
 
@@ -932,6 +1002,13 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
932
  'postnl_print_labels_and_confirm',
933
  $printAndConfirmOptions
934
  );
 
 
 
 
 
 
 
935
  }
936
 
937
  if ($printAllowed) {
@@ -963,6 +1040,11 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
963
  );
964
  }
965
 
 
 
 
 
 
966
  return $this;
967
  }
968
 
@@ -1059,6 +1141,7 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
1059
  protected function _sortCollection($sort, $dir)
1060
  {
1061
  $block = $this->getBlock();
 
1062
  $column = $block->getColumn($sort);
1063
  if (!$column) {
1064
  return $this;
50
  /**
51
  * The block we want to edit
52
  */
53
+ const SHIPMENT_GRID_CLASS_NAME = 'adminhtml/sales_shipment_grid';
54
+ const POSTNL_RETURNS_GRID_CLASS_NAME = 'postnl_adminhtml/sales_returns_grid';
55
 
56
  /**
57
  * variable name for shipment grid filter
146
  * Unfortunately there is no unique event for this block
147
  */
148
  $block = $observer->getBlock();
149
+ $shipmentGridClass = Mage::getConfig()->getBlockClassName(self::SHIPMENT_GRID_CLASS_NAME);
150
+ $postnlReturnsGridClass = Mage::getConfig()->getBlockClassName(self::POSTNL_RETURNS_GRID_CLASS_NAME);
151
 
152
+ if (!($block instanceof $shipmentGridClass) || ($block instanceof $postnlReturnsGridClass)) {
153
  return $this;
154
  }
155
 
215
  * `postnl_shipment`.`is_parcelware_exported`,
216
  * `postnl_shipment`.`product_code`,
217
  * `postnl_shipment`.`extra_cover_amount`,
218
+ * `postnl_shipment`.`return_labels_printed`,
219
+ * `postnl_shipment`.`return_phase`,
220
  * `postnl_order`.`is_pakje_gemak`,
221
  * `postnl_order`.`delivery_date`,
222
  * `postnl_order`.`is_pakketautomaat`,
251
  * Join sales_flat_order table.
252
  */
253
  $select->joinInner(
254
+ array('postnl_join_order' => $resource->getTableName('sales/order')),
255
+ '`main_table`.`order_id`=`postnl_join_order`.`entity_id`',
256
  array(
257
+ 'shipping_method' => 'postnl_join_order.shipping_method',
258
+ 'shipping_description' => 'postnl_join_order.shipping_description',
259
  )
260
  );
261
 
263
  * Join sales_flat_order_address table.
264
  */
265
  $select->joinLeft(
266
+ array('postnl_join_shipping_address' => $resource->getTableName('sales/order_address')),
267
+ "`main_table`.`order_id`=`postnl_join_shipping_address`.`parent_id` AND " .
268
+ "`postnl_join_shipping_address`.`address_type`='shipping'",
269
  array(
270
+ 'postcode' => 'postnl_join_shipping_address.postcode',
271
+ 'country_id' => 'postnl_join_shipping_address.country_id',
272
  )
273
  );
274
 
283
  'main_barcode' => 'postnl_shipment.main_barcode',
284
  'confirm_status' => 'postnl_shipment.confirm_status',
285
  'labels_printed' => 'postnl_shipment.labels_printed',
286
+ 'return_labels_printed' => 'postnl_shipment.return_labels_printed',
287
  'shipping_phase' => 'postnl_shipment.shipping_phase',
288
+ 'return_phase' => 'postnl_shipment.return_phase',
289
  'parcel_count' => 'postnl_shipment.parcel_count',
290
  'is_parcelware_exported' => 'postnl_shipment.is_parcelware_exported',
291
  'product_code' => 'postnl_shipment.product_code',
456
  'type' => 'date',
457
  'header' => $helper->__('Send Date'),
458
  'index' => 'confirm_date',
459
+ 'filter' => 'postnl_adminhtml/widget_grid_column_filter_confirmDate',
460
  'filter_index' => 'postnl_shipment.confirm_date',
461
  'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_confirmDate',
462
  'width' => '150px',
532
  $after = 'labels_printed';
533
  }
534
 
535
+ if (in_array('return_labels_printed', $columnsToDisplay)) {
536
+ $block->addColumnAfter(
537
+ 'return_labels_printed',
538
+ array(
539
+ 'header' => $helper->__('Return Labels Printed'),
540
+ 'type' => 'options',
541
+ 'index' => 'return_labels_printed',
542
+ 'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_yesNo',
543
+ 'frame_callback' => array($this, 'decorateYesNo'),
544
+ 'options' => array(
545
+ 1 => $helper->__('Yes'),
546
+ 0 => $helper->__('No'),
547
+ ),
548
+ ),
549
+ $after
550
+ );
551
+
552
+ $after = 'return_labels_printed';
553
+ }
554
+
555
  if (in_array('is_parcelware_exported', $columnsToDisplay)) {
556
  $block->addColumnAfter(
557
  'is_parcelware_exported',
602
  ),
603
  $after
604
  );
605
+
606
+ $after = 'shipping_phase';
607
+ }
608
+
609
+ if (in_array('return_phase', $columnsToDisplay)) {
610
+ $block->addColumnAfter(
611
+ 'return_phase',
612
+ array(
613
+ 'header' => $helper->__('Return Phase'),
614
+ 'align' => 'left',
615
+ 'index' => 'return_phase',
616
+ 'type' => 'options',
617
+ 'options' => Mage::helper('postnl/cif')->getShippingPhases(),
618
+ 'renderer' => 'postnl_adminhtml/widget_grid_column_renderer_shippingPhase',
619
+ 'frame_callback' => array($this, 'decorateShippingPhase'),
620
+ ),
621
+ $after
622
+ );
623
+
624
+ $after = 'return_phase'; //Defined in case of future additions to the grid.
625
  }
626
 
627
  $actionColumn = $block->getColumn('action');
680
  }
681
 
682
  $origValue = $row->getData($column->getIndex());
683
+ $date = new DateTime($origValue);
684
+ $date->setTimezone(
685
+ Mage::helper('postnl')->getStoreTimeZone(Mage_Core_Model_App::ADMIN_STORE_ID, true)
686
+ );
687
+
688
+ $formattedDate = Mage::helper('core')->formatDate($date->format('Y-m-d H:i:s'), 'full', false);
689
 
690
+ $html = "<span class='{$class}' title='{$formattedDate}'><span>{$value}</span></span>";
691
+ return $html;
692
  }
693
 
694
  /**
745
  /**
746
  * Decorates the confirm_status column
747
  *
748
+ * @param string|null $value
749
  * @param Mage_Sales_Model_Order_Shipment $row
750
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
751
  * @param boolean $isExport
791
  /**
792
  * Decorates the labels_printed column
793
  *
794
+ * @param string|null $value
795
  * @param Mage_Sales_Model_Order_Shipment $row
796
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
797
  * @param boolean $isExport
896
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massPrintLabelsAndConfirm'),
897
  );
898
 
899
+ $printPackingSlipsAndConfirmOptions = array(
900
+ 'label' => $helper->__('PostNL - Print packing slips & confirm shipment'),
901
+ 'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massPrintPackingSlipsAndConfirm'),
902
+ );
903
+
904
  $printOptions = array(
905
  'label' => $helper->__('PostNL - Print shipping labels'),
906
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massPrintLabels'),
921
  'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massCreateParcelwareExport')
922
  );
923
 
924
+ $updateShippingStatusOptions = array(
925
+ 'label' => $helper->__('PostNL - Update shipping status'),
926
+ 'url' => $adminhtmlHelper->getUrl('postnl_admin/adminhtml_shipment/massUpdateShippingStatus')
927
+ );
928
+
929
  /**
930
  * Add an additional option to the 'label printing' mass actions if the configured label size is A4.
931
  */
968
  case 'postnl_print_labels_and_confirm':
969
  $printAndConfirmOptions['selected'] = true;
970
  break;
971
+ case 'postnl_print_packing_slips_and_confirm':
972
+ $printPackingSlipsAndConfirmOptions['selected'] = true;
973
+ break;
974
  case 'postnl_print_labels':
975
  $printOptions['selected'] = true;
976
  break;
983
  case 'postnl_parcelware_export':
984
  $parcelWareOptions['selected'] = true;
985
  break;
986
+ case 'postnl_update_status':
987
+ $updateShippingStatusOptions['selected'] = true;
988
+ break;
989
  // no default
990
  }
991
 
1002
  'postnl_print_labels_and_confirm',
1003
  $printAndConfirmOptions
1004
  );
1005
+
1006
+ if ($packingSlipAllowed) {
1007
+ $massactionBlock->addItem(
1008
+ 'postnl_print_packing_slips_and_confirm',
1009
+ $printPackingSlipsAndConfirmOptions
1010
+ );
1011
+ }
1012
  }
1013
 
1014
  if ($printAllowed) {
1040
  );
1041
  }
1042
 
1043
+ $massactionBlock->addItem(
1044
+ 'postnl_update_status',
1045
+ $updateShippingStatusOptions
1046
+ );
1047
+
1048
  return $this;
1049
  }
1050
 
1141
  protected function _sortCollection($sort, $dir)
1142
  {
1143
  $block = $this->getBlock();
1144
+ /** @var Mage_Adminhtml_Block_Widget_Grid_Column $column */
1145
  $column = $block->getColumn($sort);
1146
  if (!$column) {
1147
  return $this;
app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentView.php CHANGED
@@ -94,6 +94,16 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
94
 
95
  $this->addPostnlButtons($block, $shipment);
96
 
 
 
 
 
 
 
 
 
 
 
97
  return $this;
98
  }
99
 
@@ -120,15 +130,39 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
120
  */
121
  $confirmAllowed = $helper->checkIsPostnlActionAllowed('confirm');
122
  $printAllowed = $helper->checkIsPostnlActionAllowed('print_label');
 
123
  $printPackingSlipAllowed = $helper->checkIsPostnlActionAllowed(array('print_label', 'print_packing_slip'));
124
  $deleteLabelsAllowed = $helper->checkIsPostnlActionAllowed('delete_labels');
125
  $resetConfirmAllowed = $helper->checkIsPostnlActionAllowed(array('reset_confirmation', 'delete_labels'));
126
  $sendTrackAndTraceAllowed = $helper->checkIsPostnlActionAllowed('send_track_and_trace');
127
  $convertToBuspakjeAllowed = $helper->checkIsPostnlActionAllowed('convert_to_buspakje');
128
  $convertToPackageAllowed = $helper->checkIsPostnlActionAllowed('convert_to_package');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  /**
131
- * Add a button to print this shipment's shipping labels
132
  */
133
  if ($printAllowed) {
134
  $printShippingLabelUrl = $this->getPrintShippingLabelUrl($shipment->getId());
@@ -139,7 +173,8 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
139
  'label' => $helper->__('PostNL - Print Shipping Label'),
140
  'onclick' => "printLabel('{$printShippingLabelUrl}')",
141
  'class' => 'download',
142
- )
 
143
  );
144
  }
145
 
@@ -155,32 +190,70 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
155
  'label' => $helper->__('PostNL - Print Packing Slip'),
156
  'onclick' => "printLabel('{$printPackingSlipUrl}')",
157
  'class' => 'download',
158
- )
 
159
  );
160
  }
161
 
162
  /**
163
- * Add a button to reset the shipment's confirmation status
164
  */
165
- if ($postnlShipment->canResetConfirmation() && $resetConfirmAllowed) {
166
- $resetConfirmationUrl = $this->getResetConfirmationUrl($shipment->getId());
167
- $resetWarningMessage = $helper->__(
168
- 'Are you sure that you wish to reset the confirmation status of this shipment? You will need to '
169
- . 'confirm this shipment with PostNL again before you can send it. This action will remove all barcodes'
170
- . ' and labels associated with this shipment. You can not undo this action.'
 
 
 
 
 
 
 
 
171
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
  $block->addButton(
174
- 'reset_confirmation',
175
  array(
176
- 'label' => $helper->__('PostNL - Change Confirmation'),
177
- 'onclick' => "deleteConfirm('"
178
- . $resetWarningMessage
179
- . "', '"
180
- . $resetConfirmationUrl
181
- . "')",
182
- 'class' => 'delete',
183
- )
184
  );
185
  }
186
 
@@ -212,7 +285,8 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
212
  . $convertToBuspakjeUrl
213
  . "')",
214
  'class' => 'btn-reset',
215
- )
 
216
  );
217
  }
218
 
@@ -243,70 +317,63 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
243
  . $convertToPackageUrl
244
  . "')",
245
  'class' => 'btn-reset',
246
- )
 
247
  );
248
  }
249
 
250
  /**
251
- * Update the send tracking info button so that it sends our info, instead of the default
252
  */
253
- if ($postnlShipment->isConfirmed() && $sendTrackAndTraceAllowed) {
254
- $resendTrackAndTraceUrl = $this->getResendTrackAndTraceUrl($shipment->getId());
255
-
256
- $block->updateButton(
257
- 'save',
258
- 'label',
259
- $helper->__('PostNL - Send Tracking Information')
260
  );
261
- $block->updateButton(
262
- 'save',
263
- 'onclick',
264
- "deleteConfirm('"
265
- . $helper->__('Are you sure you want to send PostNL tracking information to the customer?')
266
- . "', '" . $resendTrackAndTraceUrl . "')"
 
 
 
 
 
 
 
267
  );
268
  }
269
 
270
- if (!$postnlShipment->isConfirmed()) {
271
- /**
272
- * Add a button to remove any stored shipping labels for this shipment.
273
- */
274
- if ($postnlShipment->hasLabels() && $deleteLabelsAllowed) {
275
- $removeLabelsUrl = $this->getRemoveLabelsUrl($shipment->getId());
276
- $removeLabelsWarningMessage = $helper->__(
277
- "Are you sure that you wish to remove this shipment\'s shipping label? You will need to print a new "
278
- . "shipping label before you can send this shipment."
279
- );
280
-
281
- $block->addButton(
282
- 'remove_shipping_labels',
283
- array(
284
- 'label' => $helper->__('PostNL - Remove Shipping Label'),
285
- 'onclick' => "deleteConfirm('"
286
- . $removeLabelsWarningMessage
287
- . "', '"
288
- . $removeLabelsUrl
289
- . "')",
290
- 'class' => 'delete',
291
- )
292
- );
293
- }
294
-
295
- /**
296
- * Add a button to confirm this shipment.
297
- */
298
- if ($postnlShipment->canConfirm() && $confirmAllowed) {
299
- $confirmUrl = $this->getConfirmUrl($shipment->getId());
300
 
301
- $block->addButton(
302
- 'confirm_shipment',
303
- array(
304
- 'label' => $helper->__('PostNL - Confirm Shipment'),
305
- 'onclick' => "setLocation('{$confirmUrl}')",
306
- 'class' => 'save',
307
- )
308
- );
309
- }
 
 
 
 
310
  }
311
 
312
  return $this;
@@ -329,6 +396,23 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
329
  return $url;
330
  }
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  /**
333
  * Get adminhtml url for PostNL print packing slip action.
334
  *
@@ -456,4 +540,24 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentView
456
 
457
  return $url;
458
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  }
94
 
95
  $this->addPostnlButtons($block, $shipment);
96
 
97
+ /**
98
+ * Update the back button if the 'come_from' parameter is set.
99
+ */
100
+ if (Mage::app()->getRequest()->getParam('come_from')) {
101
+ $comeFrom = Mage::helper('core')->urlDecode(Mage::app()->getRequest()->getParam('come_from'));
102
+ $comeFromurl = $block->getUrl($comeFrom);
103
+
104
+ $block->updateButton('back', 'onclick', 'setLocation(\'' . $comeFromurl . '\')');
105
+ }
106
+
107
  return $this;
108
  }
109
 
130
  */
131
  $confirmAllowed = $helper->checkIsPostnlActionAllowed('confirm');
132
  $printAllowed = $helper->checkIsPostnlActionAllowed('print_label');
133
+ $printReturnLabelAllowed = $helper->checkIsPostnlActionAllowed(array('print_label', 'print_return_label'));
134
  $printPackingSlipAllowed = $helper->checkIsPostnlActionAllowed(array('print_label', 'print_packing_slip'));
135
  $deleteLabelsAllowed = $helper->checkIsPostnlActionAllowed('delete_labels');
136
  $resetConfirmAllowed = $helper->checkIsPostnlActionAllowed(array('reset_confirmation', 'delete_labels'));
137
  $sendTrackAndTraceAllowed = $helper->checkIsPostnlActionAllowed('send_track_and_trace');
138
  $convertToBuspakjeAllowed = $helper->checkIsPostnlActionAllowed('convert_to_buspakje');
139
  $convertToPackageAllowed = $helper->checkIsPostnlActionAllowed('convert_to_package');
140
+ $sendReturnLabelAllowed = $helper->checkIsPostnlActionAllowed(
141
+ array('print_label', 'print_return_label', 'send_return_label_email')
142
+ );
143
+
144
+ /**
145
+ * Add a button to confirm this shipment.
146
+ */
147
+ if (!$postnlShipment->isConfirmed()
148
+ && $postnlShipment->canConfirm()
149
+ && $confirmAllowed
150
+ ) {
151
+ $confirmUrl = $this->getConfirmUrl($shipment->getId());
152
+
153
+ $block->addButton(
154
+ 'confirm_shipment',
155
+ array(
156
+ 'label' => $helper->__('PostNL - Confirm Shipment'),
157
+ 'onclick' => "setLocation('{$confirmUrl}')",
158
+ 'class' => 'save',
159
+ ),
160
+ 10
161
+ );
162
+ }
163
 
164
  /**
165
+ * Add a button to print this shipment's shipping labels.
166
  */
167
  if ($printAllowed) {
168
  $printShippingLabelUrl = $this->getPrintShippingLabelUrl($shipment->getId());
173
  'label' => $helper->__('PostNL - Print Shipping Label'),
174
  'onclick' => "printLabel('{$printShippingLabelUrl}')",
175
  'class' => 'download',
176
+ ),
177
+ 20
178
  );
179
  }
180
 
190
  'label' => $helper->__('PostNL - Print Packing Slip'),
191
  'onclick' => "printLabel('{$printPackingSlipUrl}')",
192
  'class' => 'download',
193
+ ),
194
+ 30
195
  );
196
  }
197
 
198
  /**
199
+ * Add a button to print this shipment's return labels.
200
  */
201
+ if ($printReturnLabelAllowed
202
+ && $postnlShipment->canPrintReturnLabels()
203
+ && Mage::helper('postnl')->isReturnsEnabled($postnlShipment->getStoreId())
204
+ ) {
205
+ $printShippingLabelUrl = $this->getPrintReturnLabelUrl($shipment->getId());
206
+
207
+ $block->addButton(
208
+ 'print_return_label',
209
+ array(
210
+ 'label' => $helper->__('PostNL - Print Return Label'),
211
+ 'onclick' => "printLabel('{$printShippingLabelUrl}')",
212
+ 'class' => 'download',
213
+ ),
214
+ 40
215
  );
216
+ }
217
+
218
+ /**
219
+ * Add a button to send the PostNL track & trace email.
220
+ */
221
+ if ($postnlShipment->isConfirmed()) {
222
+ if ($sendTrackAndTraceAllowed) {
223
+ $resendTrackAndTraceUrl = $this->getResendTrackAndTraceUrl($shipment->getId());
224
+ $block->removeButton('save');
225
+
226
+ $block->addButton(
227
+ 'send_track_and_trace_email',
228
+ array(
229
+ 'label' => $helper->__('PostNL - Send Tracking Information'),
230
+ 'onclick' => "setLocation('{$resendTrackAndTraceUrl}')",
231
+ 'class' => 'save',
232
+ ),
233
+ 50
234
+ );
235
+ } else {
236
+ $block->updateButton('save', 'level', 50);
237
+ }
238
+ }
239
+
240
+ /**
241
+ * Add the send return label button.
242
+ */
243
+ if ($sendReturnLabelAllowed
244
+ && $postnlShipment->canSendReturnLabelEmail()
245
+ && Mage::helper('postnl')->isReturnsEnabled($postnlShipment->getStoreId())
246
+ ) {
247
+ $sendReturnLabelEmailUrl = $this->getSendReturnLabelEmailUrl($shipment->getId());
248
 
249
  $block->addButton(
250
+ 'send_return_label_email',
251
  array(
252
+ 'label' => $helper->__('PostNL - Send Return Label Email'),
253
+ 'onclick' => "setLocation('{$sendReturnLabelEmailUrl}')",
254
+ 'class' => 'save',
255
+ ),
256
+ 60
 
 
 
257
  );
258
  }
259
 
285
  . $convertToBuspakjeUrl
286
  . "')",
287
  'class' => 'btn-reset',
288
+ ),
289
+ 70
290
  );
291
  }
292
 
317
  . $convertToPackageUrl
318
  . "')",
319
  'class' => 'btn-reset',
320
+ ),
321
+ 80
322
  );
323
  }
324
 
325
  /**
326
+ * Add a button to reset the shipment's confirmation status.
327
  */
328
+ if ($postnlShipment->canResetConfirmation() && $resetConfirmAllowed) {
329
+ $resetConfirmationUrl = $this->getResetConfirmationUrl($shipment->getId());
330
+ $resetWarningMessage = $helper->__(
331
+ 'Are you sure that you wish to reset the confirmation status of this shipment? You will need to '
332
+ . 'confirm this shipment with PostNL again before you can send it. This action will remove all barcodes'
333
+ . ' and labels associated with this shipment. You can not undo this action.'
 
334
  );
335
+
336
+ $block->addButton(
337
+ 'reset_confirmation',
338
+ array(
339
+ 'label' => $helper->__('PostNL - Change Confirmation'),
340
+ 'onclick' => "deleteConfirm('"
341
+ . $resetWarningMessage
342
+ . "', '"
343
+ . $resetConfirmationUrl
344
+ . "')",
345
+ 'class' => 'delete',
346
+ ),
347
+ 90
348
  );
349
  }
350
 
351
+ /**
352
+ * Add a button to remove any stored shipping labels for this shipment.
353
+ */
354
+ if (!$postnlShipment->isConfirmed()
355
+ && $postnlShipment->hasLabels()
356
+ && $deleteLabelsAllowed
357
+ ) {
358
+ $removeLabelsUrl = $this->getRemoveLabelsUrl($shipment->getId());
359
+ $removeLabelsWarningMessage = $helper->__(
360
+ "Are you sure that you wish to remove this shipment\'s shipping label? You will need to print a new "
361
+ . "shipping label before you can send this shipment."
362
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
364
+ $block->addButton(
365
+ 'remove_shipping_labels',
366
+ array(
367
+ 'label' => $helper->__('PostNL - Remove Shipping Label'),
368
+ 'onclick' => "deleteConfirm('"
369
+ . $removeLabelsWarningMessage
370
+ . "', '"
371
+ . $removeLabelsUrl
372
+ . "')",
373
+ 'class' => 'delete',
374
+ ),
375
+ 100
376
+ );
377
  }
378
 
379
  return $this;
396
  return $url;
397
  }
398
 
399
+ /**
400
+ * Get adminhtml url for PostNL print return label action.
401
+ *
402
+ * @param int $shipmentId The ID of the current shipment
403
+ *
404
+ * @return string
405
+ */
406
+ public function getPrintReturnLabelUrl($shipmentId)
407
+ {
408
+ $url = Mage::helper('adminhtml')->getUrl(
409
+ 'postnl_admin/adminhtml_shipment/printReturnLabel',
410
+ array('shipment_id' => $shipmentId)
411
+ );
412
+
413
+ return $url;
414
+ }
415
+
416
  /**
417
  * Get adminhtml url for PostNL print packing slip action.
418
  *
540
 
541
  return $url;
542
  }
543
+
544
+ /**
545
+ * Get adminhtml url for PostNL send_return_label shipment action
546
+ *
547
+ * @param int $shipmentId The ID of the current shipment
548
+ *
549
+ * @return string
550
+ */
551
+ public function getSendReturnLabelEmailUrl($shipmentId)
552
+ {
553
+ $url = Mage::helper('adminhtml')->getUrl(
554
+ 'postnl_admin/adminhtml_shipment/sendReturnLabelEmail',
555
+ array(
556
+ 'shipment_id' => $shipmentId,
557
+ 'return_to_view' => true,
558
+ )
559
+ );
560
+
561
+ return $url;
562
+ }
563
  }
app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridColumns.php CHANGED
@@ -83,6 +83,10 @@ class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridColumns
83
  'value' => 'labels_printed',
84
  'label' => $helper->__('Labels Printed')
85
  ),
 
 
 
 
86
  array(
87
  'value' => 'is_parcelware_exported',
88
  'label' => $helper->__('Exported to Parcelware')
@@ -95,6 +99,10 @@ class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridColumns
95
  'value' => 'shipping_phase',
96
  'label' => $helper->__('Shipping Phase')
97
  ),
 
 
 
 
98
  );
99
 
100
  return $columns;
83
  'value' => 'labels_printed',
84
  'label' => $helper->__('Labels Printed')
85
  ),
86
+ array(
87
+ 'value' => 'return_labels_printed',
88
+ 'label' => $helper->__('Return Labels Printed')
89
+ ),
90
  array(
91
  'value' => 'is_parcelware_exported',
92
  'label' => $helper->__('Exported to Parcelware')
99
  'value' => 'shipping_phase',
100
  'label' => $helper->__('Shipping Phase')
101
  ),
102
+ array(
103
+ 'value' => 'return_phase',
104
+ 'label' => $helper->__('Return Phase')
105
+ ),
106
  );
107
 
108
  return $columns;
app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridMassaction.php CHANGED
@@ -55,6 +55,10 @@ class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridMassAction
55
  'value' => 'postnl_print_labels_and_confirm',
56
  'label' => $helper->__('Print shipping labels & confirm shipment'),
57
  ),
 
 
 
 
58
  array(
59
  'value' => 'postnl_print_labels',
60
  'label' => $helper->__('Print shipping labels'),
@@ -71,6 +75,10 @@ class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridMassAction
71
  'value' => 'postnl_parcelware_export',
72
  'label' => $helper->__('Parcelware export'),
73
  ),
 
 
 
 
74
  );
75
 
76
  return $options;
55
  'value' => 'postnl_print_labels_and_confirm',
56
  'label' => $helper->__('Print shipping labels & confirm shipment'),
57
  ),
58
+ array(
59
+ 'value' => 'postnl_print_packing_slips_and_confirm',
60
+ 'label' => $helper->__('Print packing slips & confirm shipment'),
61
+ ),
62
  array(
63
  'value' => 'postnl_print_labels',
64
  'label' => $helper->__('Print shipping labels'),
75
  'value' => 'postnl_parcelware_export',
76
  'label' => $helper->__('Parcelware export'),
77
  ),
78
+ array(
79
+ 'value' => 'postnl_update_status',
80
+ 'label' => $helper->__('Update shipping status'),
81
+ ),
82
  );
83
 
84
  return $options;
app/code/community/TIG/PostNL/Model/Carrier/Postnl.php CHANGED
@@ -613,7 +613,7 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
613
  }
614
 
615
  /**
616
- * Get tracking information
617
  *
618
  * @param string $tracking
619
  *
@@ -622,29 +622,22 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
622
  public function getTrackingInfo($tracking)
623
  {
624
  $statusModel = Mage::getModel('shipping/tracking_result_status');
625
- $track = $this->_getTrackByNumber($tracking);
626
- $shipment = $track->getShipment();
627
 
628
  $shippingAddress = $shipment->getShippingAddress();
629
-
630
- /**
631
- * @var Mage_Sales_Model_Order_Address $address
632
- */
633
- $addresses = $shipment->getOrder()->getAddressesCollection();
634
- foreach ($addresses as $address) {
635
- if ($address->getAddressType() == 'pakje_gemak') {
636
- $shippingAddress = $address;
637
- break;
638
- }
639
- }
640
 
641
  $statusModel->setCarrier($track->getCarrierCode())
642
  ->setCarrierTitle($this->getConfigData('name'))
643
  ->setTracking($track->getTrackNumber())
644
  ->setPopup(1)
645
- ->setUrl(
646
- $this->getHelper()->getBarcodeUrl($track->getTrackNumber(), $shippingAddress, false, false)
647
- );
648
 
649
  return $statusModel;
650
  }
613
  }
614
 
615
  /**
616
+ * Get tracking information.
617
  *
618
  * @param string $tracking
619
  *
622
  public function getTrackingInfo($tracking)
623
  {
624
  $statusModel = Mage::getModel('shipping/tracking_result_status');
625
+ $track = $this->_getTrackByNumber($tracking);
626
+ $shipment = $track->getShipment();
627
 
628
  $shippingAddress = $shipment->getShippingAddress();
629
+ $barcodeUrl = $this->getHelper()->getBarcodeUrl(
630
+ $track->getTrackNumber(),
631
+ $shippingAddress,
632
+ false,
633
+ false
634
+ );
 
 
 
 
 
635
 
636
  $statusModel->setCarrier($track->getCarrierCode())
637
  ->setCarrierTitle($this->getConfigData('name'))
638
  ->setTracking($track->getTrackNumber())
639
  ->setPopup(1)
640
+ ->setUrl($barcodeUrl);
 
 
641
 
642
  return $statusModel;
643
  }
app/code/community/TIG/PostNL/Model/Checkout/Service.php CHANGED
@@ -572,16 +572,25 @@ class TIG_PostNL_Model_Checkout_Service extends Varien_Object
572
  /**
573
  * If a confirm date has been specified, save it with the PostNL Order object so we can reference it later
574
  */
575
- if (isset($data->Voorkeuren)
576
- && is_object($data->Voorkeuren)
577
- && isset($data->Voorkeuren->Bezorging)
578
- && is_object($data->Voorkeuren->Bezorging)
579
- && isset($data->Voorkeuren->Bezorging->VerzendDatum)
580
  && isset($data->Voorkeuren->Bezorging->Datum)
581
  ) {
582
  $delivery = $data->Voorkeuren->Bezorging;
583
- $postnlOrder->setConfirmDate($delivery->VerzendDatum)
584
- ->setDeliveryDate($delivery->Datum);
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  }
586
 
587
  /**
572
  /**
573
  * If a confirm date has been specified, save it with the PostNL Order object so we can reference it later
574
  */
575
+ if (isset($data->Voorkeuren->Bezorging->VerzendDatum)
 
 
 
 
576
  && isset($data->Voorkeuren->Bezorging->Datum)
577
  ) {
578
  $delivery = $data->Voorkeuren->Bezorging;
579
+ $timeZone = Mage::getStoreConfig(
580
+ Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE,
581
+ Mage::app()->getStore()->getId()
582
+ );
583
+ $timeZone = new DateTimeZone($timeZone);
584
+ $utcTimeZone = new DateTimeZone('UTC');
585
+
586
+ $confirmDate = new DateTime($delivery->VerzendDatum, $timeZone);
587
+ $confirmDate->setTimezone($utcTimeZone);
588
+
589
+ $deliveryDate = new DateTime($delivery->Datum, $timeZone);
590
+ $deliveryDate->setTimezone($utcTimeZone);
591
+
592
+ $postnlOrder->setConfirmDate($confirmDate->format('Y-m-d H:i:s'))
593
+ ->setDeliveryDate($deliveryDate->format('Y-m-d H:i:s'));
594
  }
595
 
596
  /**
app/code/community/TIG/PostNL/Model/Core/Cif.php CHANGED
@@ -92,14 +92,15 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
92
  /**
93
  * Xpath to setting that determines whether to use a separate return address.
94
  */
95
- const XPATH_USE_SENDER_ADDRESS_AS_RETURN = 'postnl/cif_address/use_sender_address';
96
 
97
  /**
98
- * Xpath to sender address data.
99
  *
100
  * N.B. missing last part so this will return an array of all fields.
101
  */
102
  const XPATH_SENDER_ADDRESS = 'postnl/cif_address';
 
103
 
104
  /**.
105
  * Xpaths for shipment reference info.
@@ -141,15 +142,17 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
141
  /**
142
  * Array containing possible address types.
143
  *
 
 
144
  * @var array
145
  */
146
  protected $_addressTypes = array(
147
  'Receiver' => '01',
148
  'Sender' => '02',
149
- 'Return' => '03',
150
  'Collection' => '04',
151
- 'Alternative' => '08', // alternative sender. Parcels that cannot be delivered will be returned here
152
- 'Delivery' => '09', // for use with PakjeGemak
153
  );
154
 
155
  /**
@@ -415,16 +418,14 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
415
  /**
416
  * Retrieves the latest shipping status of a shipment from CIF.
417
  *
418
- * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
419
  *
420
  * @throws TIG_PostNL_Exception
421
  *
422
  * @return StdClass
423
- *
424
  */
425
- public function getShipmentStatus(TIG_PostnL_Model_Core_Shipment $postnlShipment)
426
  {
427
- $barcode = $postnlShipment->getMainBarcode();
428
  $message = $this->_getMessage($barcode);
429
  $customer = $this->_getCustomer();
430
 
@@ -483,16 +484,14 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
483
  /**
484
  * Retrieves the latest shipping status of a shipment from CIF including full status history.
485
  *
486
- * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
487
  *
488
  * @throws TIG_PostNL_Exception
489
  *
490
  * @return StdClass
491
- *
492
  */
493
- public function getCompleteShipmentStatus(TIG_PostnL_Model_Core_Shipment $postnlShipment)
494
  {
495
- $barcode = $postnlShipment->getMainBarcode();
496
  $message = $this->_getMessage($barcode);
497
  $customer = $this->_getCustomer();
498
 
@@ -611,20 +610,26 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
611
  /**
612
  * Generates shipping labels for the chosen shipment.
613
  *
614
- * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
615
- * @param $barcode
616
- * @param bool $mainBarcode
617
- * @param bool $shipmentNumber
618
- * @param string $printerType The printertype used. Currently only 'GraphicFile|PDF' is fully supported
 
 
 
619
  *
620
  * @throws TIG_PostNL_Exception
621
  *
622
  * @return array
623
  *
624
  */
625
- public function generateLabels(TIG_PostnL_Model_Core_Shipment $postnlShipment, $barcode, $mainBarcode = false,
626
- $shipmentNumber = false, $printerType = 'GraphicFile|PDF')
627
- {
 
 
 
628
  $shipment = $postnlShipment->getShipment();
629
 
630
  $availablePrinterTypes = $this->_printerTypes;
@@ -639,9 +644,23 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
639
  * Create a single shipment object
640
  */
641
  if ($mainBarcode === false || $shipmentNumber === false) {
642
- $cifShipment = $this->_getShipment($postnlShipment, $barcode);
 
 
 
 
 
 
 
643
  } else {
644
- $cifShipment = $this->_getShipment($postnlShipment, $barcode, $mainBarcode, $shipmentNumber);
 
 
 
 
 
 
 
645
  }
646
 
647
  $message = $this->_getMessage($barcode, array('Printertype' => $printerType));
@@ -675,12 +694,14 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
675
  /**
676
  * Generates shipping labels for the chosen shipment without confirming it.
677
  *
678
- * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
679
- * @param string $barcode
680
- * @param boolean|string $mainBarcode
681
- * @param bool|int $shipmentNumber
682
- * @param string $printerType The printertype used. Currently only 'GraphicFile|PDF'
683
- * is fully supported.
 
 
684
  *
685
  *
686
  * @throws TIG_PostNL_Exception
@@ -688,13 +709,19 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
688
  * @return array
689
  *
690
  */
691
- public function generateLabelsWithoutConfirm(
692
- TIG_PostnL_Model_Core_Shipment $postnlShipment,
693
- $barcode,
694
- $mainBarcode = false,
695
- $shipmentNumber = false,
696
- $printerType = 'GraphicFile|PDF'
697
  ) {
 
 
 
 
 
 
 
698
  $shipment = $postnlShipment->getShipment();
699
 
700
  $availablePrinterTypes = $this->_printerTypes;
@@ -709,9 +736,23 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
709
  * Create a single shipment object
710
  */
711
  if ($mainBarcode === false || $shipmentNumber === false) {
712
- $cifShipment = $this->_getShipment($postnlShipment, $barcode);
 
 
 
 
 
 
 
713
  } else {
714
- $cifShipment = $this->_getShipment($postnlShipment, $barcode, $mainBarcode, $shipmentNumber);
 
 
 
 
 
 
 
715
  }
716
 
717
  $message = $this->_getMessage($barcode, array('Printertype' => $printerType));
@@ -804,15 +845,17 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
804
  /**
805
  * Creates the CIF shipment object based on a PostNL shipment.
806
  *
807
- * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
808
- * @param $barcode
809
- * @param bool $mainBarcode
810
- * @param bool $shipmentNumber
 
 
811
  *
812
  * @return array
813
  */
814
- protected function _getShipment(TIG_PostnL_Model_Core_Shipment $postnlShipment,
815
- $barcode, $mainBarcode = false, $shipmentNumber = false)
816
  {
817
  $shipment = $postnlShipment->getShipment();
818
  $shippingAddress = $postnlShipment->getShippingAddress();
@@ -855,9 +898,13 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
855
  $deliveryDate = $postnlShipment->getDeliveryDate();
856
  if ($deliveryDate) {
857
  $deliveryTime = new DateTime($deliveryDate);
 
 
858
  $deliveryDate = $deliveryTime->format('d-m-Y H:i:s');
859
  }
860
 
 
 
861
  $shipmentData = array(
862
  'Barcode' => $barcode,
863
  'CollectionTimeStampEnd' => '',
@@ -875,6 +922,11 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
875
  'DeliveryDate' => $deliveryDate,
876
  );
877
 
 
 
 
 
 
878
  /**
879
  * Add group data (for multi-collo shipments)
880
  */
@@ -893,7 +945,7 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
893
  /**
894
  * Add address data
895
  */
896
- $addresses = $this->_getShipmentAddresses($postnlShipment, $shippingAddress);
897
  $shipmentData['Addresses'] = $addresses;
898
 
899
  /**
@@ -926,13 +978,15 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
926
  *
927
  * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
928
  * @param Mage_Sales_Model_order_Address $shippingAddress
 
929
  *
930
  * @return array
931
  */
932
- protected function _getShipmentAddresses(TIG_PostnL_Model_Core_Shipment $postnlShipment, $shippingAddress)
933
- {
 
934
  $useSenderAddressAsReturn = Mage::getStoreConfigFlag(
935
- self::XPATH_USE_SENDER_ADDRESS_AS_RETURN,
936
  $this->getStoreId()
937
  );
938
  $pakjeGemakAddress = $postnlShipment->getPakjeGemakAddress();
@@ -951,6 +1005,10 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
951
  $addresses['Address'][] = $this->_getAddress('Delivery', $pakjeGemakAddress);
952
  }
953
 
 
 
 
 
954
  return $addresses;
955
  }
956
 
@@ -989,10 +1047,10 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
989
  * @throws TIG_PostNL_Exception
990
  * @return array
991
  */
992
- protected function _getAddress($addressType, $shippingAddress= false)
993
  {
994
  $availableAddressTypes = $this->getAddressTypes();
995
- if (!array_key_exists($addressType, $availableAddressTypes)) {
996
  throw new TIG_PostNL_Exception(
997
  Mage::helper('postnl')->__('Invalid address type supplied: %s', $addressType),
998
  'POSTNL-0108'
@@ -1022,39 +1080,61 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
1022
 
1023
  $address = new Varien_Object($senderAddress);
1024
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  case 'Alternative':
1026
  /**
1027
  * Check if the return address is the same as the sender address. If so, no address is returned.
1028
  */
1029
  $useSenderAddress = Mage::getStoreConfig(
1030
- self::XPATH_USE_SENDER_ADDRESS_AS_RETURN,
1031
  $this->getStoreId()
1032
  );
 
1033
  if ($useSenderAddress) {
1034
  return false;
1035
  }
1036
 
1037
  /**
1038
- * Get all cif_address fields with the 'return_' prefix as an array and convert that to a
1039
  * Varien_Object. This allows the _prepareAddress method to access this data in the same way as a
1040
  * conventional Mage_Sales_Model_Order_Address object.
1041
  */
1042
  $returnAddress = Mage::getStoreConfig(self::XPATH_SENDER_ADDRESS, $this->getStoreId());
1043
 
1044
  $streetData = array(
1045
- 'streetname' => $returnAddress['return_streetname'],
1046
- 'housenumber' => $returnAddress['return_housenumber'],
1047
- 'housenumberExtension' => $returnAddress['return_housenumber_extension'],
1048
  'fullStreet' => '',
1049
  );
1050
 
1051
  $returnAddressData = array();
1052
  foreach($returnAddress as $field => $value) {
1053
- if (strpos($field, 'return_') === false) {
1054
  continue;
1055
  }
1056
 
1057
- $returnAddressData[substr($field, 7)] = $value;
1058
  }
1059
 
1060
  $address = new Varien_Object($returnAddressData);
@@ -1601,15 +1681,7 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
1601
  $countryOfOrigin = $product->getDataUsingMethod($countryOfOriginAttribute);
1602
 
1603
  if (empty($countryOfOrigin)) {
1604
- $productId = $shipmentItem->getProductId();
1605
- throw new TIG_PostNL_Exception(
1606
- Mage::helper('postnl')->__(
1607
- 'Missing country of origin value for product <a href="%s" target="_blank">#%s</a>.',
1608
- Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit', array('id' => $productId)),
1609
- $productId
1610
- ),
1611
- 'POSTNL-0091'
1612
- );
1613
  }
1614
 
1615
  return $countryOfOrigin;
92
  /**
93
  * Xpath to setting that determines whether to use a separate return address.
94
  */
95
+ const XPATH_USE_SENDER_ADDRESS_AS_ALTERNATIVE_SENDER = 'postnl/cif_address/use_sender_address';
96
 
97
  /**
98
+ * Xpath to sender and return addresses data.
99
  *
100
  * N.B. missing last part so this will return an array of all fields.
101
  */
102
  const XPATH_SENDER_ADDRESS = 'postnl/cif_address';
103
+ const XPATH_RETURN_ADDRESS = 'postnl/returns';
104
 
105
  /**.
106
  * Xpaths for shipment reference info.
142
  /**
143
  * Array containing possible address types.
144
  *
145
+ * N.B. the value of the return and alternative sender addresses were switched in v1.5.0.
146
+ *
147
  * @var array
148
  */
149
  protected $_addressTypes = array(
150
  'Receiver' => '01',
151
  'Sender' => '02',
152
+ 'Alternative' => '03', // Alternative sender. Parcels that cannot be delivered will be returned here.
153
  'Collection' => '04',
154
+ 'Return' => '08',
155
+ 'Delivery' => '09', // Post office address. For use with PakjeGemak.
156
  );
157
 
158
  /**
418
  /**
419
  * Retrieves the latest shipping status of a shipment from CIF.
420
  *
421
+ * @param string $barcode
422
  *
423
  * @throws TIG_PostNL_Exception
424
  *
425
  * @return StdClass
 
426
  */
427
+ public function getShipmentStatus($barcode)
428
  {
 
429
  $message = $this->_getMessage($barcode);
430
  $customer = $this->_getCustomer();
431
 
484
  /**
485
  * Retrieves the latest shipping status of a shipment from CIF including full status history.
486
  *
487
+ * @param string $barcode
488
  *
489
  * @throws TIG_PostNL_Exception
490
  *
491
  * @return StdClass
 
492
  */
493
+ public function getCompleteShipmentStatus($barcode)
494
  {
 
495
  $message = $this->_getMessage($barcode);
496
  $customer = $this->_getCustomer();
497
 
610
  /**
611
  * Generates shipping labels for the chosen shipment.
612
  *
613
+ * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
614
+ * @param string $barcode
615
+ * @param boolean|string $mainBarcode
616
+ * @param boolean|int $shipmentNumber
617
+ * @param boolean $printReturnLabel
618
+ * @param boolean|string $returnBarcode
619
+ * @param string $printerType The printertype used. Currently only 'GraphicFile|PDF' is
620
+ * fully supported
621
  *
622
  * @throws TIG_PostNL_Exception
623
  *
624
  * @return array
625
  *
626
  */
627
+ public function generateLabels(TIG_PostnL_Model_Core_Shipment $postnlShipment, $barcode,
628
+ $mainBarcode = false, $shipmentNumber = false,
629
+ $printReturnLabel = false, $returnBarcode = false,
630
+ $printerType = 'GraphicFile|PDF'
631
+
632
+ ) {
633
  $shipment = $postnlShipment->getShipment();
634
 
635
  $availablePrinterTypes = $this->_printerTypes;
644
  * Create a single shipment object
645
  */
646
  if ($mainBarcode === false || $shipmentNumber === false) {
647
+ $cifShipment = $this->_getShipment(
648
+ $postnlShipment,
649
+ $barcode,
650
+ false,
651
+ false,
652
+ $printReturnLabel,
653
+ $returnBarcode
654
+ );
655
  } else {
656
+ $cifShipment = $this->_getShipment(
657
+ $postnlShipment,
658
+ $barcode,
659
+ $mainBarcode,
660
+ $shipmentNumber,
661
+ $printReturnLabel,
662
+ $returnBarcode
663
+ );
664
  }
665
 
666
  $message = $this->_getMessage($barcode, array('Printertype' => $printerType));
694
  /**
695
  * Generates shipping labels for the chosen shipment without confirming it.
696
  *
697
+ * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
698
+ * @param string $barcode
699
+ * @param boolean|string $mainBarcode
700
+ * @param boolean|int $shipmentNumber
701
+ * @param boolean $printReturnLabel
702
+ * @param boolean|string $returnBarcode
703
+ * @param string $printerType The printertype used. Currently only 'GraphicFile|PDF' is
704
+ * fully supported
705
  *
706
  *
707
  * @throws TIG_PostNL_Exception
709
  * @return array
710
  *
711
  */
712
+ public function generateLabelsWithoutConfirm(TIG_PostnL_Model_Core_Shipment $postnlShipment, $barcode,
713
+ $mainBarcode = false, $shipmentNumber = false,
714
+ $printReturnLabel = false, $returnBarcode = false,
715
+ $printerType = 'GraphicFile|PDF'
716
+
 
717
  ) {
718
+ /**
719
+ * Return barcodes are required when printing return labels.
720
+ */
721
+ if ($printReturnLabel && empty($returnBarcode)) {
722
+ throw new InvalidArgumentException('Missing return barcode.');
723
+ }
724
+
725
  $shipment = $postnlShipment->getShipment();
726
 
727
  $availablePrinterTypes = $this->_printerTypes;
736
  * Create a single shipment object
737
  */
738
  if ($mainBarcode === false || $shipmentNumber === false) {
739
+ $cifShipment = $this->_getShipment(
740
+ $postnlShipment,
741
+ $barcode,
742
+ false,
743
+ false,
744
+ $printReturnLabel,
745
+ $returnBarcode
746
+ );
747
  } else {
748
+ $cifShipment = $this->_getShipment(
749
+ $postnlShipment,
750
+ $barcode,
751
+ $mainBarcode,
752
+ $shipmentNumber,
753
+ $printReturnLabel,
754
+ $returnBarcode
755
+ );
756
  }
757
 
758
  $message = $this->_getMessage($barcode, array('Printertype' => $printerType));
845
  /**
846
  * Creates the CIF shipment object based on a PostNL shipment.
847
  *
848
+ * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
849
+ * @param string $barcode
850
+ * @param bool $mainBarcode
851
+ * @param bool $shipmentNumber
852
+ * @param bool $printReturnLabel
853
+ * @param bool|string $returnBarcode
854
  *
855
  * @return array
856
  */
857
+ protected function _getShipment(TIG_PostnL_Model_Core_Shipment $postnlShipment, $barcode, $mainBarcode = false,
858
+ $shipmentNumber = false, $printReturnLabel = false, $returnBarcode = false)
859
  {
860
  $shipment = $postnlShipment->getShipment();
861
  $shippingAddress = $postnlShipment->getShippingAddress();
898
  $deliveryDate = $postnlShipment->getDeliveryDate();
899
  if ($deliveryDate) {
900
  $deliveryTime = new DateTime($deliveryDate);
901
+ $deliveryTime->setTimezone(new DateTimeZone('Europe/Berlin'));
902
+
903
  $deliveryDate = $deliveryTime->format('d-m-Y H:i:s');
904
  }
905
 
906
+ $reference = $this->_getReference($shipment);
907
+
908
  $shipmentData = array(
909
  'Barcode' => $barcode,
910
  'CollectionTimeStampEnd' => '',
922
  'DeliveryDate' => $deliveryDate,
923
  );
924
 
925
+ if ($printReturnLabel) {
926
+ $shipmentData['ReturnBarcode'] = $returnBarcode;
927
+ $shipmentData['ReturnReference'] = $reference;
928
+ }
929
+
930
  /**
931
  * Add group data (for multi-collo shipments)
932
  */
945
  /**
946
  * Add address data
947
  */
948
+ $addresses = $this->_getShipmentAddresses($postnlShipment, $shippingAddress, $printReturnLabel);
949
  $shipmentData['Addresses'] = $addresses;
950
 
951
  /**
978
  *
979
  * @param TIG_PostnL_Model_Core_Shipment $postnlShipment
980
  * @param Mage_Sales_Model_order_Address $shippingAddress
981
+ * @param boolean $printReturnLabel
982
  *
983
  * @return array
984
  */
985
+ protected function _getShipmentAddresses(TIG_PostnL_Model_Core_Shipment $postnlShipment, $shippingAddress,
986
+ $printReturnLabel
987
+ ) {
988
  $useSenderAddressAsReturn = Mage::getStoreConfigFlag(
989
+ self::XPATH_USE_SENDER_ADDRESS_AS_ALTERNATIVE_SENDER,
990
  $this->getStoreId()
991
  );
992
  $pakjeGemakAddress = $postnlShipment->getPakjeGemakAddress();
1005
  $addresses['Address'][] = $this->_getAddress('Delivery', $pakjeGemakAddress);
1006
  }
1007
 
1008
+ if ($printReturnLabel) {
1009
+ $addresses['Address'][] = $this->_getAddress('Return');
1010
+ }
1011
+
1012
  return $addresses;
1013
  }
1014
 
1047
  * @throws TIG_PostNL_Exception
1048
  * @return array
1049
  */
1050
+ protected function _getAddress($addressType, $shippingAddress = false)
1051
  {
1052
  $availableAddressTypes = $this->getAddressTypes();
1053
+ if (!isset($availableAddressTypes[$addressType])) {
1054
  throw new TIG_PostNL_Exception(
1055
  Mage::helper('postnl')->__('Invalid address type supplied: %s', $addressType),
1056
  'POSTNL-0108'
1080
 
1081
  $address = new Varien_Object($senderAddress);
1082
  break;
1083
+ case 'Return':
1084
+ $returnAddress = Mage::getStoreConfig(self::XPATH_RETURN_ADDRESS, $this->getStoreId());
1085
+
1086
+ $streetData = array(
1087
+ 'streetname' => 'Antwoordnummer:',
1088
+ 'housenumber' => $returnAddress['return_freepost_number'],
1089
+ 'housenumberExtension' => '',
1090
+ 'fullStreet' => '',
1091
+ );
1092
+
1093
+ $returnAddressData = array();
1094
+ foreach($returnAddress as $field => $value) {
1095
+ if (strpos($field, 'return_') === false) {
1096
+ continue;
1097
+ }
1098
+
1099
+ $returnAddressData[substr($field, 7)] = $value;
1100
+ }
1101
+
1102
+ $address = new Varien_Object($returnAddressData);
1103
+ break;
1104
  case 'Alternative':
1105
  /**
1106
  * Check if the return address is the same as the sender address. If so, no address is returned.
1107
  */
1108
  $useSenderAddress = Mage::getStoreConfig(
1109
+ self::XPATH_USE_SENDER_ADDRESS_AS_ALTERNATIVE_SENDER,
1110
  $this->getStoreId()
1111
  );
1112
+
1113
  if ($useSenderAddress) {
1114
  return false;
1115
  }
1116
 
1117
  /**
1118
+ * Get all cif_address fields with the 'alternative_sender_' prefix as an array and convert that to a
1119
  * Varien_Object. This allows the _prepareAddress method to access this data in the same way as a
1120
  * conventional Mage_Sales_Model_Order_Address object.
1121
  */
1122
  $returnAddress = Mage::getStoreConfig(self::XPATH_SENDER_ADDRESS, $this->getStoreId());
1123
 
1124
  $streetData = array(
1125
+ 'streetname' => $returnAddress['alternative_sender_streetname'],
1126
+ 'housenumber' => $returnAddress['alternative_sender_housenumber'],
1127
+ 'housenumberExtension' => $returnAddress['alternative_sender_housenumber_extension'],
1128
  'fullStreet' => '',
1129
  );
1130
 
1131
  $returnAddressData = array();
1132
  foreach($returnAddress as $field => $value) {
1133
+ if (strpos($field, 'alternative_sender_') === false) {
1134
  continue;
1135
  }
1136
 
1137
+ $returnAddressData[substr($field, 19)] = $value;
1138
  }
1139
 
1140
  $address = new Varien_Object($returnAddressData);
1681
  $countryOfOrigin = $product->getDataUsingMethod($countryOfOriginAttribute);
1682
 
1683
  if (empty($countryOfOrigin)) {
1684
+ $countryOfOrigin = 'NL'; /** @todo make this configurable */
 
 
 
 
 
 
 
 
1685
  }
1686
 
1687
  return $countryOfOrigin;
app/code/community/TIG/PostNL/Model/Core/Cif/Abstract.php CHANGED
@@ -91,8 +91,10 @@ abstract class TIG_PostNL_Model_Core_Cif_Abstract extends Varien_Object
91
 
92
  /**
93
  * CIF error namespace.
 
 
94
  */
95
- const CIF_ERROR_NAMESPACE = 'http://schemas.datacontract.org/2004/07/Tpp.Cif.Services.Services.Exception';
96
 
97
  /**
98
  * XML paths for config options
91
 
92
  /**
93
  * CIF error namespace.
94
+ *
95
+ * N.B. Changed in v1.5.0.
96
  */
97
+ const CIF_ERROR_NAMESPACE = 'http://postnl.nl/cif/services/common/';
98
 
99
  /**
100
  * XML paths for config options
app/code/community/TIG/PostNL/Model/Core/Label.php CHANGED
@@ -90,7 +90,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
90
  /**
91
  * Output mode. Currently 2 modes are supported: I and S.
92
  *
93
- * @see lib/TIG/PostNL/Fpdf/fpdf.php::Output()
94
  *
95
  * @var string
96
  */
@@ -124,6 +124,28 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
124
  'w' => 141.6,
125
  ),
126
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  'BusPakje' => array(
128
  1 => array(
129
  'x' => 152.4,
@@ -465,7 +487,9 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
465
  $pdf->SetAuthor('PostNL');
466
  $pdf->SetCreator('PostNL');
467
 
468
- if (!is_array($labels)) {
 
 
469
  $labels = array($labels);
470
  }
471
  /**
@@ -622,6 +646,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
622
  || $labelType == 'Label-combi'
623
  || $labelType == 'BusPakje'
624
  || $labelType == 'BusPakjeExtra'
 
625
  ) {
626
  if ($this->getLabelSize() == 'A4' && $this->getIsFirstLabel()) {
627
  $pdf->addOrientedPage('L', 'A4');
@@ -674,6 +699,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
674
  case 'Label':
675
  case 'BusPakje':
676
  case 'BusPakjeExtra':
 
677
  $position = $this->_getLabelPosition($labelType, $this->getLabelCounter());
678
 
679
  $this->increaseLabelCounter();
@@ -853,6 +879,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
853
  || $label->getLabelType() == 'Label-combi'
854
  || $label->getLabelType() == 'BusPakje'
855
  || $label->getLabelType() == 'BusPakjeExtra'
 
856
  ) {
857
  $generalLabels[] = $label;
858
  continue;
90
  /**
91
  * Output mode. Currently 2 modes are supported: I and S.
92
  *
93
+ * @see FPDF::Output()
94
  *
95
  * @var string
96
  */
124
  'w' => 141.6,
125
  ),
126
  ),
127
+ 'Return Label' => array(
128
+ 1 => array(
129
+ 'x' => 152.4,
130
+ 'y' => 3.9,
131
+ 'w' => 141.6,
132
+ ),
133
+ 2 => array(
134
+ 'x' => 152.4,
135
+ 'y' => 108.9,
136
+ 'w' => 141.6,
137
+ ),
138
+ 3 => array(
139
+ 'x' => 3.9,
140
+ 'y' => 3.9,
141
+ 'w' => 141.6,
142
+ ),
143
+ 4 => array(
144
+ 'x' => 3.9,
145
+ 'y' => 108.9,
146
+ 'w' => 141.6,
147
+ ),
148
+ ),
149
  'BusPakje' => array(
150
  1 => array(
151
  'x' => 152.4,
487
  $pdf->SetAuthor('PostNL');
488
  $pdf->SetCreator('PostNL');
489
 
490
+ if (!is_array($labels)
491
+ && !(is_object($labels) && $labels instanceof TIG_PostNL_Model_Core_Resource_Shipment_Label_Collection)
492
+ ) {
493
  $labels = array($labels);
494
  }
495
  /**
646
  || $labelType == 'Label-combi'
647
  || $labelType == 'BusPakje'
648
  || $labelType == 'BusPakjeExtra'
649
+ || $labelType == 'Return Label'
650
  ) {
651
  if ($this->getLabelSize() == 'A4' && $this->getIsFirstLabel()) {
652
  $pdf->addOrientedPage('L', 'A4');
699
  case 'Label':
700
  case 'BusPakje':
701
  case 'BusPakjeExtra':
702
+ case 'Return Label':
703
  $position = $this->_getLabelPosition($labelType, $this->getLabelCounter());
704
 
705
  $this->increaseLabelCounter();
879
  || $label->getLabelType() == 'Label-combi'
880
  || $label->getLabelType() == 'BusPakje'
881
  || $label->getLabelType() == 'BusPakjeExtra'
882
+ || $label->getLabelType() == 'Return Label'
883
  ) {
884
  $generalLabels[] = $label;
885
  continue;
app/code/community/TIG/PostNL/Model/Core/Observer/Barcode.php CHANGED
@@ -51,10 +51,12 @@ class TIG_PostNL_Model_Core_Observer_Barcode
51
  */
52
  public function generateBarcode(Varien_Event_Observer $observer)
53
  {
 
 
54
  /**
55
  * Check if the PostNL module is active
56
  */
57
- if (!Mage::helper('postnl')->isEnabled()) {
58
  return $this;
59
  }
60
 
@@ -98,11 +100,13 @@ class TIG_PostNL_Model_Core_Observer_Barcode
98
 
99
  if ($postnlOrder->getId()) {
100
  if ($postnlOrder->hasConfirmDate()) {
101
- $postnlShipment->setConfirmDate(strtotime($postnlOrder->getConfirmDate()));
 
102
  }
103
 
104
  if ($postnlOrder->hasDeliveryDate()) {
105
- $postnlShipment->setDeliveryDate(strtotime($postnlOrder->getDeliveryDate()));
 
106
  }
107
 
108
  if ($postnlOrder->getIsPakjeGemak()) {
@@ -112,6 +116,14 @@ class TIG_PostNL_Model_Core_Observer_Barcode
112
  if ($postnlOrder->getIsPakketautomaat()) {
113
  $postnlShipment->setIsPakketautomaat($postnlOrder->getIsPakketautomaat());
114
  }
 
 
 
 
 
 
 
 
115
  }
116
 
117
  /**
@@ -130,8 +142,13 @@ class TIG_PostNL_Model_Core_Observer_Barcode
130
  if ($postnlShipment->canGenerateBarcode()) {
131
  $postnlShipment->generateBarcodes();
132
  }
 
 
 
 
 
133
  } catch (Exception $e) {
134
- Mage::helper('postnl')->logException($e);
135
  }
136
 
137
  $postnlShipment->save();
51
  */
52
  public function generateBarcode(Varien_Event_Observer $observer)
53
  {
54
+ $helper = Mage::helper('postnl/cif');
55
+
56
  /**
57
  * Check if the PostNL module is active
58
  */
59
+ if (!$helper->isEnabled()) {
60
  return $this;
61
  }
62
 
100
 
101
  if ($postnlOrder->getId()) {
102
  if ($postnlOrder->hasConfirmDate()) {
103
+ $confirmDate = new DateTime($postnlOrder->getConfirmDate());
104
+ $postnlShipment->setConfirmDate($confirmDate->format('Y-m-d H:i:s'));
105
  }
106
 
107
  if ($postnlOrder->hasDeliveryDate()) {
108
+ $deliveryDate = new DateTime($postnlOrder->getDeliveryDate());
109
+ $postnlShipment->setDeliveryDate($deliveryDate->format('Y-m-d H:i:s'));
110
  }
111
 
112
  if ($postnlOrder->getIsPakjeGemak()) {
116
  if ($postnlOrder->getIsPakketautomaat()) {
117
  $postnlShipment->setIsPakketautomaat($postnlOrder->getIsPakketautomaat());
118
  }
119
+
120
+ if ($postnlOrder->hasExpectedDeliveryTimeStart()) {
121
+ $postnlShipment->setExpectedDeliveryTimeStart($postnlOrder->getExpectedDeliveryTimeStart());
122
+ }
123
+
124
+ if ($postnlOrder->hasExpectedDeliveryTimeEnd()) {
125
+ $postnlShipment->setExpectedDeliveryTimeEnd($postnlOrder->getExpectedDeliveryTimeEnd());
126
+ }
127
  }
128
 
129
  /**
142
  if ($postnlShipment->canGenerateBarcode()) {
143
  $postnlShipment->generateBarcodes();
144
  }
145
+
146
+ $printReturnLabel = $helper->isReturnsEnabled($postnlShipment->getStoreId());
147
+ if ($printReturnLabel && $postnlShipment->canGenerateReturnBarcode()) {
148
+ $postnlShipment->generateReturnBarcode();
149
+ }
150
  } catch (Exception $e) {
151
+ $helper->logException($e);
152
  }
153
 
154
  $postnlShipment->save();
app/code/community/TIG/PostNL/Model/Core/Observer/Cron.php CHANGED
@@ -58,6 +58,11 @@ class TIG_PostNL_Model_Core_Observer_Cron
58
  */
59
  const XPATH_PRODUCT_ATTRIBUTE_UPDATE_DATA = 'postnl/general/product_attribute_update_data';
60
 
 
 
 
 
 
61
  /**
62
  * Cron expression definition for updating product attributes.
63
  */
@@ -68,6 +73,50 @@ class TIG_PostNL_Model_Core_Observer_Cron
68
  */
69
  const MAX_PRODUCTS_TO_UPDATE = 250;
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  /**
72
  * Method to destroy temporary label files that have been stored for too long.
73
  *
@@ -281,7 +330,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
281
  */
282
  public function getBarcodes()
283
  {
284
- $helper = Mage::helper('postnl');
285
 
286
  /**
287
  * Check if the PostNL module is active
@@ -329,12 +378,18 @@ class TIG_PostNL_Model_Core_Observer_Cron
329
  */
330
  try {
331
  $helper->cronLog("Getting barcodes for shipment #{$postnlShipment->getId()}.");
332
- $postnlShipment->generateBarcodes()
333
- ->save();
 
 
 
 
 
 
334
 
335
  $counter--;
336
  } catch (Exception $e) {
337
- Mage::helper('postnl')->logException($e);
338
  }
339
  }
340
 
@@ -440,15 +495,154 @@ class TIG_PostNL_Model_Core_Observer_Cron
440
  return $this;
441
  }
442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  /**
444
  * Parses an TIG_PostNL_Model_Core_Cif_Exception exception in order to process specific error codes
445
  *
446
  * @param TIG_PostNL_Model_Core_Cif_Exception $e
447
- * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
 
448
  *
449
  * @return $this
450
  */
451
- protected function _parseErrorCodes($e, $postnlShipment)
452
  {
453
  $helper = Mage::helper('postnl');
454
 
@@ -499,8 +693,14 @@ class TIG_PostNL_Model_Core_Observer_Cron
499
  $helper->cronLog(
500
  "Shipment #{$postnlShipment->getId()} could not be found by CIF and was confirmed more than 1 day ago!"
501
  );
502
- $postnlShipment->setShippingPhase($postnlShipment::SHIPPING_PHASE_NOT_APPLICABLE)
503
- ->save();
 
 
 
 
 
 
504
 
505
  return $this;
506
  }
@@ -510,13 +710,13 @@ class TIG_PostNL_Model_Core_Observer_Cron
510
  }
511
 
512
  /**
513
- * Removes expired confirmations by resetting the postnl shipment to a pre-confirm state
514
  *
515
  * @return $this
516
  */
517
  public function expireConfirmation()
518
  {
519
- $helper = Mage::helper('postnl');
520
 
521
  /**
522
  * Check if the PostNL module is active
@@ -608,6 +808,13 @@ class TIG_PostNL_Model_Core_Observer_Cron
608
  if ($postnlShipment->canGenerateBarcode()) {
609
  $postnlShipment->generateBarcodes();
610
  }
 
 
 
 
 
 
 
611
  $postnlShipment->save();
612
  } catch (Exception $e) {
613
  $helper->logException($e);
@@ -663,12 +870,18 @@ class TIG_PostNL_Model_Core_Observer_Cron
663
 
664
  $twentyMinutesAgo = $twentyMinutesAgo->format('Y-m-d H:i:s');
665
 
 
 
 
 
 
 
666
  $helper->cronLog("Track and trace email will be sent for all shipments that were confirmed on or before " .
667
  "{$twentyMinutesAgo}.");
668
 
669
  /**
670
  * Get all postnl shipments that have been confirmed over 20 minutes ago whose track & trace e-mail has not yet
671
- * been sent
672
  *
673
  * Resulting SQL:
674
  * SELECT `main_table` . *
@@ -681,6 +894,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
681
  * )
682
  * AND (
683
  * confirmed_at <= '{$twentyMinutesAgo}'
 
684
  * )
685
  * AND (
686
  * (
@@ -707,7 +921,10 @@ class TIG_PostNL_Model_Core_Observer_Cron
707
  )
708
  ->addFieldToFilter(
709
  'confirmed_at',
710
- array('lteq' => $twentyMinutesAgo)
 
 
 
711
  )
712
  ->addFieldToFilter(
713
  'track_and_trace_email_sent',
@@ -724,7 +941,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
724
  );
725
 
726
  /**
727
- * Check to see if there are any results
728
  */
729
  if (!$postnlShipmentCollection->getSize()) {
730
  $helper->cronLog('No valid shipments found. Exiting cron.');
@@ -734,7 +951,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
734
  $helper->cronLog("Track & trace emails will be sent for {$postnlShipmentCollection->getSize()} shipments.");
735
 
736
  /**
737
- * Send the track and trace email for all shipments
738
  */
739
  foreach ($postnlShipmentCollection as $postnlShipment) {
740
  if (!$postnlShipment->getShipment(false)) {
@@ -742,7 +959,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
742
  }
743
 
744
  /**
745
- * Check if sending the email is allowed for this shipment
746
  */
747
  $storeId = $postnlShipment->getStoreId();
748
  if (!in_array($storeId, $allowedStoreIds) || !$postnlShipment->canSendTrackAndTraceEmail()) {
@@ -753,7 +970,7 @@ class TIG_PostNL_Model_Core_Observer_Cron
753
  }
754
 
755
  /**
756
- * Attempt to send the email
757
  */
758
  try{
759
  $helper->cronLog("Sending track and trace email for shipment #{$postnlShipment->getId()}");
@@ -821,7 +1038,15 @@ class TIG_PostNL_Model_Core_Observer_Cron
821
  );
822
 
823
  /**
824
- * Filter the collection by the lack of a parent_id OR shipping_phase being 'delivered'
 
 
 
 
 
 
 
 
825
  *
826
  * Resulting query:
827
  * SELECT `main_table`.`label_id` , `postnl_shipment`.`shipping_phase`
@@ -833,17 +1058,41 @@ class TIG_PostNL_Model_Core_Observer_Cron
833
  * parent_id IS NULL
834
  * )
835
  * OR (
836
- * shipping_phase =4
 
 
 
 
 
 
 
 
 
837
  * )
838
  * )
839
  */
840
  $labelsCollection->addFieldToFilter(
841
- array('parent_id', 'shipping_phase'),
842
- array(
843
- array('null' => true),
844
- array('eq' => $postnlShipmentClass::SHIPPING_PHASE_DELIVERED),
845
- )
846
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
 
848
  $labelCollectionSize = $labelsCollection->getSize();
849
  if ($labelCollectionSize < 1) {
@@ -985,4 +1234,256 @@ class TIG_PostNL_Model_Core_Observer_Cron
985
 
986
  return $this;
987
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
  }
58
  */
59
  const XPATH_PRODUCT_ATTRIBUTE_UPDATE_DATA = 'postnl/general/product_attribute_update_data';
60
 
61
+ /**
62
+ * Xpath to the return_expire_days setting.
63
+ */
64
+ const XPATH_RETURN_EXPIRE_DAYS = 'postnl/advanced/return_expire_days';
65
+
66
  /**
67
  * Cron expression definition for updating product attributes.
68
  */
73
  */
74
  const MAX_PRODUCTS_TO_UPDATE = 250;
75
 
76
+ /**
77
+ * @var array
78
+ */
79
+ protected $_timeZones = array();
80
+
81
+ /**
82
+ * @return array
83
+ */
84
+ public function getTimeZones()
85
+ {
86
+ return $this->_timeZones;
87
+ }
88
+
89
+ /**
90
+ * @param array $timeZones
91
+ *
92
+ * @return $this
93
+ */
94
+ public function setTimeZones($timeZones)
95
+ {
96
+ $this->_timeZones = $timeZones;
97
+
98
+ return $this;
99
+ }
100
+
101
+ /**
102
+ * @param int|string $storeId
103
+ *
104
+ * @return string
105
+ */
106
+ public function getTimeZone($storeId)
107
+ {
108
+ $timeZones = $this->getTimeZones();
109
+ if (isset($timeZones[$storeId])) {
110
+ return $timeZones[$storeId];
111
+ }
112
+
113
+ $timeZone = Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE, $storeId);
114
+ $timeZones[$storeId] = $timeZone;
115
+
116
+ $this->setTimeZones($timeZones);
117
+ return $timeZone;
118
+ }
119
+
120
  /**
121
  * Method to destroy temporary label files that have been stored for too long.
122
  *
330
  */
331
  public function getBarcodes()
332
  {
333
+ $helper = Mage::helper('postnl/cif');
334
 
335
  /**
336
  * Check if the PostNL module is active
378
  */
379
  try {
380
  $helper->cronLog("Getting barcodes for shipment #{$postnlShipment->getId()}.");
381
+ $postnlShipment->generateBarcodes();
382
+
383
+ $printReturnLabel = $helper->isReturnsEnabled($postnlShipment->getStoreId());
384
+ if ($printReturnLabel && $postnlShipment->canGenerateReturnBarcode()) {
385
+ $postnlShipment->generateReturnBarcode();
386
+ }
387
+
388
+ $postnlShipment->save();
389
 
390
  $counter--;
391
  } catch (Exception $e) {
392
+ $helper->logException($e);
393
  }
394
  }
395
 
495
  return $this;
496
  }
497
 
498
+ /**
499
+ * Update return shipment status for all shipments whose return labels have been printed.
500
+ *
501
+ * @return $this
502
+ */
503
+ public function updateReturnStatus()
504
+ {
505
+ $helper = Mage::helper('postnl');
506
+
507
+ /**
508
+ * Check if the PostNL module is active
509
+ */
510
+ if (!$helper->isEnabled()) {
511
+ return $this;
512
+ }
513
+
514
+ $helper->cronLog('UpdateReturnStatus cron starting...');
515
+
516
+ /**
517
+ * @var $postnlShipmentModelClass TIG_PostNL_Model_Core_Shipment
518
+ */
519
+ $postnlShipmentModelClass = Mage::getConfig()->getModelClassName('postnl_core/shipment');
520
+ $confirmedStatus = $postnlShipmentModelClass::CONFIRM_STATUS_CONFIRMED;
521
+ $deliveredStatus = $postnlShipmentModelClass::SHIPPING_PHASE_DELIVERED;
522
+
523
+ /**
524
+ * Get the date on which we can no longer requests return status updates for shipments.
525
+ */
526
+ $maxReturnDuration = Mage::getStoreConfig(self::XPATH_RETURN_EXPIRE_DAYS, Mage_Core_Model_App::ADMIN_STORE_ID);
527
+ $returnExpireDate = new DateTime();
528
+ $returnExpireDate->sub(new DateInterval("P{$maxReturnDuration}D"));
529
+
530
+ /**
531
+ * Get all postnl shipments with a barcode, that are confirmed and are not yet delivered.
532
+ *
533
+ * Resulting SQL:
534
+ * SELECT `main_table` . *
535
+ * FROM `tig_postnl_shipment` AS `main_table`
536
+ * WHERE (
537
+ * return_labels_printed =1
538
+ * )
539
+ * AND (
540
+ * confirm_status = 'confirmed'
541
+ * )
542
+ * AND (
543
+ * (
544
+ * (
545
+ * return_phase != '4'
546
+ * )
547
+ * OR (
548
+ * return_phase IS NULL
549
+ * )
550
+ * )
551
+ * )
552
+ * AND (
553
+ * shipment_id IS NOT NULL
554
+ * )
555
+ * AND (
556
+ * confirmed_at >= '{$returnExpireDate->format('Y-m-d')}'
557
+ * )
558
+ */
559
+ $postnlShipmentCollection = Mage::getResourceModel('postnl_core/shipment_collection');
560
+ $postnlShipmentCollection->addFieldToFilter(
561
+ 'return_labels_printed',
562
+ array('eq' => 1)
563
+ )
564
+ ->addFieldToFilter(
565
+ 'confirm_status',
566
+ array('eq' => $confirmedStatus)
567
+ )
568
+ ->addFieldToFilter(
569
+ 'return_phase',
570
+ array(
571
+ array('neq' => $deliveredStatus),
572
+ array('null' => true)
573
+ )
574
+ )
575
+ ->addFieldToFilter(
576
+ 'shipment_id',
577
+ array(
578
+ 'notnull' => true
579
+ )
580
+ )
581
+ ->addFieldToFilter(
582
+ 'confirmed_at',
583
+ array(
584
+ 'gteq' => $returnExpireDate->format('Y-m-d')
585
+ )
586
+ );
587
+
588
+ if ($postnlShipmentCollection->getSize() < 1) {
589
+ $helper->cronLog('No valid shipments found. Exiting cron.');
590
+ return $this;
591
+ }
592
+
593
+ $helper->cronLog("Return status will be updated for {$postnlShipmentCollection->getSize()} shipments.");
594
+
595
+ /**
596
+ * Request a return status update
597
+ */
598
+ foreach ($postnlShipmentCollection as $postnlShipment) {
599
+ /**
600
+ * Attempt to update the return status. Continue with the next one if it fails.
601
+ */
602
+ try{
603
+ if (!$postnlShipment->getShipment(false)) {
604
+ continue;
605
+ }
606
+
607
+ $helper->cronLog("Updating return status for shipment #{$postnlShipment->getShipment()->getId()}");
608
+
609
+ if (!$postnlShipment->canUpdateReturnStatus()) {
610
+ $postnlShipment->unlock();
611
+ $helper->cronLog(
612
+ "Updating return status for shipment #{$postnlShipment->getShipment()->getId()} is not " .
613
+ "allowed. Continuing with next shipment."
614
+ );
615
+ continue;
616
+ }
617
+
618
+ $postnlShipment->updateReturnStatus()
619
+ ->save();
620
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
621
+ $postnlShipment->unlock();
622
+
623
+ $this->_parseErrorCodes($e, $postnlShipment, true);
624
+ } catch (Exception $e) {
625
+ $postnlShipment->unlock();
626
+
627
+ Mage::helper('postnl')->logException($e);
628
+ }
629
+ }
630
+
631
+ $helper->cronLog('UpdateShippingStatus cron has finished.');
632
+
633
+ return $this;
634
+ }
635
+
636
  /**
637
  * Parses an TIG_PostNL_Model_Core_Cif_Exception exception in order to process specific error codes
638
  *
639
  * @param TIG_PostNL_Model_Core_Cif_Exception $e
640
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
641
+ * @param boolean $isReturnStatus
642
  *
643
  * @return $this
644
  */
645
+ protected function _parseErrorCodes($e, $postnlShipment, $isReturnStatus = false)
646
  {
647
  $helper = Mage::helper('postnl');
648
 
693
  $helper->cronLog(
694
  "Shipment #{$postnlShipment->getId()} could not be found by CIF and was confirmed more than 1 day ago!"
695
  );
696
+
697
+ if (true === $isReturnStatus) {
698
+ $postnlShipment->setReturnPhase($postnlShipment::SHIPPING_PHASE_NOT_APPLICABLE)
699
+ ->save();
700
+ } else {
701
+ $postnlShipment->setShippingPhase($postnlShipment::SHIPPING_PHASE_NOT_APPLICABLE)
702
+ ->save();
703
+ }
704
 
705
  return $this;
706
  }
710
  }
711
 
712
  /**
713
+ * Removes expired confirmations by resetting the postnl shipment to a pre-confirm state.
714
  *
715
  * @return $this
716
  */
717
  public function expireConfirmation()
718
  {
719
+ $helper = Mage::helper('postnl/cif');
720
 
721
  /**
722
  * Check if the PostNL module is active
808
  if ($postnlShipment->canGenerateBarcode()) {
809
  $postnlShipment->generateBarcodes();
810
  }
811
+
812
+
813
+ $printReturnLabel = $helper->isReturnsEnabled($postnlShipment->getStoreId());
814
+ if ($printReturnLabel && $postnlShipment->canGenerateReturnBarcode()) {
815
+ $postnlShipment->generateReturnBarcode();
816
+ }
817
+
818
  $postnlShipment->save();
819
  } catch (Exception $e) {
820
  $helper->logException($e);
870
 
871
  $twentyMinutesAgo = $twentyMinutesAgo->format('Y-m-d H:i:s');
872
 
873
+ $oneDayAgo = new DateTime();
874
+ $oneDayAgo->setTimestamp(Mage::getModel('core/date')->gmtTimestamp())
875
+ ->sub(new DateInterval('P1DT20M'));
876
+
877
+ $oneDayAgo = $oneDayAgo->format('Y-m-d H:i:s');
878
+
879
  $helper->cronLog("Track and trace email will be sent for all shipments that were confirmed on or before " .
880
  "{$twentyMinutesAgo}.");
881
 
882
  /**
883
  * Get all postnl shipments that have been confirmed over 20 minutes ago whose track & trace e-mail has not yet
884
+ * been sent.
885
  *
886
  * Resulting SQL:
887
  * SELECT `main_table` . *
894
  * )
895
  * AND (
896
  * confirmed_at <= '{$twentyMinutesAgo}'
897
+ * AND confirmed_at >= '{$$oneDayAgo}'
898
  * )
899
  * AND (
900
  * (
921
  )
922
  ->addFieldToFilter(
923
  'confirmed_at',
924
+ array(
925
+ 'from' => $oneDayAgo,
926
+ 'to' => $twentyMinutesAgo,
927
+ )
928
  )
929
  ->addFieldToFilter(
930
  'track_and_trace_email_sent',
941
  );
942
 
943
  /**
944
+ * Check to see if there are any results.
945
  */
946
  if (!$postnlShipmentCollection->getSize()) {
947
  $helper->cronLog('No valid shipments found. Exiting cron.');
951
  $helper->cronLog("Track & trace emails will be sent for {$postnlShipmentCollection->getSize()} shipments.");
952
 
953
  /**
954
+ * Send the track and trace email for all shipments.
955
  */
956
  foreach ($postnlShipmentCollection as $postnlShipment) {
957
  if (!$postnlShipment->getShipment(false)) {
959
  }
960
 
961
  /**
962
+ * Check if sending the email is allowed for this shipment.
963
  */
964
  $storeId = $postnlShipment->getStoreId();
965
  if (!in_array($storeId, $allowedStoreIds) || !$postnlShipment->canSendTrackAndTraceEmail()) {
970
  }
971
 
972
  /**
973
+ * Attempt to send the email.
974
  */
975
  try{
976
  $helper->cronLog("Sending track and trace email for shipment #{$postnlShipment->getId()}");
1038
  );
1039
 
1040
  /**
1041
+ * Get the date on which we can no longer requests return status updates for shipments.
1042
+ */
1043
+ $maxReturnDuration = Mage::getStoreConfig(self::XPATH_RETURN_EXPIRE_DAYS, Mage_Core_Model_App::ADMIN_STORE_ID);
1044
+ $returnExpireDate = new DateTime();
1045
+ $returnExpireDate->sub(new DateInterval("P{$maxReturnDuration}D"));
1046
+
1047
+ /**
1048
+ * Filter the collection by the lack of a parent_id OR shipping_phase being 'delivered'. Also filter based on
1049
+ * the confirm date. This is to allow return shipments enough time to be returned.
1050
  *
1051
  * Resulting query:
1052
  * SELECT `main_table`.`label_id` , `postnl_shipment`.`shipping_phase`
1058
  * parent_id IS NULL
1059
  * )
1060
  * OR (
1061
+ * shipping_phase = 4
1062
+ * )
1063
+ * )
1064
+ * AND
1065
+ * (
1066
+ * (
1067
+ * confirmed_at >= {$returnExpireDate}
1068
+ * )
1069
+ * OR (
1070
+ * return_phase = 4
1071
  * )
1072
  * )
1073
  */
1074
  $labelsCollection->addFieldToFilter(
1075
+ array('parent_id', 'shipping_phase'),
1076
+ array(
1077
+ array(
1078
+ 'null' => true
1079
+ ),
1080
+ array(
1081
+ 'eq' => $postnlShipmentClass::SHIPPING_PHASE_DELIVERED
1082
+ ),
1083
+ )
1084
+ )
1085
+ ->addFieldToFilter(
1086
+ array('confirmed_at', 'return_phase'),
1087
+ array(
1088
+ array(
1089
+ 'gteq' => $returnExpireDate->format('Y-m-d')
1090
+ ),
1091
+ array(
1092
+ 'eq' => $postnlShipmentClass::SHIPPING_PHASE_DELIVERED
1093
+ )
1094
+ )
1095
+ );
1096
 
1097
  $labelCollectionSize = $labelsCollection->getSize();
1098
  if ($labelCollectionSize < 1) {
1234
 
1235
  return $this;
1236
  }
1237
+
1238
+ /**
1239
+ * Modify the confirm- and delivery dates for all PostNL orders and shipments. These dates are currently entered in
1240
+ * the storeview's timezone. These should be entered in the UTC timezone.
1241
+ *
1242
+ * @return $this
1243
+ */
1244
+ public function updateDateTimeZone()
1245
+ {
1246
+ $helper = Mage::helper('postnl');
1247
+
1248
+ $helper->cronLog($helper->__('UpdateDateTimeZone cron starting...'));
1249
+
1250
+ $data = Mage::getStoreConfig(
1251
+ TIG_PostNL_Model_Resource_Setup::XPATH_UPDATE_DATE_TIME_ZONE_DATA,
1252
+ Mage_Core_Model_App::ADMIN_STORE_ID
1253
+ );
1254
+ if (!$data) {
1255
+ $helper->cronLog($helper->__('No IDs found. Exiting cron.'));
1256
+ return $this;
1257
+ }
1258
+
1259
+ $data = unserialize($data);
1260
+
1261
+ /**
1262
+ * Process the shipments.
1263
+ */
1264
+ if (!empty($data['shipment'])) {
1265
+ $data['shipment'] = $this->_updatePostnlShipmentDateTimeZone($data['shipment']);
1266
+ }
1267
+
1268
+ /**
1269
+ * Process the orders.
1270
+ */
1271
+ if (!empty($data['order'])) {
1272
+ $data['order'] = $this->_updatePostnlOrderDateTimeZone($data['order']);
1273
+ }
1274
+
1275
+ if (empty($data['shipment']) && empty($data['order'])) {
1276
+ /**
1277
+ * All orders and shipments have been processed so we can remove the cron.
1278
+ */
1279
+ $helper->cronLog($helper->__('All orders and shipments have been processed. Removing cron.'));
1280
+
1281
+ Mage::getConfig()->saveConfig(
1282
+ TIG_PostNL_Model_Resource_Setup::XPATH_UPDATE_DATE_TIME_ZONE_DATA,
1283
+ null,
1284
+ 'default',
1285
+ Mage_Core_Model_App::ADMIN_STORE_ID
1286
+ );
1287
+
1288
+ Mage::getModel('core/config_data')
1289
+ ->load(TIG_PostNL_Model_Resource_Setup::UPDATE_DATE_TIME_ZONE_STRING_PATH, 'path')
1290
+ ->setValue(null)
1291
+ ->setPath(TIG_PostNL_Model_Resource_Setup::UPDATE_DATE_TIME_ZONE_STRING_PATH)
1292
+ ->save();
1293
+ }
1294
+
1295
+ Mage::getConfig()->saveConfig(
1296
+ TIG_PostNL_Model_Resource_Setup::XPATH_UPDATE_DATE_TIME_ZONE_DATA,
1297
+ serialize($data),
1298
+ 'default',
1299
+ Mage_Core_Model_App::ADMIN_STORE_ID
1300
+ );
1301
+
1302
+ $helper->cronLog($helper->__('UpdateDateTimeZone cron has finished.'));
1303
+
1304
+ return $this;
1305
+ }
1306
+
1307
+ /**
1308
+ * Update the time zone of the confirm- and delivery date value for PostNL shipments.
1309
+ *
1310
+ * @param array $ids
1311
+ *
1312
+ * @return array
1313
+ */
1314
+ protected function _updatePostnlShipmentDateTimeZone($ids)
1315
+ {
1316
+ /**
1317
+ * Get all PostNL shipments.
1318
+ */
1319
+ $postnlShipments = Mage::getResourceModel('postnl_core/shipment_collection');
1320
+ $postnlShipments->addFieldToFilter('entity_id', array('in' => $ids));
1321
+ $postnlShipments->getSelect()->limit(100);
1322
+
1323
+ $helper = Mage::helper('postnl');
1324
+
1325
+ foreach ($postnlShipments as $postnlShipment) {
1326
+ $helper->cronLog($helper->__('Updating shipment ID: %s', $postnlShipment->getId()));
1327
+
1328
+ /**
1329
+ * Remove this shipment's ID from the IDs array. Even if it fails for this shipment, we don't want to try
1330
+ * again.
1331
+ */
1332
+ $key = array_search($postnlShipment->getId(), $ids);
1333
+ if($key !== false) {
1334
+ unset($ids[$key]);
1335
+ }
1336
+
1337
+ /**
1338
+ * Get the shipment's timezone.
1339
+ */
1340
+ $timeZone = $this->getTimeZone($postnlShipment->getStoreId());
1341
+
1342
+ /**
1343
+ * Get the confirm and delivery dates in their current timezone (whichever timezone the storeview is in).
1344
+ */
1345
+ $confirmDate = $postnlShipment->getConfirmDate();
1346
+ $deliveryDate = $postnlShipment->getDeliveryDate();
1347
+
1348
+ /**
1349
+ * Modify the dates to the UTC timezone.
1350
+ */
1351
+ $confirmDateTime = new DateTime($confirmDate, new DateTimeZone($timeZone));
1352
+ $confirmDateTime->setTimezone(new DateTimeZone('UTC'));
1353
+
1354
+ $deliveryDateTime = new DateTime($deliveryDate, new DateTimeZone($timeZone));
1355
+ $deliveryDateTime->setTimezone(new DateTimeZone('UTC'));
1356
+
1357
+ /**
1358
+ * Update the dates.
1359
+ */
1360
+ $postnlShipment->setConfirmDate($confirmDateTime->getTimestamp())
1361
+ ->setDeliveryDate($deliveryDateTime->getTimestamp());
1362
+
1363
+ /**
1364
+ * Save the shipment.
1365
+ */
1366
+ try {
1367
+ $postnlShipment->save();
1368
+ } catch (Exception $e) {
1369
+ $helper->cronLog($helper->__('Updating shipment ID %s failed.', $postnlShipment->getId()));
1370
+ $helper->logException($e);
1371
+ }
1372
+ }
1373
+
1374
+ return $ids;
1375
+ }
1376
+
1377
+ /**
1378
+ * Update the time zone of the confirm- and delivery date value for PostNL orders.
1379
+ *
1380
+ * @param array $ids
1381
+ *
1382
+ * @return array
1383
+ */
1384
+ protected function _updatePostnlOrderDateTimeZone($ids)
1385
+ {
1386
+ /**
1387
+ * Get all PostNL shipments.
1388
+ */
1389
+ $postnlOrders = Mage::getResourceModel('postnl_core/order_collection');
1390
+ $postnlOrders->addFieldToFilter('entity_id', array('in' => $ids));
1391
+ $postnlOrders->getSelect()->limit(100);
1392
+
1393
+ $helper = Mage::helper('postnl');
1394
+
1395
+ foreach ($postnlOrders as $postnlOrder) {
1396
+ $helper->cronLog($helper->__('Updating order ID: %s', $postnlOrder->getId()));
1397
+
1398
+ /**
1399
+ * Remove this order's ID from the IDs array. Even if it fails for this shipment, we don't want to try
1400
+ * again.
1401
+ */
1402
+ $key = array_search($postnlOrder->getId(), $ids);
1403
+ if($key !== false) {
1404
+ unset($ids[$key]);
1405
+ }
1406
+
1407
+ /**
1408
+ * Get the order's timezone.
1409
+ */
1410
+ $timeZone = $this->getTimeZone($postnlOrder->getStoreId());
1411
+
1412
+ /**
1413
+ * Get the confirm and delivery dates in their current timezone (whichever timezone the storeview is in).
1414
+ */
1415
+ $confirmDate = $postnlOrder->getConfirmDate();
1416
+ $deliveryDate = $postnlOrder->getDeliveryDate();
1417
+
1418
+ /**
1419
+ * Modify the dates to the UTC timezone.
1420
+ */
1421
+ $confirmDateTime = new DateTime($confirmDate, new DateTimeZone($timeZone));
1422
+ $confirmDateTime->setTimezone(new DateTimeZone('UTC'));
1423
+
1424
+ $deliveryDateTime = new DateTime($deliveryDate, new DateTimeZone($timeZone));
1425
+ $deliveryDateTime->setTimezone(new DateTimeZone('UTC'));
1426
+
1427
+ /**
1428
+ * Update the dates.
1429
+ */
1430
+ $postnlOrder->setConfirmDate($confirmDateTime->getTimestamp())
1431
+ ->setDeliveryDate($deliveryDateTime->getTimestamp());
1432
+
1433
+ /**
1434
+ * Save the order.
1435
+ */
1436
+ try {
1437
+ $postnlOrder->save();
1438
+ } catch (Exception $e) {
1439
+ $helper->cronLog($helper->__('Updating order ID %s failed.', $postnlOrder->getId()));
1440
+ $helper->logException($e);
1441
+ }
1442
+ }
1443
+
1444
+ return $ids;
1445
+ }
1446
+
1447
+ /**
1448
+ * Check the integrity of the PostNL order and shipment data.
1449
+ *
1450
+ * @return $this
1451
+ *
1452
+ * @throws Exception
1453
+ */
1454
+ public function integrityCheck()
1455
+ {
1456
+ $helper = Mage::helper('postnl');
1457
+
1458
+ /**
1459
+ * Check if the PostNL module is active
1460
+ */
1461
+ if (!$helper->isEnabled()) {
1462
+ return $this;
1463
+ }
1464
+
1465
+ $helper->cronLog($helper->__('IntegrityCheck cron starting...'));
1466
+
1467
+ $integrityCheckModel = Mage::getModel('postnl_core/service_integrityCheck');
1468
+ try {
1469
+ $errors = $integrityCheckModel->integrityCheck();
1470
+
1471
+ if (!empty($errors)) {
1472
+ $helper->cronLog($helper->__('The following errors were found: %s', var_export($errors, true)));
1473
+ } else {
1474
+ $helper->cronLog($helper->__('No errors found.'));
1475
+ }
1476
+
1477
+ Mage::getResourceSingleton('postnl_core/integrity')->saveIntegrityCheckResults($errors);
1478
+
1479
+ $helper->cronLog($helper->__('Results have been saved.'));
1480
+ } catch (Exception $e) {
1481
+ $helper->cronLog($helper->__("An error occurred while checking the PostNL extension's data integrity."));
1482
+ $helper->logException($e);
1483
+ }
1484
+
1485
+ $helper->cronLog($helper->__('IntegrityCheck cron has finished.'));
1486
+
1487
+ return $this;
1488
+ }
1489
  }
app/code/community/TIG/PostNL/Model/Core/Observer/Returns.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Observer_Returns
40
+ {
41
+ /**
42
+ * The block we want to edit's class.
43
+ */
44
+ const ORDER_INFO_BLOCK_CLASS = 'sales/order_info';
45
+
46
+ /**
47
+ * @var string
48
+ */
49
+ protected $_blockClassName = '';
50
+
51
+ /**
52
+ * @var bool
53
+ */
54
+ protected $_processed = false;
55
+
56
+ /**
57
+ * @return string
58
+ */
59
+ public function getBlockClassName()
60
+ {
61
+ $className = $this->_blockClassName;
62
+ if (!empty($className)) {
63
+ return $className;
64
+ }
65
+
66
+ $className = Mage::getConfig()->getBlockClassName(self::ORDER_INFO_BLOCK_CLASS);
67
+
68
+ $this->setBlockClassName($className);
69
+ return $className;
70
+ }
71
+
72
+ /**
73
+ * @param string $blackClassName
74
+ *
75
+ * @return $this
76
+ */
77
+ public function setBlockClassName($blackClassName)
78
+ {
79
+ $this->_blockClassName = $blackClassName;
80
+
81
+ return $this;
82
+ }
83
+
84
+ /**
85
+ * @return boolean
86
+ */
87
+ public function isProcessed()
88
+ {
89
+ return $this->_processed;
90
+ }
91
+
92
+ /**
93
+ * @param boolean $processed
94
+ *
95
+ * @return $this
96
+ */
97
+ public function setProcessed($processed)
98
+ {
99
+ $this->_processed = $processed;
100
+
101
+ return $this;
102
+ }
103
+
104
+ /**
105
+ * Add a link to the PostNL returns page to the sales/order/view page.
106
+ *
107
+ * @param Varien_Event_Observer $observer
108
+ *
109
+ * @return $this
110
+ *
111
+ * @event core_block_abstract_to_html_before
112
+ *
113
+ * @observer returns_view_link
114
+ */
115
+ public function addReturnLinkToAccount(Varien_Event_Observer $observer)
116
+ {
117
+ if ($this->isProcessed()) {
118
+ return $this;
119
+ }
120
+
121
+ /**
122
+ * Check if this block is the block we need to edit.
123
+ */
124
+ $block = $observer->getBlock();
125
+ $blockClassName = $this->getBlockClassName();
126
+ if (!($block instanceof $blockClassName)) {
127
+ return $this;
128
+ }
129
+
130
+ /**
131
+ * @var Mage_Sales_Block_Order_Info $block
132
+ */
133
+
134
+ /**
135
+ * If the link was already added through layout.xml we don't have to add it again.
136
+ */
137
+ $links = $block->getLinks();
138
+ if (isset($links['postnl_returns'])) {
139
+ return $this;
140
+ }
141
+
142
+ $helper = Mage::helper('postnl');
143
+
144
+ /**
145
+ * Check if printing return labels is allowed for the current order.
146
+ */
147
+ if (!$helper->canPrintReturnLabelForOrder(Mage::registry('current_order'))) {
148
+ return $this;
149
+ }
150
+
151
+ /**
152
+ * Add the link.
153
+ */
154
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
155
+ $block->addLink(
156
+ 'postnl_returns',
157
+ 'postnl/order/returns',
158
+ $helper->__('Returns')
159
+ );
160
+ } else {
161
+ $block->addLink(
162
+ 'postnl_returns',
163
+ 'postnl/guest/returns',
164
+ $helper->__('Returns')
165
+ );
166
+ }
167
+
168
+ $this->setProcessed(true);
169
+ return $this;
170
+ }
171
+ }
app/code/community/TIG/PostNL/Model/Core/Order.php CHANGED
@@ -53,6 +53,8 @@
53
  * @method string getMobilePhoneNumber()
54
  * @method int getIsPakketautomaat()
55
  * @method array|boolean getUnserializedOptions()
 
 
56
  *
57
  * @method TIG_PostNL_Model_Core_Order setIsPakketautomaat(int $value)
58
  * @method TIG_PostNL_Model_Core_Order setEntityId(int $value)
@@ -71,6 +73,9 @@
71
  * @method TIG_PostNL_Model_Core_Order setConfirmDate(string $value)
72
  * @method TIG_PostNL_Model_Core_Order setPakjeGemakAddress(mixed $value)
73
  * @method TIG_PostNL_Model_Core_Order setUnserializedOptions(array $value)
 
 
 
74
  *
75
  * @method boolean hasOrderId()
76
  * @method boolean hasQuoteId()
@@ -79,6 +84,9 @@
79
  * @method boolean hasDeliveryDate()
80
  * @method boolean hasUnserializedOptions()
81
  * @method boolean hasOptions()
 
 
 
82
  */
83
  class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
84
  {
@@ -121,6 +129,29 @@ class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
121
  return $this->_pakjeGemakTypes;
122
  }
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  /**
125
  * Gets the order associated with this PostNL Checkout Order.
126
  *
53
  * @method string getMobilePhoneNumber()
54
  * @method int getIsPakketautomaat()
55
  * @method array|boolean getUnserializedOptions()
56
+ * @method string getExpectedDeliveryTimeStart()
57
+ * @method string getExpectedDeliveryTimeEnd()
58
  *
59
  * @method TIG_PostNL_Model_Core_Order setIsPakketautomaat(int $value)
60
  * @method TIG_PostNL_Model_Core_Order setEntityId(int $value)
73
  * @method TIG_PostNL_Model_Core_Order setConfirmDate(string $value)
74
  * @method TIG_PostNL_Model_Core_Order setPakjeGemakAddress(mixed $value)
75
  * @method TIG_PostNL_Model_Core_Order setUnserializedOptions(array $value)
76
+ * @method TIG_PostNL_Model_Core_Order setExpectedDeliveryTimeStart(string $value)
77
+ * @method TIG_PostNL_Model_Core_Order setExpectedDeliveryTimeEnd(string $value)
78
+ * @method TIG_PostNL_Model_Core_Order setStoreId(int $value)
79
  *
80
  * @method boolean hasOrderId()
81
  * @method boolean hasQuoteId()
84
  * @method boolean hasDeliveryDate()
85
  * @method boolean hasUnserializedOptions()
86
  * @method boolean hasOptions()
87
+ * @method boolean hasExpectedDeliveryTimeStart()
88
+ * @method boolean hasExpectedDeliveryTimeEnd()
89
+ * @method boolean hasStoreId()
90
  */
91
  class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
92
  {
129
  return $this->_pakjeGemakTypes;
130
  }
131
 
132
+ /**
133
+ * Get this PostNL order's store ID.
134
+ *
135
+ * @return int
136
+ */
137
+ public function getStoreId()
138
+ {
139
+ if ($this->hasStoreId()) {
140
+ return $this->_getData('store_id');
141
+ }
142
+
143
+ if ($this->hasOrderId()) {
144
+ $storeId = $this->getOrder()->getStoreId();
145
+ } elseif ($this->hasQuoteId()) {
146
+ $storeId = $this->getQuote()->getStoreId();
147
+ } else {
148
+ $storeId = Mage::app()->getStore()->getId();
149
+ }
150
+
151
+ $this->setStoreId($storeId);
152
+ return $storeId;
153
+ }
154
+
155
  /**
156
  * Gets the order associated with this PostNL Checkout Order.
157
  *
app/code/community/TIG/PostNL/Model/Core/PackingSlip.php CHANGED
@@ -938,7 +938,7 @@ class TIG_PostNL_Model_Core_PackingSlip extends Mage_Sales_Model_Order_Pdf_Abstr
938
  if ($showBillingAddress && $billingAddress) {
939
  foreach ($billingAddress as $value){
940
  if ($value !== '') {
941
- foreach ($this->getStringHelper()->str_split($value, 20, true, true) as $part) {
942
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
943
  $this->y -= 10;
944
  }
@@ -954,7 +954,7 @@ class TIG_PostNL_Model_Core_PackingSlip extends Mage_Sales_Model_Order_Pdf_Abstr
954
  $this->y = $addressesStartY;
955
  foreach ($shippingAddress as $value){
956
  if ($value!=='') {
957
- foreach ($this->getStringHelper()->str_split($value, 20, true, true) as $part) {
958
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
959
  $this->y -= 10;
960
  }
@@ -972,7 +972,7 @@ class TIG_PostNL_Model_Core_PackingSlip extends Mage_Sales_Model_Order_Pdf_Abstr
972
  foreach ($pakjeGemakAddress as $value){
973
  if ($value!=='') {
974
  $text = array();
975
- foreach ($this->getStringHelper()->str_split($value, 20, true, true) as $part) {
976
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
977
  $this->y -= 10;
978
  }
938
  if ($showBillingAddress && $billingAddress) {
939
  foreach ($billingAddress as $value){
940
  if ($value !== '') {
941
+ foreach ($this->getStringHelper()->str_split($value, 33, true, true) as $part) {
942
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
943
  $this->y -= 10;
944
  }
954
  $this->y = $addressesStartY;
955
  foreach ($shippingAddress as $value){
956
  if ($value!=='') {
957
+ foreach ($this->getStringHelper()->str_split($value, 33, true, true) as $part) {
958
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
959
  $this->y -= 10;
960
  }
972
  foreach ($pakjeGemakAddress as $value){
973
  if ($value!=='') {
974
  $text = array();
975
+ foreach ($this->getStringHelper()->str_split($value, 45, true, true) as $part) {
976
  $page->drawText(strip_tags(ltrim($part)), $addressX, $this->y, 'UTF-8');
977
  $this->y -= 10;
978
  }
app/code/community/TIG/PostNL/Model/Core/Resource/Integrity.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Resource_Integrity extends TIG_PostNL_Model_Resource_Db_Abstract
40
+ {
41
+ /**
42
+ * Initialize PostNL integrity model.
43
+ */
44
+ public function _construct()
45
+ {
46
+ $this->_init('postnl_core/integrity', 'integrity_id');
47
+ }
48
+
49
+ /**
50
+ * Save the results of an integrity check.
51
+ *
52
+ * @param array $data
53
+ *
54
+ * @return $this
55
+ */
56
+ public function saveIntegrityCheckResults(array $data)
57
+ {
58
+ $adapter = $this->_getWriteAdapter();
59
+ $adapter->truncateTable($this->getMainTable());
60
+
61
+ if (empty($data)) {
62
+ return $this;
63
+ }
64
+
65
+ $insertData = array();
66
+ foreach ($data as $entityType => $entityData) {
67
+ if (!is_array($entityData)) {
68
+ continue;
69
+ }
70
+
71
+ foreach ($entityData as $error) {
72
+ if (!isset($error['id']) || !isset($error['error_code'])) {
73
+ continue;
74
+ }
75
+
76
+ $insertData[] = array(
77
+ 'entity_type' => $entityType,
78
+ 'entity_id' => $error['id'],
79
+ 'error_code' => $error['error_code'],
80
+ );
81
+ }
82
+ }
83
+
84
+ $adapter->insertMultiple($this->getMainTable(), $insertData);
85
+
86
+ return $this;
87
+ }
88
+ }
app/code/community/TIG/PostNL/Model/Core/Resource/Integrity/Collection.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Resource_Integrity_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
40
+ {
41
+ /**
42
+ * Event prefix
43
+ *
44
+ * @var string
45
+ */
46
+ protected $_eventPrefix = 'postnl_integrity_collection';
47
+
48
+ /**
49
+ * Event object
50
+ *
51
+ * @var string
52
+ */
53
+ protected $_eventObject = 'postnl_integrity_collection';
54
+
55
+ public function _construct()
56
+ {
57
+ parent::_construct();
58
+ $this->_init('postnl_core/integrity');
59
+ }
60
+ }
app/code/community/TIG/PostNL/Model/Core/Resource/Order.php CHANGED
@@ -45,4 +45,22 @@ class TIG_PostNL_Model_Core_Resource_Order extends TIG_PostNL_Model_Resource_Db_
45
  {
46
  $this->_init('postnl_core/order', 'entity_id');
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
45
  {
46
  $this->_init('postnl_core/order', 'entity_id');
47
  }
48
+
49
+ /**
50
+ * Gets the quote ID for the specified order ID.
51
+ *
52
+ * @param int $orderId
53
+ *
54
+ * @return string
55
+ */
56
+ public function getOrderQuoteId($orderId)
57
+ {
58
+ $adapter = $this->getReadConnection();
59
+ $bind = array(':order_id' => $orderId);
60
+ $select = $adapter->select()
61
+ ->from($this->getTable('sales/order'), array('quote_id'))
62
+ ->where('entity_id = :order_id');
63
+
64
+ return $adapter->fetchOne($select, $bind);
65
+ }
66
  }
app/code/community/TIG/PostNL/Model/Core/Resource/Shipment.php CHANGED
@@ -42,4 +42,22 @@ class TIG_PostNL_Model_Core_Resource_Shipment extends TIG_PostNL_Model_Resource_
42
  {
43
  $this->_init('postnl_core/shipment', 'entity_id');
44
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
42
  {
43
  $this->_init('postnl_core/shipment', 'entity_id');
44
  }
45
+
46
+ /**
47
+ * Gets the order ID for the specified shipment ID.
48
+ *
49
+ * @param int $shipmentId
50
+ *
51
+ * @return string
52
+ */
53
+ public function getShipmentOrderId($shipmentId)
54
+ {
55
+ $adapter = $this->getReadConnection();
56
+ $bind = array(':shipment_id' => $shipmentId);
57
+ $select = $adapter->select()
58
+ ->from($this->getTable('sales/shipment'), array('order_id'))
59
+ ->where('entity_id = :shipment_id');
60
+
61
+ return $adapter->fetchOne($select, $bind);
62
+ }
63
  }
app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Status/History/Collection.php CHANGED
@@ -36,7 +36,8 @@
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  */
39
- class TIG_PostNL_Model_Core_Resource_Shipment_Status_History_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
 
40
  {
41
  /**
42
  * Event prefix
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  */
39
+ class TIG_PostNL_Model_Core_Resource_Shipment_Status_History_Collection
40
+ extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
41
  {
42
  /**
43
  * Event prefix
app/code/community/TIG/PostNL/Model/Core/Service.php CHANGED
@@ -160,6 +160,12 @@ class TIG_PostNL_Model_Core_Service
160
 
161
  $convertor = Mage::getModel('sales/convert_order');
162
 
 
 
 
 
 
 
163
  $dummyOrder = Mage::getModel('postnl_core/service_orderDummy');
164
  $dummyOrder->setData($order->getData())
165
  ->setSubtotalInvoiced(0)
@@ -167,7 +173,8 @@ class TIG_PostNL_Model_Core_Service
167
  ->setTaxInvoiced(0)
168
  ->setHiddenTaxInvoiced(0)
169
  ->setBaseTaxInvoiced(0)
170
- ->setBaseHiddenTaxInvoiced(0);
 
171
 
172
  $invoice = Mage::getModel('postnl_core/service_invoiceDummy');
173
  $invoice->setOrder($dummyOrder)
160
 
161
  $convertor = Mage::getModel('sales/convert_order');
162
 
163
+ $dummyPaymentMethod = Mage::getModel('postnl_core/service_paymentMethodDummy');
164
+
165
+ $dummyPayment = Mage::getModel('postnl_core/service_paymentDummy');
166
+ $dummyPayment->setMethod('postnl_dummy')
167
+ ->setMethodInstance($dummyPaymentMethod);
168
+
169
  $dummyOrder = Mage::getModel('postnl_core/service_orderDummy');
170
  $dummyOrder->setData($order->getData())
171
  ->setSubtotalInvoiced(0)
173
  ->setTaxInvoiced(0)
174
  ->setHiddenTaxInvoiced(0)
175
  ->setBaseTaxInvoiced(0)
176
+ ->setBaseHiddenTaxInvoiced(0)
177
+ ->setPayment($dummyPayment);
178
 
179
  $invoice = Mage::getModel('postnl_core/service_invoiceDummy');
180
  $invoice->setOrder($dummyOrder)
app/code/community/TIG/PostNL/Model/Core/Service/IntegrityCheck.php ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Service_IntegrityCheck
40
+ {
41
+ /**
42
+ * Error codes that may be detected by the integrity check.
43
+ */
44
+ const ERROR_MISSING_MAGENTO_ORDER = 'POSTNL-0214';
45
+ const ERROR_MISSING_MAGENTO_QUOTE = 'POSTNL-0215';
46
+ const ERROR_MISSING_MAGENTO_SHIPMENT = 'POSTNL-0216';
47
+ const ERROR_QUOTE_MISMATCH = 'POSTNL-0217';
48
+ const ERROR_ORDER_MISMATCH = 'POSTNL-0218';
49
+
50
+ /**
51
+ * @var array
52
+ */
53
+ protected $_errors = array();
54
+
55
+ /**
56
+ * @return array
57
+ */
58
+ public function getErrors()
59
+ {
60
+ return $this->_errors;
61
+ }
62
+
63
+ /**
64
+ * @param array $errors
65
+ *
66
+ * @return $this
67
+ */
68
+ public function setErrors($errors)
69
+ {
70
+ $this->_errors = $errors;
71
+
72
+ return $this;
73
+ }
74
+
75
+ /**
76
+ * @param string $type
77
+ * @param array $error
78
+ *
79
+ * @return $this
80
+ */
81
+ public function addError($type, array $error)
82
+ {
83
+ $errors = $this->getErrors();
84
+ $errors[$type][] = $error;
85
+
86
+ $this->setErrors($errors);
87
+ return $this;
88
+ }
89
+
90
+ /**
91
+ * Check the integrity of the PostNL tables. This is done to prevent the deletion of orders, quotes, shipments etc.
92
+ * from causing errors.
93
+ *
94
+ * @return array
95
+ */
96
+ public function integrityCheck()
97
+ {
98
+ $this->validatePostnlOrderIntegrity();
99
+ $this->validatePostnlShipmentIntegrity();
100
+
101
+ $errors = $this->getErrors();
102
+
103
+ return $errors;
104
+ }
105
+
106
+ /**
107
+ * Check the integrity of PostNL orders.
108
+ *
109
+ * @return $this
110
+ */
111
+ public function validatePostnlOrderIntegrity()
112
+ {
113
+ $resource = Mage::getSingleton('core/resource');
114
+
115
+ $postnlOrderCollection = Mage::getResourceModel('postnl_core/order_collection')
116
+ ->addFieldToSelect(array('entity_id', 'quote_id', 'order_id'));
117
+
118
+ $select = $postnlOrderCollection->getSelect();
119
+
120
+ /**
121
+ * Join sales_flat_order table.
122
+ */
123
+ $select->joinLeft(
124
+ array('order' => $resource->getTableName('sales/order')),
125
+ '`main_table`.`order_id`=`order`.`entity_id`',
126
+ array(
127
+ 'magento_order_id' => 'order.entity_id',
128
+ )
129
+ );
130
+
131
+ /**
132
+ * Join sales_flat_quote table.
133
+ */
134
+ $select->joinLeft(
135
+ array('quote' => $resource->getTableName('sales/quote')),
136
+ '`main_table`.`quote_id`=`quote`.`entity_id`',
137
+ array(
138
+ 'magento_quote_id' => 'quote.entity_id',
139
+ )
140
+ );
141
+
142
+ foreach ($postnlOrderCollection as $postnlOrder) {
143
+ if ($postnlOrder->hasOrderId()) {
144
+ $this->_validateOrderId($postnlOrder);
145
+ }
146
+
147
+ if ($postnlOrder->hasQuoteId()) {
148
+ $this->_validateQuoteId($postnlOrder);
149
+ }
150
+ }
151
+
152
+ return $this;
153
+ }
154
+
155
+ /**
156
+ * Check the integrity of PostNL shipments.
157
+ *
158
+ * @return $this
159
+ */
160
+ public function validatePostnlShipmentIntegrity()
161
+ {
162
+ $resource = Mage::getSingleton('core/resource');
163
+
164
+ $postnlShipmentCollection = Mage::getResourceModel('postnl_core/shipment_collection')
165
+ ->addFieldToSelect(array('entity_id', 'shipment_id', 'order_id'));
166
+
167
+ $select = $postnlShipmentCollection->getSelect();
168
+
169
+ /**
170
+ * Join sales_flat_shipment table.
171
+ */
172
+ $select->joinLeft(
173
+ array('shipment' => $resource->getTableName('sales/shipment')),
174
+ '`main_table`.`shipment_id`=`shipment`.`entity_id`',
175
+ array(
176
+ 'magento_shipment_id' => 'shipment.entity_id',
177
+ )
178
+ );
179
+
180
+ /**
181
+ * Join sales_flat_order table.
182
+ */
183
+ $select->joinLeft(
184
+ array('order' => $resource->getTableName('sales/order')),
185
+ '`main_table`.`order_id`=`order`.`entity_id`',
186
+ array(
187
+ 'magento_order_id' => 'order.entity_id',
188
+ )
189
+ );
190
+
191
+ foreach ($postnlShipmentCollection as $postnlShipment) {
192
+ if ($postnlShipment->hasOrderId()) {
193
+ $this->_validateOrderId($postnlShipment);
194
+ }
195
+
196
+ if ($postnlShipment->hasShipmentId()) {
197
+ $this->_validateShipmentId($postnlShipment);
198
+ }
199
+ }
200
+
201
+ return $this;
202
+ }
203
+
204
+ /**
205
+ * Validate the order ID of a PostNL order or shipment.
206
+ *
207
+ * @param TIG_PostNL_Model_Core_Order|TIG_PostNL_Model_Core_Shipment $postnlObject
208
+ *
209
+ * @return bool
210
+ */
211
+ protected function _validateOrderId($postnlObject)
212
+ {
213
+ if (!$postnlObject->getData('magento_order_id')) {
214
+ if ($postnlObject instanceof TIG_PostNL_Model_Core_Order) {
215
+ $type = 'postnl_core/order';
216
+ } else {
217
+ $type = 'postnl_core/shipment';
218
+ }
219
+
220
+ $this->addError(
221
+ $type,
222
+ array(
223
+ 'id' => $postnlObject->getId(),
224
+ 'error_code' => self::ERROR_MISSING_MAGENTO_ORDER
225
+ )
226
+ );
227
+ return false;
228
+ }
229
+
230
+ if (
231
+ ($postnlObject instanceof TIG_PostNL_Model_Core_Order)
232
+ && $postnlObject->hasQuoteId()
233
+ ) {
234
+ $orderId = $postnlObject->getOrderId();
235
+ $quoteId = $postnlObject->getQuoteId();
236
+ $orderQuoteId = Mage::getResourceSingleton('postnl_core/order')->getOrderQuoteId($orderId);
237
+
238
+ if ($quoteId != $orderQuoteId) {
239
+ $this->addError(
240
+ 'postnl_core/order',
241
+ array(
242
+ 'id' => $postnlObject->getId(),
243
+ 'error_code' => self::ERROR_QUOTE_MISMATCH
244
+ )
245
+ );
246
+ return false;
247
+ }
248
+ }
249
+ return true;
250
+ }
251
+
252
+ /**
253
+ * Validate the quote ID of a PostNL order.
254
+ *
255
+ * @param TIG_PostNL_Model_Core_Order $postnlOrder
256
+ *
257
+ * @return bool
258
+ */
259
+ protected function _validateQuoteId(TIG_PostNL_Model_Core_Order $postnlOrder)
260
+ {
261
+ if (!$postnlOrder->getData('magento_quote_id')) {
262
+ $this->addError(
263
+ 'postnl_core/order',
264
+ array(
265
+ 'id' => $postnlOrder->getId(),
266
+ 'error_code' => self::ERROR_MISSING_MAGENTO_QUOTE
267
+ )
268
+ );
269
+ return false;
270
+ }
271
+
272
+ return true;
273
+ }
274
+
275
+ /**
276
+ * Validate the shipment ID of a PostNL shipment.
277
+ *
278
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
279
+ *
280
+ * @return bool
281
+ */
282
+ protected function _validateShipmentId(TIG_PostNL_Model_Core_Shipment $postnlShipment)
283
+ {
284
+ if (!$postnlShipment->getData('magento_shipment_id')) {
285
+ $this->addError(
286
+ 'postnl_core/shipment',
287
+ array(
288
+ 'id' => $postnlShipment->getId(),
289
+ 'error_code' => self::ERROR_MISSING_MAGENTO_SHIPMENT
290
+ )
291
+ );
292
+ return false;
293
+ }
294
+
295
+ $shipmentId = $postnlShipment->getShipmentId();
296
+ $orderId = $postnlShipment->getOrderId();
297
+ $shipmentOrderId = Mage::getResourceSingleton('postnl_core/shipment')->getShipmentOrderId($shipmentId);
298
+
299
+ if ($orderId != $shipmentOrderId) {
300
+ $this->addError(
301
+ 'postnl_core/shipment',
302
+ array(
303
+ 'id' => $postnlShipment->getId(),
304
+ 'error_code' => self::ERROR_ORDER_MISMATCH
305
+ )
306
+ );
307
+ return false;
308
+ }
309
+
310
+ return true;
311
+ }
312
+ }
app/code/community/TIG/PostNL/Model/Core/Service/PaymentDummy.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Service_PaymentDummy extends Mage_Sales_Model_Order_Payment
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_eventPrefix = 'postnl_dummy_payment';
45
+
46
+ /**
47
+ * @return bool
48
+ */
49
+ public function canCapture()
50
+ {
51
+ return false;
52
+ }
53
+
54
+ /**
55
+ * @return bool
56
+ */
57
+ public function canVoid(Varien_Object $document)
58
+ {
59
+ return false;
60
+ }
61
+
62
+ /**
63
+ * @return bool
64
+ */
65
+ public function canRefund()
66
+ {
67
+ return false;
68
+ }
69
+
70
+ /**
71
+ * @return bool
72
+ */
73
+ public function canRefundPartialPerInvoice()
74
+ {
75
+ return false;
76
+ }
77
+
78
+ /**
79
+ * @return bool
80
+ */
81
+ public function canCapturePartial()
82
+ {
83
+ return false;
84
+ }
85
+
86
+ /**
87
+ * @return bool
88
+ */
89
+ public function canReviewPayment()
90
+ {
91
+ return false;
92
+ }
93
+
94
+ /**
95
+ * @return bool
96
+ */
97
+ public function canFetchTransactionInfo()
98
+ {
99
+ return false;
100
+ }
101
+ }
app/code/community/TIG/PostNL/Model/Core/Service/PaymentMethodDummy.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_Service_PaymentMethodDummy extends Mage_Payment_Model_Method_Abstract
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_eventPrefix = 'postnl_dummy_payment_method';
45
+
46
+ /**
47
+ * @var string
48
+ */
49
+ protected $_code = 'postnl_dummy';
50
+
51
+ /**
52
+ * Payment Method features
53
+ * @var bool
54
+ */
55
+ protected $_isGateway = false;
56
+ /**
57
+ * @var bool
58
+ */
59
+ protected $_canOrder = false;
60
+ /**
61
+ * @var bool
62
+ */
63
+ protected $_canAuthorize = false;
64
+ /**
65
+ * @var bool
66
+ */
67
+ protected $_canCapture = false;
68
+ /**
69
+ * @var bool
70
+ */
71
+ protected $_canCapturePartial = false;
72
+ /**
73
+ * @var bool
74
+ */
75
+ protected $_canCaptureOnce = false;
76
+ /**
77
+ * @var bool
78
+ */
79
+ protected $_canRefund = false;
80
+ /**
81
+ * @var bool
82
+ */
83
+ protected $_canRefundInvoicePartial = false;
84
+ /**
85
+ * @var bool
86
+ */
87
+ protected $_canVoid = false;
88
+ /**
89
+ * @var bool
90
+ */
91
+ protected $_canUseInternal = false;
92
+ /**
93
+ * @var bool
94
+ */
95
+ protected $_canUseCheckout = false;
96
+ /**
97
+ * @var bool
98
+ */
99
+ protected $_canUseForMultishipping = false;
100
+ /**
101
+ * @var bool
102
+ */
103
+ protected $_isInitializeNeeded = false;
104
+ /**
105
+ * @var bool
106
+ */
107
+ protected $_canFetchTransactionInfo = false;
108
+ /**
109
+ * @var bool
110
+ */
111
+ protected $_canReviewPayment = false;
112
+ /**
113
+ * @var bool
114
+ */
115
+ protected $_canCreateBillingAgreement = false;
116
+ /**
117
+ * @var bool
118
+ */
119
+ protected $_canManageRecurringProfiles = false;
120
+ }
app/code/community/TIG/PostNL/Model/Core/Shipment.php CHANGED
@@ -44,6 +44,8 @@
44
  * Supported events:
45
  * - postnl_shipment_generatebarcode_before
46
  * - postnl_shipment_generatebarcode_after
 
 
47
  * - postnl_shipment_generatelabel_before
48
  * - postnl_shipment_generatelabel_after
49
  * - postnl_shipment_register_confirmation_before
@@ -59,16 +61,24 @@
59
  * - postnl_shipment_updateshippingphase_before
60
  * - postnl_shipment_updateshippingphase_after
61
  * - postnl_shipment_setshippingphase_*
 
 
 
 
 
62
  * - postnl_shipment_savelabels_before
63
  * - postnl_shipment_savelabels_after
64
  * - postnl_shipment_saveadditionaloptions_after
65
  * - postnl_shipment_add_track_and_trace_email_vars
66
  * - postnl_shipment_send_track_and_trace_email_before
67
  * - postnl_shipment_send_track_and_trace_email_after
 
 
 
68
  *
69
- * @method bool getIsDutchShipment()
70
- * @method bool getIsEuShipment()
71
- * @method bool getIsGlobalShipment()
72
  * @method int getParcelCount()
73
  * @method string|null getConfirmedStatus
74
  * @method string getStatusHistoryUpdatedAt()
@@ -86,7 +96,11 @@
86
  * @method int|null getShipmentId
87
  * @method int getLabelsPrinted()
88
  * @method bool|int getIsPakketautomaat()
89
- * @method bool getIsBuspakjeShipment()
 
 
 
 
90
  *
91
  * @method TIG_PostNL_Model_Core_Shipment setLabelsPrinted(int $value)
92
  * @method TIG_PostNL_Model_Core_Shipment setTreatAsAbandoned(int $value)
@@ -119,32 +133,43 @@
119
  * @method TIG_PostNL_Model_Core_Shipment setShipmentIncrementId(string $value)
120
  * @method TIG_PostNL_Model_Core_Shipment setIsBuspakjeShipment(bool $value)
121
  * @method TIG_PostNL_Model_Core_Shipment setDefaultProductCode(string $value)
122
- * @method TIG_PostNL_Model_Core_Shipment setLabels(array $value)
123
  * @method TIG_PostNL_Model_Core_Shipment setProductOption(string $value)
124
  * @method TIG_PostNL_Model_Core_Shipment setPayment(Mage_Sales_Model_Order_Payment $value)
 
 
 
 
 
125
  *
126
- * @method bool hasBarcodeUrl()
127
- * @method bool hasPostnlOrder()
128
- * @method bool hasShipment()
129
- * @method bool hasShipmentBaseGrandTotal()
130
- * @method bool hasGlobalpackShipmentType()
131
- * @method bool hasProductCode()
132
- * @method bool hasShippingAddress()
133
- * @method bool hasPakjeGemakAddress()
134
- * @method bool hasStoreId()
135
- * @method bool hasOrderId()
136
- * @method bool hasExtraCoverAmount()
137
- * @method bool hasLabelCollection()
138
- * @method bool hasIsPakketautomaat()
139
- * @method bool hasDeliveryDate()
140
- * @method bool hasShipmentType()
141
- * @method bool hasOrder()
142
- * @method bool hasMainBarcode()
143
- * @method bool hasShipmentIncrementId()
144
- * @method bool hasIsBuspakjeShipment()
145
- * @method bool hasDefaultProductCode()
146
- * @method bool hasProductOption()
147
- * @method bool hasPayment()
 
 
 
 
 
 
148
  */
149
  class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
150
  {
@@ -235,6 +260,11 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
235
  */
236
  const XPATH_DEFAULT_SHIPMENT_TYPE = 'postnl/cif_globalpack_settings/default_shipment_type';
237
 
 
 
 
 
 
238
  /**
239
  * CIF warning code returned when an EPS combi label is not available.
240
  */
@@ -298,6 +328,11 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
298
  */
299
  protected $_preventSaving = false;
300
 
 
 
 
 
 
301
  /**
302
  * Initialize the shipment
303
  */
@@ -786,20 +821,28 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
786
  /**
787
  * Gets all shipping labels associated with this shipment
788
  *
789
- * @return array Array of TIG_PostNL_Model_Core_Shipment_Label objects
 
 
790
  */
791
- public function getLabels()
792
  {
793
  if ($this->hasLabels(false)) {
794
- return $this->_getData('labels');
 
 
 
 
 
 
795
  }
796
 
797
  $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
798
  $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()));
799
 
800
  /**
801
- * If the 'labels_printed' flag is false, yet there are labels present something has gone wrong.
802
- * Delete the labels so the extension will generate new ones.
803
  */
804
  if (!$this->getLabelsPrinted() && $labelCollection->getSize() > 0) {
805
  $this->deleteLabels();
@@ -809,6 +852,70 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
809
  $labels = $labelCollection->getItems();
810
 
811
  $this->setLabels($labels);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  return $labels;
813
  }
814
 
@@ -891,7 +998,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
891
  }
892
 
893
  /**
894
- * Loop through all associated shipment items and add each item's row total to the shipment's total
895
  */
896
  $baseGrandTotal = 0;
897
  $shipmentItems = $shipment->getAllItems();
@@ -903,12 +1010,13 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
903
  $qty = $shipmentItem->getQty();
904
 
905
  /**
906
- * The base price of a shipment item is only available through it's associated order item
907
  */
908
- $basePrice = $shipmentItem->getOrderItem()->getBasePrice();
 
909
 
910
  /**
911
- * Calculate and add the shipment item's row total
912
  */
913
  $totalBasePrice = $basePrice * $qty;
914
  $baseGrandTotal += $totalBasePrice;
@@ -938,19 +1046,27 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
938
  return false;
939
  }
940
 
941
- /**
942
- * @var TIG_PostNL_Helper_Carrier $helper
943
- */
944
- $helper = $this->getHelper('carrier');
945
 
946
- $url = '';
947
- $shippingAddress = $this->getShippingAddress();
948
- if ($shippingAddress) {
949
- $url = $helper->getBarcodeUrl($barcode, $shippingAddress, false, $forceNl);
950
- }
951
 
952
- $this->setBarcodeUrl($url);
953
- return $url;
 
 
 
 
 
 
 
 
 
 
 
 
 
954
  }
955
 
956
  /**
@@ -1104,14 +1220,12 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1104
  * If no default product code was found, try to use another product code that is available.
1105
  */
1106
  if (!$productCode) {
1107
- Zend_Debug::dump($xpath);exit;
1108
  $availableProductCodes = $this->getAllowedProductCodes();
1109
 
1110
  /**
1111
  * If no other product codes are available for this shipment type, throw an error.
1112
  */
1113
  if (empty($availableProductCodes)) {
1114
- Zend_Debug::dump($availableProductCodes);exit;
1115
  throw new TIG_PostNL_Exception(
1116
  $this->getHelper()->__(
1117
  "No default product options are available for this shipment. Please check that you have " .
@@ -1189,7 +1303,6 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1189
  switch ($option) {
1190
  case 'only_stated_address':
1191
  return self::XPATH_DEFAULT_STATED_ADDRESS_ONLY_OPTION;
1192
- break;
1193
  //no default
1194
  }
1195
  }
@@ -1248,26 +1361,46 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1248
  * Get all barcodes associated with this shipment
1249
  *
1250
  * @param boolean $asObject Optional value to get the barcodes as entities, rather than an array of values
 
1251
  *
1252
  * @return array
1253
  */
1254
- public function getBarcodes($asObject = false)
1255
  {
1256
- $barcodeCollection = Mage::getResourceModel('postnl_core/shipment_barcode_collection');
1257
- $barcodeCollection->addFieldToSelect(array('barcode', 'barcode_number'))
1258
- ->addFieldToFilter('parent_id', array('eq' => $this->getId()));
1259
 
1260
- $barcodeCollection->getSelect()->order('barcode_number ASC');
 
 
 
 
 
1261
 
1262
  if ($asObject === false) {
1263
- $barcodeNumbers = $barcodeCollection->getColumnValues('barcode_number');
1264
- $barcodes = $barcodeCollection->getColumnValues('barcode');
 
 
 
 
 
 
 
 
 
 
 
 
 
1265
 
1266
  /**
1267
- * Combine the arrays so that the barcode numbers are the keys and the barcodes themselves are the values
1268
  */
1269
- $barcodeArray = array_combine($barcodeNumbers, $barcodes);
1270
- $barcodeArray[0] = $this->getMainBarcode();
 
1271
 
1272
  return $barcodeArray;
1273
  }
@@ -1279,6 +1412,57 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1279
  return $barcodeCollection->getItems();
1280
  }
1281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1282
  /**
1283
  * Alias for magic getIsParcelwareExported()
1284
  *
@@ -1446,7 +1630,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1446
  $isBuspakje = $this->_getData('is_buspakje');
1447
 
1448
  if (!is_null($isBuspakje)) {
1449
- return $isBuspakje;
1450
  }
1451
 
1452
  $isBuspakje = $this->_getIsBuspakje();
@@ -1482,6 +1666,14 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1482
  return $this->_preventSaving;
1483
  }
1484
 
 
 
 
 
 
 
 
 
1485
  /*******************************************************************************************************************
1486
  * SETTER METHODS
1487
  ******************************************************************************************************************/
@@ -1658,7 +1850,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1658
  /**
1659
  * Sets the current shipment's phase. Triggers an event if the phase is valid.
1660
  *
1661
- * @param mixed $phase
1662
  *
1663
  * @return $this
1664
  */
@@ -1669,7 +1861,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1669
  if (is_numeric($phase) && $phase != $this->getShippingPhase()) {
1670
  $phases = $this->getHelper('cif')->getShippingPhaseCodes();
1671
 
1672
- if (array_key_exists($phase, $phases)) {
1673
  $phaseName = $phases[$phase];
1674
  Mage::dispatchEvent('postnl_shipment_setshippingphase_' . $phaseName, array('shipment' => $this));
1675
  }
@@ -1678,6 +1870,29 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1678
  return $this;
1679
  }
1680
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1681
  /**
1682
  * Setter for the '_preventSaving' class variable.
1683
  *
@@ -1692,12 +1907,29 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1692
  return $this;
1693
  }
1694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1695
  /*******************************************************************************************************************
1696
  * HAS- METHODS
1697
  ******************************************************************************************************************/
1698
 
1699
  /**
1700
- * Check if the shipment has any associated labels
1701
  *
1702
  * @param boolean $checkCollection
1703
  *
@@ -1716,6 +1948,41 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1716
  $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
1717
  $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()));
1718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1719
  if ($labelCollection->getSize() > 0) {
1720
  return true;
1721
  }
@@ -1724,7 +1991,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1724
  }
1725
 
1726
  /**
1727
- * Checks if this shipment has extra cover
1728
  *
1729
  * @return boolean
1730
  */
@@ -1780,7 +2047,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1780
  */
1781
  public function hasCustomBarcode()
1782
  {
1783
- $productCode = $this->getProductCode();
1784
 
1785
  $customBarcodes = $this->getCustomBarcodes();
1786
  $disallowedProductCodes = array_keys($customBarcodes);
@@ -1792,6 +2059,68 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
1792
  return false;
1793
  }
1794
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1795
  /*******************************************************************************************************************
1796
  * IS- AND CAN- METHODS
1797
  ******************************************************************************************************************/
@@ -2124,6 +2453,33 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2124
  return true;
2125
  }
2126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2127
  /**
2128
  * Checks whether a barcode may be generated for a given product code.
2129
  *
@@ -2159,7 +2515,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2159
  return false;
2160
  }
2161
 
2162
- if ($this->getConfirmStatus() == self::CONFIRM_STATUS_CONFIRMED) {
2163
  return false;
2164
  }
2165
 
@@ -2167,10 +2523,6 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2167
  return false;
2168
  }
2169
 
2170
- if (!$this->getMainBarcode()) {
2171
- return false;
2172
- }
2173
-
2174
  if ($skipEuCheck === false
2175
  && $this->isEuShipment()
2176
  && !$this->getLabelsPrinted()
@@ -2229,11 +2581,11 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2229
  }
2230
 
2231
  /**
2232
- * Checks if the current shipment is eligible for a complete shipping status update.
2233
  *
2234
  * @return boolean
2235
  */
2236
- public function canUpdateCompleteShippingStatus()
2237
  {
2238
  if ($this->isLocked()) {
2239
  return false;
@@ -2243,16 +2595,46 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2243
  return false;
2244
  }
2245
 
2246
- if (!$this->getLabelsPrinted()) {
2247
  return false;
2248
  }
2249
 
2250
- if (!$this->getMainBarcode()) {
2251
  return false;
2252
  }
2253
 
2254
- $customBarcodes = $this->getCustomBarcodes();
2255
- $productCode = $this->getProductCode();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2256
 
2257
  if (array_key_exists($productCode, $customBarcodes)) {
2258
  return false;
@@ -2328,6 +2710,28 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2328
  return true;
2329
  }
2330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2331
  /**
2332
  * Checks if this shipment's confirmation status can be reset.
2333
  *
@@ -2335,15 +2739,13 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2335
  */
2336
  public function canResetConfirmation()
2337
  {
2338
- $confirmStatus = $this->getConfirmStatus();
2339
- if ($confirmStatus == self::CONFIRM_STATUS_CONFIRM_EXPIRED) {
2340
  return false;
2341
  }
2342
 
2343
- if ($confirmStatus == self::CONFIRM_STATUS_UNCONFIRMED) {
2344
  return false;
2345
  }
2346
-
2347
  $shippingPhase = $this->getShippingPhase();
2348
  if ($shippingPhase == self::SHIPPING_PHASE_DELIVERED
2349
  || $shippingPhase == self::SHIPPING_PHASE_DISTRIBUTION
@@ -2422,14 +2824,6 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2422
  return false;
2423
  }
2424
 
2425
- $shippingPhase = $this->getShippingPhase();
2426
- if ($shippingPhase == self::SHIPPING_PHASE_DELIVERED
2427
- || $shippingPhase == self::SHIPPING_PHASE_DISTRIBUTION
2428
- || $shippingPhase == self::SHIPPING_PHASE_SORTING
2429
- ) {
2430
- return false;
2431
- }
2432
-
2433
  if (!$checkAvailableProductOptions) {
2434
  return true;
2435
  }
@@ -2456,6 +2850,66 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2456
  return false;
2457
  }
2458
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2459
  /*******************************************************************************************************************
2460
  * SHIPMENT LOCKING AND UNLOCKING FUNCTIONS
2461
  ******************************************************************************************************************/
@@ -2560,6 +3014,44 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2560
  return $this;
2561
  }
2562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2563
  /**
2564
  * Generates a single barcode for this postnl shipment.
2565
  *
@@ -2661,6 +3153,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2661
  */
2662
  protected function _generateLabel($confirm = false, $barcodeNumber = false)
2663
  {
 
2664
  $mainBarcode = $this->getMainBarcode();
2665
 
2666
  /**
@@ -2670,22 +3163,54 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2670
  $barcode = $mainBarcode;
2671
  } else {
2672
  $barcode = $this->getBarcode($barcodeNumber);
2673
- $barcodeNumber++; //while barcode numbers start at 0, shipment numbers start at 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2674
  }
2675
 
2676
  /**
2677
  * @var TIG_PostNL_Model_Core_Cif $cif
2678
  */
2679
  $cif = Mage::getModel('postnl_core/cif');
2680
- $cif->setStoreId($this->getStoreId());
 
 
2681
 
2682
  /**
2683
  * @var StdClass $result
2684
  */
2685
  if ($confirm === false) {
2686
- $result = $cif->generateLabelsWithoutConfirm($this, $barcode, $mainBarcode, $barcodeNumber);
 
 
 
 
 
 
 
2687
  } else {
2688
- $result = $cif->generateLabels($this, $barcode, $mainBarcode, $barcodeNumber);
 
 
 
 
 
 
 
2689
  }
2690
 
2691
  if (!isset($result->Labels, $result->Labels->Label)) {
@@ -2928,11 +3453,13 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2928
  /**
2929
  * Requests a shipping status update for this shipment
2930
  *
 
 
2931
  * @return $this
2932
  *
2933
  * @throws TIG_PostNL_Exception
2934
  */
2935
- public function updateShippingStatus()
2936
  {
2937
  if (!$this->canUpdateShippingStatus()) {
2938
  throw new TIG_PostNL_Exception(
@@ -2945,14 +3472,22 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2945
 
2946
  Mage::dispatchEvent('postnl_shipment_updateshippingstatus_before', array('shipment' => $this));
2947
 
2948
- /**
2949
- * @var TIG_PostNL_Model_Core_Cif $cif
2950
- */
2951
- $cif = Mage::getModel('postnl_core/cif');
2952
- $cif->setStoreId($this->getStoreId());
2953
- $result = $cif->getShipmentStatus($this);
2954
 
2955
- $currentPhase = $result->Status->CurrentPhaseCode;
 
 
 
 
 
 
 
 
2956
 
2957
  if (!$currentPhase) {
2958
  return $this;
@@ -2974,6 +3509,88 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2974
  return $this;
2975
  }
2976
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2977
  /**
2978
  * Update this shipment's status history
2979
  *
@@ -2994,13 +3611,37 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
2994
 
2995
  Mage::dispatchEvent('postnl_shipment_updatecompleteshippingstatus_before', array('shipment' => $this));
2996
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2997
  /**
2998
  * @var TIG_PostNL_Model_Core_Cif $cif
2999
  * @var StdClass $result
3000
  */
3001
  $cif = Mage::getModel('postnl_core/cif');
3002
  $cif->setStoreId($this->getStoreId());
3003
- $result = $cif->getCompleteShipmentStatus($this);
3004
 
3005
  /**
3006
  * Update the shipment's shipping phase
@@ -3063,10 +3704,6 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3063
 
3064
  $this->setStatusHistoryUpdatedAt($dateModel->gmtTimestamp());
3065
 
3066
- Mage::dispatchEvent('postnl_shipment_updatecompleteshippingstatus_after', array('shipment' => $this));
3067
-
3068
- $this->unlock();
3069
-
3070
  return $this;
3071
  }
3072
 
@@ -3075,13 +3712,30 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3075
  ******************************************************************************************************************/
3076
 
3077
  /**
3078
- * Adds Magento tracking information to the order containing the previously retrieved barcode
3079
  *
3080
  * @return $this
3081
  *
3082
  * @throws TIG_PostNL_Exception
 
 
 
3083
  */
3084
- public function addTrackingCodeToShipment()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3085
  {
3086
  if (!$this->canAddTrackingCode()) {
3087
  throw new TIG_PostNL_Exception(
@@ -3091,7 +3745,11 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3091
  }
3092
 
3093
  $shipment = $this->getShipment();
3094
- $barcode = $this->getMainBarcode();
 
 
 
 
3095
 
3096
  if (!$shipment || !$barcode) {
3097
  throw new TIG_PostNL_Exception(
@@ -3102,6 +3760,9 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3102
 
3103
  $carrierCode = self::POSTNL_CARRIER_CODE;
3104
  $carrierTitle = Mage::getStoreConfig('carriers/' . $carrierCode . '/name', $shipment->getStoreId());
 
 
 
3105
 
3106
  $data = array(
3107
  'carrier_code' => $carrierCode,
@@ -3132,173 +3793,191 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3132
  * Send a track & trace email to the customer containing a link to the 'mijnpakket' environment where they
3133
  * can track their shipment.
3134
  *
3135
- * @param boolean $ignoreAlreadySent Flag to ignore the 'already sent' check.
3136
- * @param boolean $ignoreConfig Flag to ignore the configuration settings related to track&trace e-mails.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3137
  *
 
3138
  * @throws TIG_PostNL_Exception
3139
- *
3140
- * @return $this
3141
  */
3142
- public function sendTrackAndTraceEmail($ignoreAlreadySent = false, $ignoreConfig = false)
3143
  {
3144
  $helper = Mage::helper('postnl');
3145
- if (!$this->canSendTrackAndTraceEmail($ignoreAlreadySent, $ignoreConfig)) {
3146
- throw new TIG_PostNL_Exception(
3147
- $helper->__('The sendTrackAndTraceEmail action is currently unavailable.'),
3148
- 'POSTNL-0076'
3149
- );
3150
- }
3151
 
3152
  $storeId = $this->getStoreId();
3153
 
3154
  $template = Mage::getStoreConfig(self::XPATH_TRACK_AND_TRACE_EMAIL_TEMPLATE, $storeId);
3155
 
3156
- try {
3157
- /**
3158
- * @var Mage_Sales_Model_Order $order
3159
- */
3160
- $shippingAddress = $this->getShippingAddress();
3161
- $shipment = $this->getShipment();
3162
- $order = $this->getOrder();
3163
- if (!$order || !$shipment || !$shippingAddress) {
3164
- throw new TIG_PostNL_Exception(
3165
- $helper->__('Unable to send track & trace email due to missing shipment parameters.'),
3166
- 'POSTNL-0200'
3167
- );
3168
- }
3169
-
3170
- $payment = $order->getPayment();
3171
- $paymentBlockHtml = '';
3172
- if ($payment) {
3173
- /** @noinspection PhpUndefinedMethodInspection */
3174
- $paymentBlock = Mage::helper('payment')
3175
- ->getInfoBlock($payment)
3176
- ->setIsSecureMode(true);
3177
-
3178
- /** @noinspection PhpUndefinedMethodInspection */
3179
- $paymentBlock->getMethod()
3180
- ->setStore($storeId);
3181
 
3182
- /**
3183
- * @var Mage_Payment_Block_Info $paymentBlock
3184
- */
3185
- $paymentBlockHtml = $paymentBlock->toHtml();
3186
- }
 
 
3187
 
3188
  /** @noinspection PhpUndefinedMethodInspection */
3189
- $templateVariables = array(
3190
- 'postnlshipment' => $this,
3191
- 'barcode' => $this->getMainBarcode(),
3192
- 'barcode_url' => $this->getBarcodeUrl(false),
3193
- 'shipment' => $shipment,
3194
- 'order' => $order,
3195
- 'payment_html' => $paymentBlockHtml,
3196
- 'customer' => $order->getCustomer(),
3197
- 'quote' => $order->getQuote(),
3198
- 'shipment_comment' => '', /** @todo add last shipment comment */
3199
- 'billing' => $order->getBillingAddress(),
3200
- 'shipping' => $order->getShippingAddress(),
3201
- 'pakje_gemak' => $this->getPakjeGemakAddress(),
3202
- );
3203
 
3204
- $templateVariables = new Varien_Object($templateVariables);
3205
- Mage::dispatchEvent(
3206
- 'postnl_shipment_add_track_and_trace_email_vars',
3207
- array(
3208
- 'vars' => $templateVariables,
3209
- 'postnl_shipment' => $this,
3210
- )
3211
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3212
 
3213
- // Get the destination email addresses to send copies to
3214
- $copy = Mage::getStoreConfigFlag(self::XPATH_EMAIL_COPY, $storeId);
3215
- $copyTo = explode(',', Mage::getStoreConfig(self::XPATH_EMAIL_COPY_TO, $storeId));
3216
- $copyMethod = Mage::getStoreConfig(self::XPATH_EMAIL_COPY_METHOD, $storeId);
3217
 
3218
- $mailer = Mage::getModel('core/email_template_mailer');
3219
- $emailInfo = Mage::getModel('core/email_info');
3220
- $emailInfo->addTo($order->getCustomerEmail(), $shippingAddress->getName());
3221
 
3222
- if ($copy && !empty($copyTo) && $copyMethod == 'bcc') {
3223
- foreach ($copyTo as $email) {
3224
- $emailInfo->addBcc($email);
3225
- }
3226
  }
 
3227
 
3228
- $mailer->addEmailInfo($emailInfo);
3229
 
3230
- if ($copy && !empty($copyTo) && $copyMethod == 'copy') {
3231
- foreach ($copyTo as $email) {
3232
- $emailInfo = Mage::getModel('core/email_info');
3233
- $emailInfo->addTo($email);
3234
- $mailer->addEmailInfo($emailInfo);
3235
- }
3236
  }
 
3237
 
3238
- /**
3239
- * Set all required parameters.
3240
- */
3241
- $mailer->setSender(Mage::getStoreConfig($order::XML_PATH_EMAIL_IDENTITY, $storeId))
3242
- ->setStoreId($storeId)
3243
- ->setTemplateId($template)
3244
- ->setTemplateParams($templateVariables->getData());
3245
-
3246
- Mage::dispatchEvent(
3247
- 'postnl_shipment_send_track_and_trace_email_before',
3248
- array(
3249
- 'postnl_shipment' => $this,
3250
- 'mailer' => $mailer,
3251
- )
3252
- );
3253
 
3254
- /**
3255
- * Send the emails.
3256
- */
3257
- $mailer->send();
 
 
 
3258
 
3259
- Mage::dispatchEvent(
3260
- 'postnl_shipment_send_track_and_trace_email_after',
3261
- array(
3262
- 'postnl_shipment' => $this,
3263
- )
3264
- );
3265
 
3266
- /**
3267
- * Add a comment to the order and shipment that the track & trace email has been sent.
3268
- */
3269
- $order->addStatusHistoryComment(
3270
- $helper->__(
3271
- 'PostNL track & trace email has been sent for shipment #%s.',
3272
- $shipment->getIncrementId()
3273
- )
3274
- )
3275
- ->setIsCustomerNotified(1)
3276
- ->save();
3277
-
3278
- $shipment->addComment(
3279
- $helper->__('PostNL track & trace email has been sent.'),
3280
- true
3281
- )
3282
- ->save();
3283
- } catch (Exception $e) {
3284
- $helper->logException($e);
3285
- throw new TIG_PostNL_Exception(
3286
- $helper->__(
3287
- 'Unable to send track and trace email for shipment #',
3288
- $this->getShipmentId()
3289
- ),
3290
- 'POSTNL-0077'
3291
- );
3292
- }
3293
 
3294
  /**
3295
- * Set the 'email sent' flag to true for this shipment.
3296
  */
3297
- if (!$this->getShipment()->getEmailSent()) {
3298
- $this->getShipment()
3299
- ->setEmailSent(true)
 
 
 
 
 
 
 
 
 
 
3300
  ->save();
3301
- }
3302
 
3303
  return $this;
3304
  }
@@ -3324,11 +4003,63 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3324
  $barcodeModel->setParentId($this->getId())
3325
  ->setBarcode($barcode)
3326
  ->setBarcodeNumber($barcodeNumber)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3327
  ->save();
3328
 
 
 
3329
  return $this;
3330
  }
3331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3332
  /*******************************************************************************************************************
3333
  * LABEL PROCESSING METHODS
3334
  ******************************************************************************************************************/
@@ -3441,6 +4172,8 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3441
  */
3442
  $transactionSave->save();
3443
 
 
 
3444
  Mage::dispatchEvent(
3445
  'postnl_shipment_savelabels_after',
3446
  array('shipment' => $this, 'labels' => $labelsToSave)
@@ -3483,6 +4216,198 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3483
  return true;
3484
  }
3485
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3486
  /*******************************************************************************************************************
3487
  * STATUS PROCESSING METHODS
3488
  ******************************************************************************************************************/
@@ -3620,12 +4545,12 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3620
  * is a buspakje shipment.
3621
  */
3622
  if ($shipmentType == self::SHIPMENT_TYPE_DOMESTIC
3623
- && array_key_exists('is_buspakje', $codes)
3624
  && $codes['is_buspakje'] == '1'
3625
  ) {
3626
  $isBuspakje = true;
3627
  } elseif ($shipmentType == self::SHIPMENT_TYPE_DOMESTIC
3628
- && (!array_key_exists('is_buspakje', $codes)
3629
  || $codes['is_buspakje'] == '-1'
3630
  )
3631
  ) {
@@ -3802,26 +4727,26 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3802
  }
3803
 
3804
  /**
3805
- * Get the number of parcels in this shipment
3806
  *
3807
  * @return int
3808
  */
3809
  protected function _calculateParcelCount()
3810
  {
3811
  /**
3812
- * Only Dutch shipments that are not COD support multi-colli shipments
3813
  */
3814
  if (!$this->isDutchShipment() || $this->isCod()) {
3815
  return 1;
3816
  }
3817
 
3818
  /**
3819
- * get this shipment's total weight
3820
  */
3821
  $weight = $this->getTotalWeight(true);
3822
 
3823
  /**
3824
- * get the weight per parcel.
3825
  *
3826
  * @var TIG_PostNL_Helper_Cif $helper
3827
  */
@@ -3830,9 +4755,16 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3830
  $weightPerParcel = $helper->standardizeWeight($weightPerParcel, $this->getStoreId());
3831
 
3832
  /**
3833
- * calculate the number of parcels needed to ship the total weight of this shipment
3834
  */
3835
  $parcelCount = ceil($weight / $weightPerParcel);
 
 
 
 
 
 
 
3836
 
3837
  return $parcelCount;
3838
  }
@@ -3930,6 +4862,36 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3930
  return $this;
3931
  }
3932
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3933
  /*******************************************************************************************************************
3934
  * RESET AND DELETE METHODS
3935
  ******************************************************************************************************************/
@@ -3998,9 +4960,11 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
3998
  /**
3999
  * Removes all labels associated with this shipment
4000
  *
 
 
4001
  * @return $this
4002
  */
4003
- public function deleteLabels()
4004
  {
4005
  $labelCollection = $this->getLabelCollection();
4006
 
@@ -4013,6 +4977,14 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4013
  $label->delete();
4014
  }
4015
 
 
 
 
 
 
 
 
 
4016
  return $this;
4017
  }
4018
 
@@ -4023,7 +4995,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4023
  */
4024
  public function deleteBarcodes()
4025
  {
4026
- $barcodes = $this->getBarcodes(true);
4027
 
4028
  /**
4029
  * @var TIG_PostNL_Model_Core_Shipment_Barcode $barcode
@@ -4032,7 +5004,8 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4032
  $barcode->delete();
4033
  }
4034
 
4035
- $this->setMainBarcode(false);
 
4036
 
4037
  return $this;
4038
  }
@@ -4125,8 +5098,15 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4125
  /**
4126
  * Set whether labels have printed or not.
4127
  */
4128
- if ($this->getlabelsPrinted() == 0 && $this->hasLabels()) {
4129
- $this->setLabelsPrinted(1);
 
 
 
 
 
 
 
4130
  }
4131
 
4132
  /**
@@ -4147,7 +5127,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4147
  /**
4148
  * Set the parcel count.
4149
  */
4150
- if (!$this->getParcelCount()) {
4151
  $parcelCount = $this->_calculateParcelCount();
4152
  $this->setParcelCount($parcelCount);
4153
  }
@@ -4159,6 +5139,13 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
4159
  $this->setConfirmDate();
4160
  }
4161
 
 
 
 
 
 
 
 
4162
  /**
4163
  * If no order ID has been set, use the getOrderId() method. This will automatically set the order ID.
4164
  */
44
  * Supported events:
45
  * - postnl_shipment_generatebarcode_before
46
  * - postnl_shipment_generatebarcode_after
47
+ * - postnl_shipment_generatereturnbarcodes_before
48
+ * - postnl_shipment_generatereturnbarcodes_after
49
  * - postnl_shipment_generatelabel_before
50
  * - postnl_shipment_generatelabel_after
51
  * - postnl_shipment_register_confirmation_before
61
  * - postnl_shipment_updateshippingphase_before
62
  * - postnl_shipment_updateshippingphase_after
63
  * - postnl_shipment_setshippingphase_*
64
+ * - postnl_shipment_updatereturnstatus_before
65
+ * - postnl_shipment_updatereturnstatus_after
66
+ * - postnl_shipment_updatereturnphase_before
67
+ * - postnl_shipment_updatereturnphase_after
68
+ * - postnl_shipment_setreturnphase_*
69
  * - postnl_shipment_savelabels_before
70
  * - postnl_shipment_savelabels_after
71
  * - postnl_shipment_saveadditionaloptions_after
72
  * - postnl_shipment_add_track_and_trace_email_vars
73
  * - postnl_shipment_send_track_and_trace_email_before
74
  * - postnl_shipment_send_track_and_trace_email_after
75
+ * - postnl_shipment_add_return_label_email_vars
76
+ * - postnl_shipment_send_return_label_email_before
77
+ * - postnl_shipment_send_return_label_email_after
78
  *
79
+ * @method boolean getIsDutchShipment()
80
+ * @method boolean getIsEuShipment()
81
+ * @method boolean getIsGlobalShipment()
82
  * @method int getParcelCount()
83
  * @method string|null getConfirmedStatus
84
  * @method string getStatusHistoryUpdatedAt()
96
  * @method int|null getShipmentId
97
  * @method int getLabelsPrinted()
98
  * @method bool|int getIsPakketautomaat()
99
+ * @method boolean getIsBuspakjeShipment()
100
+ * @method int getReturnLabelsPrinted()
101
+ * @method string getExpectedDeliveryTimeStart()
102
+ * @method string getExpectedDeliveryTimeEnd()
103
+ * @method int getReturnPhase()
104
  *
105
  * @method TIG_PostNL_Model_Core_Shipment setLabelsPrinted(int $value)
106
  * @method TIG_PostNL_Model_Core_Shipment setTreatAsAbandoned(int $value)
133
  * @method TIG_PostNL_Model_Core_Shipment setShipmentIncrementId(string $value)
134
  * @method TIG_PostNL_Model_Core_Shipment setIsBuspakjeShipment(bool $value)
135
  * @method TIG_PostNL_Model_Core_Shipment setDefaultProductCode(string $value)
136
+ * @method TIG_PostNL_Model_Core_Shipment setLabels(mixed $value)
137
  * @method TIG_PostNL_Model_Core_Shipment setProductOption(string $value)
138
  * @method TIG_PostNL_Model_Core_Shipment setPayment(Mage_Sales_Model_Order_Payment $value)
139
+ * @method TIG_PostNL_Model_Core_Shipment setReturnLabels(mixed $value)
140
+ * @method TIG_PostNL_Model_Core_Shipment setReturnLabelsPrinted(int $value)
141
+ * @method TIG_PostNL_Model_Core_Shipment setExpectedDeliveryTimeStart(string $value)
142
+ * @method TIG_PostNL_Model_Core_Shipment setExpectedDeliveryTimeEnd(string $value)
143
+ * @method TIG_PostNL_Model_Core_Shipment setReturnBarcodeUrl(string $value)
144
  *
145
+ * @method boolean hasBarcodeUrl()
146
+ * @method boolean hasPostnlOrder()
147
+ * @method boolean hasShipment()
148
+ * @method boolean hasShipmentBaseGrandTotal()
149
+ * @method boolean hasGlobalpackShipmentType()
150
+ * @method boolean hasProductCode()
151
+ * @method boolean hasShippingAddress()
152
+ * @method boolean hasPakjeGemakAddress()
153
+ * @method boolean hasStoreId()
154
+ * @method boolean hasOrderId()
155
+ * @method boolean hasShipmentId()
156
+ * @method boolean hasExtraCoverAmount()
157
+ * @method boolean hasLabelCollection()
158
+ * @method boolean hasIsPakketautomaat()
159
+ * @method boolean hasDeliveryDate()
160
+ * @method boolean hasShipmentType()
161
+ * @method boolean hasOrder()
162
+ * @method boolean hasMainBarcode()
163
+ * @method boolean hasShipmentIncrementId()
164
+ * @method boolean hasIsBuspakjeShipment()
165
+ * @method boolean hasDefaultProductCode()
166
+ * @method boolean hasProductOption()
167
+ * @method boolean hasPayment()
168
+ * @method boolean hasReturnLabelsPrinted()
169
+ * @method boolean hasExpectedDeliveryTimeStart()
170
+ * @method boolean hasExpectedDeliveryTimeEnd()
171
+ * @method boolean hasReturnPhase()
172
+ * @method boolean hasReturnBarcodeUrl()
173
  */
174
  class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
175
  {
260
  */
261
  const XPATH_DEFAULT_SHIPMENT_TYPE = 'postnl/cif_globalpack_settings/default_shipment_type';
262
 
263
+ /**
264
+ * Xpath to the email template used to email the customer a return label.
265
+ */
266
+ const XPATH_RETURN_LABEL_EMAIL_TEMPLATE = 'postnl/returns/email_template';
267
+
268
  /**
269
  * CIF warning code returned when an EPS combi label is not available.
270
  */
328
  */
329
  protected $_preventSaving = false;
330
 
331
+ /**
332
+ * @var TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection[]
333
+ */
334
+ protected $_barcodeCollections = array();
335
+
336
  /**
337
  * Initialize the shipment
338
  */
821
  /**
822
  * Gets all shipping labels associated with this shipment
823
  *
824
+ * @param boolean $includeReturnLabels
825
+ *
826
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]
827
  */
828
+ public function getLabels($includeReturnLabels = true)
829
  {
830
  if ($this->hasLabels(false)) {
831
+ $labels = $this->_getData('labels');
832
+
833
+ if (!$includeReturnLabels) {
834
+ return $this->_filterReturnLabels($labels);
835
+ }
836
+
837
+ return $labels;
838
  }
839
 
840
  $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
841
  $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()));
842
 
843
  /**
844
+ * If the 'labels_printed' flag is false, yet there are labels present something has gone wrong. Delete the
845
+ * labels so the extension will generate new ones.
846
  */
847
  if (!$this->getLabelsPrinted() && $labelCollection->getSize() > 0) {
848
  $this->deleteLabels();
852
  $labels = $labelCollection->getItems();
853
 
854
  $this->setLabels($labels);
855
+
856
+ /**
857
+ * If all labels are allowed, return the labels.
858
+ */
859
+ if (!$includeReturnLabels) {
860
+ return $this->_filterReturnLabels($labels);
861
+ }
862
+
863
+ return $labels;
864
+ }
865
+
866
+ /**
867
+ * Get all return labels for this shipment.
868
+ *
869
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]
870
+ */
871
+ public function getReturnLabels()
872
+ {
873
+ /**
874
+ * If we already have all return labels stored, retrieve them from the entity's data.
875
+ */
876
+ if ($this->hasReturnLabels()) {
877
+ $labels = $this->_getData('return_labels');
878
+
879
+ if (!is_array($labels)) {
880
+ $labels = $labels->getItems();
881
+ }
882
+ return $labels;
883
+ }
884
+
885
+ /**
886
+ * If we already have all labels, get them and filter out all non-return labels.
887
+ */
888
+ if ($this->hasLabels(false)) {
889
+ $labels = $this->_getData('labels');
890
+ if (!is_array($labels)) {
891
+ $labels = $labels->getItems();
892
+ }
893
+
894
+ /**
895
+ * Filter out all regular shipping labels.
896
+ *
897
+ * @var TIG_PostNL_Model_Core_Shipment_Label[] $labels
898
+ */
899
+ foreach ($labels as $key => $label) {
900
+ if (!$label->isReturnLabel()) {
901
+ unset($labels[$key]);
902
+ }
903
+ }
904
+
905
+ $this->setReturnLabels($labels);
906
+ return $labels;
907
+ }
908
+
909
+ /**
910
+ * Get the entire label collection and filter out all non-return labels.
911
+ */
912
+ $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
913
+ $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()))
914
+ ->addFieldToFilter('label_type', array('in' => $this->getHelper('cif')->getReturnLabelTypes()));
915
+
916
+ $labels = $labelCollection->getItems();
917
+
918
+ $this->setReturnLabels($labels);
919
  return $labels;
920
  }
921
 
998
  }
999
 
1000
  /**
1001
+ * Loop through all associated shipment items and add each item's row total to the shipment's total.
1002
  */
1003
  $baseGrandTotal = 0;
1004
  $shipmentItems = $shipment->getAllItems();
1010
  $qty = $shipmentItem->getQty();
1011
 
1012
  /**
1013
+ * The base price of a shipment item is only available through it's associated order item.
1014
  */
1015
+ $orderItem = $shipmentItem->getOrderItem();
1016
+ $basePrice = $orderItem->getBasePriceInclTax() + $orderItem->getBaseDiscountAmount();
1017
 
1018
  /**
1019
+ * Calculate and add the shipment item's row total.
1020
  */
1021
  $totalBasePrice = $basePrice * $qty;
1022
  $baseGrandTotal += $totalBasePrice;
1046
  return false;
1047
  }
1048
 
1049
+ $barcodeUrl = $this->_getBarcodeUrl($barcode, $forceNl);
 
 
 
1050
 
1051
+ $this->setBarcodeUrl($barcodeUrl);
1052
+ return $barcodeUrl;
1053
+ }
 
 
1054
 
1055
+ /**
1056
+ * Gets the url for this shipment's return barcode.
1057
+ *
1058
+ * Currently the same url as the main barcode url should be used. This may change in the future.
1059
+ *
1060
+ * @param boolean $forceNl
1061
+ *
1062
+ * @return string
1063
+ *
1064
+ * @see TIG_PostNL_Model_Core_Shipment::getBarcodeUrl()
1065
+ * @see TIG_PostNL_Helper_Carrier::getBarcodeUrl()
1066
+ */
1067
+ public function getReturnBarcodeUrl($forceNl = false)
1068
+ {
1069
+ return $this->getBarcodeUrl($forceNl);
1070
  }
1071
 
1072
  /**
1220
  * If no default product code was found, try to use another product code that is available.
1221
  */
1222
  if (!$productCode) {
 
1223
  $availableProductCodes = $this->getAllowedProductCodes();
1224
 
1225
  /**
1226
  * If no other product codes are available for this shipment type, throw an error.
1227
  */
1228
  if (empty($availableProductCodes)) {
 
1229
  throw new TIG_PostNL_Exception(
1230
  $this->getHelper()->__(
1231
  "No default product options are available for this shipment. Please check that you have " .
1303
  switch ($option) {
1304
  case 'only_stated_address':
1305
  return self::XPATH_DEFAULT_STATED_ADDRESS_ONLY_OPTION;
 
1306
  //no default
1307
  }
1308
  }
1361
  * Get all barcodes associated with this shipment
1362
  *
1363
  * @param boolean $asObject Optional value to get the barcodes as entities, rather than an array of values
1364
+ * @param string $type
1365
  *
1366
  * @return array
1367
  */
1368
+ public function getBarcodes($asObject = false, $type = 'shipment')
1369
  {
1370
+ if (!$this->getId()) {
1371
+ return array();
1372
+ }
1373
 
1374
+ $barcodeCollections = $this->_getBarcodeCollections();
1375
+ if (!empty($type) && isset($barcodeCollections[$type])) {
1376
+ $barcodeCollection = $barcodeCollections[$type];
1377
+ } else {
1378
+ $barcodeCollection = $this->_getBarcodeCollection($type);
1379
+ }
1380
 
1381
  if ($asObject === false) {
1382
+ /**
1383
+ * Combine the arrays so that the barcode numbers are the keys and the barcodes themselves are the values.
1384
+ *
1385
+ * @var TIG_postNL_Model_Core_Shipment_Barcode $barcode
1386
+ */
1387
+ $barcodeArray = array();
1388
+ $numberlessBarcodes = array();
1389
+ foreach ($barcodeCollection as $key => $barcode) {
1390
+ if ($barcode->getBarcodeNumber()) {
1391
+ $barcodeArray[$barcode->getBarcodeNumber()] = $barcode->getBarcode();
1392
+ } else {
1393
+ $numberlessBarcodes[] = $barcode->getBarcode();
1394
+ }
1395
+ }
1396
+ $barcodeArray = array_merge($barcodeArray, $numberlessBarcodes);
1397
 
1398
  /**
1399
+ * Add the main barcode if the requested type is 'shipment'.
1400
  */
1401
+ if ($type == TIG_PostNL_Model_Core_Shipment_Barcode::BARCODE_TYPE_SHIPMENT) {
1402
+ $barcodeArray[0] = $this->getMainBarcode();
1403
+ }
1404
 
1405
  return $barcodeArray;
1406
  }
1412
  return $barcodeCollection->getItems();
1413
  }
1414
 
1415
+ /**
1416
+ * Get this shipment's return barcode if available.
1417
+ *
1418
+ * @param int|null $barcodeNumber
1419
+ *
1420
+ * @return string|null
1421
+ */
1422
+ public function getReturnBarcode($barcodeNumber = null)
1423
+ {
1424
+ if (!is_numeric($barcodeNumber) || $barcodeNumber < 1) {
1425
+ $barcodeNumber = 0;
1426
+ }
1427
+
1428
+ /**
1429
+ * @var TIG_PostNL_Model_Core_Shipment_Barcode $barcode
1430
+ */
1431
+ $barcode = Mage::getModel('postnl_core/shipment_barcode');
1432
+ $barcode->loadByParentAndBarcodeNumber($this->getId(), $barcodeNumber, $barcode::BARCODE_TYPE_RETURN);
1433
+
1434
+ return $barcode->getBarcode();
1435
+ }
1436
+
1437
+ /**
1438
+ * Get the barcode collection for a specified type.
1439
+ *
1440
+ * @param string $type
1441
+ *
1442
+ * @return TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection
1443
+ */
1444
+ protected function _getBarcodeCollection($type)
1445
+ {
1446
+ $barcodeCollection = Mage::getResourceModel('postnl_core/shipment_barcode_collection');
1447
+ $barcodeCollection->addFieldToSelect(array('barcode', 'barcode_number'))
1448
+ ->addFieldToFilter('parent_id', array('eq' => $this->getId()));
1449
+
1450
+ /**
1451
+ * Add an optional filter by barcode type.
1452
+ */
1453
+ if (!empty($type)) {
1454
+ $barcodeCollection->addFieldToFilter('barcode_type', array('eq' => $type));
1455
+ }
1456
+
1457
+ $barcodeCollection->getSelect()->order('barcode_number ASC');
1458
+
1459
+ if (!empty($type)) {
1460
+ $this->_setBarcodeCollections($barcodeCollection->load(), $type);
1461
+ }
1462
+
1463
+ return $barcodeCollection;
1464
+ }
1465
+
1466
  /**
1467
  * Alias for magic getIsParcelwareExported()
1468
  *
1630
  $isBuspakje = $this->_getData('is_buspakje');
1631
 
1632
  if (!is_null($isBuspakje)) {
1633
+ return (bool) $isBuspakje;
1634
  }
1635
 
1636
  $isBuspakje = $this->_getIsBuspakje();
1666
  return $this->_preventSaving;
1667
  }
1668
 
1669
+ /**
1670
+ * @return TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection[]
1671
+ */
1672
+ protected function _getBarcodeCollections()
1673
+ {
1674
+ return $this->_barcodeCollections;
1675
+ }
1676
+
1677
  /*******************************************************************************************************************
1678
  * SETTER METHODS
1679
  ******************************************************************************************************************/
1850
  /**
1851
  * Sets the current shipment's phase. Triggers an event if the phase is valid.
1852
  *
1853
+ * @param int $phase
1854
  *
1855
  * @return $this
1856
  */
1861
  if (is_numeric($phase) && $phase != $this->getShippingPhase()) {
1862
  $phases = $this->getHelper('cif')->getShippingPhaseCodes();
1863
 
1864
+ if (isset($phases[$phase])) {
1865
  $phaseName = $phases[$phase];
1866
  Mage::dispatchEvent('postnl_shipment_setshippingphase_' . $phaseName, array('shipment' => $this));
1867
  }
1870
  return $this;
1871
  }
1872
 
1873
+ /**
1874
+ * Sets the current shipment's return phase. Triggers an event if the phase is valid.
1875
+ *
1876
+ * @param int $phase
1877
+ *
1878
+ * @return $this
1879
+ */
1880
+ public function setReturnPhase($phase)
1881
+ {
1882
+ $this->setData('return_phase', $phase);
1883
+
1884
+ if (is_numeric($phase) && $phase != $this->getReturnPhase()) {
1885
+ $phases = $this->getHelper('cif')->getShippingPhaseCodes();
1886
+
1887
+ if (isset($phases[$phase])) {
1888
+ $phaseName = $phases[$phase];
1889
+ Mage::dispatchEvent('postnl_shipment_setreturnphase_' . $phaseName, array('shipment' => $this));
1890
+ }
1891
+ }
1892
+
1893
+ return $this;
1894
+ }
1895
+
1896
  /**
1897
  * Setter for the '_preventSaving' class variable.
1898
  *
1907
  return $this;
1908
  }
1909
 
1910
+ /**
1911
+ * @param TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection $collection
1912
+ * @param string $type
1913
+ *
1914
+ * @return $this
1915
+ */
1916
+ protected function _setBarcodeCollections(TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection $collection,
1917
+ $type
1918
+ ) {
1919
+ $barcodesCollections = $this->_getBarcodeCollections();
1920
+ $barcodesCollections[$type] = $collection;
1921
+
1922
+ $this->_barcodeCollections = $barcodesCollections;
1923
+
1924
+ return $this;
1925
+ }
1926
+
1927
  /*******************************************************************************************************************
1928
  * HAS- METHODS
1929
  ******************************************************************************************************************/
1930
 
1931
  /**
1932
+ * Check if the shipment has any associated labels.
1933
  *
1934
  * @param boolean $checkCollection
1935
  *
1948
  $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
1949
  $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()));
1950
 
1951
+ $this->setLabels($labelCollection->getItems());
1952
+
1953
+ if ($labelCollection->getSize() > 0) {
1954
+ return true;
1955
+ }
1956
+
1957
+ return false;
1958
+ }
1959
+
1960
+ /**
1961
+ * Check if the shipment has any associated return labels.
1962
+ *
1963
+ * @param boolean $checkCollection
1964
+ *
1965
+ * @return boolean
1966
+ */
1967
+ public function hasReturnLabels($checkCollection = true)
1968
+ {
1969
+ $labels = $this->_getData('return_labels');
1970
+ if ($labels && $labels->getSize() > 0) {
1971
+ return true;
1972
+ }
1973
+
1974
+ if (!$checkCollection) {
1975
+ return false;
1976
+ }
1977
+
1978
+ $returnLabelTypes = Mage::helper('postnl/cif')->getReturnLabelTypes();
1979
+
1980
+ $labelCollection = Mage::getResourceModel('postnl_core/shipment_label_collection');
1981
+ $labelCollection->addFieldToFilter('parent_id', array('eq' => $this->getid()))
1982
+ ->addFieldToFilter('label_type', array('in' => $returnLabelTypes));
1983
+
1984
+ $this->setReturnLabels($labelCollection);
1985
+
1986
  if ($labelCollection->getSize() > 0) {
1987
  return true;
1988
  }
1991
  }
1992
 
1993
  /**
1994
+ * Checks if this shipment has extra cover.
1995
  *
1996
  * @return boolean
1997
  */
2047
  */
2048
  public function hasCustomBarcode()
2049
  {
2050
+ $productCode = (string) $this->getProductCode();
2051
 
2052
  $customBarcodes = $this->getCustomBarcodes();
2053
  $disallowedProductCodes = array_keys($customBarcodes);
2059
  return false;
2060
  }
2061
 
2062
+ /**
2063
+ * Check if this shipment has any return barcodes.
2064
+ *
2065
+ * @return boolean
2066
+ */
2067
+ public function hasReturnBarcode()
2068
+ {
2069
+ /**
2070
+ * @var $barcodeModel TIG_PostNL_Model_Core_Shipment_Barcode
2071
+ */
2072
+ $barcodeModel = Mage::getConfig()->getModelClassName('postnl_core/shipment_barcode');
2073
+ $barcodes = $this->getBarcodes(false, $barcodeModel::BARCODE_TYPE_RETURN);
2074
+
2075
+ if (count($barcodes) > 0) {
2076
+ return true;
2077
+ }
2078
+
2079
+ return false;
2080
+ }
2081
+
2082
+ /**
2083
+ * Check if this shipment has a return label.
2084
+ *
2085
+ * @return boolean
2086
+ */
2087
+ public function hasReturnLabel()
2088
+ {
2089
+ $labels = $this->getLabels(true);
2090
+
2091
+ foreach ($labels as $label) {
2092
+ if ($label->isReturnLabel()) {
2093
+ return true;
2094
+ }
2095
+ }
2096
+
2097
+ return false;
2098
+ }
2099
+
2100
+ /*******************************************************************************************************************
2101
+ * UNS- METHODS
2102
+ ******************************************************************************************************************/
2103
+
2104
+ /**
2105
+ * @return $this
2106
+ */
2107
+ public function unsBarcodeCollections()
2108
+ {
2109
+ $this->_barcodeCollections = array();
2110
+
2111
+ return $this;
2112
+ }
2113
+
2114
+ /**
2115
+ * @return $this
2116
+ */
2117
+ public function unsLabelsToSave()
2118
+ {
2119
+ $this->_labelsToSave = array();
2120
+
2121
+ return $this;
2122
+ }
2123
+
2124
  /*******************************************************************************************************************
2125
  * IS- AND CAN- METHODS
2126
  ******************************************************************************************************************/
2453
  return true;
2454
  }
2455
 
2456
+ /**
2457
+ * Checks if a return barcode may be generated for this shipment.
2458
+ *
2459
+ * @return boolean
2460
+ *
2461
+ * @throws TIG_PostNL_Exception
2462
+ */
2463
+ public function canGenerateReturnBarcode()
2464
+ {
2465
+ /**
2466
+ * Return barcodes are only available for Dutch parcel shipments.
2467
+ */
2468
+ if (!$this->isDutchShipment() || $this->isBuspakjeShipment()) {
2469
+ return false;
2470
+ }
2471
+
2472
+ if (!$this->getShipmentId() && !$this->getShipment(false)) {
2473
+ return false;
2474
+ }
2475
+
2476
+ if ($this->hasReturnBarcode()) {
2477
+ return false;
2478
+ }
2479
+
2480
+ return true;
2481
+ }
2482
+
2483
  /**
2484
  * Checks whether a barcode may be generated for a given product code.
2485
  *
2515
  return false;
2516
  }
2517
 
2518
+ if ($this->isConfirmed()) {
2519
  return false;
2520
  }
2521
 
2523
  return false;
2524
  }
2525
 
 
 
 
 
2526
  if ($skipEuCheck === false
2527
  && $this->isEuShipment()
2528
  && !$this->getLabelsPrinted()
2581
  }
2582
 
2583
  /**
2584
+ * Check if the current shipment's return status may be updated.
2585
  *
2586
  * @return boolean
2587
  */
2588
+ public function canUpdateReturnStatus()
2589
  {
2590
  if ($this->isLocked()) {
2591
  return false;
2595
  return false;
2596
  }
2597
 
2598
+ if (self::SHIPPING_PHASE_DELIVERED == $this->getReturnPhase()) {
2599
  return false;
2600
  }
2601
 
2602
+ if (!$this->getLabelsPrinted() || !$this->getReturnLabelsPrinted()) {
2603
  return false;
2604
  }
2605
 
2606
+ if (!$this->getMainBarcode() || !$this->hasReturnBarcode()) {
2607
+ return false;
2608
+ }
2609
+
2610
+ return true;
2611
+ }
2612
+
2613
+ /**
2614
+ * Checks if the current shipment is eligible for a complete shipping status update.
2615
+ *
2616
+ * @return boolean
2617
+ */
2618
+ public function canUpdateCompleteShippingStatus()
2619
+ {
2620
+ if ($this->isLocked()) {
2621
+ return false;
2622
+ }
2623
+
2624
+ if (self::CONFIRM_STATUS_CONFIRMED != $this->getConfirmStatus()) {
2625
+ return false;
2626
+ }
2627
+
2628
+ if (!$this->getLabelsPrinted()) {
2629
+ return false;
2630
+ }
2631
+
2632
+ if (!$this->getMainBarcode()) {
2633
+ return false;
2634
+ }
2635
+
2636
+ $customBarcodes = $this->getCustomBarcodes();
2637
+ $productCode = $this->getProductCode();
2638
 
2639
  if (array_key_exists($productCode, $customBarcodes)) {
2640
  return false;
2710
  return true;
2711
  }
2712
 
2713
+ /**
2714
+ * Check if the return label can be mailed to the customer.
2715
+ *
2716
+ * @return boolean
2717
+ */
2718
+ public function canSendReturnLabelEmail()
2719
+ {
2720
+ if ($this->isLocked()) {
2721
+ return false;
2722
+ }
2723
+
2724
+ if (!$this->hasReturnLabels()) {
2725
+ return false;
2726
+ }
2727
+
2728
+ if (!$this->canPrintReturnLabels()) {
2729
+ return false;
2730
+ }
2731
+
2732
+ return true;
2733
+ }
2734
+
2735
  /**
2736
  * Checks if this shipment's confirmation status can be reset.
2737
  *
2739
  */
2740
  public function canResetConfirmation()
2741
  {
2742
+ if ($this->hasCustomBarcode()) {
 
2743
  return false;
2744
  }
2745
 
2746
+ if (!$this->isConfirmed()) {
2747
  return false;
2748
  }
 
2749
  $shippingPhase = $this->getShippingPhase();
2750
  if ($shippingPhase == self::SHIPPING_PHASE_DELIVERED
2751
  || $shippingPhase == self::SHIPPING_PHASE_DISTRIBUTION
2824
  return false;
2825
  }
2826
 
 
 
 
 
 
 
 
 
2827
  if (!$checkAvailableProductOptions) {
2828
  return true;
2829
  }
2850
  return false;
2851
  }
2852
 
2853
+ /**
2854
+ * Check if a return label may be printed for this shipment.
2855
+ *
2856
+ * @return boolean
2857
+ */
2858
+ public function canPrintReturnLabels()
2859
+ {
2860
+ if (!$this->isDutchShipment() || $this->isBuspakjeShipment()) {
2861
+ return false;
2862
+ }
2863
+
2864
+ if ($this->hasReturnLabels()) {
2865
+ return true;
2866
+ }
2867
+
2868
+ /**
2869
+ * If the shipment has labels, but no return labels it cannot print a return label. Instead the existing labels
2870
+ * need to be deleted first.
2871
+ */
2872
+ if ($this->hasLabels()) {
2873
+ return false;
2874
+ }
2875
+
2876
+ /**
2877
+ * If the shipment has a barcode, but no return barcode it cannot print a return label. The barcodes need to be
2878
+ * deleted first so new ones may be requested.
2879
+ */
2880
+ if ($this->hasMainBarcode() && !$this->hasReturnBarcode()) {
2881
+ return false;
2882
+ }
2883
+
2884
+ if ($this->canGenerateReturnBarcode()) {
2885
+ return true;
2886
+ }
2887
+
2888
+ return false;
2889
+ }
2890
+
2891
+ /**
2892
+ * Check if the current shipment's parcel count may be altered.
2893
+ *
2894
+ * @return boolean
2895
+ */
2896
+ public function canChangeParcelCount()
2897
+ {
2898
+ if ($this->isConfirmed()) {
2899
+ return false;
2900
+ }
2901
+
2902
+ if (!$this->isDutchShipment()) {
2903
+ return false;
2904
+ }
2905
+
2906
+ if ($this->isCod()) {
2907
+ return false;
2908
+ }
2909
+
2910
+ return true;
2911
+ }
2912
+
2913
  /*******************************************************************************************************************
2914
  * SHIPMENT LOCKING AND UNLOCKING FUNCTIONS
2915
  ******************************************************************************************************************/
3014
  return $this;
3015
  }
3016
 
3017
+ /**
3018
+ * Generates a return barcode for this shipment.
3019
+ *
3020
+ * @return $this
3021
+ *
3022
+ * @throws TIG_PostNL_Exception
3023
+ */
3024
+ public function generateReturnBarcode()
3025
+ {
3026
+ if (!$this->canGenerateReturnBarcode()) {
3027
+ throw new TIG_PostNL_Exception(
3028
+ Mage::helper('postnl')->__('The generateReturnBarcode action is currently unavailable.'),
3029
+ 'POSTNL-0201'
3030
+ );
3031
+ }
3032
+
3033
+ $this->lock();
3034
+
3035
+ Mage::dispatchEvent('postnl_shipment_generatereturnbarcodes_before', array('shipment' => $this));
3036
+
3037
+ $parcelCount = $this->getParcelCount();
3038
+ if (!$parcelCount) {
3039
+ $parcelCount = $this->_calculateParcelCount();
3040
+ }
3041
+
3042
+ /**
3043
+ * Generate a return barcode for each parcel and save it.
3044
+ */
3045
+ for ($i = 0; $i < $parcelCount; $i++) {
3046
+ $barcode = $this->_generateBarcode();
3047
+ $this->_addReturnBarcode($barcode, $i);
3048
+ }
3049
+
3050
+ Mage::dispatchEvent('postnl_shipment_generatereturnbarcodes_after', array('shipment' => $this));
3051
+ $this->unlock();
3052
+ return $this;
3053
+ }
3054
+
3055
  /**
3056
  * Generates a single barcode for this postnl shipment.
3057
  *
3153
  */
3154
  protected function _generateLabel($confirm = false, $barcodeNumber = false)
3155
  {
3156
+ $storeId = $this->getStoreId();
3157
  $mainBarcode = $this->getMainBarcode();
3158
 
3159
  /**
3163
  $barcode = $mainBarcode;
3164
  } else {
3165
  $barcode = $this->getBarcode($barcodeNumber);
3166
+ }
3167
+
3168
+ $returnBarcode = false;
3169
+ $printReturnLabel = $this->getHelper('cif')->isReturnsEnabled($storeId);
3170
+
3171
+ /**
3172
+ * If we should print a return label, get the return barcode.
3173
+ */
3174
+ if ($printReturnLabel) {
3175
+ $returnBarcode = $this->getReturnBarcode($barcodeNumber);
3176
+
3177
+ /**
3178
+ * If no return barcode is available, we can only print the regular shipping labels.
3179
+ */
3180
+ if (empty($returnBarcode)) {
3181
+ $printReturnLabel = false;
3182
+ }
3183
  }
3184
 
3185
  /**
3186
  * @var TIG_PostNL_Model_Core_Cif $cif
3187
  */
3188
  $cif = Mage::getModel('postnl_core/cif');
3189
+ $cif->setStoreId($storeId);
3190
+
3191
+ $barcodeNumber++; //while barcode numbers start at 0, shipment numbers start at 1
3192
 
3193
  /**
3194
  * @var StdClass $result
3195
  */
3196
  if ($confirm === false) {
3197
+ $result = $cif->generateLabelsWithoutConfirm(
3198
+ $this,
3199
+ $barcode,
3200
+ $mainBarcode,
3201
+ $barcodeNumber,
3202
+ $printReturnLabel,
3203
+ $returnBarcode
3204
+ );
3205
  } else {
3206
+ $result = $cif->generateLabels(
3207
+ $this,
3208
+ $barcode,
3209
+ $mainBarcode,
3210
+ $barcodeNumber,
3211
+ $printReturnLabel,
3212
+ $returnBarcode
3213
+ );
3214
  }
3215
 
3216
  if (!isset($result->Labels, $result->Labels->Label)) {
3453
  /**
3454
  * Requests a shipping status update for this shipment
3455
  *
3456
+ * @param boolean $parseColloNotFoundError
3457
+ *
3458
  * @return $this
3459
  *
3460
  * @throws TIG_PostNL_Exception
3461
  */
3462
+ public function updateShippingStatus($parseColloNotFoundError = false)
3463
  {
3464
  if (!$this->canUpdateShippingStatus()) {
3465
  throw new TIG_PostNL_Exception(
3472
 
3473
  Mage::dispatchEvent('postnl_shipment_updateshippingstatus_before', array('shipment' => $this));
3474
 
3475
+ try {
3476
+ $currentPhase = $this->_getShipmentStatus($this->getMainBarcode());
3477
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
3478
+ if (!$parseColloNotFoundError) {
3479
+ throw $e;
3480
+ }
3481
 
3482
+ $errorNumbers = $e->getErrorNumbers();
3483
+ if (1 === count($errorNumbers)
3484
+ && TIG_PostNL_Model_Core_Cif::SHIPMENT_NOT_FOUND_ERROR_NUMBER == $errorNumbers[0]
3485
+ ) {
3486
+ $currentPhase = self::SHIPPING_PHASE_NOT_APPLICABLE;
3487
+ } else {
3488
+ throw $e;
3489
+ }
3490
+ }
3491
 
3492
  if (!$currentPhase) {
3493
  return $this;
3509
  return $this;
3510
  }
3511
 
3512
+ /**
3513
+ * Requests a return status update for this shipment
3514
+ *
3515
+ * @param boolean $parseColloNotFoundError
3516
+ *
3517
+ * @return $this
3518
+ *
3519
+ * @throws TIG_PostNL_Exception
3520
+ */
3521
+ public function updateReturnStatus($parseColloNotFoundError = false)
3522
+ {
3523
+ if (!$this->canUpdateReturnStatus()) {
3524
+ throw new TIG_PostNL_Exception(
3525
+ Mage::helper('postnl')->__('The updateReturnStatus action is currently unavailable.'),
3526
+ 'POSTNL-0204'
3527
+ );
3528
+ }
3529
+
3530
+ $this->lock();
3531
+
3532
+ Mage::dispatchEvent('postnl_shipment_updatereturnstatus_before', array('shipment' => $this));
3533
+
3534
+ try {
3535
+ $currentPhase = $this->_getShipmentStatus($this->getReturnBarcode());
3536
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
3537
+ if (!$parseColloNotFoundError) {
3538
+ throw $e;
3539
+ }
3540
+
3541
+ $errorNumbers = $e->getErrorNumbers();
3542
+ if (1 === count($errorNumbers)
3543
+ && TIG_PostNL_Model_Core_Cif::SHIPMENT_NOT_FOUND_ERROR_NUMBER == $errorNumbers[0]
3544
+ ) {
3545
+ $currentPhase = self::SHIPPING_PHASE_NOT_APPLICABLE;
3546
+ } else {
3547
+ throw $e;
3548
+ }
3549
+ }
3550
+
3551
+ if (!$currentPhase) {
3552
+ return $this;
3553
+ }
3554
+
3555
+ Mage::dispatchEvent(
3556
+ 'postnl_shipment_updatereturnphase_before',
3557
+ array('shipment' => $this, 'phase' => $currentPhase)
3558
+ );
3559
+ $this->setReturnPhase($currentPhase);
3560
+ Mage::dispatchEvent(
3561
+ 'postnl_shipment_updatereturnphase_after',
3562
+ array('shipment' => $this, 'phase' => $currentPhase)
3563
+ );
3564
+
3565
+ Mage::dispatchEvent('postnl_shipment_updatereturnstatus_after', array('shipment' => $this));
3566
+
3567
+ $this->unlock();
3568
+ return $this;
3569
+ }
3570
+
3571
+ /**
3572
+ * Get a shipment status update for the specified barcode.
3573
+ *
3574
+ * @param string $barcode
3575
+ *
3576
+ * @return string|null
3577
+ *
3578
+ * @throws TIG_PostNL_Exception
3579
+ */
3580
+ protected function _getShipmentStatus($barcode)
3581
+ {
3582
+ /**
3583
+ * @var TIG_PostNL_Model_Core_Cif $cif
3584
+ */
3585
+ $cif = Mage::getModel('postnl_core/cif');
3586
+ $cif->setStoreId($this->getStoreId());
3587
+ $result = $cif->getShipmentStatus($barcode);
3588
+
3589
+ $currentPhase = $result->Status->CurrentPhaseCode;
3590
+
3591
+ return $currentPhase;
3592
+ }
3593
+
3594
  /**
3595
  * Update this shipment's status history
3596
  *
3611
 
3612
  Mage::dispatchEvent('postnl_shipment_updatecompleteshippingstatus_before', array('shipment' => $this));
3613
 
3614
+ $this->_updateCompleteStatus($this->getMainBarcode());
3615
+ if ($this->hasReturnBarcode()) {
3616
+ $this->_updateCompleteStatus($this->getReturnBarcode());
3617
+ }
3618
+
3619
+ Mage::dispatchEvent('postnl_shipment_updatecompleteshippingstatus_after', array('shipment' => $this));
3620
+
3621
+ $this->unlock();
3622
+
3623
+ return $this;
3624
+ }
3625
+
3626
+ /**
3627
+ * Update the complete status history for the specified barcode.
3628
+ *
3629
+ * @param string $barcode
3630
+ *
3631
+ * @return $this
3632
+ *
3633
+ * @throws Exception
3634
+ * @throws TIG_PostNL_Exception
3635
+ */
3636
+ protected function _updateCompleteStatus($barcode)
3637
+ {
3638
  /**
3639
  * @var TIG_PostNL_Model_Core_Cif $cif
3640
  * @var StdClass $result
3641
  */
3642
  $cif = Mage::getModel('postnl_core/cif');
3643
  $cif->setStoreId($this->getStoreId());
3644
+ $result = $cif->getCompleteShipmentStatus($barcode);
3645
 
3646
  /**
3647
  * Update the shipment's shipping phase
3704
 
3705
  $this->setStatusHistoryUpdatedAt($dateModel->gmtTimestamp());
3706
 
 
 
 
 
3707
  return $this;
3708
  }
3709
 
3712
  ******************************************************************************************************************/
3713
 
3714
  /**
3715
+ * Add Magento tracking information to the order for the return shipment.
3716
  *
3717
  * @return $this
3718
  *
3719
  * @throws TIG_PostNL_Exception
3720
+ *
3721
+ * @todo call this method after return labels have been printed
3722
+ * @todo find a way to hide this from customers or to mark it properly as a return shipment
3723
  */
3724
+ public function addReturnTrackingCodeToShipment()
3725
+ {
3726
+ return $this->addTrackingCodeToShipment(true);
3727
+ }
3728
+
3729
+ /**
3730
+ * Add Magento tracking information to the order containing the previously retrieved barcode.
3731
+ *
3732
+ * @param boolean $isReturn
3733
+ *
3734
+ * @return $this
3735
+ *
3736
+ * @throws TIG_PostNL_Exception
3737
+ */
3738
+ public function addTrackingCodeToShipment($isReturn = false)
3739
  {
3740
  if (!$this->canAddTrackingCode()) {
3741
  throw new TIG_PostNL_Exception(
3745
  }
3746
 
3747
  $shipment = $this->getShipment();
3748
+ if (true === $isReturn) {
3749
+ $barcode = $this->getReturnBarcode();
3750
+ } else {
3751
+ $barcode = $this->getMainBarcode();
3752
+ }
3753
 
3754
  if (!$shipment || !$barcode) {
3755
  throw new TIG_PostNL_Exception(
3760
 
3761
  $carrierCode = self::POSTNL_CARRIER_CODE;
3762
  $carrierTitle = Mage::getStoreConfig('carriers/' . $carrierCode . '/name', $shipment->getStoreId());
3763
+ if ($isReturn) {
3764
+ $carrierTitle .= ' - ' . $this->getHelper()->__('return');
3765
+ }
3766
 
3767
  $data = array(
3768
  'carrier_code' => $carrierCode,
3793
  * Send a track & trace email to the customer containing a link to the 'mijnpakket' environment where they
3794
  * can track their shipment.
3795
  *
3796
+ * @param boolean $ignoreAlreadySent Flag to ignore the 'already sent' check.
3797
+ * @param boolean $ignoreConfig Flag to ignore the configuration settings related to track&trace e-mails.
3798
+ *
3799
+ * @throws TIG_PostNL_Exception
3800
+ *
3801
+ * @return $this
3802
+ */
3803
+ public function sendTrackAndTraceEmail($ignoreAlreadySent = false, $ignoreConfig = false)
3804
+ {
3805
+ $helper = Mage::helper('postnl');
3806
+ if (!$this->canSendTrackAndTraceEmail($ignoreAlreadySent, $ignoreConfig)) {
3807
+ throw new TIG_PostNL_Exception(
3808
+ $helper->__('The sendTrackAndTraceEmail action is currently unavailable.'),
3809
+ 'POSTNL-0076'
3810
+ );
3811
+ }
3812
+
3813
+ try {
3814
+ $this->_sendTrackAndTraceEmail();
3815
+ } catch (Exception $e) {
3816
+ $helper->logException($e);
3817
+ throw new TIG_PostNL_Exception(
3818
+ $helper->__(
3819
+ 'Unable to send track and trace email for shipment #%s.',
3820
+ $this->getShipmentId()
3821
+ ),
3822
+ 'POSTNL-0077'
3823
+ );
3824
+ }
3825
+
3826
+ /**
3827
+ * Set the 'email sent' flag to true for this shipment.
3828
+ */
3829
+ if ($this->getShipment() && !$this->getShipment()->getEmailSent()) {
3830
+ $this->getShipment()
3831
+ ->setEmailSent(true)
3832
+ ->save();
3833
+ }
3834
+
3835
+ return $this;
3836
+ }
3837
+
3838
+ /**
3839
+ * Send a track & trace email to the customer containing a link to the 'mijnpakket' environment where they
3840
+ * can track their shipment.
3841
+ *
3842
+ * @return $this
3843
  *
3844
+ * @throws Exception
3845
  * @throws TIG_PostNL_Exception
 
 
3846
  */
3847
+ protected function _sendTrackAndTraceEmail()
3848
  {
3849
  $helper = Mage::helper('postnl');
 
 
 
 
 
 
3850
 
3851
  $storeId = $this->getStoreId();
3852
 
3853
  $template = Mage::getStoreConfig(self::XPATH_TRACK_AND_TRACE_EMAIL_TEMPLATE, $storeId);
3854
 
3855
+ /**
3856
+ * @var Mage_Sales_Model_Order $order
3857
+ */
3858
+ $shippingAddress = $this->getShippingAddress();
3859
+ $shipment = $this->getShipment();
3860
+ $order = $this->getOrder();
3861
+ if (!$order || !$shipment || !$shippingAddress) {
3862
+ throw new TIG_PostNL_Exception(
3863
+ $helper->__('Unable to send track & trace email due to missing shipment parameters.'),
3864
+ 'POSTNL-0200'
3865
+ );
3866
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
3867
 
3868
+ $payment = $order->getPayment();
3869
+ $paymentBlockHtml = '';
3870
+ if ($payment) {
3871
+ /** @noinspection PhpUndefinedMethodInspection */
3872
+ $paymentBlock = Mage::helper('payment')
3873
+ ->getInfoBlock($payment)
3874
+ ->setIsSecureMode(true);
3875
 
3876
  /** @noinspection PhpUndefinedMethodInspection */
3877
+ $paymentBlock->getMethod()
3878
+ ->setStore($storeId);
 
 
 
 
 
 
 
 
 
 
 
 
3879
 
3880
+ /**
3881
+ * @var Mage_Payment_Block_Info $paymentBlock
3882
+ */
3883
+ $paymentBlockHtml = $paymentBlock->toHtml();
3884
+ }
3885
+
3886
+ /** @noinspection PhpUndefinedMethodInspection */
3887
+ $templateVariables = array(
3888
+ 'postnlshipment' => $this,
3889
+ 'barcode' => $this->getMainBarcode(),
3890
+ 'barcode_url' => $this->getBarcodeUrl(false),
3891
+ 'shipment' => $shipment,
3892
+ 'order' => $order,
3893
+ 'payment_html' => $paymentBlockHtml,
3894
+ 'customer' => $order->getCustomer(),
3895
+ 'quote' => $order->getQuote(),
3896
+ 'shipment_comment' => '', /** @todo add last shipment comment */
3897
+ 'billing' => $order->getBillingAddress(),
3898
+ 'shipping' => $order->getShippingAddress(),
3899
+ 'pakje_gemak' => $this->getPakjeGemakAddress(),
3900
+ );
3901
+
3902
+ $templateVariables = new Varien_Object($templateVariables);
3903
+ Mage::dispatchEvent(
3904
+ 'postnl_shipment_add_track_and_trace_email_vars',
3905
+ array(
3906
+ 'vars' => $templateVariables,
3907
+ 'postnl_shipment' => $this,
3908
+ )
3909
+ );
3910
 
3911
+ // Get the destination email addresses to send copies to
3912
+ $copy = Mage::getStoreConfigFlag(self::XPATH_EMAIL_COPY, $storeId);
3913
+ $copyTo = explode(',', Mage::getStoreConfig(self::XPATH_EMAIL_COPY_TO, $storeId));
3914
+ $copyMethod = Mage::getStoreConfig(self::XPATH_EMAIL_COPY_METHOD, $storeId);
3915
 
3916
+ $mailer = Mage::getModel('core/email_template_mailer');
3917
+ $emailInfo = Mage::getModel('core/email_info');
3918
+ $emailInfo->addTo($order->getCustomerEmail(), $shippingAddress->getName());
3919
 
3920
+ if ($copy && !empty($copyTo) && $copyMethod == 'bcc') {
3921
+ foreach ($copyTo as $email) {
3922
+ $emailInfo->addBcc($email);
 
3923
  }
3924
+ }
3925
 
3926
+ $mailer->addEmailInfo($emailInfo);
3927
 
3928
+ if ($copy && !empty($copyTo) && $copyMethod == 'copy') {
3929
+ foreach ($copyTo as $email) {
3930
+ $emailInfo = Mage::getModel('core/email_info');
3931
+ $emailInfo->addTo($email);
3932
+ $mailer->addEmailInfo($emailInfo);
 
3933
  }
3934
+ }
3935
 
3936
+ /**
3937
+ * Set all required parameters.
3938
+ */
3939
+ $mailer->setSender(Mage::getStoreConfig($order::XML_PATH_EMAIL_IDENTITY, $storeId))
3940
+ ->setStoreId($storeId)
3941
+ ->setTemplateId($template)
3942
+ ->setTemplateParams($templateVariables->getData());
 
 
 
 
 
 
 
 
3943
 
3944
+ Mage::dispatchEvent(
3945
+ 'postnl_shipment_send_track_and_trace_email_before',
3946
+ array(
3947
+ 'postnl_shipment' => $this,
3948
+ 'mailer' => $mailer,
3949
+ )
3950
+ );
3951
 
3952
+ /**
3953
+ * Send the emails.
3954
+ */
3955
+ $mailer->send();
 
 
3956
 
3957
+ Mage::dispatchEvent(
3958
+ 'postnl_shipment_send_track_and_trace_email_after',
3959
+ array(
3960
+ 'postnl_shipment' => $this,
3961
+ )
3962
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3963
 
3964
  /**
3965
+ * Add a comment to the order and shipment that the track & trace email has been sent.
3966
  */
3967
+ $order->addStatusHistoryComment(
3968
+ $helper->__(
3969
+ 'PostNL track & trace email has been sent for shipment #%s.',
3970
+ $shipment->getIncrementId()
3971
+ )
3972
+ )
3973
+ ->setIsCustomerNotified(1)
3974
+ ->save();
3975
+
3976
+ $shipment->addComment(
3977
+ $helper->__('PostNL track & trace email has been sent.'),
3978
+ true
3979
+ )
3980
  ->save();
 
3981
 
3982
  return $this;
3983
  }
4003
  $barcodeModel->setParentId($this->getId())
4004
  ->setBarcode($barcode)
4005
  ->setBarcodeNumber($barcodeNumber)
4006
+ ->setBarcodeType($barcodeModel::BARCODE_TYPE_SHIPMENT)
4007
+ ->save();
4008
+
4009
+ $this->unsBarcodeCollections();
4010
+
4011
+ return $this;
4012
+ }
4013
+
4014
+ /**
4015
+ * Add a return barcode to this shipment's barcode collection
4016
+ *
4017
+ * @param string $barcode The barcode to add
4018
+ * @param int $barcodeNumber The number of this barcode
4019
+ *
4020
+ * @return $this
4021
+ */
4022
+ protected function _addReturnBarcode($barcode, $barcodeNumber)
4023
+ {
4024
+ /**
4025
+ * @var TIG_PostNL_Model_Core_Shipment_Barcode $barcodeModel
4026
+ */
4027
+ $barcodeModel = Mage::getModel('postnl_core/shipment_barcode');
4028
+ $barcodeModel->setParentId($this->getId())
4029
+ ->setBarcode($barcode)
4030
+ ->setBarcodeNumber($barcodeNumber)
4031
+ ->setBarcodeType($barcodeModel::BARCODE_TYPE_RETURN)
4032
  ->save();
4033
 
4034
+ $this->unsBarcodeCollections();
4035
+
4036
  return $this;
4037
  }
4038
 
4039
+ /**
4040
+ * Get the barcode URL for the specified barcode.
4041
+ *
4042
+ * @param string $barcode
4043
+ * @param boolean $forceNl
4044
+ *
4045
+ * @return string
4046
+ */
4047
+ protected function _getBarcodeUrl($barcode, $forceNl = false)
4048
+ {
4049
+ /**
4050
+ * @var TIG_PostNL_Helper_Carrier $helper
4051
+ */
4052
+ $helper = $this->getHelper('carrier');
4053
+
4054
+ $url = '';
4055
+ $shippingAddress = $this->getShippingAddress();
4056
+ if ($shippingAddress) {
4057
+ $url = $helper->getBarcodeUrl($barcode, $shippingAddress, false, $forceNl);
4058
+ }
4059
+
4060
+ return $url;
4061
+ }
4062
+
4063
  /*******************************************************************************************************************
4064
  * LABEL PROCESSING METHODS
4065
  ******************************************************************************************************************/
4172
  */
4173
  $transactionSave->save();
4174
 
4175
+ $this->unsLabelsToSave();
4176
+
4177
  Mage::dispatchEvent(
4178
  'postnl_shipment_savelabels_after',
4179
  array('shipment' => $this, 'labels' => $labelsToSave)
4216
  return true;
4217
  }
4218
 
4219
+ /**
4220
+ * Filter out return labels.
4221
+ *
4222
+ * @param TIG_PostNL_Model_Core_Shipment_Label[] $labels
4223
+ *
4224
+ * @return TIG_PostNL_Model_Core_Shipment_Label[]
4225
+ */
4226
+ protected function _filterReturnLabels($labels)
4227
+ {
4228
+ foreach ($labels as $key => $label) {
4229
+ if ($label->isReturnLabel()) {
4230
+ unset($labels[$key]);
4231
+ }
4232
+ }
4233
+
4234
+ return $labels;
4235
+ }
4236
+
4237
+ /**
4238
+ * Send an email to the customer containing the return label as a pdf attachment.
4239
+ *
4240
+ * @return $this
4241
+ *
4242
+ * @throws TIG_PostNL_Exception
4243
+ */
4244
+ public function sendReturnLabelEmail()
4245
+ {
4246
+ $helper = Mage::helper('postnl');
4247
+ if (!$this->canSendReturnLabelEmail()) {
4248
+ throw new TIG_PostNL_Exception(
4249
+ $helper->__('The sendReturnLabelEmail action is currently unavailable.'),
4250
+ 'POSTNL-0207'
4251
+ );
4252
+ }
4253
+
4254
+ try {
4255
+ $this->_sendReturnLabelEmail();
4256
+ } catch (Exception $e) {
4257
+ $helper->logException($e);
4258
+ throw new TIG_PostNL_Exception(
4259
+ $helper->__(
4260
+ 'Unable to send return email for shipment #%s.',
4261
+ $this->getShipmentId()
4262
+ ),
4263
+ 'POSTNL-0208'
4264
+ );
4265
+ }
4266
+
4267
+ /**
4268
+ * Set the 'return labels printed' flag to true for this shipment.
4269
+ */
4270
+ if (!$this->getReturnLabelsPrinted()) {
4271
+ $this->setReturnLabelsPrinted(true)
4272
+ ->save();
4273
+ }
4274
+
4275
+ return $this;
4276
+ }
4277
+
4278
+ /**
4279
+ * Send an email to the customer with the return label as a pdf attachment.
4280
+ *
4281
+ * @return $this
4282
+ *
4283
+ * @throws Exception
4284
+ * @throws TIG_PostNL_Exception
4285
+ */
4286
+ protected function _sendReturnLabelEmail()
4287
+ {
4288
+ $helper = Mage::helper('postnl');
4289
+
4290
+ $storeId = $this->getStoreId();
4291
+
4292
+ $template = Mage::getStoreConfig(self::XPATH_RETURN_LABEL_EMAIL_TEMPLATE, $storeId);
4293
+
4294
+ /**
4295
+ * @var Mage_Sales_Model_Order $order
4296
+ */
4297
+ $shippingAddress = $this->getShippingAddress();
4298
+ $shipment = $this->getShipment();
4299
+ $order = $this->getOrder();
4300
+ $returnLabels = $this->getReturnLabels();
4301
+ if (!$order || !$shipment || !$shippingAddress || empty($returnLabels)) {
4302
+ throw new TIG_PostNL_Exception(
4303
+ $helper->__('Unable to send return label email due to missing shipment parameters.'),
4304
+ 'POSTNL-0209'
4305
+ );
4306
+ }
4307
+
4308
+ $payment = $order->getPayment();
4309
+ $paymentBlockHtml = '';
4310
+ if ($payment) {
4311
+ /** @noinspection PhpUndefinedMethodInspection */
4312
+ $paymentBlock = Mage::helper('payment')
4313
+ ->getInfoBlock($payment)
4314
+ ->setIsSecureMode(true);
4315
+
4316
+ /** @noinspection PhpUndefinedMethodInspection */
4317
+ $paymentBlock->getMethod()
4318
+ ->setStore($storeId);
4319
+
4320
+ /**
4321
+ * @var Mage_Payment_Block_Info $paymentBlock
4322
+ */
4323
+ $paymentBlockHtml = $paymentBlock->toHtml();
4324
+ }
4325
+
4326
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
4327
+ $quote = Mage::getModel('sales/quote')->load($order->getQuoteId());
4328
+
4329
+ /** @noinspection PhpUndefinedMethodInspection */
4330
+ $templateVariables = array(
4331
+ 'postnlshipment' => $this,
4332
+ 'barcode' => $this->getMainBarcode(),
4333
+ 'barcode_url' => $this->getBarcodeUrl(false),
4334
+ 'return_barcode' => $this->getReturnBarcode(),
4335
+ 'return_barcode_url' => $this->getReturnBarcodeUrl(false),
4336
+ 'shipment' => $shipment,
4337
+ 'order' => $order,
4338
+ 'payment_html' => $paymentBlockHtml,
4339
+ 'customer' => $customer,
4340
+ 'customer_name' => $order->getCustomerName(),
4341
+ 'quote' => $quote,
4342
+ 'shipment_comment' => '', /** @todo add last shipment comment */
4343
+ 'billing' => $order->getBillingAddress(),
4344
+ 'shipping' => $order->getShippingAddress(),
4345
+ 'pakje_gemak' => $this->getPakjeGemakAddress(),
4346
+ );
4347
+
4348
+ $templateVariables = new Varien_Object($templateVariables);
4349
+
4350
+ $returnLabelPdf = Mage::getModel('postnl_core/label')
4351
+ ->setLabelSize('A4')
4352
+ ->setOutputMode('S')
4353
+ ->createPdf($returnLabels);
4354
+ $returnLabelObject = new varien_Object(array('label_pdf' => $returnLabelPdf));
4355
+
4356
+ Mage::dispatchEvent(
4357
+ 'postnl_shipment_add_return_label_email_vars',
4358
+ array(
4359
+ 'vars' => $templateVariables,
4360
+ 'return_label' => $returnLabelObject,
4361
+ 'postnl_shipment' => $this,
4362
+ )
4363
+ );
4364
+
4365
+ $emailInfo = Mage::getModel('core/email_info');
4366
+ $emailInfo->addTo($order->getCustomerEmail(), $shippingAddress->getName());
4367
+
4368
+ $transactionalEmail = Mage::getModel('core/email_template');
4369
+ $transactionalEmail->setDesignConfig(array('area' => 'frontend', 'store' => $storeId));
4370
+
4371
+ /** @var Zend_Mail $mail */
4372
+ $mail = $transactionalEmail->getMail();
4373
+ $mail->createAttachment(
4374
+ $returnLabelObject->getData('label_pdf'),
4375
+ Zend_Mime::TYPE_OCTETSTREAM,
4376
+ Zend_Mime::DISPOSITION_ATTACHMENT,
4377
+ Zend_Mime::ENCODING_BASE64,
4378
+ $helper->__('postnl_return_label.pdf')
4379
+ );
4380
+
4381
+ $transactionalEmail->sendTransactional(
4382
+ $template,
4383
+ Mage::getStoreConfig($order::XML_PATH_EMAIL_IDENTITY, $storeId),
4384
+ $emailInfo->getToEmails(),
4385
+ $emailInfo->getToNames(),
4386
+ $templateVariables->getData(),
4387
+ $this->getStoreId()
4388
+ );
4389
+
4390
+ /**
4391
+ * Add a comment to the order and shipment that the return label email has been sent.
4392
+ */
4393
+ $order->addStatusHistoryComment(
4394
+ $helper->__(
4395
+ 'PostNL return label email has been sent for shipment #%s.',
4396
+ $shipment->getIncrementId()
4397
+ )
4398
+ )
4399
+ ->setIsCustomerNotified(1)
4400
+ ->save();
4401
+
4402
+ $shipment->addComment(
4403
+ $helper->__('PostNL return label email has been sent.'),
4404
+ true
4405
+ )
4406
+ ->save();
4407
+
4408
+ return $this;
4409
+ }
4410
+
4411
  /*******************************************************************************************************************
4412
  * STATUS PROCESSING METHODS
4413
  ******************************************************************************************************************/
4545
  * is a buspakje shipment.
4546
  */
4547
  if ($shipmentType == self::SHIPMENT_TYPE_DOMESTIC
4548
+ && isset($codes['is_buspakje'])
4549
  && $codes['is_buspakje'] == '1'
4550
  ) {
4551
  $isBuspakje = true;
4552
  } elseif ($shipmentType == self::SHIPMENT_TYPE_DOMESTIC
4553
+ && (!isset($codes['is_buspakje'])
4554
  || $codes['is_buspakje'] == '-1'
4555
  )
4556
  ) {
4727
  }
4728
 
4729
  /**
4730
+ * Get the number of parcels in this shipment.
4731
  *
4732
  * @return int
4733
  */
4734
  protected function _calculateParcelCount()
4735
  {
4736
  /**
4737
+ * Only Dutch shipments that are not COD support multi-colli shipments.
4738
  */
4739
  if (!$this->isDutchShipment() || $this->isCod()) {
4740
  return 1;
4741
  }
4742
 
4743
  /**
4744
+ * Get this shipment's total weight.
4745
  */
4746
  $weight = $this->getTotalWeight(true);
4747
 
4748
  /**
4749
+ * Get the weight per parcel.
4750
  *
4751
  * @var TIG_PostNL_Helper_Cif $helper
4752
  */
4755
  $weightPerParcel = $helper->standardizeWeight($weightPerParcel, $this->getStoreId());
4756
 
4757
  /**
4758
+ * Calculate the number of parcels needed to ship the total weight of this shipment.
4759
  */
4760
  $parcelCount = ceil($weight / $weightPerParcel);
4761
+ if ($parcelCount < 1) {
4762
+ $parcelCount = 1;
4763
+ }
4764
+
4765
+ if ($parcelCount < 1) {
4766
+ $parcelCount = 1;
4767
+ }
4768
 
4769
  return $parcelCount;
4770
  }
4862
  return $this;
4863
  }
4864
 
4865
+ /**
4866
+ * Changes the current shipment's product code.
4867
+ *
4868
+ * @param int $parcelCount
4869
+ *
4870
+ * @return $this
4871
+ *
4872
+ * @throws TIG_PostNL_Exception
4873
+ */
4874
+ public function changeParcelCount($parcelCount)
4875
+ {
4876
+ if (!$this->canChangeParcelCount()) {
4877
+ throw new TIG_PostNL_Exception(
4878
+ $this->getHelper()->__('The changeParcelCount action is currently unavailable.'),
4879
+ 'POSTNL-0203'
4880
+ );
4881
+ }
4882
+
4883
+ $parcelCount = (int) $parcelCount;
4884
+
4885
+ if ($parcelCount < 1) {
4886
+ $parcelCount = 1;
4887
+ }
4888
+
4889
+ $this->deleteBarcodes()
4890
+ ->setParcelCount($parcelCount);
4891
+
4892
+ return $this;
4893
+ }
4894
+
4895
  /*******************************************************************************************************************
4896
  * RESET AND DELETE METHODS
4897
  ******************************************************************************************************************/
4960
  /**
4961
  * Removes all labels associated with this shipment
4962
  *
4963
+ * @param boolean $resetLabelsPrinted
4964
+ *
4965
  * @return $this
4966
  */
4967
+ public function deleteLabels($resetLabelsPrinted = true)
4968
  {
4969
  $labelCollection = $this->getLabelCollection();
4970
 
4977
  $label->delete();
4978
  }
4979
 
4980
+ $this->setLabels(false)
4981
+ ->setReturnLabels(false);
4982
+
4983
+ if ($resetLabelsPrinted) {
4984
+ $this->setLabelsPrinted(false)
4985
+ ->setReturnLabelsPrinted(false);
4986
+ }
4987
+
4988
  return $this;
4989
  }
4990
 
4995
  */
4996
  public function deleteBarcodes()
4997
  {
4998
+ $barcodes = $this->getBarcodes(true, false);
4999
 
5000
  /**
5001
  * @var TIG_PostNL_Model_Core_Shipment_Barcode $barcode
5004
  $barcode->delete();
5005
  }
5006
 
5007
+ $this->setMainBarcode(false)
5008
+ ->unsBarcodeCollections();
5009
 
5010
  return $this;
5011
  }
5098
  /**
5099
  * Set whether labels have printed or not.
5100
  */
5101
+ if ($this->getLabelsPrinted() == 0 && $this->hasLabels()) {
5102
+ $this->setLabelsPrinted(true);
5103
+ }
5104
+
5105
+ /**
5106
+ * Set whether return labels have printed or not.
5107
+ */
5108
+ if ($this->getReturnLabelsPrinted() == 0 && $this->hasReturnLabels()) {
5109
+ $this->setReturnLabelsPrinted(true);
5110
  }
5111
 
5112
  /**
5127
  /**
5128
  * Set the parcel count.
5129
  */
5130
+ if (!$this->getParcelCount() || $this->getParcelCount() < 1) {
5131
  $parcelCount = $this->_calculateParcelCount();
5132
  $this->setParcelCount($parcelCount);
5133
  }
5139
  $this->setConfirmDate();
5140
  }
5141
 
5142
+ /**
5143
+ * Check if this shipment is a letter box order.
5144
+ */
5145
+ if ($this->isObjectNew() && self::SHIPMENT_TYPE_BUSPAKJE == $this->getShipmentType()) {
5146
+ $this->setIsBuspakje(true);
5147
+ }
5148
+
5149
  /**
5150
  * If no order ID has been set, use the getOrderId() method. This will automatically set the order ID.
5151
  */
app/code/community/TIG/PostNL/Model/Core/Shipment/Barcode.php CHANGED
@@ -36,18 +36,25 @@
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  *
39
- * Class TIG_PostNL_Model_Core_Shipment_Barcode@method getBarcode
 
 
 
 
 
 
40
  *
41
- * @method int getBarcodeNumber()
42
- * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcodeNumber(int $value)
43
- * @method int getBarcodeId()
44
  * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcodeId(int $value)
45
- * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcode(string $value)
46
- * @method int getParentId()
47
  * @method TIG_PostNL_Model_Core_Shipment_Barcode setParentId(int $value)
 
 
 
48
  */
49
  class TIG_PostNL_Model_Core_Shipment_Barcode extends Mage_Core_Model_Abstract
50
  {
 
 
 
51
  /**
52
  * Prefix of model events names
53
  *
@@ -63,19 +70,25 @@ class TIG_PostNL_Model_Core_Shipment_Barcode extends Mage_Core_Model_Abstract
63
  /**
64
  * Load a barcode object based on a postnl shipment Id and a barcode number
65
  *
66
- * @param $parentId
67
- * @param $barcodeNumber
 
68
  *
69
  * @return $this
70
  */
71
- public function loadByParentAndBarcodeNumber($parentId, $barcodeNumber)
72
  {
 
 
 
 
73
  /**
74
  * @var TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection $collection
75
  */
76
  $collection = $this->getCollection();
77
  $collection->addFieldToSelect('*')
78
  ->addFieldToFilter('parent_id', array('eq' => $parentId))
 
79
  ->addFieldToFilter('barcode_number', array('eq' => $barcodeNumber));
80
 
81
  if ($collection->getSize()) {
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  *
39
+ * Class TIG_PostNL_Model_Core_Shipment_Barcode
40
+ *
41
+ * @method int getBarcodeId()
42
+ * @method int getParentId()
43
+ * @method string getBarcodeType()
44
+ * @method int getBarcodeNumber()
45
+ * @method string getBarcode()
46
  *
 
 
 
47
  * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcodeId(int $value)
 
 
48
  * @method TIG_PostNL_Model_Core_Shipment_Barcode setParentId(int $value)
49
+ * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcodeType(string $value)
50
+ * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcodeNumber(int $value)
51
+ * @method TIG_PostNL_Model_Core_Shipment_Barcode setBarcode(string $value)
52
  */
53
  class TIG_PostNL_Model_Core_Shipment_Barcode extends Mage_Core_Model_Abstract
54
  {
55
+ const BARCODE_TYPE_SHIPMENT = 'shipment';
56
+ const BARCODE_TYPE_RETURN = 'return';
57
+
58
  /**
59
  * Prefix of model events names
60
  *
70
  /**
71
  * Load a barcode object based on a postnl shipment Id and a barcode number
72
  *
73
+ * @param int $parentId
74
+ * @param int $barcodeNumber
75
+ * @param string|boolean $type
76
  *
77
  * @return $this
78
  */
79
+ public function loadByParentAndBarcodeNumber($parentId, $barcodeNumber, $type = false)
80
  {
81
+ if (!$type) {
82
+ $type = self::BARCODE_TYPE_SHIPMENT;
83
+ }
84
+
85
  /**
86
  * @var TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection $collection
87
  */
88
  $collection = $this->getCollection();
89
  $collection->addFieldToSelect('*')
90
  ->addFieldToFilter('parent_id', array('eq' => $parentId))
91
+ ->addFieldToFilter('barcode_type', array('eq' => $type))
92
  ->addFieldToFilter('barcode_number', array('eq' => $barcodeNumber));
93
 
94
  if ($collection->getSize()) {
app/code/community/TIG/PostNL/Model/Core/Shipment/Label.php CHANGED
@@ -86,4 +86,21 @@ class TIG_PostNL_Model_Core_Shipment_Label extends Mage_Core_Model_Abstract
86
 
87
  return $label;
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
86
 
87
  return $label;
88
  }
89
+
90
+ /**
91
+ * Check if this label is a return label.
92
+ *
93
+ * @return bool
94
+ */
95
+ public function isReturnLabel()
96
+ {
97
+ $labelType = $this->getLabelType();
98
+ $returnLabelTypes = Mage::helper('postnl/cif')->getReturnLabelTypes();
99
+
100
+ if (in_array($labelType, $returnLabelTypes)) {
101
+ return true;
102
+ }
103
+
104
+ return false;
105
+ }
106
  }
app/code/community/TIG/PostNL/Model/Core/Shipment/Status/History.php CHANGED
@@ -74,7 +74,7 @@ class TIG_PostNL_Model_Core_Shipment_Status_History extends Mage_Core_Model_Abst
74
  /**
75
  * Set the 'phase' attribute. The phase must be formatted as a 2 digit number (i.e. 01, 04, 12, 99 etc.)
76
  *
77
- * @param string | int $phase
78
  *
79
  * @return TIG_PostNL_Model_Core_Shipment_Status_History
80
  */
@@ -91,7 +91,7 @@ class TIG_PostNL_Model_Core_Shipment_Status_History extends Mage_Core_Model_Abst
91
  /**
92
  * Load a history item based on a postnl shipment id and a status code.
93
  *
94
- * @param int $shipmentId
95
  * @param string $code
96
  *
97
  * @return TIG_PostNL_Model_Core_Shipment_Status_History
@@ -120,8 +120,8 @@ class TIG_PostNL_Model_Core_Shipment_Status_History extends Mage_Core_Model_Abst
120
  /**
121
  * Check if a status history item exists for the given postnl shipment and status
122
  *
123
- * @param int $shipmentId
124
- * @param $status
125
  *
126
  * @return boolean
127
  */
@@ -135,19 +135,19 @@ class TIG_PostNL_Model_Core_Shipment_Status_History extends Mage_Core_Model_Abst
135
  ->addFieldToFilter('parent_id', array('eq' => $shipmentId))
136
  ->addFieldToFilter('code', array('eq' => $status->Code));
137
 
138
- if ($status->LocationCode !== '') {
139
  $collection->addFieldToFilter('location_code', array('eq' => $status->LocationCode));
140
  }
141
 
142
- if ($status->DestinationLocationCode !== '') {
143
  $collection->addFieldToFilter('destination_location_code', array('eq' => $status->DestinationLocationCode));
144
  }
145
 
146
- if ($status->RouteCode !== '') {
147
  $collection->addFieldToFilter('route_code', array('eq' => $status->RouteCode));
148
  }
149
 
150
- if ($status->RouteName !== '') {
151
  $collection->addFieldToFilter('route_name', array('eq' => $status->RouteName));
152
  }
153
 
74
  /**
75
  * Set the 'phase' attribute. The phase must be formatted as a 2 digit number (i.e. 01, 04, 12, 99 etc.)
76
  *
77
+ * @param string|int $phase
78
  *
79
  * @return TIG_PostNL_Model_Core_Shipment_Status_History
80
  */
91
  /**
92
  * Load a history item based on a postnl shipment id and a status code.
93
  *
94
+ * @param int $shipmentId
95
  * @param string $code
96
  *
97
  * @return TIG_PostNL_Model_Core_Shipment_Status_History
120
  /**
121
  * Check if a status history item exists for the given postnl shipment and status
122
  *
123
+ * @param int $shipmentId
124
+ * @param StdClass $status
125
  *
126
  * @return boolean
127
  */
135
  ->addFieldToFilter('parent_id', array('eq' => $shipmentId))
136
  ->addFieldToFilter('code', array('eq' => $status->Code));
137
 
138
+ if (!empty($status->LocationCode)) {
139
  $collection->addFieldToFilter('location_code', array('eq' => $status->LocationCode));
140
  }
141
 
142
+ if (!empty($status->DestinationLocationCode)) {
143
  $collection->addFieldToFilter('destination_location_code', array('eq' => $status->DestinationLocationCode));
144
  }
145
 
146
+ if (!empty($status->RouteCode)) {
147
  $collection->addFieldToFilter('route_code', array('eq' => $status->RouteCode));
148
  }
149
 
150
+ if (!empty($status->RouteName)) {
151
  $collection->addFieldToFilter('route_name', array('eq' => $status->RouteName));
152
  }
153
 
app/code/community/TIG/PostNL/Model/Core/System/Config/Source/AllProductOptions.php CHANGED
@@ -306,11 +306,8 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
306
  */
307
  $helper = Mage::helper('postnl');
308
  if ($helper->canUseEpsBEOnlyOption()
309
- && (
310
- (isset($flags['group'])
311
- && $flags['group'] == 'eu_options'
312
- )
313
- || (!isset($flags['group']))
314
  )
315
  ) {
316
  if (!$asFlatArray) {
@@ -352,6 +349,16 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
352
  return $options;
353
  }
354
 
 
 
 
 
 
 
 
 
 
 
355
  /**
356
  * Get the list of available product options that have extra cover.
357
  *
306
  */
307
  $helper = Mage::helper('postnl');
308
  if ($helper->canUseEpsBEOnlyOption()
309
+ && (!isset($flags['group'])
310
+ || $flags['group'] == 'eu_options'
 
 
 
311
  )
312
  ) {
313
  if (!$asFlatArray) {
349
  return $options;
350
  }
351
 
352
+ /**
353
+ * Get a flat array of all options.
354
+ *
355
+ * @return array
356
+ */
357
+ public function toArray()
358
+ {
359
+ return $this->getOptions(array(), true);
360
+ }
361
+
362
  /**
363
  * Get the list of available product options that have extra cover.
364
  *
app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CommentType.php CHANGED
@@ -53,7 +53,7 @@ class TIG_PostNL_Model_Core_System_Config_Source_CommentType
53
  ),
54
  array(
55
  'value' => 'shipment_comment',
56
- 'label' => $helper->__('Last shipment comment'),
57
  ),
58
  );
59
 
53
  ),
54
  array(
55
  'value' => 'shipment_comment',
56
+ 'label' => $helper->__('Last shipment comment (as shown on the shipment detail page)'),
57
  ),
58
  );
59
 
app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingDays.php CHANGED
@@ -45,7 +45,7 @@ class TIG_PostNL_Model_Core_System_Config_Source_ShippingDays
45
  */
46
  public function toOptionArray()
47
  {
48
- $helper = Mage::helper('postnl');
49
  $labelSizes = array(
50
  array(
51
  'value' => '1',
@@ -73,6 +73,13 @@ class TIG_PostNL_Model_Core_System_Config_Source_ShippingDays
73
  ),
74
  );
75
 
 
 
 
 
 
 
 
76
  return $labelSizes;
77
  }
78
  }
45
  */
46
  public function toOptionArray()
47
  {
48
+ $helper = Mage::helper('postnl/deliveryOptions');
49
  $labelSizes = array(
50
  array(
51
  'value' => '1',
73
  ),
74
  );
75
 
76
+ if ($helper->canUseSundaySorting()) {
77
+ $labelSizes[] = array(
78
+ 'value' => '7',
79
+ 'label' => $helper->__('Sunday'),
80
+ );
81
+ }
82
+
83
  return $labelSizes;
84
  }
85
  }
app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StaticBlocks.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Core_System_Config_Source_StaticBlocks
40
+ {
41
+ /**
42
+ * @var array
43
+ */
44
+ protected $_options;
45
+
46
+ /**
47
+ * @return array
48
+ */
49
+ public function getOptions()
50
+ {
51
+ return $this->_options;
52
+ }
53
+
54
+ /**
55
+ * @param array $options
56
+ *
57
+ * @return $this
58
+ */
59
+ public function setOptions($options)
60
+ {
61
+ $this->_options = $options;
62
+
63
+ return $this;
64
+ }
65
+
66
+ /**
67
+ * @return bool
68
+ */
69
+ public function hasOptions()
70
+ {
71
+ $options = $this->_options;
72
+ if (is_array($options) && count($options) > 0) {
73
+ return true;
74
+ }
75
+
76
+ return false;
77
+ }
78
+
79
+ /**
80
+ * Returns an option array for all static blocks.
81
+ *
82
+ * @return array
83
+ */
84
+ public function toOptionArray()
85
+ {
86
+ if ($this->hasOptions()) {
87
+ return $this->getOptions();
88
+ }
89
+
90
+ /**
91
+ * Get the basic empty option.
92
+ */
93
+ $options = array(
94
+ array(
95
+ 'label' => Mage::helper('postnl')->__('-- None --'),
96
+ 'value' => '',
97
+ ),
98
+ );
99
+
100
+ /**
101
+ * Get all static blocks.
102
+ */
103
+ $blocksCollection = Mage::getResourceModel('cms/block_collection');
104
+
105
+ /**
106
+ * Add filters based on the current config scope.
107
+ *
108
+ * This prevents the merchant from accidentally selecting a static block that is not available in the current
109
+ * scope.
110
+ */
111
+ $request = Mage::app()->getRequest();
112
+ if ($request->getParam('store')) {
113
+ $store = Mage::app()->getStore($request->getParam('store'));
114
+
115
+ $blocksCollection->addStoreFilter($store);
116
+ } elseif ($request->getParam('website')) {
117
+ $website = Mage::getModel('core/website')->load($request->getParam('website'));
118
+ $stores = $website->getStoreIds();
119
+
120
+ $blocksCollection->addStoreFilter($stores);
121
+ }
122
+
123
+ /**
124
+ * Convert the collection to an option array where the block's ID is the value and the block's title is the
125
+ * label.
126
+ */
127
+ $blocksOptions = $blocksCollection->toOptionArray();
128
+
129
+ /**
130
+ * Merge the empty option with the static blocks.
131
+ */
132
+ $options = array_merge($options, $blocksOptions);
133
+
134
+ $this->setOptions($options);
135
+ return $options;
136
+ }
137
+ }
app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StreetField.php CHANGED
@@ -38,11 +38,6 @@
38
  */
39
  class TIG_PostNL_Model_Core_System_Config_Source_StreetField
40
  {
41
- /**
42
- * XML path to community edition address lines configuration option
43
- */
44
- const XPATH_COMMUNITY_STREET_LINES = 'customer/address/street_lines';
45
-
46
  /**
47
  * @var null|array The resulting product option array
48
  */
@@ -59,74 +54,8 @@ class TIG_PostNL_Model_Core_System_Config_Source_StreetField
59
  return $this->_options;
60
  }
61
 
62
- if (Mage::helper('postnl')->isEnterprise()) {
63
- $array = $this->_getEnterpriseOptions();
64
-
65
- $this->_options = $array;
66
- return $array;
67
- }
68
-
69
- $array = $this->_getCommunityOptions();
70
-
71
- $this->_options = $array;
72
- return $array;
73
- }
74
-
75
- /**
76
- * Gets options for community edition shops
77
- *
78
- * @return array
79
- */
80
- protected function _getCommunityOptions()
81
- {
82
- $request = Mage::app()->getRequest();
83
- $helper = Mage::helper('postnl');
84
-
85
- /**
86
- * Get the allowed number of address lines based on the current scope
87
- */
88
- if ($request->getParam('store')) {
89
- $lineCount = Mage::getStoreConfig(self::XPATH_COMMUNITY_STREET_LINES, $request->getParam('store'));
90
- } elseif ($request->getParam('website')) {
91
- $website = Mage::getModel('core/website')->load($request->getParam('website'), 'code');
92
- $lineCount = $website->getConfig(self::XPATH_COMMUNITY_STREET_LINES, $website->getId());
93
- } else {
94
- $lineCount = Mage::getStoreConfig(
95
- self::XPATH_COMMUNITY_STREET_LINES,
96
- Mage_Core_Model_App::ADMIN_STORE_ID
97
- );
98
- }
99
-
100
- /**
101
- * It's possible to leave the streetfield empty in community. In that case, the default value of 2 will be used.
102
- */
103
- if (!$lineCount) {
104
- $lineCount = 2;
105
- }
106
-
107
- /**
108
- * Build the option array
109
- */
110
- $array = array();
111
- for ($n = 1; $n <= $lineCount; $n++) {
112
- $array[] = array(
113
- 'value' => $n,
114
- 'label' => $helper->__('Street line #%s', $n),
115
- );
116
- }
117
-
118
- return $array;
119
- }
120
-
121
- /**
122
- * Gets options for enterprise edition shops
123
- *
124
- * @return array
125
- */
126
- protected function _getEnterpriseOptions()
127
- {
128
- $helper = Mage::helper('postnl');
129
- $lineCount = Mage::helper('customer/address')->getStreetLines();
130
 
131
  /**
132
  * Build the option array
@@ -139,6 +68,7 @@ class TIG_PostNL_Model_Core_System_Config_Source_StreetField
139
  );
140
  }
141
 
 
142
  return $array;
143
  }
144
  }
38
  */
39
  class TIG_PostNL_Model_Core_System_Config_Source_StreetField
40
  {
 
 
 
 
 
41
  /**
42
  * @var null|array The resulting product option array
43
  */
54
  return $this->_options;
55
  }
56
 
57
+ $helper = Mage::helper('postnl/addressValidation');
58
+ $lineCount = $helper->getAddressLineCount();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  /**
61
  * Build the option array
68
  );
69
  }
70
 
71
+ $this->_options = $array;
72
  return $array;
73
  }
74
  }
app/code/community/TIG/PostNL/Model/DeliveryOptions/Cif.php CHANGED
@@ -92,12 +92,15 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
92
  );
93
  }
94
 
95
- $shippingDuration = Mage::helper('postnl/deliveryOptions')->getShippingDuration($quote);
 
 
 
96
 
97
  $soapParams = array(
98
  'GetDeliveryDate' => array(
99
  'Postalcode' => $postcode,
100
- 'ShippingDate' => Mage::getSingleton('core/date')->date('d-m-Y H:i:s'),
101
  'ShippingDuration' => $shippingDuration,
102
  'CutOffTime' => $this->_getCutOffTime(),
103
  'AllowSundaySorting' => $this->_getSundaySortingAllowed(),
@@ -160,10 +163,11 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
160
 
161
  $soapParams = array(
162
  'Timeframe' => array(
163
- 'PostalCode' => $data['postcode'],
164
- 'HouseNumber' => $data['housenumber'],
165
- 'StartDate' => $startDate,
166
- 'EndDate' => $endDate->format('d-m-Y'),
 
167
  ),
168
  'Message' => $this->_getMessage('')
169
  );
@@ -212,8 +216,10 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
212
  $message = $this->_getMessage('');
213
 
214
  $soapParams = array(
215
- 'Location' => $location,
216
- 'Message' => $message,
 
 
217
  );
218
 
219
  /**
@@ -238,7 +244,7 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
238
  }
239
 
240
  /**
241
- * gets post office locations within a specific area, marked by a set of coordinates.
242
  *
243
  * @param $data
244
  *
@@ -259,8 +265,9 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
259
  $message = $this->_getMessage('');
260
 
261
  $soapParams = array(
262
- 'Location' => $location,
263
- 'Message' => $message,
 
264
  );
265
 
266
  /**
92
  );
93
  }
94
 
95
+ $shippingDuration = Mage::helper('postnl/deliveryOptions')->getQuoteShippingDuration($quote);
96
+
97
+ $date = new DateTime(Mage::getSingleton('core/date')->gmtDate('d-m-Y H:i:s'));
98
+ $date->setTimezone(new DateTimeZone('Europe/Berlin'));
99
 
100
  $soapParams = array(
101
  'GetDeliveryDate' => array(
102
  'Postalcode' => $postcode,
103
+ 'ShippingDate' => $date->format('d-m-Y H:i:s'),
104
  'ShippingDuration' => $shippingDuration,
105
  'CutOffTime' => $this->_getCutOffTime(),
106
  'AllowSundaySorting' => $this->_getSundaySortingAllowed(),
163
 
164
  $soapParams = array(
165
  'Timeframe' => array(
166
+ 'PostalCode' => $data['postcode'],
167
+ 'HouseNumber' => $data['housenumber'],
168
+ 'StartDate' => $startDate,
169
+ 'EndDate' => $endDate->format('d-m-Y'),
170
+ 'SundaySorting' => $this->_getSundaySortingAllowed(),
171
  ),
172
  'Message' => $this->_getMessage('')
173
  );
216
  $message = $this->_getMessage('');
217
 
218
  $soapParams = array(
219
+ 'Location' => $location,
220
+ 'Message' => $message,
221
+ 'Countrycode' => 'NL' // @todo make dynamic
222
+
223
  );
224
 
225
  /**
244
  }
245
 
246
  /**
247
+ * Gets post office locations within a specific area, marked by a set of coordinates.
248
  *
249
  * @param $data
250
  *
265
  $message = $this->_getMessage('');
266
 
267
  $soapParams = array(
268
+ 'Location' => $location,
269
+ 'Message' => $message,
270
+ 'Countrycode' => 'NL' // @todo make dynamic
271
  );
272
 
273
  /**
app/code/community/TIG/PostNL/Model/DeliveryOptions/Product/Attribute/Source/ShippingDuration.php CHANGED
@@ -118,4 +118,56 @@ class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ShippingDuration
118
  $this->_options = $options;
119
  return $options;
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
118
  $this->_options = $options;
119
  return $options;
120
  }
121
+
122
+ /**
123
+ * Retrieve flat column definition
124
+ *
125
+ * @return array
126
+ */
127
+ public function getFlatColums()
128
+ {
129
+ $attributeCode = $this->getAttribute()->getAttributeCode();
130
+ $column = array(
131
+ 'default' => null,
132
+ 'extra' => null,
133
+ 'type' => Varien_Db_Ddl_Table::TYPE_VARCHAR,
134
+ 'is_null' => true,
135
+ 'comment' => $attributeCode . ' column',
136
+ );
137
+
138
+ $columnDefinition = array($attributeCode => $column);
139
+ return $columnDefinition;
140
+ }
141
+
142
+ /**
143
+ * Retrieve Indexes(s) for Flat
144
+ *
145
+ * @return array
146
+ */
147
+ public function getFlatIndexes()
148
+ {
149
+ $indexes = array();
150
+
151
+ $index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode());
152
+ $indexes[$index] = array(
153
+ 'type' => 'index',
154
+ 'fields' => array($this->getAttribute()->getAttributeCode())
155
+ );
156
+
157
+ return $indexes;
158
+ }
159
+
160
+ /**
161
+ * Retrieve Select For Flat Attribute update
162
+ *
163
+ * @param int $store
164
+ * @return Varien_Db_Select|null
165
+ */
166
+ public function getFlatUpdateSelect($store)
167
+ {
168
+ $select = Mage::getResourceModel('eav/entity_attribute')
169
+ ->getFlatUpdateSelect($this->getAttribute(), $store);
170
+
171
+ return $select;
172
+ }
173
  }
app/code/community/TIG/PostNL/Model/DeliveryOptions/Service.php CHANGED
@@ -124,22 +124,29 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
124
  /**
125
  * Calculate the confirm date for a specified delivery date.
126
  *
127
- * @param string $deliveryDate
 
128
  *
129
  * @return DateTime
130
  */
131
- public function getConfirmDate($deliveryDate)
132
  {
133
  if ($this->hasConfirmDate()) {
134
  return $this->_getData('confirm_date');
135
  }
136
 
137
- $deliveryDate = new DateTime($deliveryDate);
 
 
 
 
 
 
 
138
 
139
  $confirmDate = $deliveryDate->sub(new DateInterval("P1D"));
140
- $confirmDate = $confirmDate->format('Y-m-d');
141
 
142
- $confirmDate = Mage::helper('postnl/deliveryOptions')->getValidConfirmDate($confirmDate);
143
 
144
  $this->setConfirmDate($confirmDate);
145
  return $confirmDate;
@@ -165,6 +172,14 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
165
  $shippingDays = Mage::getStoreConfig(self::XPATH_SHIPPING_DAYS, Mage::app()->getStore()->getId());
166
  $shippingDays = explode(',', $shippingDays);
167
 
 
 
 
 
 
 
 
 
168
  foreach ($timeframes as $key => $timeframe) {
169
  /**
170
  * Get the date of the time frame and calculate the shipping day. The shipping day will be the day before
@@ -172,22 +187,34 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
172
  */
173
  $timeframeDate = new DateTime($timeframe->Date);
174
  $deliveryDay = (int) $timeframeDate->format('N');
175
- $shippingDay = (int) $timeframeDate->sub(new DateInterval('P1D'))->format('N');
176
 
177
- if ($shippingDay < 1 || $shippingDay > 6) {
178
- $shippingDay = 6;
 
 
 
179
  }
180
 
181
  /**
182
- * If the shipping day is not allowed, remove the time frame from the array.
 
183
  *
184
- * For tuesday delivery either saturday or monday needs to be available.
 
185
  */
186
- if ($deliveryDay === 2 && !in_array($shippingDay, $shippingDays)) {
187
- $shippingDay = 6;
 
 
 
 
 
 
 
 
188
  }
189
 
190
- if (!in_array($shippingDay, $shippingDays)) {
191
  unset($timeframes[$key]);
192
  }
193
  }
@@ -198,6 +225,37 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
198
  return array_values($timeframes);
199
  }
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  /**
202
  * @param float|int $costs
203
  *
@@ -241,7 +299,9 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
241
  }
242
 
243
  /**
244
- * @param $data
 
 
245
  *
246
  * @return $this
247
  */
@@ -249,7 +309,10 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
249
  {
250
  $quote = $this->getQuote();
251
 
252
- $confirmDate = $this->getConfirmDate($data['date'])->getTimestamp();
 
 
 
253
 
254
  /**
255
  * @var TIG_PostNL_Model_Core_Order $postnlOrder
@@ -263,8 +326,10 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
263
  ->setMobilePhoneNumber(false, true)
264
  ->setType($data['type'])
265
  ->setShipmentCosts($data['costs'])
266
- ->setDeliveryDate($data['date'])
267
- ->setConfirmDate($confirmDate);
 
 
268
 
269
  if ($data['type'] == 'PA') {
270
  $postnlOrder->setIsPakketautomaat(true)
@@ -274,6 +339,18 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
274
  $postnlOrder->setIsPakjeGemak(true);
275
  }
276
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  /**
278
  * Remove any existing PakjeGemak addresses.
279
  *
@@ -282,13 +359,14 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
282
  foreach ($quote->getAllAddresses() as $quoteAddress) {
283
  if ($quoteAddress->getAddressType() == self::ADDRESS_TYPE_PAKJEGEMAK) {
284
  $quoteAddress->isDeleted(true);
 
285
  }
286
  }
287
 
288
  /**
289
  * Add an optional PakjeGemak address.
290
  */
291
- if (array_key_exists('address', $data)) {
292
  $address = $data['address'];
293
 
294
  $street = array(
@@ -316,10 +394,10 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
316
  ->setTelephone($phoneNumber)
317
  ->setStreet($street);
318
 
319
- $quote->addAddress($pakjeGemakAddress)
320
- ->save();
321
  }
322
 
 
323
  $postnlOrder->save();
324
 
325
  return $this;
124
  /**
125
  * Calculate the confirm date for a specified delivery date.
126
  *
127
+ * @param string|DateTime $deliveryDate
128
+ * @param string|boolean $timeZone
129
  *
130
  * @return DateTime
131
  */
132
+ public function getConfirmDate($deliveryDate, $timeZone = false)
133
  {
134
  if ($this->hasConfirmDate()) {
135
  return $this->_getData('confirm_date');
136
  }
137
 
138
+ if (!is_string($timeZone)) {
139
+ $timeZone = 'UTC';
140
+ }
141
+ $timeZone = new DateTimeZone($timeZone);
142
+
143
+ if (is_string($deliveryDate)) {
144
+ $deliveryDate = new DateTime($deliveryDate, $timeZone);
145
+ }
146
 
147
  $confirmDate = $deliveryDate->sub(new DateInterval("P1D"));
 
148
 
149
+ $confirmDate = Mage::helper('postnl/deliveryOptions')->getValidConfirmDate($confirmDate, $timeZone);
150
 
151
  $this->setConfirmDate($confirmDate);
152
  return $confirmDate;
172
  $shippingDays = Mage::getStoreConfig(self::XPATH_SHIPPING_DAYS, Mage::app()->getStore()->getId());
173
  $shippingDays = explode(',', $shippingDays);
174
 
175
+ $helper = Mage::helper('postnl/deliveryOptions');
176
+
177
+ /**
178
+ * Calculate the earliest possible shipping date for comparison.
179
+ */
180
+ $earliestShippingDate = new DateTime('now', new DateTimeZone('Europe/Berlin'));
181
+ $earliestShippingDate->add(new DateInterval("P{$helper->getQuoteShippingDuration()}D"));
182
+
183
  foreach ($timeframes as $key => $timeframe) {
184
  /**
185
  * Get the date of the time frame and calculate the shipping day. The shipping day will be the day before
187
  */
188
  $timeframeDate = new DateTime($timeframe->Date);
189
  $deliveryDay = (int) $timeframeDate->format('N');
 
190
 
191
+ $shippingDate = clone $timeframeDate;
192
+ $shippingDay = (int) $shippingDate->sub(new DateInterval('P1D'))->format('N');
193
+
194
+ if (in_array($shippingDay, $shippingDays)) {
195
+ continue;
196
  }
197
 
198
  /**
199
+ * If the delivery day is tuesday and sunday sorting is not available, shipping the order on saturday will
200
+ * also result in a tuesday delivery so we need to validate saturday as a valid shipping date.
201
  *
202
+ * If the delivery day is monday and sunday sorting is available, shipping the order on saturday will also
203
+ * result in a monday delivery so we need to validate saturday as a valid shipping date.
204
  */
205
+ $valid = false;
206
+ if (
207
+ ($deliveryDay === 2
208
+ && !$helper->canUseSundaySorting()
209
+ )
210
+ || ($deliveryDay === 1
211
+ && $helper->canUseSundaySorting()
212
+ )
213
+ ) {
214
+ $valid = $this->_validateSaturdayShipping($shippingDays, $shippingDate, $earliestShippingDate);
215
  }
216
 
217
+ if (false === $valid) {
218
  unset($timeframes[$key]);
219
  }
220
  }
225
  return array_values($timeframes);
226
  }
227
 
228
+ /**
229
+ * Validate if saturday shipping is allowed for the specified shipping date when taking the earliest possible
230
+ * shipping date into consideration.
231
+ *
232
+ * @param array $shippingDays
233
+ * @param DateTime $shippingDate
234
+ * @param DateTime $earliestShippingDate
235
+ *
236
+ * @return bool
237
+ */
238
+ protected function _validateSaturdayShipping($shippingDays, DateTime $shippingDate, DateTime $earliestShippingDate)
239
+ {
240
+ $shippingDate->modify('last saturday');
241
+ $shippingDay = 6;
242
+
243
+ if (!in_array($shippingDay, $shippingDays)) {
244
+ return false;
245
+ }
246
+
247
+ $cutOffTime = Mage::helper('postnl/deliveryOptions')->getCutOffTime(null, true, $shippingDate);
248
+ $cutOffTime = explode(':', $cutOffTime);
249
+
250
+ $shippingDate->setTime($cutOffTime[0], $cutOffTime[1], $cutOffTime[2]);
251
+
252
+ if ($shippingDate < $earliestShippingDate) {
253
+ return false;
254
+ }
255
+
256
+ return true;
257
+ }
258
+
259
  /**
260
  * @param float|int $costs
261
  *
299
  }
300
 
301
  /**
302
+ * Save the specified delivery option.
303
+ *
304
+ * @param array $data
305
  *
306
  * @return $this
307
  */
309
  {
310
  $quote = $this->getQuote();
311
 
312
+ $timeZone = Mage::app()->getLocale()->getTimezone();
313
+
314
+ $deliveryDate = Mage::getSingleton('core/date')->gmtDate('Y-m-d H:i:s', $data['date']);
315
+ $confirmDate = $this->getConfirmDate($deliveryDate, $timeZone);
316
 
317
  /**
318
  * @var TIG_PostNL_Model_Core_Order $postnlOrder
326
  ->setMobilePhoneNumber(false, true)
327
  ->setType($data['type'])
328
  ->setShipmentCosts($data['costs'])
329
+ ->setDeliveryDate($deliveryDate)
330
+ ->setConfirmDate($confirmDate->format('Y-m-d H:i:s'))
331
+ ->setExpectedDeliveryTimeStart(false)
332
+ ->setExpectedDeliveryTimeEnd(false);
333
 
334
  if ($data['type'] == 'PA') {
335
  $postnlOrder->setIsPakketautomaat(true)
339
  $postnlOrder->setIsPakjeGemak(true);
340
  }
341
 
342
+ /**
343
+ * Set the expected delivery timeframe if available.
344
+ */
345
+ if (isset($data['from'])) {
346
+ $from = Mage::getSingleton('core/date')->gmtDate('H:i:s', $data['from']);
347
+ $postnlOrder->setExpectedDeliveryTimeStart($from);
348
+ }
349
+ if (isset($data['to'])) {
350
+ $to = Mage::getSingleton('core/date')->gmtDate('H:i:s', $data['to']);
351
+ $postnlOrder->setExpectedDeliveryTimeEnd($to);
352
+ }
353
+
354
  /**
355
  * Remove any existing PakjeGemak addresses.
356
  *
359
  foreach ($quote->getAllAddresses() as $quoteAddress) {
360
  if ($quoteAddress->getAddressType() == self::ADDRESS_TYPE_PAKJEGEMAK) {
361
  $quoteAddress->isDeleted(true);
362
+ $quote->removeAddress($quoteAddress->getId());
363
  }
364
  }
365
 
366
  /**
367
  * Add an optional PakjeGemak address.
368
  */
369
+ if (isset($data['address'])) {
370
  $address = $data['address'];
371
 
372
  $street = array(
394
  ->setTelephone($phoneNumber)
395
  ->setStreet($street);
396
 
397
+ $quote->addAddress($pakjeGemakAddress);
 
398
  }
399
 
400
+ $quote->save();
401
  $postnlOrder->save();
402
 
403
  return $this;
app/code/community/TIG/PostNL/Model/ExtensionControl/Config.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_ExtensionControl_Config
40
+ {
41
+ const VALIDATION_REGEX = '/^[a-zA-Z0-9!?_-]*$/';
42
+
43
+ /**
44
+ * @var Zend_Validate_Regex
45
+ */
46
+ protected $_validator;
47
+
48
+ /**
49
+ * @return Zend_Validate_Regex
50
+ */
51
+ public function getValidator()
52
+ {
53
+ $validator = $this->_validator;
54
+ if (!$validator) {
55
+ $validator = new Zend_Validate_Regex(self::VALIDATION_REGEX);
56
+ $this->setValidator($validator);
57
+ }
58
+
59
+ return $validator;
60
+ }
61
+
62
+ /**
63
+ * @param Zend_Validate_Regex $validator
64
+ *
65
+ * @return $this
66
+ */
67
+ public function setValidator(Zend_Validate_Regex $validator)
68
+ {
69
+ $this->_validator = $validator;
70
+
71
+ return $this;
72
+ }
73
+
74
+ /**
75
+ * Save config settings as returned by the activateWebshop call.
76
+ *
77
+ * @param array $settings
78
+ *
79
+ * @return $this
80
+ *
81
+ * @throws TIG_PostNL_Exception
82
+ */
83
+ public function saveConfigSettings(array $settings)
84
+ {
85
+ /**
86
+ * Check to make sure the settings are present.
87
+ */
88
+ if (!is_array($settings)) {
89
+ throw new TIG_PostNL_Exception(
90
+ Mage::helper('postnl')->__('Invalid settings provided.'),
91
+ 'POSTNL-0211'
92
+ );
93
+ }
94
+
95
+ foreach ($settings as $setting => $value) {
96
+ if (empty($value)) {
97
+ continue;
98
+ }
99
+
100
+ $xpath = false;
101
+ switch ($setting) {
102
+ case 'cendrisPassword':
103
+ $xpath = TIG_PostNL_Model_AddressValidation_Cendris::XPATH_PASSWORD;
104
+ break;
105
+ case 'cendrisUsername':
106
+ $xpath = TIG_PostNL_Model_AddressValidation_Cendris::XPATH_USERNAME;
107
+ break;
108
+ case 'googleMapsApiKey':
109
+ $xpath = TIG_PostNL_Helper_DeliveryOptions::XPATH_GOOGLE_MAPS_API_KEY;
110
+ break;
111
+ //no default
112
+ }
113
+
114
+ if (!$xpath) {
115
+ continue;
116
+ }
117
+
118
+ $this->_saveConfigSetting($xpath, $value);
119
+ }
120
+
121
+ return $this;
122
+ }
123
+
124
+ /**
125
+ * Save a configuration value with the specified Xpath and value.
126
+ *
127
+ * @param string $xpath
128
+ * @param string $value
129
+ *
130
+ * @return $this
131
+ *
132
+ * @throws Exception
133
+ * @throws TIG_PostNL_Exception
134
+ */
135
+ protected function _saveConfigSetting($xpath, $value)
136
+ {
137
+ $validator = $this->getValidator();
138
+ if (!$validator->isValid($value)) {
139
+ throw new TIG_PostNL_Exception(
140
+ Mage::helper('postnl')->__('Invalid config value provided.'),
141
+ 'POSTNL-0212'
142
+ );
143
+ }
144
+
145
+ $configData = Mage::getModel('core/config_data')
146
+ ->load($xpath, 'path');
147
+
148
+ $configData->setValue($value)
149
+ ->setPath($xpath)
150
+ ->save();
151
+
152
+ return $this;
153
+ }
154
+ }
app/code/community/TIG/PostNL/Model/ExtensionControl/Observer/Cron.php CHANGED
@@ -39,7 +39,7 @@
39
  class TIG_PostNL_Model_ExtensionControl_Observer_Cron
40
  {
41
  /**
42
- * updates the shop's statistics with the extension control system.
43
  *
44
  * @return TIG_PostNL_Model_ExtensionControl_Observer_Cron
45
  */
@@ -48,14 +48,14 @@ class TIG_PostNL_Model_ExtensionControl_Observer_Cron
48
  $helper = Mage::helper('postnl');
49
 
50
  /**
51
- * Check if the PostNL module is active
52
  */
53
  if (!$helper->isEnabled()) {
54
  return $this;
55
  }
56
 
57
  /**
58
- * Check if the extension may send statistics to the extension control system
59
  */
60
  if (!Mage::helper('postnl/webservices')->canSendStatistics()) {
61
  return $this;
@@ -64,7 +64,7 @@ class TIG_PostNL_Model_ExtensionControl_Observer_Cron
64
  $helper->cronLog('UpdateStatistics cron starting...');
65
 
66
  /**
67
- * Attempt to update the shop's statistics
68
  */
69
  try {
70
  $helper->cronLog('Updating shop statistics.');
@@ -148,4 +148,44 @@ class TIG_PostNL_Model_ExtensionControl_Observer_Cron
148
  $helper->cronLog('CheckFeedUpdate cron has finished.');
149
  return $this;
150
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
39
  class TIG_PostNL_Model_ExtensionControl_Observer_Cron
40
  {
41
  /**
42
+ * Updates the shop's statistics with the extension control system.
43
  *
44
  * @return TIG_PostNL_Model_ExtensionControl_Observer_Cron
45
  */
48
  $helper = Mage::helper('postnl');
49
 
50
  /**
51
+ * Check if the PostNL module is active.
52
  */
53
  if (!$helper->isEnabled()) {
54
  return $this;
55
  }
56
 
57
  /**
58
+ * Check if the extension may send statistics to the extension control system.
59
  */
60
  if (!Mage::helper('postnl/webservices')->canSendStatistics()) {
61
  return $this;
64
  $helper->cronLog('UpdateStatistics cron starting...');
65
 
66
  /**
67
+ * Attempt to update the shop's statistics.
68
  */
69
  try {
70
  $helper->cronLog('Updating shop statistics.');
148
  $helper->cronLog('CheckFeedUpdate cron has finished.');
149
  return $this;
150
  }
151
+
152
+ /**
153
+ * Update the shop's config settings with settings retrieved from the extension control system. Currently this is
154
+ * used for the Google Maps API key, and the Cendris username and password.
155
+ *
156
+ * N.B. this will not be used to overwrite settings that were configured by the end-user.
157
+ *
158
+ * @return $this
159
+ */
160
+ public function updateSettings()
161
+ {
162
+ $helper = Mage::helper('postnl');
163
+
164
+ /**
165
+ * Check if the PostNL module is active.
166
+ */
167
+ if (!$helper->isEnabled()) {
168
+ return $this;
169
+ }
170
+
171
+ $helper->cronLog('UpdateSettings cron starting...');
172
+
173
+ /**
174
+ * Attempt to update the shop's statistics
175
+ */
176
+ try {
177
+ $helper->cronLog('Updating shop config settings.');
178
+
179
+ $webservices = Mage::getModel('postnl_extensioncontrol/webservices');
180
+ $settings = $webservices->updateConfigSettings();
181
+
182
+ Mage::getModel('postnl_extensioncontrol/config')->saveConfigSettings($settings);
183
+ } catch (Exception $e) {
184
+ $helper->cronLog('An error occurred: ' . $e->getMessage());
185
+ $helper->logException($e);
186
+ }
187
+
188
+ $helper->cronLog('UpdateSettings has finished.');
189
+ return $this;
190
+ }
191
  }
app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices.php CHANGED
@@ -103,12 +103,12 @@ class TIG_PostNL_Model_ExtensionControl_Webservices extends TIG_PostNL_Model_Ext
103
  const SUCCESS_MESSAGE = 'success';
104
 
105
  /**
106
- * Activates the webshop. This will trigger a private key and a unique key to be sent to the specified e-mail, which must be
107
- * entered into system config by the merchant in order to finish the activation process.
108
  *
109
  * @param boolean|string $email
110
  *
111
- * @return TIG_PostNL_Model_ExtensionControl_Webservices
112
  *
113
  * @throws TIG_PostNL_Exception
114
  */
@@ -135,7 +135,7 @@ class TIG_PostNL_Model_ExtensionControl_Webservices extends TIG_PostNL_Model_Ext
135
  );
136
  }
137
 
138
- return $this;
139
  }
140
 
141
  /**
@@ -259,6 +259,29 @@ class TIG_PostNL_Model_ExtensionControl_Webservices extends TIG_PostNL_Model_Ext
259
  return $result;
260
  }
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  /**
263
  * Gets information about the Magento version and edition as well as the version of the currently installed PostNL extension.
264
  *
103
  const SUCCESS_MESSAGE = 'success';
104
 
105
  /**
106
+ * Activates the webshop. This will trigger a private key and a unique key to be sent to the specified e-mail, which
107
+ * must be entered into system config by the merchant in order to finish the activation process.
108
  *
109
  * @param boolean|string $email
110
  *
111
+ * @return array
112
  *
113
  * @throws TIG_PostNL_Exception
114
  */
135
  );
136
  }
137
 
138
+ return $result;
139
  }
140
 
141
  /**
259
  return $result;
260
  }
261
 
262
+ /**
263
+ * Get the most recent statistics from the extension control system.
264
+ *
265
+ * @return array
266
+ *
267
+ * @throws Exception
268
+ * @throws SoapFault
269
+ * @throws TIG_PostNL_Exception
270
+ */
271
+ public function updateConfigSettings()
272
+ {
273
+ $result = $this->call('getSettings');
274
+
275
+ if (!is_array($result)) {
276
+ throw new TIG_PostNL_Exception(
277
+ Mage::helper('postnl')->__('Invalid updateConfigSettings response: %s', var_export($result, true)),
278
+ 'POSTNL-0213'
279
+ );
280
+ }
281
+
282
+ return $result;
283
+ }
284
+
285
  /**
286
  * Gets information about the Magento version and edition as well as the version of the currently installed PostNL extension.
287
  *
app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices/Abstract.php CHANGED
@@ -83,15 +83,15 @@ abstract class TIG_PostNL_Model_ExtensionControl_Webservices_Abstract extends Va
83
  /**
84
  * Calls a webservice method
85
  *
86
- * @param string $method The method that will be called
87
- * @param array $soapParams An array of parameters to be sent
88
  *
89
  * @throws Exception
90
  * @throws SoapFault
91
  *
92
- * @return object
93
  */
94
- public function call($method, $soapParams)
95
  {
96
  try {
97
  $wsdl = Mage::getStoreConfig(self::WEBSERVICE_WSDL_URL_XPATH, Mage_Core_Model_App::ADMIN_STORE_ID);
@@ -128,7 +128,11 @@ abstract class TIG_PostNL_Model_ExtensionControl_Webservices_Abstract extends Va
128
  /**
129
  * Call the SOAP method.
130
  */
131
- $response = $client->$method($soapParams);
 
 
 
 
132
 
133
  Mage::helper('postnl/webservices')->logWebserviceCall($client);
134
  return $response;
83
  /**
84
  * Calls a webservice method
85
  *
86
+ * @param string $method The method that will be called
87
+ * @param null|array $soapParams An array of parameters to be sent
88
  *
89
  * @throws Exception
90
  * @throws SoapFault
91
  *
92
+ * @return mixed
93
  */
94
+ public function call($method, $soapParams = null)
95
  {
96
  try {
97
  $wsdl = Mage::getStoreConfig(self::WEBSERVICE_WSDL_URL_XPATH, Mage_Core_Model_App::ADMIN_STORE_ID);
128
  /**
129
  * Call the SOAP method.
130
  */
131
+ if (null !== $soapParams) {
132
+ $response = $client->$method($soapParams);
133
+ } else {
134
+ $response = $client->$method();
135
+ }
136
 
137
  Mage::helper('postnl/webservices')->logWebserviceCall($client);
138
  return $response;
app/code/community/TIG/PostNL/Model/Resource/Order/Shipment.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Model_Resource_Order_Shipment extends Mage_Sales_Model_Resource_Order_Shipment
40
+ {
41
+ /**
42
+ * Retrieve shipment ID by shipment increment ID
43
+ *
44
+ * @param string|int $incrementId
45
+ *
46
+ * @return int
47
+ */
48
+ public function getShipmentId($incrementId)
49
+ {
50
+ $adapter = $this->getReadConnection();
51
+ $bind = array(':increment_id' => $incrementId);
52
+ $select = $adapter->select()
53
+ ->from($this->getMainTable(), array('entity_id'))
54
+ ->where('increment_id = :increment_id');
55
+
56
+ return $adapter->fetchOne($select, $bind);
57
+ }
58
+ }
app/code/community/TIG/PostNL/Model/Resource/Setup.php CHANGED
@@ -44,6 +44,12 @@ class TIG_PostNL_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
44
  const SHIPPING_STATUS_CRON_STRING_PATH = 'crontab/jobs/postnl_update_shipping_status/schedule/cron_expr';
45
  const SHIPPING_STATUS_CRON_MODEL_PATH = 'crontab/jobs/postnl_update_shipping_status/run/model';
46
 
 
 
 
 
 
 
47
  /**
48
  * Cron expression and cron model definitions for statistics update cron
49
  */
@@ -56,6 +62,12 @@ class TIG_PostNL_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
56
  const UPDATE_PRODUCT_ATTRIBUTE_STRING_PATH = 'crontab/jobs/postnl_update_product_attribute/schedule/cron_expr';
57
  const UPDATE_PRODUCT_ATTRIBUTE_MODEL_PATH = 'crontab/jobs/postnl_update_product_attribute/run/model';
58
 
 
 
 
 
 
 
59
  /**
60
  * XML path to the support tab_expanded setting
61
  */
@@ -88,6 +100,11 @@ class TIG_PostNL_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
88
  */
89
  const XPATH_PRODUCT_ATTRIBUTE_UPDATE_DATA = 'postnl/general/product_attribute_update_data';
90
 
 
 
 
 
 
91
  /**
92
  * Minimum server memory required by the PostNL extension in bytes.
93
  */
@@ -98,11 +115,13 @@ class TIG_PostNL_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
98
  */
99
  const SUCCESSFUL_UPDATE_ERROR_CODE = 'POSTNL-0083';
100
  const SHIPPING_STATUS_CRON_ERROR_CODE = 'POSTNL-0084';
 
101
  const UPDATE_STATISTICS_CRON_ERROR_CODE = 'POSTNL-0085';
102
  const UNSUPPORTED_MAGENTO_VERSION_ERROR_CODE = 'POSTNL-0086';
103
  const SUCCESSFUL_INSTALL_ERROR_CODE = 'POSTNL-0156';
104
  const MEMORY_LIMIT_ERROR_CODE = 'POSTNL-0175';
105
  const UPDATE_PRODUCT_ATTRIBUTE_ERROR_CODE = 'POSTNL-0197';
 
106
 
107
  /**
108
  * callAfterApplyAllUpdates flag. Causes applyAfterUpdates() to be called.
@@ -1316,4 +1335,120 @@ class TIG_PostNL_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
1316
 
1317
  return $this;
1318
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1319
  }
44
  const SHIPPING_STATUS_CRON_STRING_PATH = 'crontab/jobs/postnl_update_shipping_status/schedule/cron_expr';
45
  const SHIPPING_STATUS_CRON_MODEL_PATH = 'crontab/jobs/postnl_update_shipping_status/run/model';
46
 
47
+ /**
48
+ * Cron expression and cron model definitions for return_status cron
49
+ */
50
+ const RETURN_STATUS_CRON_STRING_PATH = 'crontab/jobs/postnl_update_return_status/schedule/cron_expr';
51
+ const RETURN_STATUS_CRON_MODEL_PATH = 'crontab/jobs/postnl_update_return_status/run/model';
52
+
53
  /**
54
  * Cron expression and cron model definitions for statistics update cron
55
  */
62
  const UPDATE_PRODUCT_ATTRIBUTE_STRING_PATH = 'crontab/jobs/postnl_update_product_attribute/schedule/cron_expr';
63
  const UPDATE_PRODUCT_ATTRIBUTE_MODEL_PATH = 'crontab/jobs/postnl_update_product_attribute/run/model';
64
 
65
+ /**
66
+ * Cron expression and cron model definitions for updating product attributes.
67
+ */
68
+ const UPDATE_DATE_TIME_ZONE_STRING_PATH = 'crontab/jobs/postnl_update_date_time_zone/schedule/cron_expr';
69
+ const UPDATE_DATE_TIME_ZONE_MODEL_PATH = 'crontab/jobs/postnl_update_date_time_zone/run/model';
70
+
71
  /**
72
  * XML path to the support tab_expanded setting
73
  */
100
  */
101
  const XPATH_PRODUCT_ATTRIBUTE_UPDATE_DATA = 'postnl/general/product_attribute_update_data';
102
 
103
+ /**
104
+ * Xpath to the update date time zone data used by the update date time zone cron.
105
+ */
106
+ const XPATH_UPDATE_DATE_TIME_ZONE_DATA = 'postnl/general/product_attribute_update_data';
107
+
108
  /**
109
  * Minimum server memory required by the PostNL extension in bytes.
110
  */
115
  */
116
  const SUCCESSFUL_UPDATE_ERROR_CODE = 'POSTNL-0083';
117
  const SHIPPING_STATUS_CRON_ERROR_CODE = 'POSTNL-0084';
118
+ const RETURN_STATUS_CRON_ERROR_CODE = 'POSTNL-0205';
119
  const UPDATE_STATISTICS_CRON_ERROR_CODE = 'POSTNL-0085';
120
  const UNSUPPORTED_MAGENTO_VERSION_ERROR_CODE = 'POSTNL-0086';
121
  const SUCCESSFUL_INSTALL_ERROR_CODE = 'POSTNL-0156';
122
  const MEMORY_LIMIT_ERROR_CODE = 'POSTNL-0175';
123
  const UPDATE_PRODUCT_ATTRIBUTE_ERROR_CODE = 'POSTNL-0197';
124
+ const UPDATE_DATE_TIME_ZONE_ERROR_CODE = 'POSTNL-0206';
125
 
126
  /**
127
  * callAfterApplyAllUpdates flag. Causes applyAfterUpdates() to be called.
1335
 
1336
  return $this;
1337
  }
1338
+
1339
+ /**
1340
+ * Generate a random cron expression for the return status update cron for this merchant and store it in the
1341
+ * database.
1342
+ *
1343
+ * @throws TIG_PostNL_Exception
1344
+ *
1345
+ * @return $this
1346
+ */
1347
+ public function generateReturnStatusCronExpr()
1348
+ {
1349
+ /**
1350
+ * Generate semi-random values for the cron expression.
1351
+ */
1352
+ $cronMinute = mt_rand(0, 59);
1353
+
1354
+ $cronNightHour = mt_rand(0, 3);
1355
+ $cronMorningHour = $cronNightHour + 8; //8 hours after the night update
1356
+ $cronAfternoonHour = $cronMorningHour + 8; //8 hours after the morning update
1357
+
1358
+ /**
1359
+ * Generate a cron expr that runs on a specified minute on a specified hour between 0 and 3 AM, between 8 and
1360
+ * 11 AM, and between 4 and 7 PM.
1361
+ */
1362
+ $cronExpr = "{$cronMinute} {$cronNightHour},{$cronMorningHour},{$cronAfternoonHour} * * *";
1363
+
1364
+ /**
1365
+ * Store the cron expression in core_config_data.
1366
+ */
1367
+ try {
1368
+ Mage::getModel('core/config_data')
1369
+ ->load(self::RETURN_STATUS_CRON_STRING_PATH, 'path')
1370
+ ->setValue($cronExpr)
1371
+ ->setPath(self::RETURN_STATUS_CRON_STRING_PATH)
1372
+ ->save();
1373
+ Mage::getModel('core/config_data')
1374
+ ->load(self::RETURN_STATUS_CRON_MODEL_PATH, 'path')
1375
+ ->setValue((string) Mage::getConfig()->getNode(self::RETURN_STATUS_CRON_MODEL_PATH))
1376
+ ->setPath(self::RETURN_STATUS_CRON_MODEL_PATH)
1377
+ ->save();
1378
+ } catch (Exception $e) {
1379
+ throw new TIG_PostNL_Exception(
1380
+ Mage::helper('postnl')->__('Unable to save return_status cron expression: %s', $cronExpr),
1381
+ self::RETURN_STATUS_CRON_ERROR_CODE,
1382
+ $e
1383
+ );
1384
+ }
1385
+
1386
+ return $this;
1387
+ }
1388
+
1389
+ /**
1390
+ * Set the date time zone update cron's cron expression and save the necessary attribute data.
1391
+ *
1392
+ * @return $this
1393
+ * @throws TIG_PostNL_Exception
1394
+ */
1395
+ public function setDateTimeZoneUpdateCron()
1396
+ {
1397
+ /**
1398
+ * Get the PostNL shipment and order IDs that need to be processed.
1399
+ */
1400
+ $postnlShipmentCollection = Mage::getResourceModel('postnl_core/shipment_collection');
1401
+ $postnlShipmentCollection->addFieldToSelect('entity_id');
1402
+ $postnlShipmentIds = $postnlShipmentCollection->getAllIds();
1403
+
1404
+ $postnlOrderCollection = Mage::getResourceModel('postnl_core/order_collection');
1405
+ $postnlOrderCollection->addFieldToSelect('entity_id');
1406
+ $postnlOrderIds = $postnlOrderCollection->getAllIds();
1407
+
1408
+ $idsToProcess = array(
1409
+ 'shipment' => $postnlShipmentIds,
1410
+ 'order' => $postnlOrderIds,
1411
+ );
1412
+
1413
+ /**
1414
+ * Serialize the IDs that need to be processed for storage in the database.
1415
+ */
1416
+ $serializedData = serialize($idsToProcess);
1417
+
1418
+ /**
1419
+ * Save the IDs that need to be processed.
1420
+ */
1421
+ Mage::getConfig()->saveConfig(
1422
+ self::XPATH_UPDATE_DATE_TIME_ZONE_DATA,
1423
+ $serializedData,
1424
+ 'default',
1425
+ Mage_Core_Model_App::ADMIN_STORE_ID
1426
+ );
1427
+
1428
+ $cronExpr = "*/5 * * * *";
1429
+
1430
+ /**
1431
+ * Store the cron expression in core_config_data.
1432
+ */
1433
+ try {
1434
+ Mage::getModel('core/config_data')
1435
+ ->load(self::UPDATE_DATE_TIME_ZONE_STRING_PATH, 'path')
1436
+ ->setValue($cronExpr)
1437
+ ->setPath(self::UPDATE_DATE_TIME_ZONE_STRING_PATH)
1438
+ ->save();
1439
+ Mage::getModel('core/config_data')
1440
+ ->load(self::UPDATE_DATE_TIME_ZONE_MODEL_PATH, 'path')
1441
+ ->setValue((string) Mage::getConfig()->getNode(self::UPDATE_DATE_TIME_ZONE_MODEL_PATH))
1442
+ ->setPath(self::UPDATE_DATE_TIME_ZONE_MODEL_PATH)
1443
+ ->save();
1444
+ } catch (Exception $e) {
1445
+ throw new TIG_PostNL_Exception(
1446
+ Mage::helper('postnl')->__('Unable to save update_date_time_zone cron expression: %s', $cronExpr),
1447
+ self::UPDATE_DATE_TIME_ZONE_ERROR_CODE,
1448
+ $e
1449
+ );
1450
+ }
1451
+
1452
+ return $this;
1453
+ }
1454
  }
app/code/community/TIG/PostNL/controllers/Adminhtml/ConfigController.php CHANGED
@@ -240,6 +240,7 @@ class TIG_PostNL_Adminhtml_ConfigController extends TIG_PostNL_Controller_Adminh
240
 
241
  $content = $gridBlock->getCsvFile();
242
 
 
243
  $this->_prepareDownloadResponse($fileName, $content);
244
 
245
  return $this;
@@ -264,6 +265,7 @@ class TIG_PostNL_Adminhtml_ConfigController extends TIG_PostNL_Controller_Adminh
264
 
265
  $content = $gridBlock->getCsvFile();
266
 
 
267
  $this->_prepareDownloadResponse($fileName, $content);
268
 
269
  return $this;
@@ -319,6 +321,8 @@ class TIG_PostNL_Adminhtml_ConfigController extends TIG_PostNL_Controller_Adminh
319
  'value' => $zip,
320
  'rm' => true,
321
  );
 
 
322
  $this->_prepareDownloadResponse($zipName, $content);
323
 
324
  return $this;
240
 
241
  $content = $gridBlock->getCsvFile();
242
 
243
+ $this->postDispatch();
244
  $this->_prepareDownloadResponse($fileName, $content);
245
 
246
  return $this;
265
 
266
  $content = $gridBlock->getCsvFile();
267
 
268
+ $this->postDispatch();
269
  $this->_prepareDownloadResponse($fileName, $content);
270
 
271
  return $this;
321
  'value' => $zip,
322
  'rm' => true,
323
  );
324
+
325
+ $this->postDispatch();
326
  $this->_prepareDownloadResponse($zipName, $content);
327
 
328
  return $this;
app/code/community/TIG/PostNL/controllers/Adminhtml/ExtensionControlController.php CHANGED
@@ -162,7 +162,11 @@ class TIG_PostNL_Adminhtml_ExtensionControlController extends TIG_PostNL_Control
162
  /**
163
  * Activate the webshop
164
  */
165
- $webservice->activateWebshop($email);
 
 
 
 
166
  } catch (SoapFault $e) {
167
  /**
168
  * If the webshop is already registered (email, hostname combo exists), continue the activation by sending a
162
  /**
163
  * Activate the webshop
164
  */
165
+ $result = $webservice->activateWebshop($email);
166
+
167
+ if (isset($result['settings']) && is_array($result['settings'])) {
168
+ Mage::getModel('postnl_extensioncontrol/config')->saveConfigSettings($result['settings']);
169
+ }
170
  } catch (SoapFault $e) {
171
  /**
172
  * If the webshop is already registered (email, hostname combo exists), continue the activation by sending a
app/code/community/TIG/PostNL/controllers/Adminhtml/ReturnsController.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_Adminhtml_ReturnsController extends Mage_Adminhtml_Controller_Sales_Shipment
40
+ {
41
+ /**
42
+ * Returns grid.
43
+ *
44
+ * @return $this
45
+ */
46
+ public function indexAction()
47
+ {
48
+ $this->_title($this->__('Sales'))->_title($this->__('PostNL Returns'));
49
+
50
+ $this->_initAction()
51
+ ->_addContent($this->getLayout()->createBlock('postnl_adminhtml/sales_returns'))
52
+ ->renderLayout();
53
+
54
+ return $this;
55
+ }
56
+ }
app/code/community/TIG/PostNL/controllers/Adminhtml/ShipmentController.php CHANGED
@@ -85,10 +85,14 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
85
  );
86
  }
87
 
 
 
 
 
88
  /**
89
- * get the labels from CIF
90
  */
91
- $labels = $this->_getLabels($shipment);
92
 
93
  /**
94
  * We need to check for warnings before the label download response
@@ -110,13 +114,13 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
110
  $helper->logException($e);
111
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
112
 
113
- $this->_redirect('adminhtml/sales_shipment/index');
114
  return $this;
115
  } catch (TIG_PostNL_Exception $e) {
116
  $helper->logException($e);
117
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
118
 
119
- $this->_redirect('adminhtml/sales_shipment/index');
120
  return $this;
121
  } catch (Exception $e) {
122
  $helper->logException($e);
@@ -124,10 +128,111 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
124
  $this->__('An error occurred while processing this action.')
125
  );
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  $this->_redirect('adminhtml/sales_shipment/index');
128
  return $this;
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  return $this;
132
  }
133
 
@@ -167,11 +272,15 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
167
  */
168
  $shipment = $this->_loadShipment($shipmentId, true);
169
 
 
 
 
 
170
  /**
171
  * Get the labels from CIF and create the packing slip.
172
  */
173
  $pdf = new Zend_Pdf();
174
- $shipmentLabels = $this->_getLabels($shipment, false);
175
  Mage::getModel('postnl_core/packingSlip')->createPdf($shipmentLabels, $shipment, $pdf);
176
  $output = $pdf->render();
177
 
@@ -189,19 +298,19 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
189
  $helper->logException($e);
190
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
191
 
192
- $this->_redirect('adminhtml/sales_shipment/index');
193
  } catch (TIG_PostNL_Exception $e) {
194
  $helper->logException($e);
195
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
196
 
197
- $this->_redirect('adminhtml/sales_shipment/index');
198
  } catch (Exception $e) {
199
  $helper->logException($e);
200
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
201
  $this->__('An error occurred while processing this action.')
202
  );
203
 
204
- $this->_redirect('adminhtml/sales_shipment/index');
205
  }
206
 
207
  return $this;
@@ -264,13 +373,13 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
264
  $helper->logException($e);
265
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
266
 
267
- $this->_redirect('adminhtml/sales_shipment/index');
268
  return $this;
269
  } catch (TIG_PostNL_Exception $e) {
270
  $helper->logException($e);
271
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
272
 
273
- $this->_redirect('adminhtml/sales_shipment/index');
274
  return $this;
275
  } catch (Exception $e) {
276
  $helper->logException($e);
@@ -278,7 +387,7 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
278
  $this->__('An error occurred while processing this action.')
279
  );
280
 
281
- $this->_redirect('adminhtml/sales_shipment/index');
282
  return $this;
283
  }
284
 
@@ -433,6 +542,87 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
433
  return $this;
434
  }
435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  /**
437
  * Resets a single shipment's confirmation status.
438
  *
@@ -694,11 +884,104 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
694
  *
695
  * @return $this
696
  */
697
- public function convertToPackageAction()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
698
  {
699
  $helper = Mage::helper('postnl');
700
  $shipmentId = $this->getRequest()->getParam('shipment_id');
701
- if (!$this->_checkIsAllowed(array('convert_to_package', 'delete_labels'))) {
702
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
703
  $this->__('The current user is not allowed to perform this action.')
704
  );
@@ -737,8 +1020,8 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
737
 
738
  $postnlShipment = $this->_getPostnlShipment($shipmentId);
739
 
740
- if ($postnlShipment->isConfirmed()) {
741
- if (!$this->_checkIsAllowed(array('reset_confirmation'))) {
742
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
743
  $this->__('The current user is not allowed to perform this action.')
744
  );
@@ -747,9 +1030,12 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
747
  return $this;
748
  }
749
 
750
- $postnlShipment->resetConfirmation(true, true)->save();
751
  }
752
- $postnlShipment->convertToPackage()->save();
 
 
 
753
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
754
  Mage::helper('postnl/cif')->parseCifException($e);
755
 
@@ -775,7 +1061,7 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
775
  }
776
 
777
  $helper->addSessionMessage('adminhtml/session', null, 'success',
778
- $this->__('The shipment has been converted to a package.')
779
  );
780
 
781
  $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
@@ -787,11 +1073,11 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
787
  *
788
  * @return $this
789
  */
790
- public function changeProductCodeAction()
791
  {
792
  $helper = Mage::helper('postnl');
793
  $shipmentId = $this->getRequest()->getParam('shipment_id');
794
- if (!$this->_checkIsAllowed(array('change_product_code'))) {
795
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
796
  $this->__('The current user is not allowed to perform this action.')
797
  );
@@ -843,9 +1129,9 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
843
  $postnlShipment->deleteLabels();
844
  }
845
 
846
- $productOption = $this->getRequest()->getParam('product_option');
847
 
848
- $postnlShipment->changeProductCode($productOption)->save();
849
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
850
  Mage::helper('postnl/cif')->parseCifException($e);
851
 
@@ -871,7 +1157,7 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
871
  }
872
 
873
  $helper->addSessionMessage('adminhtml/session', null, 'success',
874
- $this->__("The shipment's product option has been changed succesfully.")
875
  );
876
 
877
  $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
@@ -1058,6 +1344,17 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1058
  */
1059
  public function massFullPostnlFlowWithPackingSlipAction()
1060
  {
 
 
 
 
 
 
 
 
 
 
 
1061
  return $this->massFullPostnlFlowAction('packing_slip');
1062
  }
1063
 
@@ -1107,10 +1404,13 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1107
  * Add either a success or failure message and redirect the user accordingly.
1108
  */
1109
  if ($this->_errors < count($orderIds)) {
1110
- $helper->addSessionMessage(
1111
- 'adminhtml/session', null, 'success',
1112
- $this->__('The shipments were successfully created.')
1113
- );
 
 
 
1114
  } else {
1115
  $helper->addSessionMessage(
1116
  'adminhtml/session',
@@ -1235,7 +1535,11 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1235
  */
1236
  foreach ($shipments as $shipment) {
1237
  try {
1238
- $shipmentLabels = $this->_getLabels($shipment, true);
 
 
 
 
1239
  $labels = array_merge($labels, $shipmentLabels);
1240
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1241
  Mage::helper('postnl/cif')->parseCifException($e);
@@ -1319,6 +1623,133 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1319
  return $this;
1320
  }
1321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1322
  /**
1323
  * Prints shipping labels for selected shipments.
1324
  *
@@ -1368,7 +1799,11 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1368
  */
1369
  foreach ($shipments as $shipment) {
1370
  try {
1371
- $shipmentLabels = $this->_getLabels($shipment, false);
 
 
 
 
1372
  $labels = array_merge($labels, $shipmentLabels);
1373
  } catch (TIG_PostNL_Exception $e) {
1374
  $helper->logException($e);
@@ -1554,7 +1989,11 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1554
  );
1555
  }
1556
 
1557
- $shipmentLabels = $this->_getLabels($shipment, false);
 
 
 
 
1558
  $packingSlipModel->createPdf($shipmentLabels, $shipment, $pdf);
1559
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1560
  Mage::helper('postnl/cif')->parseCifException($e);
@@ -1744,7 +2183,7 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1744
  }
1745
 
1746
  /**
1747
- * Creates a Parcelware export file based on the selected shipments
1748
  *
1749
  * @return $this
1750
  */
@@ -1764,7 +2203,7 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1764
  $shipmentIds = $this->_getShipmentIds();
1765
 
1766
  /**
1767
- * Load the shipments and check if they are valid
1768
  */
1769
  $shipments = $this->_loadAndCheckShipments($shipmentIds, true);
1770
 
@@ -1777,6 +2216,91 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1777
  $timestamp = date('Ymd_His', Mage::getModel('core/date')->timestamp());
1778
 
1779
  $this->_prepareDownloadResponse("PostNL_Parcelware_Export_{$timestamp}.csv", $csvContents);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1780
  } catch (TIG_PostNL_Exception $e) {
1781
  $helper->logException($e);
1782
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
@@ -1793,6 +2317,22 @@ class TIG_PostNL_Adminhtml_ShipmentController extends TIG_PostNL_Controller_Admi
1793
  return $this;
1794
  }
1795
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1796
  $this->_redirect('adminhtml/sales_shipment/index');
1797
  return $this;
1798
  }
85
  );
86
  }
87
 
88
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
89
+ $shipment->getStoreId()
90
+ );
91
+
92
  /**
93
+ * Get the labels from CIF.
94
  */
95
+ $labels = $this->_getLabels($shipment, false, $printReturnLabels);
96
 
97
  /**
98
  * We need to check for warnings before the label download response
114
  $helper->logException($e);
115
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
116
 
117
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
118
  return $this;
119
  } catch (TIG_PostNL_Exception $e) {
120
  $helper->logException($e);
121
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
122
 
123
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
124
  return $this;
125
  } catch (Exception $e) {
126
  $helper->logException($e);
128
  $this->__('An error occurred while processing this action.')
129
  );
130
 
131
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
132
+ return $this;
133
+ }
134
+
135
+ return $this;
136
+ }
137
+ /**
138
+ * Print a return label for a single shipment.
139
+ *
140
+ * @return $this
141
+ */
142
+ public function printReturnLabelAction()
143
+ {
144
+ $helper = Mage::helper('postnl');
145
+ if (!$this->_checkIsAllowed(array('print_label', 'print_return_label'))) {
146
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
147
+ $this->__('The current user is not allowed to perform this action.')
148
+ );
149
+
150
+ $this->_redirect('adminhtml/sales_shipment/index');
151
+ return $this;
152
+ }
153
+
154
+ $shipmentId = $this->getRequest()->getParam('shipment_id');
155
+
156
+ /**
157
+ * If no shipment was selected, cause an error
158
+ */
159
+ if (is_null($shipmentId)) {
160
+ $helper->addSessionMessage('adminhtml/session', null, 'error',
161
+ $this->__('Please select a shipment.')
162
+ );
163
  $this->_redirect('adminhtml/sales_shipment/index');
164
  return $this;
165
  }
166
 
167
+ try {
168
+ /**
169
+ * Load the shipment and check if it exists and is valid.
170
+ *
171
+ * @var Mage_Sales_Model_Order_Shipment $shipment
172
+ */
173
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
174
+ if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shipment->getOrder()->getShippingMethod())) {
175
+ throw new TIG_PostNL_Exception(
176
+ $this->__(
177
+ 'This action is not available for shipment #%s, because it was not shipped using PostNL.',
178
+ $shipmentId
179
+ ),
180
+ 'POSTNL-0009'
181
+ );
182
+ }
183
+
184
+ /**
185
+ * Get the labels from CIF.
186
+ */
187
+ $labels = $this->_getReturnLabels($shipment);
188
+ if (false === $labels) {
189
+ throw new TIG_PostNL_Exception(
190
+ $this->__(
191
+ 'Unable to retrieve return labels for this shipment.',
192
+ $shipmentId
193
+ ),
194
+ 'POSTNL-0202'
195
+ );
196
+ }
197
+
198
+ /**
199
+ * We need to check for warnings before the label download response
200
+ */
201
+ $this->_checkForWarnings();
202
+
203
+ /**
204
+ * merge the labels and print them
205
+ */
206
+ $labelModel = Mage::getModel('postnl_core/label');
207
+ $output = $labelModel->createPdf($labels);
208
+
209
+ $filename = 'PostNL Return Labels-' . date('YmdHis') . '.pdf';
210
+
211
+ $this->_preparePdfResponse($filename, $output);
212
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
213
+ Mage::helper('postnl/cif')->parseCifException($e);
214
+
215
+ $helper->logException($e);
216
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
217
+
218
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
219
+ return $this;
220
+ } catch (TIG_PostNL_Exception $e) {
221
+ $helper->logException($e);
222
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
223
+
224
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
225
+ return $this;
226
+ } catch (Exception $e) {
227
+ $helper->logException($e);
228
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
229
+ $this->__('An error occurred while processing this action.')
230
+ );
231
+
232
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
233
+ return $this;
234
+ }
235
+
236
  return $this;
237
  }
238
 
272
  */
273
  $shipment = $this->_loadShipment($shipmentId, true);
274
 
275
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
276
+ $shipment->getStoreId()
277
+ );
278
+
279
  /**
280
  * Get the labels from CIF and create the packing slip.
281
  */
282
  $pdf = new Zend_Pdf();
283
+ $shipmentLabels = $this->_getLabels($shipment, false, $printReturnLabels);
284
  Mage::getModel('postnl_core/packingSlip')->createPdf($shipmentLabels, $shipment, $pdf);
285
  $output = $pdf->render();
286
 
298
  $helper->logException($e);
299
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
300
 
301
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
302
  } catch (TIG_PostNL_Exception $e) {
303
  $helper->logException($e);
304
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
305
 
306
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
307
  } catch (Exception $e) {
308
  $helper->logException($e);
309
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
310
  $this->__('An error occurred while processing this action.')
311
  );
312
 
313
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
314
  }
315
 
316
  return $this;
373
  $helper->logException($e);
374
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
375
 
376
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
377
  return $this;
378
  } catch (TIG_PostNL_Exception $e) {
379
  $helper->logException($e);
380
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
381
 
382
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
383
  return $this;
384
  } catch (Exception $e) {
385
  $helper->logException($e);
387
  $this->__('An error occurred while processing this action.')
388
  );
389
 
390
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
391
  return $this;
392
  }
393
 
542
  return $this;
543
  }
544
 
545
+ /**
546
+ * Send the shipment's return label via email to the customer.
547
+ *
548
+ * @return $this
549
+ */
550
+ public function sendReturnLabelEmailAction()
551
+ {
552
+ $helper = Mage::helper('postnl');
553
+ if (!$this->_checkIsAllowed('send_return_label_email')) {
554
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
555
+ $this->__('The current user is not allowed to perform this action.')
556
+ );
557
+
558
+ $this->_redirect('adminhtml/sales_shipment/index');
559
+ return $this;
560
+ }
561
+
562
+ $shipmentId = $this->getRequest()->getParam('shipment_id');
563
+
564
+ /**
565
+ * If no shipment was selected, cause an error
566
+ */
567
+ if (is_null($shipmentId)) {
568
+ $helper->addSessionMessage('adminhtml/session', null, 'error',
569
+ $this->__('Shipment not found.')
570
+ );
571
+ $this->_redirect('adminhtml/sales_shipment/index');
572
+ return $this;
573
+ }
574
+
575
+ try {
576
+ /**
577
+ * Load the shipment and check if it exists and is valid.
578
+ *
579
+ * @var Mage_Sales_Model_Order_Shipment $shipment
580
+ */
581
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
582
+ if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shipment->getOrder()->getShippingMethod())) {
583
+ throw new TIG_PostNL_Exception(
584
+ $this->__(
585
+ 'This action is not available for shipment #%s, because it was not shipped using PostNL.',
586
+ $shipmentId
587
+ ),
588
+ 'POSTNL-0009'
589
+ );
590
+ }
591
+
592
+ $postnlShipment = $this->_getPostnlShipment($shipmentId);
593
+ $postnlShipment->sendReturnLabelEmail();
594
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
595
+ Mage::helper('postnl/cif')->parseCifException($e);
596
+
597
+ $helper->logException($e);
598
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
599
+
600
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
601
+ return $this;
602
+ } catch (TIG_PostNL_Exception $e) {
603
+ $helper->logException($e);
604
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
605
+
606
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
607
+ return $this;
608
+ } catch (Exception $e) {
609
+ $helper->logException($e);
610
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
611
+ $this->__('An error occurred while processing this action.')
612
+ );
613
+
614
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
615
+ return $this;
616
+ }
617
+
618
+ $helper->addSessionMessage('adminhtml/session', null, 'success',
619
+ $this->__('The return label email was sent.')
620
+ );
621
+
622
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
623
+ return $this;
624
+ }
625
+
626
  /**
627
  * Resets a single shipment's confirmation status.
628
  *
884
  *
885
  * @return $this
886
  */
887
+ public function convertToPackageAction()
888
+ {
889
+ $helper = Mage::helper('postnl');
890
+ $shipmentId = $this->getRequest()->getParam('shipment_id');
891
+ if (!$this->_checkIsAllowed(array('convert_to_package', 'delete_labels'))) {
892
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
893
+ $this->__('The current user is not allowed to perform this action.')
894
+ );
895
+
896
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
897
+ return $this;
898
+ }
899
+
900
+ /**
901
+ * If no shipment was selected, cause an error
902
+ */
903
+ if (is_null($shipmentId)) {
904
+ $helper->addSessionMessage('adminhtml/session', null, 'error',
905
+ $this->__('Shipment not found.')
906
+ );
907
+ $this->_redirect('adminhtml/sales_shipment/index');
908
+ return $this;
909
+ }
910
+
911
+ try {
912
+ /**
913
+ * Load the shipment and check if it exists and is valid.
914
+ *
915
+ * @var Mage_Sales_Model_Order_Shipment $shipment
916
+ */
917
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
918
+ if (!Mage::helper('postnl/carrier')->isPostnlShippingMethod($shipment->getOrder()->getShippingMethod())) {
919
+ throw new TIG_PostNL_Exception(
920
+ $this->__(
921
+ 'This action is not available for shipment #%s, because it was not shipped using PostNL.',
922
+ $shipmentId
923
+ ),
924
+ 'POSTNL-0009'
925
+ );
926
+ }
927
+
928
+ $postnlShipment = $this->_getPostnlShipment($shipmentId);
929
+
930
+ if ($postnlShipment->isConfirmed()) {
931
+ if (!$this->_checkIsAllowed(array('reset_confirmation'))) {
932
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
933
+ $this->__('The current user is not allowed to perform this action.')
934
+ );
935
+
936
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
937
+ return $this;
938
+ }
939
+
940
+ $postnlShipment->resetConfirmation(true, true)->save();
941
+ }
942
+ $postnlShipment->convertToPackage()->save();
943
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
944
+ Mage::helper('postnl/cif')->parseCifException($e);
945
+
946
+ $helper->logException($e);
947
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
948
+
949
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
950
+ return $this;
951
+ } catch (TIG_PostNL_Exception $e) {
952
+ $helper->logException($e);
953
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
954
+
955
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
956
+ return $this;
957
+ } catch (Exception $e) {
958
+ $helper->logException($e);
959
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
960
+ $this->__('An error occurred while processing this action.')
961
+ );
962
+
963
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
964
+ return $this;
965
+ }
966
+
967
+ $helper->addSessionMessage('adminhtml/session', null, 'success',
968
+ $this->__('The shipment has been converted to a package.')
969
+ );
970
+
971
+ $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
972
+ return $this;
973
+ }
974
+
975
+ /**
976
+ * Convert a shipment's product code.
977
+ *
978
+ * @return $this
979
+ */
980
+ public function changeProductCodeAction()
981
  {
982
  $helper = Mage::helper('postnl');
983
  $shipmentId = $this->getRequest()->getParam('shipment_id');
984
+ if (!$this->_checkIsAllowed(array('change_product_code'))) {
985
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
986
  $this->__('The current user is not allowed to perform this action.')
987
  );
1020
 
1021
  $postnlShipment = $this->_getPostnlShipment($shipmentId);
1022
 
1023
+ if ($postnlShipment->hasLabels()) {
1024
+ if (!$this->_checkIsAllowed(array('delete_labels'))) {
1025
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
1026
  $this->__('The current user is not allowed to perform this action.')
1027
  );
1030
  return $this;
1031
  }
1032
 
1033
+ $postnlShipment->deleteLabels();
1034
  }
1035
+
1036
+ $productOption = $this->getRequest()->getParam('product_option');
1037
+
1038
+ $postnlShipment->changeProductCode($productOption)->save();
1039
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1040
  Mage::helper('postnl/cif')->parseCifException($e);
1041
 
1061
  }
1062
 
1063
  $helper->addSessionMessage('adminhtml/session', null, 'success',
1064
+ $this->__("The shipment's product option has been changed succesfully.")
1065
  );
1066
 
1067
  $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
1073
  *
1074
  * @return $this
1075
  */
1076
+ public function changeParcelCountAction()
1077
  {
1078
  $helper = Mage::helper('postnl');
1079
  $shipmentId = $this->getRequest()->getParam('shipment_id');
1080
+ if (!$this->_checkIsAllowed(array('change_parcel_count'))) {
1081
  $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
1082
  $this->__('The current user is not allowed to perform this action.')
1083
  );
1129
  $postnlShipment->deleteLabels();
1130
  }
1131
 
1132
+ $parcelCount = (int) $this->getRequest()->getParam('parcel_count');
1133
 
1134
+ $postnlShipment->changeParcelCount($parcelCount)->save();
1135
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1136
  Mage::helper('postnl/cif')->parseCifException($e);
1137
 
1157
  }
1158
 
1159
  $helper->addSessionMessage('adminhtml/session', null, 'success',
1160
+ $this->__("The shipment's parcel count has been changed succesfully.")
1161
  );
1162
 
1163
  $this->_redirect('adminhtml/sales_shipment/view', array('shipment_id' => $shipmentId));
1344
  */
1345
  public function massFullPostnlFlowWithPackingSlipAction()
1346
  {
1347
+ if (!$this->_checkIsAllowed(array('print_packing_slips'))) {
1348
+ Mage::helper('postnl')->addSessionMessage(
1349
+ 'adminhtml/session', 'POSTNL-0155', 'error',
1350
+ $this->__('The current user is not allowed to perform this action.')
1351
+ );
1352
+
1353
+ $this->_redirect('adminhtml/sales_order/index');
1354
+
1355
+ return $this;
1356
+ }
1357
+
1358
  return $this->massFullPostnlFlowAction('packing_slip');
1359
  }
1360
 
1404
  * Add either a success or failure message and redirect the user accordingly.
1405
  */
1406
  if ($this->_errors < count($orderIds)) {
1407
+ $existingShipmentsLoaded = Mage::registry('postnl_existing_shipments_loaded');
1408
+ if (!is_array($existingShipmentsLoaded) || count($existingShipmentsLoaded) != count($shipmentIds)) {
1409
+ $helper->addSessionMessage(
1410
+ 'adminhtml/session', null, 'success',
1411
+ $this->__('The shipments were successfully created.')
1412
+ );
1413
+ }
1414
  } else {
1415
  $helper->addSessionMessage(
1416
  'adminhtml/session',
1535
  */
1536
  foreach ($shipments as $shipment) {
1537
  try {
1538
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
1539
+ $shipment->getStoreId()
1540
+ );
1541
+
1542
+ $shipmentLabels = $this->_getLabels($shipment, true, $printReturnLabels);
1543
  $labels = array_merge($labels, $shipmentLabels);
1544
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1545
  Mage::helper('postnl/cif')->parseCifException($e);
1623
  return $this;
1624
  }
1625
 
1626
+ /**
1627
+ * Prints shipping packing slips and confirms selected shipments.
1628
+ *
1629
+ * @return $this
1630
+ */
1631
+ public function massPrintPackingSlipsAndConfirmAction()
1632
+ {
1633
+ $helper = Mage::helper('postnl');
1634
+ if (!$this->_checkIsAllowed(array('print_label', 'confirm', 'print_packing_slips'))) {
1635
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0155', 'error',
1636
+ $this->__('The current user is not allowed to perform this action.')
1637
+ );
1638
+
1639
+ $this->_redirect('adminhtml/sales_shipment/index');
1640
+ return $this;
1641
+ }
1642
+
1643
+ try {
1644
+ $shipmentIds = $this->_getShipmentIds();
1645
+
1646
+ /**
1647
+ * Validate the number of labels to be printed. Every shipment has at least 1 label. So if we have more than
1648
+ * 200 shipments we can stop the process right here.
1649
+ *
1650
+ * @var $labelClassName TIG_PostNL_Model_Core_Label
1651
+ */
1652
+ $labelClassName = Mage::getConfig()->getModelClassName('postnl_core/label');
1653
+ if(count($shipmentIds) > $labelClassName::MAX_LABEL_COUNT
1654
+ && !Mage::helper('postnl/cif')->allowInfinitePrinting()
1655
+ ) {
1656
+ throw new TIG_PostNL_Exception(
1657
+ $this->__('You can print a maximum of 200 labels at once.'),
1658
+ 'POSTNL-0014'
1659
+ );
1660
+ }
1661
+
1662
+ /**
1663
+ * Load the shipments and check if they are valid
1664
+ */
1665
+ $shipments = $this->_loadAndCheckShipments($shipmentIds, true, false);
1666
+
1667
+ /**
1668
+ * Get the labels from CIF.
1669
+ *
1670
+ * @var TIG_PostNL_Model_Core_Shipment $shipment
1671
+ */
1672
+ $output = false;
1673
+ foreach ($shipments as $shipment) {
1674
+ try {
1675
+ /**
1676
+ * Load the shipments and check if they are valid
1677
+ */
1678
+ $shipments = $this->_loadAndCheckShipments($shipmentIds, true, false);
1679
+
1680
+ $output = $this->_getMassPackingSlipsOutput($shipments);
1681
+ $this->_checkForWarnings();
1682
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1683
+ Mage::helper('postnl/cif')->parseCifException($e);
1684
+
1685
+ $helper->logException($e);
1686
+ $this->addWarning(
1687
+ array(
1688
+ 'entity_id' => $shipment->getShipmentIncrementId(),
1689
+ 'code' => $e->getCode(),
1690
+ 'description' => $e->getMessage(),
1691
+ )
1692
+ );
1693
+ } catch (TIG_PostNL_Exception $e) {
1694
+ $helper->logException($e);
1695
+ $this->addWarning(
1696
+ array(
1697
+ 'entity_id' => $shipment->getShipmentIncrementId(),
1698
+ 'code' => $e->getCode(),
1699
+ 'description' => $e->getMessage(),
1700
+ )
1701
+ );
1702
+ } catch (Exception $e) {
1703
+ $helper->logException($e);
1704
+ $this->addWarning(
1705
+ array(
1706
+ 'entity_id' => $shipment->getShipmentIncrementId(),
1707
+ 'code' => null,
1708
+ 'description' => $e->getMessage(),
1709
+ )
1710
+ );
1711
+ }
1712
+ }
1713
+
1714
+ /**
1715
+ * We need to check for warnings before the label download response
1716
+ */
1717
+ $this->_checkForWarnings();
1718
+
1719
+ if (!$output) {
1720
+ $helper->addSessionMessage('adminhtml/session', null, 'error',
1721
+ $this->__(
1722
+ 'Unfortunately no shipments could be processed. Please check the error messages for more ' .
1723
+ 'details.'
1724
+ )
1725
+ );
1726
+
1727
+ $this->_redirect('adminhtml/sales_shipment/index');
1728
+ return $this;
1729
+ }
1730
+
1731
+ $filename = 'PostNL Packing Slips-' . date('YmdHis') . '.pdf';
1732
+
1733
+ $this->_preparePdfResponse($filename, $output);
1734
+ } catch (TIG_PostNL_Exception $e) {
1735
+ $helper->logException($e);
1736
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
1737
+
1738
+ $this->_redirect('adminhtml/sales_shipment/index');
1739
+ return $this;
1740
+ } catch (Exception $e) {
1741
+ $helper->logException($e);
1742
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
1743
+ $this->__('An error occurred while processing this action.')
1744
+ );
1745
+
1746
+ $this->_redirect('adminhtml/sales_shipment/index');
1747
+ return $this;
1748
+ }
1749
+
1750
+ return $this;
1751
+ }
1752
+
1753
  /**
1754
  * Prints shipping labels for selected shipments.
1755
  *
1799
  */
1800
  foreach ($shipments as $shipment) {
1801
  try {
1802
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
1803
+ $shipment->getStoreId()
1804
+ );
1805
+
1806
+ $shipmentLabels = $this->_getLabels($shipment, false, $printReturnLabels);
1807
  $labels = array_merge($labels, $shipmentLabels);
1808
  } catch (TIG_PostNL_Exception $e) {
1809
  $helper->logException($e);
1989
  );
1990
  }
1991
 
1992
+ $printReturnLabels = Mage::helper('postnl')->canPrintReturnLabelsWithShippingLabels(
1993
+ $shipment->getStoreId()
1994
+ );
1995
+
1996
+ $shipmentLabels = $this->_getLabels($shipment, false, $printReturnLabels);
1997
  $packingSlipModel->createPdf($shipmentLabels, $shipment, $pdf);
1998
  } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
1999
  Mage::helper('postnl/cif')->parseCifException($e);
2183
  }
2184
 
2185
  /**
2186
+ * Creates a Parcelware export file based on the selected shipments.
2187
  *
2188
  * @return $this
2189
  */
2203
  $shipmentIds = $this->_getShipmentIds();
2204
 
2205
  /**
2206
+ * Load the shipments and check if they are valid.
2207
  */
2208
  $shipments = $this->_loadAndCheckShipments($shipmentIds, true);
2209
 
2216
  $timestamp = date('Ymd_His', Mage::getModel('core/date')->timestamp());
2217
 
2218
  $this->_prepareDownloadResponse("PostNL_Parcelware_Export_{$timestamp}.csv", $csvContents);
2219
+ return $this;
2220
+ } catch (TIG_PostNL_Exception $e) {
2221
+ $helper->logException($e);
2222
+ $helper->addExceptionSessionMessage('adminhtml/session', $e);
2223
+
2224
+ $this->_redirect('adminhtml/sales_shipment/index');
2225
+ return $this;
2226
+ } catch (Exception $e) {
2227
+ $helper->logException($e);
2228
+ $helper->addSessionMessage('adminhtml/session', 'POSTNL-0010', 'error',
2229
+ $this->__('An error occurred while processing this action.')
2230
+ );
2231
+
2232
+ $this->_redirect('adminhtml/sales_shipment/index');
2233
+ return $this;
2234
+ }
2235
+ }
2236
+
2237
+ /**
2238
+ * Update the shipping status of the selected shipments.
2239
+ *
2240
+ * @return $this
2241
+ */
2242
+ public function massUpdateShippingStatusAction()
2243
+ {
2244
+ $helper = Mage::helper('postnl');
2245
+
2246
+ try {
2247
+ $shipmentIds = $this->_getShipmentIds();
2248
+
2249
+ /**
2250
+ * Load the shipments and check if they are valid
2251
+ */
2252
+ $shipments = $this->_loadAndCheckShipments($shipmentIds, true, false);
2253
+
2254
+ /**
2255
+ * Updating the shipping status of a lot of shipments may take a while, therefore we need to disable the PHP
2256
+ * execution time limit.
2257
+ */
2258
+ set_time_limit(0);
2259
+
2260
+ /**
2261
+ * Update the shipping status for the shipments.
2262
+ *
2263
+ * @var TIG_PostNL_Model_Core_Shipment $shipment
2264
+ */
2265
+ $errors = 0;
2266
+ foreach ($shipments as $shipment) {
2267
+ try {
2268
+ $this->_updateShippingStatus($shipment);
2269
+ } catch (TIG_PostNL_Model_Core_Cif_Exception $e) {
2270
+ Mage::helper('postnl/cif')->parseCifException($e);
2271
+
2272
+ $helper->logException($e);
2273
+ $this->addWarning(
2274
+ array(
2275
+ 'entity_id' => $shipment->getShipmentIncrementId(),
2276
+ 'code' => $e->getCode(),
2277
+ 'description' => $e->getMessage(),
2278
+ )
2279
+ );
2280
+ $errors++;
2281
+ } catch (TIG_PostNL_Exception $e) {
2282
+ $helper->logException($e);
2283
+ $this->addWarning(
2284
+ array(
2285
+ 'entity_id' => $shipment->getShipmentIncrementId(),
2286
+ 'code' => $e->getCode(),
2287
+ 'description' => $e->getMessage(),
2288
+ )
2289
+ );
2290
+ $errors++;
2291
+ } catch (Exception $e) {
2292
+ $helper->logException($e);
2293
+ $this->addWarning(
2294
+ array(
2295
+ 'entity_id' => $shipment->getShipmentIncrementId(),
2296
+ 'code' => null,
2297
+ 'description' => $e->getMessage(),
2298
+ )
2299
+ );
2300
+ $errors++;
2301
+ }
2302
+ }
2303
+
2304
  } catch (TIG_PostNL_Exception $e) {
2305
  $helper->logException($e);
2306
  $helper->addExceptionSessionMessage('adminhtml/session', $e);
2317
  return $this;
2318
  }
2319
 
2320
+ $this->_checkForWarnings();
2321
+
2322
+ if ($errors < count($shipments)) {
2323
+ $helper->addSessionMessage(
2324
+ 'adminhtml/session', null, 'success',
2325
+ $this->__('The shipping status has been updated successfully.')
2326
+ );
2327
+ } else {
2328
+ $helper->addSessionMessage(
2329
+ 'adminhtml/session', null, 'error',
2330
+ $this->__(
2331
+ 'Unfortunately no shipments could be processed. Please check the error messages for more details.'
2332
+ )
2333
+ );
2334
+ }
2335
+
2336
  $this->_redirect('adminhtml/sales_shipment/index');
2337
  return $this;
2338
  }
app/code/community/TIG/PostNL/controllers/CheckoutController.php CHANGED
@@ -39,19 +39,19 @@
39
  class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
40
  {
41
  /**
42
- * XML path of show_summary_page setting
43
  */
44
  const XPATH_SHOW_SUMMARY_PAGE = 'postnl/checkout/show_summary_page';
45
 
46
  /**
47
- * Order class variable
48
  *
49
  * @var Mage_Sales_Model_Order | void
50
  */
51
  protected $_order;
52
 
53
  /**
54
- * Gets the stored order object
55
  *
56
  * @return Mage_Sales_Model_Order
57
  */
@@ -62,7 +62,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
62
  }
63
 
64
  /**
65
- * Sets an order object
66
  *
67
  * @param Mage_Sales_Model_Order $order
68
  *
@@ -75,7 +75,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
75
  }
76
 
77
  /**
78
- * Checks if the PostNL webservice is available for the current account
79
  *
80
  * @return $this
81
  */
@@ -125,7 +125,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
125
  }
126
 
127
  /**
128
- * Prepares a new PostNL Checkout Order
129
  *
130
  * @return $this
131
  */
@@ -222,7 +222,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
222
  }
223
 
224
  /**
225
- * Shows a summary of the PostNL Checkout order before the user confirms it
226
  *
227
  * @return $this
228
  */
@@ -232,7 +232,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
232
  $helper = Mage::helper('postnl');
233
 
234
  /**
235
- * Validate the quote
236
  */
237
  $quoteIsValid = $this->_validateQuote($quote);
238
  if (!$quoteIsValid || !$this->_isPostnlCheckoutActive()) {
@@ -241,7 +241,7 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
241
  }
242
 
243
  /**
244
- * Check if showing the checkout summary page is allowed
245
  */
246
  $showSummarypage = Mage::getStoreConfigFlag(self::XPATH_SHOW_SUMMARY_PAGE);
247
  if (!$showSummarypage) {
@@ -251,18 +251,19 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
251
 
252
  try {
253
  /**
254
- * Get the order details from CIF for the order the customer just placed
255
  */
256
  $cif = Mage::getModel('postnl_checkout/cif');
257
  $orderDetails = $cif->readOrder();
258
 
259
  /**
260
- * Update the quote with the received order details
261
  */
262
  $service = Mage::getModel('postnl_checkout/service');
263
  $service->setQuote($quote)
264
  ->updateQuoteAddresses($orderDetails)
265
- ->updateQuotePayment($orderDetails, true, true) //only set the payment method, not all possible fields
 
266
  ->updateQuoteCustomer($orderDetails)
267
  ->updatePostnlOrder($orderDetails);
268
 
@@ -393,8 +394,8 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
393
  }
394
 
395
  /**
396
- * Next we update the quote's payment if we didn't get to do that in the previous step and then place the order. Also we
397
- * need to process any chosen communication options
398
  */
399
  try {
400
  if ($skipUpdatePayment === false) {
@@ -404,23 +405,22 @@ class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
404
  $service->updatePostnlOrder($orderDetails);
405
 
406
  /**
407
- * Create the order
408
  */
409
  $order = $service->saveOrder();
410
 
411
  $service->confirmPostnlOrder();
412
 
413
  /**
414
- * Parse any possible communication options
415
  */
416
  $this->_parseCommunicationOptions($orderDetails, $order);
417
  } catch (Exception $e) {
418
  $helper->logException($e);
419
  $helper->addSessionMessage('checkout/session', 'POSTNL-0021', 'error',
420
  $this->__(
421
- 'An error occurred while processing your order.'
422
- . 'Please try again. '
423
- . 'if this problem persists, please contact the webshop owner.'
424
  )
425
  );
426
 
39
  class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
40
  {
41
  /**
42
+ * XML path of show_summary_page setting.
43
  */
44
  const XPATH_SHOW_SUMMARY_PAGE = 'postnl/checkout/show_summary_page';
45
 
46
  /**
47
+ * Order class variable.
48
  *
49
  * @var Mage_Sales_Model_Order | void
50
  */
51
  protected $_order;
52
 
53
  /**
54
+ * Gets the stored order object.
55
  *
56
  * @return Mage_Sales_Model_Order
57
  */
62
  }
63
 
64
  /**
65
+ * Sets an order object.
66
  *
67
  * @param Mage_Sales_Model_Order $order
68
  *
75
  }
76
 
77
  /**
78
+ * Checks if the PostNL webservice is available for the current account.
79
  *
80
  * @return $this
81
  */
125
  }
126
 
127
  /**
128
+ * Prepares a new PostNL Checkout Order.
129
  *
130
  * @return $this
131
  */
222
  }
223
 
224
  /**
225
+ * Shows a summary of the PostNL Checkout order before the user confirms it.
226
  *
227
  * @return $this
228
  */
232
  $helper = Mage::helper('postnl');
233
 
234
  /**
235
+ * Validate the quote.
236
  */
237
  $quoteIsValid = $this->_validateQuote($quote);
238
  if (!$quoteIsValid || !$this->_isPostnlCheckoutActive()) {
241
  }
242
 
243
  /**
244
+ * Check if showing the checkout summary page is allowed.
245
  */
246
  $showSummarypage = Mage::getStoreConfigFlag(self::XPATH_SHOW_SUMMARY_PAGE);
247
  if (!$showSummarypage) {
251
 
252
  try {
253
  /**
254
+ * Get the order details from CIF for the order the customer just placed.
255
  */
256
  $cif = Mage::getModel('postnl_checkout/cif');
257
  $orderDetails = $cif->readOrder();
258
 
259
  /**
260
+ * Update the quote with the received order details.
261
  */
262
  $service = Mage::getModel('postnl_checkout/service');
263
  $service->setQuote($quote)
264
  ->updateQuoteAddresses($orderDetails)
265
+ ->updateQuotePayment($orderDetails, true, true) // Only set the payment method, not all possible
266
+ // fields.
267
  ->updateQuoteCustomer($orderDetails)
268
  ->updatePostnlOrder($orderDetails);
269
 
394
  }
395
 
396
  /**
397
+ * Next we update the quote's payment if we didn't get to do that in the previous step and then place the order.
398
+ * Also we need to process any chosen communication options.
399
  */
400
  try {
401
  if ($skipUpdatePayment === false) {
405
  $service->updatePostnlOrder($orderDetails);
406
 
407
  /**
408
+ * Create the order.
409
  */
410
  $order = $service->saveOrder();
411
 
412
  $service->confirmPostnlOrder();
413
 
414
  /**
415
+ * Parse any possible communication options.
416
  */
417
  $this->_parseCommunicationOptions($orderDetails, $order);
418
  } catch (Exception $e) {
419
  $helper->logException($e);
420
  $helper->addSessionMessage('checkout/session', 'POSTNL-0021', 'error',
421
  $this->__(
422
+ 'An error occurred while processing your order. Please try again. if this problem persists, ' .
423
+ 'please contact the webshop owner.'
 
424
  )
425
  );
426
 
app/code/community/TIG/PostNL/controllers/DeliveryOptionsController.php CHANGED
@@ -62,6 +62,11 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
62
  */
63
  const MOBILE_PHONE_NUMBER_REGEX = '#^(((\+31|0|0031)6){1}[1-9]{1}[0-9]{7})$#i';
64
 
 
 
 
 
 
65
  /**
66
  * @var null|array
67
  */
@@ -548,6 +553,58 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
548
  return $this;
549
  }
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  /**
552
  * Check to see if PostNL delivery options are active and available.
553
  *
@@ -708,6 +765,16 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
708
  $date = $params['date'];
709
  $costs = Mage::helper('core')->jsonDecode($params['costs']);
710
 
 
 
 
 
 
 
 
 
 
 
711
  /**
712
  * The costs object should contain an amount incl. VAT and excl. VAT.
713
  */
@@ -737,6 +804,7 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
737
  $typeValidator = new Zend_Validate_InArray(array('haystack' => $validTypes));
738
  $dateValidator = new Zend_Validate_Date(array('format' => 'd-m-Y'));
739
  $costsValidator = new Zend_Validate_Float();
 
740
 
741
  /**
742
  * Validate the postcode.
@@ -783,6 +851,14 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
783
  'costs' => $costs,
784
  );
785
 
 
 
 
 
 
 
 
 
786
  if (isset($params['number'])) {
787
  $phoneNumber = $this->_getSavePhonePostData($params);
788
  $data['number'] = $phoneNumber;
@@ -815,12 +891,11 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
815
  || !isset($address['HouseNr'])
816
  || !isset($address['Zipcode'])
817
  || !isset($address['Name'])
818
- || !isset($address['PhoneNumber'])
819
  ) {
820
  throw new TIG_PostNL_Exception(
821
  $this->__(
822
  'Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country '
823
- . 'code, street, house number, phonenumber and zipcode.'
824
  ),
825
  'POSTNL-0141'
826
  );
62
  */
63
  const MOBILE_PHONE_NUMBER_REGEX = '#^(((\+31|0|0031)6){1}[1-9]{1}[0-9]{7})$#i';
64
 
65
+ /**
66
+ * Regular expression to match a valid PostNL time.
67
+ */
68
+ const TIME_REGEX = '#^[0-9]{2,2}:[0-9]{2,2}(:[0-9]{2,2})?$#';
69
+
70
  /**
71
  * @var null|array
72
  */
553
  return $this;
554
  }
555
 
556
+ /**
557
+ * Get the formatted PakjeGemak address if available.
558
+ *
559
+ * @return $this
560
+ */
561
+ public function getFormattedPakjeGemakAddressAction()
562
+ {
563
+ /**
564
+ * This action may only be called using AJAX requests
565
+ */
566
+ if (!$this->getRequest()->isAjax()) {
567
+ $this->getResponse()
568
+ ->setBody('not_allowed');
569
+
570
+ return $this;
571
+ }
572
+
573
+ if (!$this->_canUseDeliveryOptions()) {
574
+ $this->getResponse()
575
+ ->setBody('not_allowed');
576
+
577
+ return $this;
578
+ }
579
+
580
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
581
+
582
+ $pakjeGemakAddress = false;
583
+ /** @var Mage_Sales_Model_Quote_Address $address */
584
+ foreach ($quote->getAllAddresses() as $address) {
585
+ if ($address->getAddressType() == 'pakje_gemak') {
586
+ $pakjeGemakAddress = $address;
587
+ break;
588
+ }
589
+ }
590
+
591
+ if (!$pakjeGemakAddress) {
592
+ $this->getResponse()
593
+ ->setBody('not_found');
594
+
595
+ return $this;
596
+ }
597
+
598
+ /**
599
+ * Format the address.
600
+ */
601
+ $formattedAddress = $pakjeGemakAddress->format('html');
602
+ $this->getResponse()
603
+ ->setBody($formattedAddress);
604
+
605
+ return $this;
606
+ }
607
+
608
  /**
609
  * Check to see if PostNL delivery options are active and available.
610
  *
765
  $date = $params['date'];
766
  $costs = Mage::helper('core')->jsonDecode($params['costs']);
767
 
768
+ $from = false;
769
+ if (!empty($params['from'])) {
770
+ $from = $params['from'];
771
+ }
772
+
773
+ $to = false;
774
+ if (!empty($params['to'])) {
775
+ $to = $params['to'];
776
+ }
777
+
778
  /**
779
  * The costs object should contain an amount incl. VAT and excl. VAT.
780
  */
804
  $typeValidator = new Zend_Validate_InArray(array('haystack' => $validTypes));
805
  $dateValidator = new Zend_Validate_Date(array('format' => 'd-m-Y'));
806
  $costsValidator = new Zend_Validate_Float();
807
+ $timeValidator = new Zend_Validate_Regex(array('pattern' => self::TIME_REGEX));
808
 
809
  /**
810
  * Validate the postcode.
851
  'costs' => $costs,
852
  );
853
 
854
+ if ($from && $timeValidator->isValid($from)) {
855
+ $data['from'] = $from;
856
+ }
857
+
858
+ if ($to && $timeValidator->isValid($to)) {
859
+ $data['to'] = $to;
860
+ }
861
+
862
  if (isset($params['number'])) {
863
  $phoneNumber = $this->_getSavePhonePostData($params);
864
  $data['number'] = $phoneNumber;
891
  || !isset($address['HouseNr'])
892
  || !isset($address['Zipcode'])
893
  || !isset($address['Name'])
 
894
  ) {
895
  throw new TIG_PostNL_Exception(
896
  $this->__(
897
  'Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country '
898
+ . 'code, street, house number and zipcode.'
899
  ),
900
  'POSTNL-0141'
901
  );
app/code/community/TIG/PostNL/controllers/GuestController.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_GuestController extends TIG_PostNL_Controller_Sales
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_errorRedirect = 'sales/guest/view';
45
+
46
+ /**
47
+ * Try to load valid order and register it.
48
+ *
49
+ * @param int|null $orderId
50
+ *
51
+ * @return boolean
52
+ */
53
+ protected function _loadValidOrder($orderId = null)
54
+ {
55
+ return Mage::helper('sales/guest')->loadValidOrder();
56
+ }
57
+
58
+ /**
59
+ * Check PostNL shipment view availability
60
+ *
61
+ * @param TIG_PostNL_Model_Core_Shipment $postnlShipment
62
+ *
63
+ * @return boolean
64
+ */
65
+ protected function _canViewPostnlShipment(TIG_PostNL_Model_Core_Shipment $postnlShipment)
66
+ {
67
+ if (!$this->_loadValidOrder($postnlShipment->getOrderId())) {
68
+ return false;
69
+ }
70
+
71
+ /**
72
+ * @var Mage_Sales_Model_Order $order
73
+ */
74
+ $order = Mage::registry('current_order');
75
+ $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
76
+
77
+ if ($postnlShipment->getId()
78
+ && $postnlShipment->isConfirmed()
79
+ && $order->getId()
80
+ && $postnlShipment->getOrderId() == $order->getId()
81
+ && in_array($order->getState(), $availableStates, $strict = true)
82
+ ) {
83
+ return true;
84
+ }
85
+
86
+ return false;
87
+ }
88
+ }
app/code/community/TIG/PostNL/controllers/OrderController.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ class TIG_PostNL_OrderController extends TIG_PostNL_Controller_Sales
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ protected $_errorRedirect = 'sales/order/history';
45
+ }
app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.4.1-1.5.0.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+
40
+ /**
41
+ * @var TIG_PostNL_Model_Resource_Setup $installer
42
+ */
43
+ $installer = $this;
44
+
45
+ /**
46
+ * A new ACl role has been added for printing return labels.
47
+ */
48
+ $returnLabelsAclResource = array(
49
+ 'admin/postnl/shipment/actions/print_label/print_return_labels',
50
+ 'admin/postnl/shipment/actions/print_label/print_return_labels/send_return_label_email',
51
+ );
52
+
53
+ $returnLabelsRequiredResources = array(
54
+ 'admin/postnl',
55
+ 'admin/postnl/shipment',
56
+ 'admin/postnl/shipment/actions',
57
+ 'admin/postnl/shipment/actions/print_label',
58
+ );
59
+
60
+ /**
61
+ * A new ACl role has been added for changing the parcel count of a shipment.
62
+ */
63
+ $changeParcelCountAclResource = array(
64
+ 'admin/postnl/shipment/actions/convert/change_parcel_count',
65
+ );
66
+
67
+ $changeParcelCountRequiredResources = array(
68
+ 'admin/postnl',
69
+ 'admin/postnl/shipment',
70
+ 'admin/postnl/shipment/actions',
71
+ 'admin/postnl/shipment/actions/convert',
72
+ );
73
+
74
+ /**
75
+ * A new ACl role has been added for viewing the PostNL returns grid.
76
+ */
77
+ $postnlReturnsGridAclResource = array(
78
+ 'admin/sales/postnl_returns',
79
+ );
80
+
81
+ $postnlReturnsGridRequiredResources = array(
82
+ 'admin/sales',
83
+ 'admin/sales/shipment',
84
+ );
85
+
86
+ /**
87
+ * These CIF webservices have been updated.
88
+ */
89
+ $updatedWebservices = array(
90
+ 'cif_version_labelling',
91
+ 'cif_version_timeframe',
92
+ 'cif_version_shippingstatus',
93
+ 'cif_version_location',
94
+ 'cif_version_deliverydate',
95
+ 'cif_version_confirming',
96
+ 'cif_version_barcode',
97
+ 'cif_version_timeframe',
98
+ );
99
+
100
+ $settingsToMove = array(
101
+ 'postnl/cif_address/return_firstname' => 'postnl/cif_address/alternative_sender_firstname',
102
+ 'postnl/cif_address/return_lastname' => 'postnl/cif_address/alternative_sender_lastname',
103
+ 'postnl/cif_address/return_company' => 'postnl/cif_address/alternative_sender_company',
104
+ 'postnl/cif_address/return_department' => 'postnl/cif_address/alternative_sender_department',
105
+ 'postnl/cif_address/return_streetname' => 'postnl/cif_address/alternative_sender_streetname',
106
+ 'postnl/cif_address/return_housenumber' => 'postnl/cif_address/alternative_sender_housenumber',
107
+ 'postnl/cif_address/return_housenumber_extension' => 'postnl/cif_address/alternative_sender_housenumber_extension',
108
+ 'postnl/cif_address/return_postcode' => 'postnl/cif_address/alternative_sender_postcode',
109
+ 'postnl/cif_address/return_city' => 'postnl/cif_address/alternative_sender_city',
110
+ 'postnl/cif_address/return_region' => 'postnl/cif_address/alternative_sender_region',
111
+ 'postnl/cif_address/return_country' => 'postnl/cif_address/alternative_sender_country',
112
+ );
113
+
114
+ foreach ($settingsToMove as $from => $to) {
115
+ $installer->moveConfigSettingInDb($from, $to);
116
+ }
117
+
118
+ $installer->addAclRules($returnLabelsAclResource, $returnLabelsRequiredResources)
119
+ ->addAclRules($changeParcelCountAclResource, $changeParcelCountRequiredResources)
120
+ ->addAclRules($postnlReturnsGridAclResource, $postnlReturnsGridRequiredResources)
121
+ ->resetWebserviceVersions($updatedWebservices)
122
+ ->generateReturnStatusCronExpr()
123
+ ->setDateTimeZoneUpdateCron()
124
+ ->clearConfigCache();
app/code/community/TIG/PostNL/etc/adminhtml.xml CHANGED
@@ -39,6 +39,20 @@
39
  */
40
  -->
41
  <config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  <acl>
43
  <resources>
44
  <admin>
@@ -87,6 +101,16 @@
87
  <title>Print Packing Slip</title>
88
  <sort_order>10</sort_order>
89
  </print_packing_slips>
 
 
 
 
 
 
 
 
 
 
90
  </children>
91
  </print_label>
92
  <create_parcelware_export translate="title" module="postnl">
@@ -121,6 +145,10 @@
121
  <title>Change Product Option</title>
122
  <sort_order>30</sort_order>
123
  </change_product_code>
 
 
 
 
124
  </children>
125
  </convert>
126
  </children>
@@ -129,6 +157,14 @@
129
  </shipment>
130
  </children>
131
  </postnl>
 
 
 
 
 
 
 
 
132
  </children>
133
  </admin>
134
  </resources>
39
  */
40
  -->
41
  <config>
42
+ <menu>
43
+ <sales>
44
+ <children>
45
+ <postnl_returns translate="title" module="postnl">
46
+ <title>PostNL Returns</title>
47
+ <action>postnl_admin/adminhtml_returns</action>
48
+ <sort_order>35</sort_order>
49
+ <depends>
50
+ <config>postnl/returns/return_labels_active</config>
51
+ </depends>
52
+ </postnl_returns>
53
+ </children>
54
+ </sales>
55
+ </menu>
56
  <acl>
57
  <resources>
58
  <admin>
101
  <title>Print Packing Slip</title>
102
  <sort_order>10</sort_order>
103
  </print_packing_slips>
104
+ <print_return_labels translate="title" module="postnl">
105
+ <title>Print Return Label</title>
106
+ <sort_order>20</sort_order>
107
+ <children>
108
+ <send_return_label_email translate="title" module="postnl">
109
+ <title>Send Return Label Email</title>
110
+ <sort_order>10</sort_order>
111
+ </send_return_label_email>
112
+ </children>
113
+ </print_return_labels>
114
  </children>
115
  </print_label>
116
  <create_parcelware_export translate="title" module="postnl">
145
  <title>Change Product Option</title>
146
  <sort_order>30</sort_order>
147
  </change_product_code>
148
+ <change_parcel_count translate="title" module="postnl">
149
+ <title>Change Colli Count</title>
150
+ <sort_order>40</sort_order>
151
+ </change_parcel_count>
152
  </children>
153
  </convert>
154
  </children>
157
  </shipment>
158
  </children>
159
  </postnl>
160
+ <sales>
161
+ <children>
162
+ <postnl_returns translate="title" module="postnl">
163
+ <title>PostNL Returns</title>
164
+ <sort_order>35</sort_order>
165
+ </postnl_returns>
166
+ </children>
167
+ </sales>
168
  </children>
169
  </admin>
170
  </resources>
app/code/community/TIG/PostNL/etc/config.xml CHANGED
@@ -41,7 +41,7 @@
41
  <config>
42
  <modules>
43
  <TIG_PostNL>
44
- <version>1.4.1</version>
45
  </TIG_PostNL>
46
  </modules>
47
 
@@ -139,6 +139,9 @@
139
  <shipment_status_history>
140
  <table>tig_postnl_shipment_status_history</table>
141
  </shipment_status_history>
 
 
 
142
  </entities>
143
  </postnl_core_resource>
144
  <postnl_carrier_resource>
@@ -228,11 +231,16 @@
228
  </events>
229
  <template>
230
  <email>
231
- <postnl_cif_labels_and_confirming_track_and_trace_email_template translate="label" module="postnl">
232
  <label>PostNL Track &amp; Trace Email</label>
233
  <file>TIG/PostNL/track_and_trace.html</file>
234
  <type>html</type>
235
- </postnl_cif_labels_and_confirming_track_and_trace_email_template>
 
 
 
 
 
236
  </email>
237
  </template>
238
  <payment>
@@ -546,6 +554,12 @@
546
  <class>postnl_deliveryoptions/observer_shippingMethodAvailable</class>
547
  <method>addDeliveryOptions</method>
548
  </checkout_deliveryoptions>
 
 
 
 
 
 
549
  </observers>
550
  </core_block_abstract_to_html_before>
551
  <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
@@ -576,7 +590,7 @@
576
  <!-- remove old temporary label files (by default files older than 5 min will be deleted) -->
577
  <postnl_clean_temp_labels>
578
  <schedule>
579
- <cron_expr>*/5 * * * *</cron_expr> <!-- every 5 minutes -->
580
  </schedule>
581
  <run>
582
  <model>postnl_core/observer_cron::cleanTempLabels</model>
@@ -602,11 +616,22 @@
602
  </postnl_get_missing_barcodes>
603
  <!-- Update the shipping status for all undelivered PostNL shipments -->
604
  <postnl_update_shipping_status>
605
- <!-- No cron expression. A semi-random cron expression is generated when the module first is installed. It's stored in the core_config_data table. -->
606
- <run>
 
 
607
  <model>postnl_core/observer_cron::updateShippingStatus</model>
608
  </run>
609
  </postnl_update_shipping_status>
 
 
 
 
 
 
 
 
 
610
  <!-- Expire confirmations of shipments that have been confirmed, but have not been shipped within the maximum number of days -->
611
  <postnl_expire_confirmation>
612
  <schedule>
@@ -627,7 +652,9 @@
627
  </postnl_send_track_and_trace_email>
628
  <!-- Update the shop's statistics with the extension control system -->
629
  <postnl_update_statistics>
630
- <!-- No cron expression. A semi-random cron expression is generated when the module first is installed. It's stored in the core_config_data table. -->
 
 
631
  <run>
632
  <model>postnl_extensioncontrol/observer_cron::updateStatistics</model>
633
  </run>
@@ -635,7 +662,7 @@
635
  <!-- Update the shop's statistics with the extension control system -->
636
  <postnl_update_notification_feed>
637
  <schedule>
638
- <cron_expr>0 * * * *</cron_expr> <!-- every hour on the hour -->
639
  </schedule>
640
  <run>
641
  <model>postnl_extensioncontrol/observer_cron::checkFeedUpdate</model>
@@ -657,6 +684,31 @@
657
  <model>postnl_core/observer_cron::updateProductAttribute</model>
658
  </run>
659
  </postnl_update_product_attribute>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
  </jobs>
661
  </crontab>
662
 
@@ -750,16 +802,16 @@
750
  <region/>
751
  <country>NL</country> <!-- All sender addresses must be located in the Netherlands -->
752
  <use_sender_address>1</use_sender_address> <!-- Use the sender address as the return address -->
753
- <return_firstname/>
754
- <return_lastname/>
755
- <return_company/>
756
- <return_streetname/>
757
- <return_housenumber/>
758
- <return_housenumber_extension/>
759
- <return_postcode/>
760
- <return_city/>
761
- <return_region/>
762
- <return_country>NL</return_country> <!-- All return addresses must be located in the Netherlands -->
763
  </cif_address>
764
  <cif_labels_and_confirming>
765
  <label_size>A4</label_size> <!-- A4 size labels -->
@@ -821,8 +873,8 @@
821
  <mijnpakket_test_base_url>https://tppwscheckout-sandbox.e-id.nl/</mijnpakket_test_base_url> <!-- Base URL for MijnPakket in test mode -->
822
  <mijnpakket_login_js_path>Checkout2/Login.js</mijnpakket_login_js_path> <!-- Path to MijnPakket login JS file -->
823
  <mijnpakket_checkout_premium_js_path>Checkout2/CheckoutPremium.js</mijnpakket_checkout_premium_js_path> <!-- Path to MijnPakket Checkout premium JS file -->
824
- <mijnpakket_login_btn_live_base_url>https://checkout.postnl.nl/</mijnpakket_login_btn_live_base_url> <!-- Base URL for MijnPakket login button in live mode -->
825
- <mijnpakket_login_btn_test_base_url>https://tppcb-sandbox.e-id.nl/</mijnpakket_login_btn_test_base_url> <!-- Base URL for MijnPakket login button in test mode -->
826
  <mijnpakket_login_btn_url_path>Button/PremiumLogin</mijnpakket_login_btn_url_path> <!-- Path to MijnPakket login button -->
827
  <default_pakketautomaat_product_option>3553</default_pakketautomaat_product_option> <!-- Parcel dispenser -->
828
  </delivery_options>
@@ -868,11 +920,26 @@
868
  </packing_slip>
869
  <track_and_trace>
870
  <send_track_and_trace_email>1</send_track_and_trace_email> <!-- automatically send a track & trace email to the customer -->
871
- <track_and_trace_email_template>postnl_cif_labels_and_confirming_track_and_trace_email_template</track_and_trace_email_template> <!-- Default template from locale -->
872
  <send_copy>0</send_copy> <!-- Do not send a copy of the track & trace email -->
873
  <copy_to/>
874
  <copy_method>bcc</copy_method> <!-- Use the bcc method for sending the track & trace email copy -->
875
  </track_and_trace>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
876
  <cod>
877
  <account_name/>
878
  <iban/>
@@ -962,7 +1029,7 @@
962
  <grid>
963
  <show_grid_options>1</show_grid_options> <!-- Show product options in the order grid -->
964
  <show_buspakje_option>1</show_buspakje_option> <!-- Show the option to mark a shipment as being a buspakje -->
965
- <order_grid_columns>shipment_type</order_grid_columns> <!-- Show the shipment type column -->
966
  <order_grid_massaction_default>postnl_create_shipments</order_grid_massaction_default> <!-- Select the create shipments mass action by default -->
967
  <shipping_grid_columns>shipment_type,confirm_date,confirm_status,labels_printed,barcode,shipping_phase</shipping_grid_columns> <!-- Show the shipping description, shipment type, label-printed and shipping phase columns -->
968
  <shipping_grid_massaction_default>postnl_print_labels_and_confirm</shipping_grid_massaction_default> <!-- 'Print labels and confirm shipment' massaction -->
@@ -972,8 +1039,8 @@
972
  <alternative_default_max_amount>100</alternative_default_max_amount> <!-- 100 EUR -->
973
  <alternative_default_option>3189</alternative_default_option> <!-- Signature on delivery -->
974
  <default_evening_product_option>3385</default_evening_product_option> <!-- Deliver to stated address only -->
975
- <default_pakjegemak_product_option>3533</default_pakjegemak_product_option> <!-- Post Office + signature on delivery -->
976
- <default_pge_product_option>3543</default_pge_product_option> <!-- Post Office + Signature on Delivery + Notification -->
977
  <default_buspakje_product_option>2928</default_buspakje_product_option> <!-- Buspakje Extra -->
978
  <default_stated_address_only_product_option>3385</default_stated_address_only_product_option> <!-- Deliver to stated address only -->
979
  <default_eu_product_option>4952</default_eu_product_option> <!-- EU Pack Special to consumer (combilabel) -->
@@ -988,32 +1055,38 @@
988
  <max_parcel_count>200</max_parcel_count> <!-- Maximum of 200 parcels per shipment allowed -->
989
  <max_temp_file_storage_time>300</max_temp_file_storage_time> <!-- 300 seconds (5 minutes) -->
990
  <confirm_expire_days>9</confirm_expire_days> <!-- 9 days -->
 
991
  <send_statistics>1</send_statistics> <!-- Send extension usage statistics to PostNL -->
992
  <receive_updates>1</receive_updates> <!-- Automatically receive updates regarding the PostNL extension -->
993
  <feed_url>ext.tigpostnl.nl/rss</feed_url> <!-- Default URL for the RSS notification feed -->
994
  <feed_use_https>0</feed_use_https> <!-- use regular http:// to get the latest feed updates. At the moment https is not yet supported, however it may be in the future. -->
995
  <show_error_details_in_frontend>0</show_error_details_in_frontend> <!-- Do not show error details in the frontend -->
996
  <postnl_shipping_methods>postnl_flatrate,postnl_tablerate,postnl_matrixrate</postnl_shipping_methods> <!-- By default only the PostNL shipping methods may be consider to be 'PostNL shipping methods' -->
997
- <cif_version_shippingstatus>1_3</cif_version_shippingstatus> <!-- v1.3 -->
998
- <cif_version_confirming>1_4</cif_version_confirming> <!-- v1.4 -->
999
- <cif_version_labelling>1_5</cif_version_labelling> <!-- v1.5 -->
1000
- <cif_version_barcode>1_0</cif_version_barcode> <!-- v1.0 -->
1001
  <cif_version_checkout>2_2</cif_version_checkout> <!-- v2.2 -->
1002
- <cif_version_deliverydate>1_1</cif_version_deliverydate> <!-- v1.1 -->
1003
- <cif_version_timeframe>1_0</cif_version_timeframe> <!-- v1.0 -->
1004
- <cif_version_location>1_0</cif_version_location> <!-- v1.0 -->
1005
  </advanced>
1006
 
1007
- <!-- Login data for the postcode check functionality. DO NOT CHANGE THIS UNLESS SPECIFICALLY INSTRUCTED TO DO SO BY POSTNL OR TIG -->
1008
  <cendris>
1009
  <username>tpgpost030</username>
1010
  <password>Post2014!</password>
1011
  </cendris>
1012
 
1013
- <!-- Google maps API key. Only change this value if you wish to use your own API key instead. -->
1014
  <google_maps>
1015
- <api_key>AIzaSyCHq62q_WNkFPdfgQkQzX46H4n2AGD0ubs</api_key>
1016
  </google_maps>
 
 
 
 
 
1017
  </postnl>
1018
  </default>
1019
 
@@ -1782,7 +1855,7 @@
1782
  <type>error</type>
1783
  </POSTNL-0140>
1784
  <POSTNL-0141>
1785
- <message>Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number, phonenumber and zipcode.</message>
1786
  <url>http://kb.tig.nl/topic/53037577</url>
1787
  <type>error</type>
1788
  </POSTNL-0141>
@@ -2081,6 +2154,106 @@
2081
  <url>http://kb.tig.nl/topic/102373326</url>
2082
  <type>error</type>
2083
  </POSTNL-0200>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2084
 
2085
  <!-- These error codes are generated by CIF, not by this extension -->
2086
  <LIRS_0>
41
  <config>
42
  <modules>
43
  <TIG_PostNL>
44
+ <version>1.5.1</version>
45
  </TIG_PostNL>
46
  </modules>
47
 
139
  <shipment_status_history>
140
  <table>tig_postnl_shipment_status_history</table>
141
  </shipment_status_history>
142
+ <integrity>
143
+ <table>tig_postnl_integrity</table>
144
+ </integrity>
145
  </entities>
146
  </postnl_core_resource>
147
  <postnl_carrier_resource>
231
  </events>
232
  <template>
233
  <email>
234
+ <postnl_track_and_trace_track_and_trace_email_template translate="label" module="postnl">
235
  <label>PostNL Track &amp; Trace Email</label>
236
  <file>TIG/PostNL/track_and_trace.html</file>
237
  <type>html</type>
238
+ </postnl_track_and_trace_track_and_trace_email_template>
239
+ <postnl_returns_email_template translate="label" module="postnl">
240
+ <label>PostNL Return Label Email</label>
241
+ <file>TIG/PostNL/return_label.html</file>
242
+ <type>html</type>
243
+ </postnl_returns_email_template>
244
  </email>
245
  </template>
246
  <payment>
554
  <class>postnl_deliveryoptions/observer_shippingMethodAvailable</class>
555
  <method>addDeliveryOptions</method>
556
  </checkout_deliveryoptions>
557
+ <!-- Adds a link to the returns page on the sales/order/view page -->
558
+ <returns_view_link>
559
+ <type>singleton</type>
560
+ <class>postnl_core/observer_returns</class>
561
+ <method>addReturnLinkToAccount</method>
562
+ </returns_view_link>
563
  </observers>
564
  </core_block_abstract_to_html_before>
565
  <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
590
  <!-- remove old temporary label files (by default files older than 5 min will be deleted) -->
591
  <postnl_clean_temp_labels>
592
  <schedule>
593
+ <cron_expr>30 * * * *</cron_expr> <!-- every hour at 30 minutes minutes -->
594
  </schedule>
595
  <run>
596
  <model>postnl_core/observer_cron::cleanTempLabels</model>
616
  </postnl_get_missing_barcodes>
617
  <!-- Update the shipping status for all undelivered PostNL shipments -->
618
  <postnl_update_shipping_status>
619
+ <schedule>
620
+ <cron_expr>30 3,11,15 * * *</cron_expr> <!-- This schedule will be overwritten by a semi-random cron expression that is generated when the extension is first installed. It's stored in the core_config_data table. -->
621
+ </schedule>
622
+ <run>
623
  <model>postnl_core/observer_cron::updateShippingStatus</model>
624
  </run>
625
  </postnl_update_shipping_status>
626
+ <!-- Update the return status for all undelivered PostNL shipments -->
627
+ <postnl_update_return_status>
628
+ <schedule>
629
+ <cron_expr>30 2,10,18 * * *</cron_expr> <!-- This schedule will be overwritten by a semi-random cron expression that is generated when the extension is first installed. It's stored in the core_config_data table. -->
630
+ </schedule>
631
+ <run>
632
+ <model>postnl_core/observer_cron::updateReturnStatus</model>
633
+ </run>
634
+ </postnl_update_return_status>
635
  <!-- Expire confirmations of shipments that have been confirmed, but have not been shipped within the maximum number of days -->
636
  <postnl_expire_confirmation>
637
  <schedule>
652
  </postnl_send_track_and_trace_email>
653
  <!-- Update the shop's statistics with the extension control system -->
654
  <postnl_update_statistics>
655
+ <schedule>
656
+ <cron_expr>30 6,18 * * *</cron_expr> <!-- This schedule will be overwritten by a semi-random cron expression that is generated when the extension is first installed. It's stored in the core_config_data table. -->
657
+ </schedule>
658
  <run>
659
  <model>postnl_extensioncontrol/observer_cron::updateStatistics</model>
660
  </run>
662
  <!-- Update the shop's statistics with the extension control system -->
663
  <postnl_update_notification_feed>
664
  <schedule>
665
+ <cron_expr>15 * * * *</cron_expr> <!-- every hour at 15 minutes on the hour -->
666
  </schedule>
667
  <run>
668
  <model>postnl_extensioncontrol/observer_cron::checkFeedUpdate</model>
684
  <model>postnl_core/observer_cron::updateProductAttribute</model>
685
  </run>
686
  </postnl_update_product_attribute>
687
+ <!-- Update PostNl shipment and order dates to the correct (UTC) time zone. This needs to be performed for certain update scripts, however it can be very taxing on the server when there are a lot of products. Therefore we'll process it using a cronjob. -->
688
+ <postnl_update_date_time_zone>
689
+ <!-- No cron expression. The cron expression is generated when the extension is updated and will be removed once the update has finished. -->
690
+ <run>
691
+ <model>postnl_core/observer_cron::updateDateTimeZone</model>
692
+ </run>
693
+ </postnl_update_date_time_zone>
694
+ <!-- Update PostNl config settings. Currently this is used for the Google Maps API key, and the Cendris username and password. -->
695
+ <postnl_update_config_settings>
696
+ <schedule>
697
+ <cron_expr>0 0 * * 0</cron_expr> <!-- every sunday at midnight. -->
698
+ </schedule>
699
+ <run>
700
+ <model>postnl_core/observer_cron::updateDateTimeZone</model>
701
+ </run>
702
+ </postnl_update_config_settings>
703
+ <!-- Verify PostNL's data integrity. -->
704
+ <postnl_data_integrity_check>
705
+ <schedule>
706
+ <cron_expr>0 5 * * *</cron_expr> <!-- every night at 5 AM. -->
707
+ </schedule>
708
+ <run>
709
+ <model>postnl_core/observer_cron::integrityCheck</model>
710
+ </run>
711
+ </postnl_data_integrity_check>
712
  </jobs>
713
  </crontab>
714
 
802
  <region/>
803
  <country>NL</country> <!-- All sender addresses must be located in the Netherlands -->
804
  <use_sender_address>1</use_sender_address> <!-- Use the sender address as the return address -->
805
+ <alternative_sender_firstname/>
806
+ <alternative_sender_lastname/>
807
+ <alternative_sender_company/>
808
+ <alternative_sender_streetname/>
809
+ <alternative_sender_housenumber/>
810
+ <alternative_sender_housenumber_extension/>
811
+ <alternative_sender_postcode/>
812
+ <alternative_sender_city/>
813
+ <alternative_sender_region/>
814
+ <alternative_sender_country>NL</alternative_sender_country> <!-- All alternative sender addresses must be located in the Netherlands -->
815
  </cif_address>
816
  <cif_labels_and_confirming>
817
  <label_size>A4</label_size> <!-- A4 size labels -->
873
  <mijnpakket_test_base_url>https://tppwscheckout-sandbox.e-id.nl/</mijnpakket_test_base_url> <!-- Base URL for MijnPakket in test mode -->
874
  <mijnpakket_login_js_path>Checkout2/Login.js</mijnpakket_login_js_path> <!-- Path to MijnPakket login JS file -->
875
  <mijnpakket_checkout_premium_js_path>Checkout2/CheckoutPremium.js</mijnpakket_checkout_premium_js_path> <!-- Path to MijnPakket Checkout premium JS file -->
876
+ <mijnpakket_login_btn_live_base_url>checkout.postnl.nl/</mijnpakket_login_btn_live_base_url> <!-- Base URL for MijnPakket login button in live mode -->
877
+ <mijnpakket_login_btn_test_base_url>tppcb-sandbox.e-id.nl/</mijnpakket_login_btn_test_base_url> <!-- Base URL for MijnPakket login button in test mode -->
878
  <mijnpakket_login_btn_url_path>Button/PremiumLogin</mijnpakket_login_btn_url_path> <!-- Path to MijnPakket login button -->
879
  <default_pakketautomaat_product_option>3553</default_pakketautomaat_product_option> <!-- Parcel dispenser -->
880
  </delivery_options>
920
  </packing_slip>
921
  <track_and_trace>
922
  <send_track_and_trace_email>1</send_track_and_trace_email> <!-- automatically send a track & trace email to the customer -->
923
+ <track_and_trace_email_template>postnl_track_and_trace_track_and_trace_email_template</track_and_trace_email_template> <!-- Default template from locale -->
924
  <send_copy>0</send_copy> <!-- Do not send a copy of the track & trace email -->
925
  <copy_to/>
926
  <copy_method>bcc</copy_method> <!-- Use the bcc method for sending the track & trace email copy -->
927
  </track_and_trace>
928
+ <returns>
929
+ <return_labels_active>0</return_labels_active> <!-- Do not use return labels -->
930
+ <print_return_and_shipping_label>0</print_return_and_shipping_label> <!-- Do not print the return label along with the shipping labels -->
931
+ <customer_print_label>0</customer_print_label> <!-- Do not allow logged in customers to print return labels -->
932
+ <guest_print_label>0</guest_print_label> <!-- Do not allow guests to print return labels -->
933
+ <email_template>postnl_returns_email_template</email_template> <!-- Default template from locale -->
934
+ <return_label_instructions_block/>
935
+ <return_company/>
936
+ <return_department/>
937
+ <return_freepost_number/>
938
+ <return_postcode/>
939
+ <return_city/>
940
+ <return_region/>
941
+ <return_country>NL</return_country> <!-- Only returns to the Netherlands are supported at this time -->
942
+ </returns>
943
  <cod>
944
  <account_name/>
945
  <iban/>
1029
  <grid>
1030
  <show_grid_options>1</show_grid_options> <!-- Show product options in the order grid -->
1031
  <show_buspakje_option>1</show_buspakje_option> <!-- Show the option to mark a shipment as being a buspakje -->
1032
+ <order_grid_columns>shipment_type,confirm_date,confirm_status,shipping_phase</order_grid_columns> <!-- Show the shipment type, confirm date, confirm status and shipping phase columns -->
1033
  <order_grid_massaction_default>postnl_create_shipments</order_grid_massaction_default> <!-- Select the create shipments mass action by default -->
1034
  <shipping_grid_columns>shipment_type,confirm_date,confirm_status,labels_printed,barcode,shipping_phase</shipping_grid_columns> <!-- Show the shipping description, shipment type, label-printed and shipping phase columns -->
1035
  <shipping_grid_massaction_default>postnl_print_labels_and_confirm</shipping_grid_massaction_default> <!-- 'Print labels and confirm shipment' massaction -->
1039
  <alternative_default_max_amount>100</alternative_default_max_amount> <!-- 100 EUR -->
1040
  <alternative_default_option>3189</alternative_default_option> <!-- Signature on delivery -->
1041
  <default_evening_product_option>3385</default_evening_product_option> <!-- Deliver to stated address only -->
1042
+ <default_pakjegemak_product_option>3544</default_pakjegemak_product_option> <!-- Post Office + Signature on Delivery + Notification -->
1043
+ <default_pge_product_option>3544</default_pge_product_option> <!-- Post Office + Signature on Delivery + Notification -->
1044
  <default_buspakje_product_option>2928</default_buspakje_product_option> <!-- Buspakje Extra -->
1045
  <default_stated_address_only_product_option>3385</default_stated_address_only_product_option> <!-- Deliver to stated address only -->
1046
  <default_eu_product_option>4952</default_eu_product_option> <!-- EU Pack Special to consumer (combilabel) -->
1055
  <max_parcel_count>200</max_parcel_count> <!-- Maximum of 200 parcels per shipment allowed -->
1056
  <max_temp_file_storage_time>300</max_temp_file_storage_time> <!-- 300 seconds (5 minutes) -->
1057
  <confirm_expire_days>9</confirm_expire_days> <!-- 9 days -->
1058
+ <return_expire_days>30</return_expire_days> <!-- 17 days -->
1059
  <send_statistics>1</send_statistics> <!-- Send extension usage statistics to PostNL -->
1060
  <receive_updates>1</receive_updates> <!-- Automatically receive updates regarding the PostNL extension -->
1061
  <feed_url>ext.tigpostnl.nl/rss</feed_url> <!-- Default URL for the RSS notification feed -->
1062
  <feed_use_https>0</feed_use_https> <!-- use regular http:// to get the latest feed updates. At the moment https is not yet supported, however it may be in the future. -->
1063
  <show_error_details_in_frontend>0</show_error_details_in_frontend> <!-- Do not show error details in the frontend -->
1064
  <postnl_shipping_methods>postnl_flatrate,postnl_tablerate,postnl_matrixrate</postnl_shipping_methods> <!-- By default only the PostNL shipping methods may be consider to be 'PostNL shipping methods' -->
1065
+ <cif_version_shippingstatus>1_4</cif_version_shippingstatus> <!-- v1.4 -->
1066
+ <cif_version_confirming>1_5</cif_version_confirming> <!-- v1.5 -->
1067
+ <cif_version_labelling>1_6</cif_version_labelling> <!-- v1.6 -->
1068
+ <cif_version_barcode>1_1</cif_version_barcode> <!-- v1.1 -->
1069
  <cif_version_checkout>2_2</cif_version_checkout> <!-- v2.2 -->
1070
+ <cif_version_deliverydate>1_2</cif_version_deliverydate> <!-- v1.2 -->
1071
+ <cif_version_timeframe>1_2</cif_version_timeframe> <!-- v1.2 -->
1072
+ <cif_version_location>1_1</cif_version_location> <!-- v1.1 -->
1073
  </advanced>
1074
 
1075
+ <!-- Login data for the postcode check functionality. -->
1076
  <cendris>
1077
  <username>tpgpost030</username>
1078
  <password>Post2014!</password>
1079
  </cendris>
1080
 
1081
+ <!-- Google maps API key. -->
1082
  <google_maps>
1083
+ <api_key>AIzaSyB09S8SLpSPRF6YRZJDTuRpQIW71c51wm8</api_key>
1084
  </google_maps>
1085
+
1086
+ <!-- These settings are used by the PostNl extension for upgrade scripts. -->
1087
+ <update>
1088
+ <product_attribute_update_data/>
1089
+ </update>
1090
  </postnl>
1091
  </default>
1092
 
1855
  <type>error</type>
1856
  </POSTNL-0140>
1857
  <POSTNL-0141>
1858
+ <message>Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number and zipcode.</message>
1859
  <url>http://kb.tig.nl/topic/53037577</url>
1860
  <type>error</type>
1861
  </POSTNL-0141>
2154
  <url>http://kb.tig.nl/topic/102373326</url>
2155
  <type>error</type>
2156
  </POSTNL-0200>
2157
+ <POSTNL-0201>
2158
+ <message>The generateReturnBarcode action is currently unavailable.</message>
2159
+ <url>http://kb.tig.nl/topic/84684878</url>
2160
+ <type>error</type>
2161
+ </POSTNL-0201>
2162
+ <POSTNL-0202>
2163
+ <message>Unable to retrieve return labels for this shipment.</message>
2164
+ <url>http://kb.tig.nl/topic/84685238</url>
2165
+ <type>error</type>
2166
+ </POSTNL-0202>
2167
+ <POSTNL-0203>
2168
+ <message>The changeParcelCount action is currently unavailable.</message>
2169
+ <url>http://kb.tig.nl/topic/84693347</url>
2170
+ <type>error</type>
2171
+ </POSTNL-0203>
2172
+ <POSTNL-0204>
2173
+ <message>The updateReturnStatus action is currently unavailable.</message>
2174
+ <url>http://kb.tig.nl/topic/84693727</url>
2175
+ <type>error</type>
2176
+ </POSTNL-0204>
2177
+ <POSTNL-0205>
2178
+ <message>Unable to save return_status cron expression: %s</message>
2179
+ <url>http://kb.tig.nl/topic/84685838</url>
2180
+ <type>error</type>
2181
+ </POSTNL-0205>
2182
+ <POSTNL-0206>
2183
+ <message>Unable to save update_date_time_zone cron expression: %s</message>
2184
+ <url>http://kb.tig.nl/topic/84685968</url>
2185
+ <type>error</type>
2186
+ </POSTNL-0206>
2187
+ <POSTNL-0207>
2188
+ <message>The sendReturnLabelEmail action is currently unavailable.</message>
2189
+ <url>http://kb.tig.nl/topic/84694197</url>
2190
+ <type>error</type>
2191
+ </POSTNL-0207>
2192
+ <POSTNL-0208>
2193
+ <message>Unable to send return email for shipment #%s</message>
2194
+ <url>http://kb.tig.nl/topic/84694457</url>
2195
+ <type>error</type>
2196
+ </POSTNL-0208>
2197
+ <POSTNL-0209>
2198
+ <message>Unable to send return label email due to missing shipment parameters.</message>
2199
+ <url>http://kb.tig.nl/topic/84686268</url>
2200
+ <type>error</type>
2201
+ </POSTNL-0209>
2202
+ <POSTNL-0210>
2203
+ <message>The installed version of PHP is too low. The installed PHP version is %s, the minimum required PHP version is %s.</message>
2204
+ <url>http://kb.tig.nl/topic/84694597</url>
2205
+ <type>error</type>
2206
+ </POSTNL-0210>
2207
+ <POSTNL-0211>
2208
+ <message>Invalid settings provided.</message>
2209
+ <url>http://kb.tig.nl/topic/84694787</url>
2210
+ <type>error</type>
2211
+ </POSTNL-0211>
2212
+ <POSTNL-0212>
2213
+ <message>Invalid config value provided.</message>
2214
+ <url>http://kb.tig.nl/topic/84694817</url>
2215
+ <type>error</type>
2216
+ </POSTNL-0212>
2217
+ <POSTNL-0213>
2218
+ <message>Invalid updateConfigSettings response: %s</message>
2219
+ <url>http://kb.tig.nl/topic/84694847</url>
2220
+ <type>error</type>
2221
+ </POSTNL-0213>
2222
+ <POSTNL-0214>
2223
+ <message>Missing Magento order.</message>
2224
+ <url/>
2225
+ <type>error</type>
2226
+ </POSTNL-0214>
2227
+ <POSTNL-0215>
2228
+ <message>Missing Magento quote.</message>
2229
+ <url/>
2230
+ <type>error</type>
2231
+ </POSTNL-0215>
2232
+ <POSTNL-0216>
2233
+ <message>Missing Magento shipment.</message>
2234
+ <url/>
2235
+ <type>error</type>
2236
+ </POSTNL-0216>
2237
+ <POSTNL-0217>
2238
+ <message>Quote IDs do not match.</message>
2239
+ <url/>
2240
+ <type>error</type>
2241
+ </POSTNL-0217>
2242
+ <POSTNL-0218>
2243
+ <message>Order IDs do not match.</message>
2244
+ <url/>
2245
+ <type>error</type>
2246
+ </POSTNL-0218>
2247
+ <POSTNL-0219>
2248
+ <message>There appear to be problems with the integrity of the PostNL order and/or shipment data.</message>
2249
+ <url>http://kb.tig.nl/topic/84695007</url>
2250
+ <type>error</type>
2251
+ </POSTNL-0219>
2252
+ <POSTNL-0220>
2253
+ <message>The shipping status of shipment #%s cannot be updated.</message>
2254
+ <url>http://kb.tig.nl/topic/84686768</url>
2255
+ <type>error</type>
2256
+ </POSTNL-0220>
2257
 
2258
  <!-- These error codes are generated by CIF, not by this extension -->
2259
  <LIRS_0>
app/code/community/TIG/PostNL/etc/jstranslator.xml CHANGED
@@ -129,7 +129,16 @@
129
  <as_soon_as_possible translate="message" module="postnl">
130
  <message>As soon as possible</message>
131
  </as_soon_as_possible>
132
- <wizard_step_saved translate="message" module="postnl">
133
- <message>The previous has been saved successfully!</message>
134
- </wizard_step_saved>
 
 
 
 
 
 
 
 
 
135
  </jstranslator>
129
  <as_soon_as_possible translate="message" module="postnl">
130
  <message>As soon as possible</message>
131
  </as_soon_as_possible>
132
+ <wizard_previous_step_saved translate="message" module="postnl">
133
+ <message>The previous step has been saved successfully!</message>
134
+ </wizard_previous_step_saved>
135
+ <wizard_current_step_saved translate="message" module="postnl">
136
+ <message>This step has been saved successfully!</message>
137
+ </wizard_current_step_saved>
138
+ <parcel_dispenser translate="message" module="postnl">
139
+ <message>parcel dispenser</message>
140
+ </parcel_dispenser>
141
+ <post_office_address translate="message" module="postnl">
142
+ <message>Post Office Address</message>
143
+ </post_office_address>
144
  </jstranslator>
app/code/community/TIG/PostNL/etc/logging.xml CHANGED
@@ -42,70 +42,206 @@
42
  <postnl_shipment translate="label" module="postnl">
43
  <label>PostNL</label>
44
  <actions>
45
- <postnl_admin_adminhtml_shipment_printLabel translate="label" module="postnl">
46
  <action>Print label</action>
47
  <expected_models>
48
  <postnl_core__shipment/>
49
  </expected_models>
50
  </postnl_admin_adminhtml_shipment_printLabel>
51
- <postnl_admin_adminhtml_shipment_confirm translate="label" module="postnl">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  <action>Confirm shipment</action>
53
  <expected_models>
54
  <postnl_core__shipment/>
55
  </expected_models>
 
 
 
56
  </postnl_admin_adminhtml_shipment_confirm>
57
- <postnl_admin_adminhtml_shipment_sendTrackAndTrace translate="label" module="postnl">
 
 
 
 
 
 
 
 
58
  <action>Send track &amp; trace email</action>
59
  <expected_models>
60
  <postnl_core__shipment/>
61
  </expected_models>
 
 
 
62
  </postnl_admin_adminhtml_shipment_sendTrackAndTrace>
63
- <postnl_admin_adminhtml_statusHistory translate="label" module="postnl">
64
- <action>View status history</action>
 
65
  <expected_models>
66
  <postnl_core__shipment/>
67
  </expected_models>
68
- </postnl_admin_adminhtml_statusHistory>
69
- <postnl_admin_adminhtml_shipment_resetConfirmation translate="label" module="postnl">
 
 
 
 
70
  <action>Change confirmation</action>
71
  <expected_models>
72
  <postnl_core__shipment/>
73
  </expected_models>
74
  </postnl_admin_adminhtml_shipment_resetConfirmation>
75
- <postnl_admin_adminhtml_shipment_removeLabels translate="label" module="postnl">
 
76
  <action>Delete labels</action>
77
  <expected_models>
78
  <postnl_core__shipment/>
79
  </expected_models>
 
 
 
80
  </postnl_admin_adminhtml_shipment_removeLabels>
81
- <postnl_admin_adminhtml_shipment_massCreateShipments translate="label" module="postnl">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  <action>Create shipments</action>
83
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
84
  </postnl_admin_adminhtml_shipment_massCreateShipments>
85
- <postnl_admin_adminhtml_shipment_massPrintLabelsAndConfirm translate="label" module="postnl">
 
 
 
 
 
 
 
 
 
 
 
86
  <action>Print labels and confirm shipment</action>
87
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
88
  </postnl_admin_adminhtml_shipment_massPrintLabelsAndConfirm>
89
- <postnl_admin_adminhtml_shipment_massPrintLabels translate="label" module="postnl">
 
 
 
 
 
 
90
  <action>Print labels</action>
91
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
92
  </postnl_admin_adminhtml_shipment_massPrintLabels>
93
- <postnl_admin_adminhtml_shipment_massPrintPackingslips translate="label" module="postnl">
 
94
  <action>Print packing slips</action>
95
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
96
  </postnl_admin_adminhtml_shipment_massPrintPackingslips>
97
- <postnl_admin_adminhtml_shipment_massConfirm translate="label" module="postnl">
 
98
  <action>Confirm shipments</action>
99
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
100
  </postnl_admin_adminhtml_shipment_massConfirm>
101
- <postnl_admin_adminhtml_shipment_massCreateParcelwareExport translate="label" module="postnl">
 
102
  <action>Create Parcelware export</action>
103
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
104
  </postnl_admin_adminhtml_shipment_massCreateParcelwareExport>
105
- <postnl_admin_adminhtml_shipment_massFullPostnlFlow translate="label" module="postnl">
106
- <action>Create shipments, print labels and confirm</action>
 
107
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
108
- </postnl_admin_adminhtml_shipment_massFullPostnlFlow>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  </actions>
110
  </postnl_shipment>
111
  </logging>
42
  <postnl_shipment translate="label" module="postnl">
43
  <label>PostNL</label>
44
  <actions>
45
+ <postnl_admin_adminhtml_shipment_printLabel translate="action" module="postnl">
46
  <action>Print label</action>
47
  <expected_models>
48
  <postnl_core__shipment/>
49
  </expected_models>
50
  </postnl_admin_adminhtml_shipment_printLabel>
51
+
52
+ <postnl_admin_adminhtml_shipment_printReturnLabel translate="action" module="postnl">
53
+ <action>Print return label</action>
54
+ <expected_models>
55
+ <postnl_core__shipment/>
56
+ </expected_models>
57
+ </postnl_admin_adminhtml_shipment_printReturnLabel>
58
+
59
+ <postnl_admin_adminhtml_shipment_printPackingSlip translate="action" module="postnl">
60
+ <action>Print packing slip</action>
61
+ <expected_models>
62
+ <postnl_core__shipment/>
63
+ </expected_models>
64
+ </postnl_admin_adminhtml_shipment_printPackingSlip>
65
+
66
+ <postnl_admin_adminhtml_shipment_confirm translate="action" module="postnl">
67
  <action>Confirm shipment</action>
68
  <expected_models>
69
  <postnl_core__shipment/>
70
  </expected_models>
71
+ <skip_on_back>
72
+ <adminhtml_sales_shipment_view/>
73
+ </skip_on_back>
74
  </postnl_admin_adminhtml_shipment_confirm>
75
+
76
+ <postnl_admin_adminhtml_statusHistory translate="action" module="postnl">
77
+ <action>View status history</action>
78
+ <expected_models>
79
+ <postnl_core__shipment/>
80
+ </expected_models>
81
+ </postnl_admin_adminhtml_statusHistory>
82
+
83
+ <postnl_admin_adminhtml_shipment_sendTrackAndTrace translate="action" module="postnl">
84
  <action>Send track &amp; trace email</action>
85
  <expected_models>
86
  <postnl_core__shipment/>
87
  </expected_models>
88
+ <skip_on_back>
89
+ <adminhtml_sales_shipment_view/>
90
+ </skip_on_back>
91
  </postnl_admin_adminhtml_shipment_sendTrackAndTrace>
92
+
93
+ <postnl_admin_adminhtml_shipment_sendReturnLabelEmail translate="action" module="postnl">
94
+ <action>Send return label email</action>
95
  <expected_models>
96
  <postnl_core__shipment/>
97
  </expected_models>
98
+ <skip_on_back>
99
+ <adminhtml_sales_shipment_view/>
100
+ </skip_on_back>
101
+ </postnl_admin_adminhtml_shipment_sendReturnLabelEmail>
102
+
103
+ <postnl_admin_adminhtml_shipment_resetConfirmation translate="action" module="postnl">
104
  <action>Change confirmation</action>
105
  <expected_models>
106
  <postnl_core__shipment/>
107
  </expected_models>
108
  </postnl_admin_adminhtml_shipment_resetConfirmation>
109
+
110
+ <postnl_admin_adminhtml_shipment_removeLabels translate="action" module="postnl">
111
  <action>Delete labels</action>
112
  <expected_models>
113
  <postnl_core__shipment/>
114
  </expected_models>
115
+ <skip_on_back>
116
+ <adminhtml_sales_shipment_view/>
117
+ </skip_on_back>
118
  </postnl_admin_adminhtml_shipment_removeLabels>
119
+
120
+ <postnl_admin_adminhtml_shipment_convertToBuspakje translate="action" module="postnl">
121
+ <action>Convert to letter box</action>
122
+ <expected_models>
123
+ <postnl_core__shipment/>
124
+ </expected_models>
125
+ <skip_on_back>
126
+ <adminhtml_sales_shipment_view/>
127
+ </skip_on_back>
128
+ </postnl_admin_adminhtml_shipment_convertToBuspakje>
129
+
130
+ <postnl_admin_adminhtml_shipment_convertToPackage translate="action" module="postnl">
131
+ <action>Convert to package</action>
132
+ <expected_models>
133
+ <postnl_core__shipment/>
134
+ </expected_models>
135
+ <skip_on_back>
136
+ <adminhtml_sales_shipment_view/>
137
+ </skip_on_back>
138
+ </postnl_admin_adminhtml_shipment_convertToPackage>
139
+
140
+ <postnl_admin_adminhtml_shipment_changeProductCode translate="action" module="postnl">
141
+ <action>Change product code</action>
142
+ <expected_models>
143
+ <postnl_core__shipment/>
144
+ </expected_models>
145
+ <skip_on_back>
146
+ <adminhtml_sales_shipment_view/>
147
+ </skip_on_back>
148
+ </postnl_admin_adminhtml_shipment_changeProductCode>
149
+
150
+ <postnl_admin_adminhtml_shipment_changeParcelCount translate="action" module="postnl">
151
+ <action>Change parcel count</action>
152
+ <expected_models>
153
+ <postnl_core__shipment/>
154
+ </expected_models>
155
+ <skip_on_back>
156
+ <adminhtml_sales_shipment_view/>
157
+ </skip_on_back>
158
+ </postnl_admin_adminhtml_shipment_changeParcelCount>
159
+
160
+ <postnl_admin_adminhtml_shipment_massCreateShipments translate="action" module="postnl">
161
  <action>Create shipments</action>
162
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
163
  </postnl_admin_adminhtml_shipment_massCreateShipments>
164
+
165
+ <postnl_admin_adminhtml_shipment_massFullPostnlFlow translate="action" module="postnl">
166
+ <action>Create shipments, print labels and confirm shipment</action>
167
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
168
+ </postnl_admin_adminhtml_shipment_massFullPostnlFlow>
169
+
170
+ <postnl_admin_adminhtml_shipment_massFullPostnlFlowWithPackingSlip translate="action" module="postnl">
171
+ <action>Create shipments, print packing slips and confirm shipment</action>
172
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
173
+ </postnl_admin_adminhtml_shipment_massFullPostnlFlowWithPackingSlip>
174
+
175
+ <postnl_admin_adminhtml_shipment_massPrintLabelsAndConfirm translate="action" module="postnl">
176
  <action>Print labels and confirm shipment</action>
177
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
178
  </postnl_admin_adminhtml_shipment_massPrintLabelsAndConfirm>
179
+
180
+ <postnl_admin_adminhtml_shipment_massPrintPackingSlipsAndConfirm translate="action" module="postnl">
181
+ <action>Print packing slips and confirm shipment</action>
182
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
183
+ </postnl_admin_adminhtml_shipment_massPrintPackingSlipsAndConfirm>
184
+
185
+ <postnl_admin_adminhtml_shipment_massPrintLabels translate="action" module="postnl">
186
  <action>Print labels</action>
187
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
188
  </postnl_admin_adminhtml_shipment_massPrintLabels>
189
+
190
+ <postnl_admin_adminhtml_shipment_massPrintPackingslips translate="action" module="postnl">
191
  <action>Print packing slips</action>
192
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
193
  </postnl_admin_adminhtml_shipment_massPrintPackingslips>
194
+
195
+ <postnl_admin_adminhtml_shipment_massConfirm translate="action" module="postnl">
196
  <action>Confirm shipments</action>
197
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
198
  </postnl_admin_adminhtml_shipment_massConfirm>
199
+
200
+ <postnl_admin_adminhtml_shipment_massCreateParcelwareExport translate="action" module="postnl">
201
  <action>Create Parcelware export</action>
202
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
203
  </postnl_admin_adminhtml_shipment_massCreateParcelwareExport>
204
+
205
+ <postnl_admin_adminhtml_shipment_massUpdateShippingStatus translate="action" module="postnl">
206
+ <action>Update shipping statusses</action>
207
  <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchSaveMassAction</post_dispatch>
208
+ </postnl_admin_adminhtml_shipment_massUpdateShippingStatus>
209
+
210
+ <postnl_admin_adminhtml_config_validateAccount translate="action" module="postnl">
211
+ <action>Validate account settings</action>
212
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
213
+ </postnl_admin_adminhtml_config_validateAccount>
214
+
215
+ <postnl_admin_adminhtml_config_exportTablerates translate="action" module="postnl">
216
+ <action>Export table rates</action>
217
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
218
+ </postnl_admin_adminhtml_config_exportTablerates>
219
+
220
+ <postnl_admin_adminhtml_config_exportMatrixrates translate="action" module="postnl">
221
+ <action>Export matrix rates</action>
222
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
223
+ </postnl_admin_adminhtml_config_exportMatrixrates>
224
+
225
+ <postnl_admin_adminhtml_config_downloadLogs translate="action" module="postnl">
226
+ <action>Download logs</action>
227
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
228
+ </postnl_admin_adminhtml_config_downloadLogs>
229
+
230
+ <postnl_admin_adminhtml_extensionControl_activate translate="action" module="postnl">
231
+ <action>Activate</action>
232
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
233
+ <skip_on_back>
234
+ <adminhtml_system_config_edit/>
235
+ </skip_on_back>
236
+ </postnl_admin_adminhtml_extensionControl_activate>
237
+
238
+ <postnl_admin_adminhtml_extensionControl_showActivationFields translate="action" module="postnl">
239
+ <action>Reset activation</action>
240
+ <post_dispatch>postnl__admin_logging_handler_postnl::postDispatchAction</post_dispatch>
241
+ <skip_on_back>
242
+ <adminhtml_system_config_edit/>
243
+ </skip_on_back>
244
+ </postnl_admin_adminhtml_extensionControl_showActivationFields>
245
  </actions>
246
  </postnl_shipment>
247
  </logging>
app/code/community/TIG/PostNL/etc/system.xml CHANGED
@@ -766,16 +766,16 @@
766
  <show_in_website>1</show_in_website>
767
  <show_in_store>1</show_in_store>
768
  </region>
769
- <return_address_header translate="label" module="postnl">
770
- <label>Return address</label>
771
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
772
  <sort_order>120</sort_order>
773
  <show_in_default>1</show_in_default>
774
  <show_in_website>1</show_in_website>
775
  <show_in_store>1</show_in_store>
776
- </return_address_header>
777
  <use_sender_address translate="label" module="postnl">
778
- <label>Use the sender address as the return adress</label>
779
  <frontend_type>checkbox</frontend_type>
780
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
781
  <source_model>postnl/system_config_source_yesno</source_model>
@@ -784,7 +784,7 @@
784
  <show_in_website>1</show_in_website>
785
  <show_in_store>1</show_in_store>
786
  </use_sender_address>
787
- <return_firstname translate="label" module="postnl">
788
  <label>First Name</label>
789
  <frontend_type>text</frontend_type>
790
  <sort_order>140</sort_order>
@@ -795,8 +795,8 @@
795
  <use_sender_address>0</use_sender_address>
796
  </depends>
797
  <validate>postnl-validate-empty</validate>
798
- </return_firstname>
799
- <return_lastname translate="label" module="postnl">
800
  <label>Last Name</label>
801
  <frontend_type>text</frontend_type>
802
  <sort_order>150</sort_order>
@@ -807,8 +807,8 @@
807
  <use_sender_address>0</use_sender_address>
808
  </depends>
809
  <validate>postnl-validate-empty</validate>
810
- </return_lastname>
811
- <return_company translate="label" module="postnl">
812
  <label>Company</label>
813
  <frontend_type>text</frontend_type>
814
  <sort_order>160</sort_order>
@@ -818,8 +818,8 @@
818
  <depends>
819
  <use_sender_address>0</use_sender_address>
820
  </depends>
821
- </return_company>
822
- <return_department translate="label" module="postnl">
823
  <label>Department</label>
824
  <frontend_type>text</frontend_type>
825
  <sort_order>170</sort_order>
@@ -829,8 +829,8 @@
829
  <depends>
830
  <use_sender_address>0</use_sender_address>
831
  </depends>
832
- </return_department>
833
- <return_streetname translate="label" module="postnl">
834
  <label>Street</label>
835
  <frontend_type>text</frontend_type>
836
  <sort_order>180</sort_order>
@@ -842,8 +842,8 @@
842
  <use_sender_address>0</use_sender_address>
843
  </depends>
844
  <validate>postnl-validate-empty</validate>
845
- </return_streetname>
846
- <return_housenumber translate="label" module="postnl">
847
  <label>House Nr.</label>
848
  <frontend_type>text</frontend_type>
849
  <sort_order>190</sort_order>
@@ -855,8 +855,8 @@
855
  <use_sender_address>0</use_sender_address>
856
  </depends>
857
  <validate>postnl-validate-empty</validate>
858
- </return_housenumber>
859
- <return_housenumber_extension translate="label" module="postnl">
860
  <label>House Nr. Extension</label>
861
  <frontend_type>text</frontend_type>
862
  <sort_order>200</sort_order>
@@ -866,8 +866,8 @@
866
  <depends>
867
  <use_sender_address>0</use_sender_address>
868
  </depends>
869
- </return_housenumber_extension>
870
- <return_postcode translate="label" module="postnl">
871
  <label>Postcode</label>
872
  <frontend_type>text</frontend_type>
873
  <sort_order>210</sort_order>
@@ -878,8 +878,8 @@
878
  <use_sender_address>0</use_sender_address>
879
  </depends>
880
  <validate>postnl-validate-empty</validate>
881
- </return_postcode>
882
- <return_city translate="label" module="postnl">
883
  <label>City</label>
884
  <frontend_type>text</frontend_type>
885
  <sort_order>220</sort_order>
@@ -890,8 +890,8 @@
890
  <use_sender_address>0</use_sender_address>
891
  </depends>
892
  <validate>postnl-validate-empty</validate>
893
- </return_city>
894
- <return_region translate="label" module="postnl">
895
  <label>Region</label>
896
  <frontend_type>text</frontend_type>
897
  <sort_order>230</sort_order>
@@ -901,7 +901,7 @@
901
  <depends>
902
  <use_sender_address>0</use_sender_address>
903
  </depends>
904
- </return_region>
905
  <save_and_continue translate="label" module="postnl">
906
  <label>Save and continue</label>
907
  <frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
@@ -961,7 +961,8 @@
961
  </shipping_duration>
962
  <cutoff_time translate="label tooltip" module="postnl">
963
  <label>Order cut-off time</label>
964
- <tooltip>When an order is placed after this time, another day will be added to the shipping duration.</tooltip>
 
965
  <frontend_model>postnl_adminhtml/system_config_form_field_hourMinute</frontend_model>
966
  <source_model>postnl_core/system_config_source_hourMinute</source_model>
967
  <backend_model>postnl_core/system_config_backend_hourMinute</backend_model>
@@ -970,12 +971,27 @@
970
  <show_in_website>1</show_in_website>
971
  <show_in_store>1</show_in_store>
972
  </cutoff_time>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
  <shipping_days translate="label comment" module="postnl">
974
  <label>Shipping days</label>
975
  <comment><![CDATA[Select on which days of the week orders are shipped. You can read more about shipping and delivery days <a href="http://kb.tig.nl/topic/102775036" target="_blank">here</a>.]]></comment>
976
  <source_model>postnl_core/system_config_source_shippingDays</source_model>
977
  <frontend_type>multiselect</frontend_type>
978
- <sort_order>60</sort_order>
979
  <show_in_default>1</show_in_default>
980
  <show_in_website>1</show_in_website>
981
  <show_in_store>1</show_in_store>
@@ -983,7 +999,7 @@
983
  <checkout_settings_header translate="titel" module="postnl">
984
  <label>Checkout settings</label>
985
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
986
- <sort_order>70</sort_order>
987
  <show_in_default>1</show_in_default>
988
  <show_in_website>1</show_in_website>
989
  <show_in_store>1</show_in_store>
@@ -993,7 +1009,7 @@
993
  <tooltip>Postcode validation and delivery options are only available for supported checkouts.</tooltip>
994
  <frontend_type>select</frontend_type>
995
  <source_model>postnl_core/system_config_source_checkoutExtensions</source_model>
996
- <sort_order>80</sort_order>
997
  <show_in_default>1</show_in_default>
998
  <show_in_website>1</show_in_website>
999
  <show_in_store>1</show_in_store>
@@ -1001,7 +1017,7 @@
1001
  <checkout_extension_other translate="label" module="postnl">
1002
  <label>Specify checkout extension</label>
1003
  <frontend_type>text</frontend_type>
1004
- <sort_order>90</sort_order>
1005
  <show_in_default>1</show_in_default>
1006
  <show_in_website>1</show_in_website>
1007
  <show_in_store>1</show_in_store>
@@ -1016,7 +1032,7 @@
1016
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1017
  <source_model>postnl/system_config_source_yesno</source_model>
1018
  <backend_model>postnl_addressvalidation/system_config_backend_validateAccount</backend_model>
1019
- <sort_order>100</sort_order>
1020
  <show_in_default>1</show_in_default>
1021
  <show_in_website>1</show_in_website>
1022
  <show_in_store>1</show_in_store>
@@ -1032,7 +1048,7 @@
1032
  <frontend_type>checkbox</frontend_type>
1033
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1034
  <source_model>postnl/system_config_source_yesno</source_model>
1035
- <sort_order>110</sort_order>
1036
  <show_in_default>1</show_in_default>
1037
  <show_in_website>1</show_in_website>
1038
  <show_in_store>1</show_in_store>
@@ -1049,7 +1065,7 @@
1049
  <frontend_type>checkbox</frontend_type>
1050
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1051
  <source_model>postnl/system_config_source_yesno</source_model>
1052
- <sort_order>120</sort_order>
1053
  <show_in_default>1</show_in_default>
1054
  <show_in_website>1</show_in_website>
1055
  <show_in_store>1</show_in_store>
@@ -1065,7 +1081,7 @@
1065
  <label>Maximum number of attempts</label>
1066
  <tooltip>After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.</tooltip>
1067
  <frontend_type>text</frontend_type>
1068
- <sort_order>130</sort_order>
1069
  <show_in_default>1</show_in_default>
1070
  <show_in_website>1</show_in_website>
1071
  <show_in_store>1</show_in_store>
@@ -1082,7 +1098,7 @@
1082
  <label>Connection timeout duration</label>
1083
  <tooltip>After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.</tooltip>
1084
  <frontend_type>text</frontend_type>
1085
- <sort_order>140</sort_order>
1086
  <show_in_default>1</show_in_default>
1087
  <show_in_website>1</show_in_website>
1088
  <show_in_store>1</show_in_store>
@@ -1095,6 +1111,28 @@
1095
  </depends>
1096
  <validate>validate-int validate-greater-than-zero</validate>
1097
  </postcode_check_timeout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1098
  <split_street translate="label comment tooltip" module="postnl">
1099
  <label>Split street parts</label>
1100
  <comment><![CDATA[You can read more on how to configure split address lines <a href="http://kb.tig.nl/topic/55961916" target="_blank">here</a>.]]></comment>
@@ -1102,11 +1140,14 @@
1102
  <frontend_type>checkbox</frontend_type>
1103
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1104
  <source_model>postnl/system_config_source_yesno</source_model>
1105
- <sort_order>150</sort_order>
1106
  <show_in_default>1</show_in_default>
1107
  <show_in_website>1</show_in_website>
1108
  <show_in_store>0</show_in_store>
1109
  <depends>
 
 
 
1110
  <use_postcode_check>0</use_postcode_check>
1111
  </depends>
1112
  </split_street>
@@ -1114,40 +1155,49 @@
1114
  <label>Streetname field</label>
1115
  <frontend_type>select</frontend_type>
1116
  <source_model>postnl_core/system_config_source_streetField</source_model>
1117
- <sort_order>160</sort_order>
1118
  <show_in_default>1</show_in_default>
1119
  <show_in_website>1</show_in_website>
1120
  <show_in_store>0</show_in_store>
1121
  <depends>
 
 
 
1122
  <split_street>1</split_street>
1123
  <use_postcode_check>0</use_postcode_check>
1124
  </depends>
1125
- <validate>validate-select</validate>
1126
  </streetname_field>
1127
  <housenr_field translate="label" module="postnl">
1128
  <label>Housenr. field</label>
1129
  <frontend_type>select</frontend_type>
1130
  <source_model>postnl_core/system_config_source_streetField</source_model>
1131
- <sort_order>170</sort_order>
1132
  <show_in_default>1</show_in_default>
1133
  <show_in_website>1</show_in_website>
1134
  <show_in_store>0</show_in_store>
1135
  <depends>
 
 
 
1136
  <split_street>1</split_street>
1137
  <use_postcode_check>0</use_postcode_check>
1138
  </depends>
1139
- <validate>validate-select</validate>
1140
  </housenr_field>
1141
  <split_housenr translate="label" module="postnl">
1142
  <label>Split house number parts</label>
1143
  <frontend_type>checkbox</frontend_type>
1144
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1145
  <source_model>postnl/system_config_source_yesno</source_model>
1146
- <sort_order>180</sort_order>
1147
  <show_in_default>1</show_in_default>
1148
  <show_in_website>1</show_in_website>
1149
  <show_in_store>0</show_in_store>
1150
  <depends>
 
 
 
1151
  <split_street>1</split_street>
1152
  <use_postcode_check>0</use_postcode_check>
1153
  </depends>
@@ -1156,21 +1206,24 @@
1156
  <label>Housenr. extension field</label>
1157
  <frontend_type>select</frontend_type>
1158
  <source_model>postnl_core/system_config_source_streetField</source_model>
1159
- <sort_order>190</sort_order>
1160
  <show_in_default>1</show_in_default>
1161
  <show_in_website>1</show_in_website>
1162
  <show_in_store>0</show_in_store>
1163
  <depends>
 
 
 
1164
  <split_street>1</split_street>
1165
  <split_housenr>1</split_housenr>
1166
  <use_postcode_check>0</use_postcode_check>
1167
  </depends>
1168
- <validate>validate-select</validate>
1169
  </housenr_extension_field>
1170
  <optional_street_fields_header translate="label" module="postnl">
1171
  <label>Optional address fields</label>
1172
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
1173
- <sort_order>200</sort_order>
1174
  <show_in_default>1</show_in_default>
1175
  <show_in_website>1</show_in_website>
1176
  <show_in_store>0</show_in_store>
@@ -1179,7 +1232,7 @@
1179
  <label>Area field</label>
1180
  <frontend_type>select</frontend_type>
1181
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1182
- <sort_order>210</sort_order>
1183
  <show_in_default>1</show_in_default>
1184
  <show_in_website>1</show_in_website>
1185
  <show_in_store>0</show_in_store>
@@ -1188,7 +1241,7 @@
1188
  <label>Building name field</label>
1189
  <frontend_type>select</frontend_type>
1190
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1191
- <sort_order>220</sort_order>
1192
  <show_in_default>1</show_in_default>
1193
  <show_in_website>1</show_in_website>
1194
  <show_in_store>0</show_in_store>
@@ -1197,7 +1250,7 @@
1197
  <label>Department field</label>
1198
  <frontend_type>select</frontend_type>
1199
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1200
- <sort_order>230</sort_order>
1201
  <show_in_default>1</show_in_default>
1202
  <show_in_website>1</show_in_website>
1203
  <show_in_store>0</show_in_store>
@@ -1207,7 +1260,7 @@
1207
  <tooltip>Doorcodes are often used in foreign addresses such as those used in France and Singapore.</tooltip>
1208
  <frontend_type>select</frontend_type>
1209
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1210
- <sort_order>240</sort_order>
1211
  <show_in_default>1</show_in_default>
1212
  <show_in_website>1</show_in_website>
1213
  <show_in_store>0</show_in_store>
@@ -1216,7 +1269,7 @@
1216
  <label>Floor field</label>
1217
  <frontend_type>select</frontend_type>
1218
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1219
- <sort_order>250</sort_order>
1220
  <show_in_default>1</show_in_default>
1221
  <show_in_website>1</show_in_website>
1222
  <show_in_store>0</show_in_store>
@@ -1225,7 +1278,7 @@
1225
  <label>Remark field</label>
1226
  <frontend_type>select</frontend_type>
1227
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1228
- <sort_order>260</sort_order>
1229
  <show_in_default>1</show_in_default>
1230
  <show_in_website>1</show_in_website>
1231
  <show_in_store>0</show_in_store>
@@ -1233,7 +1286,7 @@
1233
  <save_and_continue translate="label" module="postnl">
1234
  <label>Save and continue</label>
1235
  <frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
1236
- <sort_order>270</sort_order>
1237
  <show_in_default>1</show_in_default>
1238
  <show_in_website>1</show_in_website>
1239
  <show_in_store>1</show_in_store>
@@ -2029,7 +2082,7 @@
2029
  <show_in_default>1</show_in_default>
2030
  <show_in_website>1</show_in_website>
2031
  <show_in_store>0</show_in_store>
2032
- <next_step_rel/>
2033
  </save_and_continue>
2034
  <only_global_and_website_header translate="label" module="postnl">
2035
  <label><![CDATA[These settings are only available on the 'global' and 'website' scopes.]]></label>
@@ -2388,6 +2441,200 @@
2388
  </copy_method>
2389
  </fields>
2390
  </track_and_trace>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2391
  <cod translate="label comment" module="postnl">
2392
  <label>PostNL COD</label>
2393
  <comment><![CDATA[Activate an extra payment method with COD shipments.<br/>Please note: In order to offer COD shipments to your customers you will need to complete the fields below and activate an extra payment method <a href="%s" target="_blank">here</a>.]]></comment>
@@ -2398,7 +2645,7 @@
2398
  </params>
2399
  </comment_url>
2400
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2401
- <sort_order>1100</sort_order>
2402
  <show_in_default>1</show_in_default>
2403
  <show_in_website>1</show_in_website>
2404
  <show_in_store>0</show_in_store>
@@ -2536,7 +2783,7 @@
2536
  <label>Worldwide Shipping</label>
2537
  <comment>Are you planning to ship outside of the EU? Activate GlobalPack with the details you have received from PostNL. You can ignore the GlobalPack settings for domestic shipping and shipping within the EU.</comment>
2538
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2539
- <sort_order>1200</sort_order>
2540
  <show_in_default>1</show_in_default>
2541
  <show_in_website>1</show_in_website>
2542
  <show_in_store>0</show_in_store>
@@ -2690,7 +2937,7 @@
2690
  </depends>
2691
  </country_of_origin_attribute>
2692
  <description_attribute translate="label" module="postnl">
2693
- <label>Product description attribyte</label>
2694
  <frontend_type>select</frontend_type>
2695
  <source_model>postnl_core/system_config_source_attributes</source_model>
2696
  <sort_order>130</sort_order>
@@ -2746,7 +2993,7 @@
2746
  <label>PostNL Checkout Settings</label>
2747
  <comment><![CDATA[PostNL Checkout is a method alongside your own order process that allows your customers to choose where, when and how to receive their order. Please note: Use the Delivery Options to configure the PostNL settings in your own checkout. Use the settings below to configure the settings for the PostNL Checkout.<br/><br/>Does the PostNL Checkout button stay gray? Click <a href="http://kb.tig.nl/topic/39102986" target="_blank">here</a> for possible causes and solutions.]]></comment>
2748
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2749
- <sort_order>1300</sort_order>
2750
  <show_in_default>1</show_in_default>
2751
  <show_in_website>1</show_in_website>
2752
  <show_in_store>1</show_in_store>
@@ -3006,7 +3253,7 @@
3006
  <label>PostNL Checkout Payment Settings</label>
3007
  <comment>This is where you specify which payment options will be presented to your customers in PostNL Checkout. At least one of these must be activated for PostNL Checkout to work.</comment>
3008
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3009
- <sort_order>1400</sort_order>
3010
  <show_in_default>1</show_in_default>
3011
  <show_in_website>1</show_in_website>
3012
  <show_in_store>1</show_in_store>
@@ -3635,7 +3882,7 @@
3635
  <label>Parcelware Settings</label>
3636
  <comment><![CDATA[This is where you can configure your Parcelware export. You can find more information about configuring these settings <a href="http://kb.tig.nl/topic/94906903" target="_blank" title="More info">here</a>.]]></comment>
3637
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3638
- <sort_order>1500</sort_order>
3639
  <show_in_default>1</show_in_default>
3640
  <show_in_website>1</show_in_website>
3641
  <show_in_store>1</show_in_store>
@@ -3725,7 +3972,7 @@
3725
  <label>User Settings</label>
3726
  <comment>From this menu you can add columns containing PostNL specific information to the orders and shipments grid. Here you can also define default values for actions.</comment>
3727
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3728
- <sort_order>1600</sort_order>
3729
  <show_in_default>1</show_in_default>
3730
  <show_in_website>0</show_in_website>
3731
  <show_in_store>0</show_in_store>
@@ -3768,6 +4015,7 @@
3768
  <fieldset>delivery_options</fieldset>
3769
  <value>manual</value>
3770
  </buspakje_calculation_mode>
 
3771
  </depends>
3772
  </show_buspakje_option>
3773
  <shipping_grid_columns_anchor>
@@ -3872,7 +4120,7 @@
3872
  <depends>
3873
  <use_alternative_default>1</use_alternative_default>
3874
  </depends>
3875
- <validate>validate-digits validate-greater-than-zero</validate> <!-- not negative integers only -->
3876
  </alternative_default_max_amount>
3877
  <alternative_default_option translate="label tooltip" module="postnl">
3878
  <label>Alternative default shipping option</label>
@@ -3995,7 +4243,7 @@
3995
  <label>Technical Settings</label>
3996
  <comment>These settings are intended for advanced users only! If you're not 100% sure what you're doing, please do not touch these settings.</comment>
3997
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3998
- <sort_order>1700</sort_order>
3999
  <show_in_default>1</show_in_default>
4000
  <show_in_website>0</show_in_website>
4001
  <show_in_store>0</show_in_store>
766
  <show_in_website>1</show_in_website>
767
  <show_in_store>1</show_in_store>
768
  </region>
769
+ <alternative_sender_address_header translate="label" module="postnl">
770
+ <label>Alternative sender address</label>
771
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
772
  <sort_order>120</sort_order>
773
  <show_in_default>1</show_in_default>
774
  <show_in_website>1</show_in_website>
775
  <show_in_store>1</show_in_store>
776
+ </alternative_sender_address_header>
777
  <use_sender_address translate="label" module="postnl">
778
+ <label>Use only the primary sender address</label>
779
  <frontend_type>checkbox</frontend_type>
780
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
781
  <source_model>postnl/system_config_source_yesno</source_model>
784
  <show_in_website>1</show_in_website>
785
  <show_in_store>1</show_in_store>
786
  </use_sender_address>
787
+ <alternative_sender_firstname translate="label" module="postnl">
788
  <label>First Name</label>
789
  <frontend_type>text</frontend_type>
790
  <sort_order>140</sort_order>
795
  <use_sender_address>0</use_sender_address>
796
  </depends>
797
  <validate>postnl-validate-empty</validate>
798
+ </alternative_sender_firstname>
799
+ <alternative_sender_lastname translate="label" module="postnl">
800
  <label>Last Name</label>
801
  <frontend_type>text</frontend_type>
802
  <sort_order>150</sort_order>
807
  <use_sender_address>0</use_sender_address>
808
  </depends>
809
  <validate>postnl-validate-empty</validate>
810
+ </alternative_sender_lastname>
811
+ <alternative_sender_company translate="label" module="postnl">
812
  <label>Company</label>
813
  <frontend_type>text</frontend_type>
814
  <sort_order>160</sort_order>
818
  <depends>
819
  <use_sender_address>0</use_sender_address>
820
  </depends>
821
+ </alternative_sender_company>
822
+ <alternative_sender_department translate="label" module="postnl">
823
  <label>Department</label>
824
  <frontend_type>text</frontend_type>
825
  <sort_order>170</sort_order>
829
  <depends>
830
  <use_sender_address>0</use_sender_address>
831
  </depends>
832
+ </alternative_sender_department>
833
+ <alternative_sender_streetname translate="label" module="postnl">
834
  <label>Street</label>
835
  <frontend_type>text</frontend_type>
836
  <sort_order>180</sort_order>
842
  <use_sender_address>0</use_sender_address>
843
  </depends>
844
  <validate>postnl-validate-empty</validate>
845
+ </alternative_sender_streetname>
846
+ <alternative_sender_housenumber translate="label" module="postnl">
847
  <label>House Nr.</label>
848
  <frontend_type>text</frontend_type>
849
  <sort_order>190</sort_order>
855
  <use_sender_address>0</use_sender_address>
856
  </depends>
857
  <validate>postnl-validate-empty</validate>
858
+ </alternative_sender_housenumber>
859
+ <alternative_sender_housenumber_extension translate="label" module="postnl">
860
  <label>House Nr. Extension</label>
861
  <frontend_type>text</frontend_type>
862
  <sort_order>200</sort_order>
866
  <depends>
867
  <use_sender_address>0</use_sender_address>
868
  </depends>
869
+ </alternative_sender_housenumber_extension>
870
+ <alternative_sender_postcode translate="label" module="postnl">
871
  <label>Postcode</label>
872
  <frontend_type>text</frontend_type>
873
  <sort_order>210</sort_order>
878
  <use_sender_address>0</use_sender_address>
879
  </depends>
880
  <validate>postnl-validate-empty</validate>
881
+ </alternative_sender_postcode>
882
+ <alternative_sender_city translate="label" module="postnl">
883
  <label>City</label>
884
  <frontend_type>text</frontend_type>
885
  <sort_order>220</sort_order>
890
  <use_sender_address>0</use_sender_address>
891
  </depends>
892
  <validate>postnl-validate-empty</validate>
893
+ </alternative_sender_city>
894
+ <alternative_sender_region translate="label" module="postnl">
895
  <label>Region</label>
896
  <frontend_type>text</frontend_type>
897
  <sort_order>230</sort_order>
901
  <depends>
902
  <use_sender_address>0</use_sender_address>
903
  </depends>
904
+ </alternative_sender_region>
905
  <save_and_continue translate="label" module="postnl">
906
  <label>Save and continue</label>
907
  <frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
961
  </shipping_duration>
962
  <cutoff_time translate="label tooltip" module="postnl">
963
  <label>Order cut-off time</label>
964
+ <tooltip><![CDATA[When an order is placed after this time, another day will be added to the shipping duration. Please enter this time in the %s time zone.]]></tooltip>
965
+ <tooltip_block>postnl_adminhtml/system_config_form_field_tooltip_hourMinute</tooltip_block>
966
  <frontend_model>postnl_adminhtml/system_config_form_field_hourMinute</frontend_model>
967
  <source_model>postnl_core/system_config_source_hourMinute</source_model>
968
  <backend_model>postnl_core/system_config_backend_hourMinute</backend_model>
971
  <show_in_website>1</show_in_website>
972
  <show_in_store>1</show_in_store>
973
  </cutoff_time>
974
+ <sunday_cutoff_time translate="label tooltip" module="postnl">
975
+ <label>Sunday cut-off time</label>
976
+ <tooltip><![CDATA[When an order is placed after this time, another day will be added to the shipping duration. Please enter this time in the %s time zone.]]></tooltip>
977
+ <tooltip_block>postnl_adminhtml/system_config_form_field_tooltip_hourMinute</tooltip_block>
978
+ <frontend_model>postnl_adminhtml/system_config_form_field_hourMinute</frontend_model>
979
+ <source_model>postnl_core/system_config_source_hourMinute</source_model>
980
+ <backend_model>postnl_core/system_config_backend_hourMinute</backend_model>
981
+ <sort_order>60</sort_order>
982
+ <show_in_default>1</show_in_default>
983
+ <show_in_website>1</show_in_website>
984
+ <show_in_store>1</show_in_store>
985
+ <depends>
986
+ <allow_sunday_sorting>1</allow_sunday_sorting>
987
+ </depends>
988
+ </sunday_cutoff_time>
989
  <shipping_days translate="label comment" module="postnl">
990
  <label>Shipping days</label>
991
  <comment><![CDATA[Select on which days of the week orders are shipped. You can read more about shipping and delivery days <a href="http://kb.tig.nl/topic/102775036" target="_blank">here</a>.]]></comment>
992
  <source_model>postnl_core/system_config_source_shippingDays</source_model>
993
  <frontend_type>multiselect</frontend_type>
994
+ <sort_order>70</sort_order>
995
  <show_in_default>1</show_in_default>
996
  <show_in_website>1</show_in_website>
997
  <show_in_store>1</show_in_store>
999
  <checkout_settings_header translate="titel" module="postnl">
1000
  <label>Checkout settings</label>
1001
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
1002
+ <sort_order>80</sort_order>
1003
  <show_in_default>1</show_in_default>
1004
  <show_in_website>1</show_in_website>
1005
  <show_in_store>1</show_in_store>
1009
  <tooltip>Postcode validation and delivery options are only available for supported checkouts.</tooltip>
1010
  <frontend_type>select</frontend_type>
1011
  <source_model>postnl_core/system_config_source_checkoutExtensions</source_model>
1012
+ <sort_order>90</sort_order>
1013
  <show_in_default>1</show_in_default>
1014
  <show_in_website>1</show_in_website>
1015
  <show_in_store>1</show_in_store>
1017
  <checkout_extension_other translate="label" module="postnl">
1018
  <label>Specify checkout extension</label>
1019
  <frontend_type>text</frontend_type>
1020
+ <sort_order>100</sort_order>
1021
  <show_in_default>1</show_in_default>
1022
  <show_in_website>1</show_in_website>
1023
  <show_in_store>1</show_in_store>
1032
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1033
  <source_model>postnl/system_config_source_yesno</source_model>
1034
  <backend_model>postnl_addressvalidation/system_config_backend_validateAccount</backend_model>
1035
+ <sort_order>110</sort_order>
1036
  <show_in_default>1</show_in_default>
1037
  <show_in_website>1</show_in_website>
1038
  <show_in_store>1</show_in_store>
1048
  <frontend_type>checkbox</frontend_type>
1049
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1050
  <source_model>postnl/system_config_source_yesno</source_model>
1051
+ <sort_order>120</sort_order>
1052
  <show_in_default>1</show_in_default>
1053
  <show_in_website>1</show_in_website>
1054
  <show_in_store>1</show_in_store>
1065
  <frontend_type>checkbox</frontend_type>
1066
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1067
  <source_model>postnl/system_config_source_yesno</source_model>
1068
+ <sort_order>130</sort_order>
1069
  <show_in_default>1</show_in_default>
1070
  <show_in_website>1</show_in_website>
1071
  <show_in_store>1</show_in_store>
1081
  <label>Maximum number of attempts</label>
1082
  <tooltip>After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.</tooltip>
1083
  <frontend_type>text</frontend_type>
1084
+ <sort_order>140</sort_order>
1085
  <show_in_default>1</show_in_default>
1086
  <show_in_website>1</show_in_website>
1087
  <show_in_store>1</show_in_store>
1098
  <label>Connection timeout duration</label>
1099
  <tooltip>After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.</tooltip>
1100
  <frontend_type>text</frontend_type>
1101
+ <sort_order>150</sort_order>
1102
  <show_in_default>1</show_in_default>
1103
  <show_in_website>1</show_in_website>
1104
  <show_in_store>1</show_in_store>
1111
  </depends>
1112
  <validate>validate-int validate-greater-than-zero</validate>
1113
  </postcode_check_timeout>
1114
+ <address_lines>
1115
+ <frontend_type>hidden</frontend_type>
1116
+ <frontend_model>postnl_adminhtml/system_config_form_field_addressLines</frontend_model>
1117
+ <sort_order>160</sort_order>
1118
+ <show_in_default>1</show_in_default>
1119
+ <show_in_website>1</show_in_website>
1120
+ <show_in_store>0</show_in_store>
1121
+ </address_lines>
1122
+ <split_street_unavailable_info translate="comment" module="postnl">
1123
+ <comment><![CDATA[You are currently using fewer than 2 address lines. In order to guarantee proper address processing, the PostNL extension requires at least 2 address lines. You can read more on how to configure split address lines <a href="http://kb.tig.nl/topic/55961916" target="_blank">here</a>.]]></comment>
1124
+ <frontend_model>postnl_adminhtml/system_config_form_field_infoBox</frontend_model>
1125
+ <sort_order>170</sort_order>
1126
+ <show_in_default>1</show_in_default>
1127
+ <show_in_website>1</show_in_website>
1128
+ <show_in_store>0</show_in_store>
1129
+ <depends>
1130
+ <address_lines>
1131
+ <eval><![CDATA[{{value}} < 2]]></eval>
1132
+ </address_lines>
1133
+ <use_postcode_check>0</use_postcode_check>
1134
+ </depends>
1135
+ </split_street_unavailable_info>
1136
  <split_street translate="label comment tooltip" module="postnl">
1137
  <label>Split street parts</label>
1138
  <comment><![CDATA[You can read more on how to configure split address lines <a href="http://kb.tig.nl/topic/55961916" target="_blank">here</a>.]]></comment>
1140
  <frontend_type>checkbox</frontend_type>
1141
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1142
  <source_model>postnl/system_config_source_yesno</source_model>
1143
+ <sort_order>180</sort_order>
1144
  <show_in_default>1</show_in_default>
1145
  <show_in_website>1</show_in_website>
1146
  <show_in_store>0</show_in_store>
1147
  <depends>
1148
+ <address_lines>
1149
+ <eval><![CDATA[{{value}} > 1]]></eval>
1150
+ </address_lines>
1151
  <use_postcode_check>0</use_postcode_check>
1152
  </depends>
1153
  </split_street>
1155
  <label>Streetname field</label>
1156
  <frontend_type>select</frontend_type>
1157
  <source_model>postnl_core/system_config_source_streetField</source_model>
1158
+ <sort_order>190</sort_order>
1159
  <show_in_default>1</show_in_default>
1160
  <show_in_website>1</show_in_website>
1161
  <show_in_store>0</show_in_store>
1162
  <depends>
1163
+ <address_lines>
1164
+ <eval><![CDATA[{{value}} > 1]]></eval>
1165
+ </address_lines>
1166
  <split_street>1</split_street>
1167
  <use_postcode_check>0</use_postcode_check>
1168
  </depends>
1169
+ <validate>validate-select postnl-street-field</validate>
1170
  </streetname_field>
1171
  <housenr_field translate="label" module="postnl">
1172
  <label>Housenr. field</label>
1173
  <frontend_type>select</frontend_type>
1174
  <source_model>postnl_core/system_config_source_streetField</source_model>
1175
+ <sort_order>200</sort_order>
1176
  <show_in_default>1</show_in_default>
1177
  <show_in_website>1</show_in_website>
1178
  <show_in_store>0</show_in_store>
1179
  <depends>
1180
+ <address_lines>
1181
+ <eval><![CDATA[{{value}} > 1]]></eval>
1182
+ </address_lines>
1183
  <split_street>1</split_street>
1184
  <use_postcode_check>0</use_postcode_check>
1185
  </depends>
1186
+ <validate>validate-select postnl-street-field</validate>
1187
  </housenr_field>
1188
  <split_housenr translate="label" module="postnl">
1189
  <label>Split house number parts</label>
1190
  <frontend_type>checkbox</frontend_type>
1191
  <backend_model>postnl/system_config_backend_checkbox</backend_model>
1192
  <source_model>postnl/system_config_source_yesno</source_model>
1193
+ <sort_order>210</sort_order>
1194
  <show_in_default>1</show_in_default>
1195
  <show_in_website>1</show_in_website>
1196
  <show_in_store>0</show_in_store>
1197
  <depends>
1198
+ <address_lines>
1199
+ <eval><![CDATA[{{value}} > 2]]></eval>
1200
+ </address_lines>
1201
  <split_street>1</split_street>
1202
  <use_postcode_check>0</use_postcode_check>
1203
  </depends>
1206
  <label>Housenr. extension field</label>
1207
  <frontend_type>select</frontend_type>
1208
  <source_model>postnl_core/system_config_source_streetField</source_model>
1209
+ <sort_order>220</sort_order>
1210
  <show_in_default>1</show_in_default>
1211
  <show_in_website>1</show_in_website>
1212
  <show_in_store>0</show_in_store>
1213
  <depends>
1214
+ <address_lines>
1215
+ <eval><![CDATA[{{value}} > 2]]></eval>
1216
+ </address_lines>
1217
  <split_street>1</split_street>
1218
  <split_housenr>1</split_housenr>
1219
  <use_postcode_check>0</use_postcode_check>
1220
  </depends>
1221
+ <validate>validate-select postnl-street-field</validate>
1222
  </housenr_extension_field>
1223
  <optional_street_fields_header translate="label" module="postnl">
1224
  <label>Optional address fields</label>
1225
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
1226
+ <sort_order>230</sort_order>
1227
  <show_in_default>1</show_in_default>
1228
  <show_in_website>1</show_in_website>
1229
  <show_in_store>0</show_in_store>
1232
  <label>Area field</label>
1233
  <frontend_type>select</frontend_type>
1234
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1235
+ <sort_order>240</sort_order>
1236
  <show_in_default>1</show_in_default>
1237
  <show_in_website>1</show_in_website>
1238
  <show_in_store>0</show_in_store>
1241
  <label>Building name field</label>
1242
  <frontend_type>select</frontend_type>
1243
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1244
+ <sort_order>250</sort_order>
1245
  <show_in_default>1</show_in_default>
1246
  <show_in_website>1</show_in_website>
1247
  <show_in_store>0</show_in_store>
1250
  <label>Department field</label>
1251
  <frontend_type>select</frontend_type>
1252
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1253
+ <sort_order>260</sort_order>
1254
  <show_in_default>1</show_in_default>
1255
  <show_in_website>1</show_in_website>
1256
  <show_in_store>0</show_in_store>
1260
  <tooltip>Doorcodes are often used in foreign addresses such as those used in France and Singapore.</tooltip>
1261
  <frontend_type>select</frontend_type>
1262
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1263
+ <sort_order>270</sort_order>
1264
  <show_in_default>1</show_in_default>
1265
  <show_in_website>1</show_in_website>
1266
  <show_in_store>0</show_in_store>
1269
  <label>Floor field</label>
1270
  <frontend_type>select</frontend_type>
1271
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1272
+ <sort_order>280</sort_order>
1273
  <show_in_default>1</show_in_default>
1274
  <show_in_website>1</show_in_website>
1275
  <show_in_store>0</show_in_store>
1278
  <label>Remark field</label>
1279
  <frontend_type>select</frontend_type>
1280
  <source_model>postnl_core/system_config_source_streetFieldWithDefault</source_model>
1281
+ <sort_order>290</sort_order>
1282
  <show_in_default>1</show_in_default>
1283
  <show_in_website>1</show_in_website>
1284
  <show_in_store>0</show_in_store>
1286
  <save_and_continue translate="label" module="postnl">
1287
  <label>Save and continue</label>
1288
  <frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
1289
+ <sort_order>300</sort_order>
1290
  <show_in_default>1</show_in_default>
1291
  <show_in_website>1</show_in_website>
1292
  <show_in_store>1</show_in_store>
2082
  <show_in_default>1</show_in_default>
2083
  <show_in_website>1</show_in_website>
2084
  <show_in_store>0</show_in_store>
2085
+ <next_step_rel>postnl_cif</next_step_rel>
2086
  </save_and_continue>
2087
  <only_global_and_website_header translate="label" module="postnl">
2088
  <label><![CDATA[These settings are only available on the 'global' and 'website' scopes.]]></label>
2441
  </copy_method>
2442
  </fields>
2443
  </track_and_trace>
2444
+ <returns translate="label comment" module="postnl">
2445
+ <label>Returns</label>
2446
+ <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2447
+ <sort_order>1100</sort_order>
2448
+ <show_in_default>1</show_in_default>
2449
+ <show_in_website>1</show_in_website>
2450
+ <show_in_store>1</show_in_store>
2451
+ <fields>
2452
+ <returns_header translate="label" module="postnl">
2453
+ <label>Returns</label>
2454
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
2455
+ <sort_order>10</sort_order>
2456
+ <show_in_default>1</show_in_default>
2457
+ <show_in_website>1</show_in_website>
2458
+ <show_in_store>1</show_in_store>
2459
+ </returns_header>
2460
+ <return_labels_active translate="label" module="postnl">
2461
+ <label>Activate returns</label>
2462
+ <frontend_type>checkbox</frontend_type>
2463
+ <backend_model>postnl/system_config_backend_checkbox</backend_model>
2464
+ <source_model>postnl/system_config_source_yesno</source_model>
2465
+ <sort_order>20</sort_order>
2466
+ <show_in_default>1</show_in_default>
2467
+ <show_in_website>0</show_in_website>
2468
+ <show_in_store>0</show_in_store>
2469
+ </return_labels_active>
2470
+ <print_return_and_shipping_label translate="label tooltip" module="postnl">
2471
+ <label>Print the return label along with regular shipping labels</label>
2472
+ <tooltip>Activate this option to ship the order and returnlabel together.</tooltip>
2473
+ <frontend_type>checkbox</frontend_type>
2474
+ <backend_model>postnl/system_config_backend_checkbox</backend_model>
2475
+ <source_model>postnl/system_config_source_yesno</source_model>
2476
+ <sort_order>30</sort_order>
2477
+ <show_in_default>1</show_in_default>
2478
+ <show_in_website>0</show_in_website>
2479
+ <show_in_store>0</show_in_store>
2480
+ <depends>
2481
+ <return_labels_active>1</return_labels_active>
2482
+ </depends>
2483
+ </print_return_and_shipping_label>
2484
+ <customer_print_label translate="label tooltip" module="postnl">
2485
+ <label>Allow customers to print the return label from the webshop</label>
2486
+ <tooltip>This will add a button to the customer's account to print the return label for this shipment.</tooltip>
2487
+ <frontend_type>checkbox</frontend_type>
2488
+ <backend_model>postnl/system_config_backend_checkbox</backend_model>
2489
+ <source_model>postnl/system_config_source_yesno</source_model>
2490
+ <sort_order>40</sort_order>
2491
+ <show_in_default>1</show_in_default>
2492
+ <show_in_website>1</show_in_website>
2493
+ <show_in_store>1</show_in_store>
2494
+ <depends>
2495
+ <return_labels_active>1</return_labels_active>
2496
+ </depends>
2497
+ </customer_print_label>
2498
+ <guest_print_label translate="label tooltip" module="postnl">
2499
+ <label>Allow guests to print the return labels</label>
2500
+ <tooltip>This will add a button to the sales/guest/shipment page so that guests can print a return label for this shipment.</tooltip>
2501
+ <frontend_type>checkbox</frontend_type>
2502
+ <backend_model>postnl/system_config_backend_checkbox</backend_model>
2503
+ <source_model>postnl/system_config_source_yesno</source_model>
2504
+ <sort_order>50</sort_order>
2505
+ <show_in_default>1</show_in_default>
2506
+ <show_in_website>1</show_in_website>
2507
+ <show_in_store>1</show_in_store>
2508
+ <depends>
2509
+ <return_labels_active>1</return_labels_active>
2510
+ <customer_print_label>1</customer_print_label>
2511
+ </depends>
2512
+ </guest_print_label>
2513
+ <return_label_instructions_block translate="label tooltip" module="postnl">
2514
+ <label>Return labels instructions block</label>
2515
+ <tooltip>Please select a static block that contains instructions for customers on how to use the return labels.</tooltip>
2516
+ <frontend_type>select</frontend_type>
2517
+ <source_model>postnl_core/system_config_source_staticBlocks</source_model>
2518
+ <sort_order>60</sort_order>
2519
+ <show_in_default>1</show_in_default>
2520
+ <show_in_website>1</show_in_website>
2521
+ <show_in_store>1</show_in_store>
2522
+ <depends>
2523
+ <return_labels_active>1</return_labels_active>
2524
+ <customer_print_label>1</customer_print_label>
2525
+ </depends>
2526
+ </return_label_instructions_block>
2527
+ <email_template translate="label tooltip" module="postnl">
2528
+ <label>Return label email template</label>
2529
+ <tooltip>You can send the customer an email with the return label attached as a pdf. Please select which transactional email template you would like to use for this email.</tooltip>
2530
+ <frontend_type>select</frontend_type>
2531
+ <source_model>adminhtml/system_config_source_email_template</source_model>
2532
+ <sort_order>70</sort_order>
2533
+ <show_in_default>1</show_in_default>
2534
+ <show_in_website>1</show_in_website>
2535
+ <show_in_store>1</show_in_store>
2536
+ <validate>validate-select</validate>
2537
+ <depends>
2538
+ <return_labels_active>1</return_labels_active>
2539
+ </depends>
2540
+ </email_template>
2541
+ <return_address_header translate="label" module="postnl">
2542
+ <label>Return address</label>
2543
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
2544
+ <sort_order>80</sort_order>
2545
+ <show_in_default>1</show_in_default>
2546
+ <show_in_website>1</show_in_website>
2547
+ <show_in_store>1</show_in_store>
2548
+ <depends>
2549
+ <return_labels_active>1</return_labels_active>
2550
+ </depends>
2551
+ </return_address_header>
2552
+ <return_company translate="label" module="postnl">
2553
+ <label>Company</label>
2554
+ <frontend_type>text</frontend_type>
2555
+ <sort_order>90</sort_order>
2556
+ <show_in_default>1</show_in_default>
2557
+ <show_in_website>1</show_in_website>
2558
+ <show_in_store>1</show_in_store>
2559
+ <depends>
2560
+ <return_labels_active>1</return_labels_active>
2561
+ </depends>
2562
+ <validate>postnl-validate-empty</validate>
2563
+ </return_company>
2564
+ <return_department translate="label" module="postnl">
2565
+ <label>Department</label>
2566
+ <frontend_type>text</frontend_type>
2567
+ <sort_order>100</sort_order>
2568
+ <show_in_default>1</show_in_default>
2569
+ <show_in_website>1</show_in_website>
2570
+ <show_in_store>1</show_in_store>
2571
+ <depends>
2572
+ <return_labels_active>1</return_labels_active>
2573
+ </depends>
2574
+ <validate>postnl-validate-empty</validate>
2575
+ </return_department>
2576
+ <return_freepost_number translate="label comment tooltip" module="postnl">
2577
+ <label>Freepost number</label>
2578
+ <comment><![CDATA[You can apply for a freepost number on <a href="http://www.postnl.nl/zakelijke-oplossingen/ontvangen/antwoordnummer/?searchResult=position1" target="_blank" title="Request a freepost number.">this</a> page.]]></comment>
2579
+ <tooltip>A freepost number is a requisite for using return labels.</tooltip>
2580
+ <frontend_type>text</frontend_type>
2581
+ <sort_order>110</sort_order>
2582
+ <show_in_default>1</show_in_default>
2583
+ <show_in_website>1</show_in_website>
2584
+ <show_in_store>1</show_in_store>
2585
+ <depends>
2586
+ <return_labels_active>1</return_labels_active>
2587
+ </depends>
2588
+ <validate>postnl-validate-empty</validate>
2589
+ </return_freepost_number>
2590
+ <return_postcode translate="label" module="postnl">
2591
+ <label>Postcode</label>
2592
+ <frontend_type>text</frontend_type>
2593
+ <sort_order>120</sort_order>
2594
+ <show_in_default>1</show_in_default>
2595
+ <show_in_website>1</show_in_website>
2596
+ <show_in_store>1</show_in_store>
2597
+ <depends>
2598
+ <return_labels_active>1</return_labels_active>
2599
+ </depends>
2600
+ <validate>postnl-validate-empty</validate>
2601
+ </return_postcode>
2602
+ <return_city translate="label" module="postnl">
2603
+ <label>City</label>
2604
+ <frontend_type>text</frontend_type>
2605
+ <sort_order>130</sort_order>
2606
+ <show_in_default>1</show_in_default>
2607
+ <show_in_website>1</show_in_website>
2608
+ <show_in_store>1</show_in_store>
2609
+ <depends>
2610
+ <return_labels_active>1</return_labels_active>
2611
+ </depends>
2612
+ <validate>postnl-validate-empty</validate>
2613
+ </return_city>
2614
+ <return_region translate="label" module="postnl">
2615
+ <label>Region</label>
2616
+ <frontend_type>text</frontend_type>
2617
+ <sort_order>140</sort_order>
2618
+ <show_in_default>1</show_in_default>
2619
+ <show_in_website>1</show_in_website>
2620
+ <show_in_store>1</show_in_store>
2621
+ <depends>
2622
+ <return_labels_active>1</return_labels_active>
2623
+ </depends>
2624
+ </return_region>
2625
+ <only_global_header translate="label" module="postnl">
2626
+ <label>These settings are only available on the 'global' scope.</label>
2627
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
2628
+ <sort_order>150</sort_order>
2629
+ <show_in_default>0</show_in_default>
2630
+ <show_in_website>1</show_in_website>
2631
+ <show_in_store>1</show_in_store>
2632
+ <depends>
2633
+ <return_labels_active>0</return_labels_active>
2634
+ </depends>
2635
+ </only_global_header>
2636
+ </fields>
2637
+ </returns>
2638
  <cod translate="label comment" module="postnl">
2639
  <label>PostNL COD</label>
2640
  <comment><![CDATA[Activate an extra payment method with COD shipments.<br/>Please note: In order to offer COD shipments to your customers you will need to complete the fields below and activate an extra payment method <a href="%s" target="_blank">here</a>.]]></comment>
2645
  </params>
2646
  </comment_url>
2647
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2648
+ <sort_order>1200</sort_order>
2649
  <show_in_default>1</show_in_default>
2650
  <show_in_website>1</show_in_website>
2651
  <show_in_store>0</show_in_store>
2783
  <label>Worldwide Shipping</label>
2784
  <comment>Are you planning to ship outside of the EU? Activate GlobalPack with the details you have received from PostNL. You can ignore the GlobalPack settings for domestic shipping and shipping within the EU.</comment>
2785
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2786
+ <sort_order>1300</sort_order>
2787
  <show_in_default>1</show_in_default>
2788
  <show_in_website>1</show_in_website>
2789
  <show_in_store>0</show_in_store>
2937
  </depends>
2938
  </country_of_origin_attribute>
2939
  <description_attribute translate="label" module="postnl">
2940
+ <label>Product description attribute</label>
2941
  <frontend_type>select</frontend_type>
2942
  <source_model>postnl_core/system_config_source_attributes</source_model>
2943
  <sort_order>130</sort_order>
2993
  <label>PostNL Checkout Settings</label>
2994
  <comment><![CDATA[PostNL Checkout is a method alongside your own order process that allows your customers to choose where, when and how to receive their order. Please note: Use the Delivery Options to configure the PostNL settings in your own checkout. Use the settings below to configure the settings for the PostNL Checkout.<br/><br/>Does the PostNL Checkout button stay gray? Click <a href="http://kb.tig.nl/topic/39102986" target="_blank">here</a> for possible causes and solutions.]]></comment>
2995
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
2996
+ <sort_order>1400</sort_order>
2997
  <show_in_default>1</show_in_default>
2998
  <show_in_website>1</show_in_website>
2999
  <show_in_store>1</show_in_store>
3253
  <label>PostNL Checkout Payment Settings</label>
3254
  <comment>This is where you specify which payment options will be presented to your customers in PostNL Checkout. At least one of these must be activated for PostNL Checkout to work.</comment>
3255
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3256
+ <sort_order>1500</sort_order>
3257
  <show_in_default>1</show_in_default>
3258
  <show_in_website>1</show_in_website>
3259
  <show_in_store>1</show_in_store>
3882
  <label>Parcelware Settings</label>
3883
  <comment><![CDATA[This is where you can configure your Parcelware export. You can find more information about configuring these settings <a href="http://kb.tig.nl/topic/94906903" target="_blank" title="More info">here</a>.]]></comment>
3884
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3885
+ <sort_order>1600</sort_order>
3886
  <show_in_default>1</show_in_default>
3887
  <show_in_website>1</show_in_website>
3888
  <show_in_store>1</show_in_store>
3972
  <label>User Settings</label>
3973
  <comment>From this menu you can add columns containing PostNL specific information to the orders and shipments grid. Here you can also define default values for actions.</comment>
3974
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
3975
+ <sort_order>1700</sort_order>
3976
  <show_in_default>1</show_in_default>
3977
  <show_in_website>0</show_in_website>
3978
  <show_in_store>0</show_in_store>
4015
  <fieldset>delivery_options</fieldset>
4016
  <value>manual</value>
4017
  </buspakje_calculation_mode>
4018
+ <show_grid_options>1</show_grid_options>
4019
  </depends>
4020
  </show_buspakje_option>
4021
  <shipping_grid_columns_anchor>
4120
  <depends>
4121
  <use_alternative_default>1</use_alternative_default>
4122
  </depends>
4123
+ <validate>validate-not-negative-number</validate>
4124
  </alternative_default_max_amount>
4125
  <alternative_default_option translate="label tooltip" module="postnl">
4126
  <label>Alternative default shipping option</label>
4243
  <label>Technical Settings</label>
4244
  <comment>These settings are intended for advanced users only! If you're not 100% sure what you're doing, please do not touch these settings.</comment>
4245
  <frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
4246
+ <sort_order>1800</sort_order>
4247
  <show_in_default>1</show_in_default>
4248
  <show_in_website>0</show_in_website>
4249
  <show_in_store>0</show_in_store>
app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.4.1-1.5.0.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+
40
+ /**
41
+ * @var TIG_PostNL_Model_Resource_Setup $installer
42
+ */
43
+ $installer = $this;
44
+
45
+ $installer->startSetup();
46
+
47
+ $conn = $installer->getConnection();
48
+
49
+ /***********************************************************************************************************************
50
+ * POSTNL ORDER
51
+ **********************************************************************************************************************/
52
+
53
+ $tableName = $installer->getTable('postnl_core/order');
54
+
55
+ if (!$conn->tableColumnExists($tableName, 'expected_delivery_time_start')) {
56
+ $conn->addColumn(
57
+ $tableName,
58
+ 'expected_delivery_time_start',
59
+ array(
60
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
61
+ 'length' => '16',
62
+ 'nullable' => true,
63
+ 'comment' => 'Expected Delivery Time Start',
64
+ 'after' => 'delivery_date',
65
+ )
66
+ );
67
+ }
68
+
69
+ if (!$conn->tableColumnExists($tableName, 'expected_delivery_time_end')) {
70
+ $conn->addColumn(
71
+ $tableName,
72
+ 'expected_delivery_time_end',
73
+ array(
74
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
75
+ 'length' => '16',
76
+ 'nullable' => true,
77
+ 'comment' => 'Expected Delivery Time End',
78
+ 'after' => 'expected_delivery_time_start',
79
+ )
80
+ );
81
+ }
82
+
83
+ /***********************************************************************************************************************
84
+ * POSTNL SHIPMENT
85
+ **********************************************************************************************************************/
86
+
87
+ $tableName = $installer->getTable('postnl_core/shipment');
88
+
89
+ if (!$conn->tableColumnExists($tableName, 'return_labels_printed')) {
90
+ $conn->addColumn(
91
+ $tableName,
92
+ 'return_labels_printed',
93
+ array(
94
+ 'type' => Varien_Db_Ddl_Table::TYPE_BOOLEAN,
95
+ 'nullable' => false,
96
+ 'default' => '0',
97
+ 'comment' => 'Return labels Printed',
98
+ 'after' => 'labels_printed',
99
+ )
100
+ );
101
+ }
102
+
103
+ if (!$conn->tableColumnExists($tableName, 'expected_delivery_time_start')) {
104
+ $conn->addColumn(
105
+ $tableName,
106
+ 'expected_delivery_time_start',
107
+ array(
108
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
109
+ 'length' => '16',
110
+ 'nullable' => true,
111
+ 'comment' => 'Expected Delivery Time Start',
112
+ 'after' => 'delivery_date',
113
+ )
114
+ );
115
+ }
116
+
117
+ if (!$conn->tableColumnExists($tableName, 'expected_delivery_time_end')) {
118
+ $conn->addColumn(
119
+ $tableName,
120
+ 'expected_delivery_time_end',
121
+ array(
122
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
123
+ 'length' => '16',
124
+ 'nullable' => true,
125
+ 'comment' => 'Expected Delivery Time End',
126
+ 'after' => 'expected_delivery_time_start',
127
+ )
128
+ );
129
+ }
130
+
131
+ if (!$conn->tableColumnExists($tableName, 'return_phase')) {
132
+ $conn->addColumn(
133
+ $tableName,
134
+ 'return_phase',
135
+ array(
136
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
137
+ 'length' => '2',
138
+ 'nullable' => true,
139
+ 'unsigned' => true,
140
+ 'comment' => 'Return Phase',
141
+ 'after' => 'shipping_phase',
142
+ )
143
+ );
144
+ }
145
+
146
+ /***********************************************************************************************************************
147
+ * POSTNL SHIPMENT BARCODE
148
+ **********************************************************************************************************************/
149
+
150
+ $tableName = $installer->getTable('postnl_core/shipment_barcode');
151
+
152
+ if (!$conn->tableColumnExists($tableName, 'barcode_type')) {
153
+ $conn->addColumn(
154
+ $tableName,
155
+ 'barcode_type',
156
+ array(
157
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
158
+ 'length' => '16',
159
+ 'nullable' => true,
160
+ 'comment' => 'Barcode Type',
161
+ 'after' => 'parent_id',
162
+ )
163
+ );
164
+ }
165
+
166
+ if ($conn->tableColumnExists($tableName, 'barcode_number')) {
167
+ $conn->modifyColumn(
168
+ $tableName,
169
+ 'barcode_number',
170
+ array(
171
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
172
+ 'length' => '5',
173
+ 'nullable' => true,
174
+ 'comment' => 'Barcode Number',
175
+ 'unsigned' => true,
176
+ )
177
+ );
178
+ }
179
+
180
+ /***********************************************************************************************************************
181
+ * POSTNL SHIPMENT STATUS HISTORY
182
+ **********************************************************************************************************************/
183
+
184
+ $tableName = $installer->getTable('postnl_core/shipment_status_history');
185
+
186
+ if (!$conn->tableColumnExists($tableName, 'return_labels_printed')) {
187
+ $conn->addColumn(
188
+ $tableName,
189
+ 'shipment_type',
190
+ array(
191
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
192
+ 'length' => '16',
193
+ 'nullable' => true,
194
+ 'default' => 'shipment',
195
+ 'comment' => 'Shipment Type',
196
+ 'after' => 'parent_id',
197
+ )
198
+ );
199
+ }
200
+
201
+ /***********************************************************************************************************************
202
+ * POSTNL INTEGRITY
203
+ **********************************************************************************************************************/
204
+
205
+ $tableName = $installer->getTable('postnl_core/integrity');
206
+
207
+ if (!$conn->isTableExists($tableName)) {
208
+ $table = $installer->getConnection()
209
+ ->newTable($tableName);
210
+
211
+ $table->addColumn(
212
+ 'integrity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
213
+ 'identity' => true,
214
+ 'unsigned' => true,
215
+ 'nullable' => false,
216
+ 'primary' => true,
217
+ ), 'Primary key'
218
+ )
219
+ ->addColumn(
220
+ 'entity_type', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array(
221
+ 'nullable' => false,
222
+ ), 'Entity Type'
223
+ )
224
+ ->addColumn(
225
+ 'entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
226
+ 'nullable' => false,
227
+ ), 'Entity Id'
228
+ )
229
+ ->addColumn(
230
+ 'error_code', Varien_Db_Ddl_Table::TYPE_TEXT, 11, array(
231
+ 'nullable' => false,
232
+ 'default' => '0',
233
+ ), 'Error Code'
234
+ )
235
+ ->setComment('PostNL Integrity');
236
+
237
+ $installer->getConnection()->createTable($table);
238
+ }
239
+
240
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/TIG/postnl.xml CHANGED
@@ -50,6 +50,7 @@
50
  <block type="postnl/adminhtml_cronNotification" name="postnl_cron_notification" template="TIG/PostNL/cron_notification.phtml"/>
51
  <block type="postnl/adminhtml_logNotification" name="postnl_log_notification" template="TIG/PostNL/log_notification.phtml"/>
52
  <block type="postnl/adminhtml_upgradeNotification" name="postnl_upgrade_notification" template="TIG/PostNL/upgrade_notification.phtml"/>
 
53
  </reference>
54
  </default>
55
 
@@ -217,6 +218,9 @@
217
  <type>js_css</type>
218
  <name>prototype/windows/themes/default.css</name>
219
  </action>
 
 
 
220
  <block type="postnl_adminhtml/windowsTheme" name="postnl_order_windows_theme" template="TIG/PostNL/sales/order/windows_theme.phtml" output="toHtml"/>
221
  </reference>
222
  <reference name="sales_shipment_view">
50
  <block type="postnl/adminhtml_cronNotification" name="postnl_cron_notification" template="TIG/PostNL/cron_notification.phtml"/>
51
  <block type="postnl/adminhtml_logNotification" name="postnl_log_notification" template="TIG/PostNL/log_notification.phtml"/>
52
  <block type="postnl/adminhtml_upgradeNotification" name="postnl_upgrade_notification" template="TIG/PostNL/upgrade_notification.phtml"/>
53
+ <!--<block type="postnl/adminhtml_integrityNotification" name="postnl_integrity_notification" template="TIG/PostNL/integrity_notification.phtml"/>-->
54
  </reference>
55
  </default>
56
 
218
  <type>js_css</type>
219
  <name>prototype/windows/themes/default.css</name>
220
  </action>
221
+ <action method="addJs">
222
+ <name>varien/form.js</name>
223
+ </action>
224
  <block type="postnl_adminhtml/windowsTheme" name="postnl_order_windows_theme" template="TIG/PostNL/sales/order/windows_theme.phtml" output="toHtml"/>
225
  </reference>
226
  <reference name="sales_shipment_view">
app/design/adminhtml/default/default/template/TIG/PostNL/integrity_notification.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_Adminhtml_IntegrityNotification $this
40
+ * @var TIG_PostNL_Helper_Data $_helper
41
+ */
42
+ ?>
43
+ <?php $_hasIntegrityErrors = $this->hasIntegrityErrors(); ?>
44
+ <?php if ($_hasIntegrityErrors): ?>
45
+ <?php $_helper = $this->helper('postnl'); ?>
46
+ <?php $_errorUrl = $_helper->getErrorUrl('POSTNL-0219'); ?>
47
+ <div class="notification-global">
48
+ <strong>[POSTNL-0219] <?php echo $this->__("The PostNL extension has detected some issues with the PostNL extension's data integrity."); ?></strong>
49
+ <?php if ($_errorUrl): ?>
50
+ <a href="<?php echo $_errorUrl; ?>" target="blank"><?php echo $this->__('Click here for more information from the TiG knowledgebase.') ?></a>
51
+ <?php endif; ?>
52
+ </div>
53
+ <?php endif; ?>
54
+
app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/delivery_options.phtml CHANGED
@@ -43,6 +43,9 @@
43
 
44
  <?php $_postnlShipment = $this->getPostnlShipment(); ?>
45
 
 
 
 
46
  <?php $_canChangeProductCode = $this->canChangeProductCode(); ?>
47
  <?php if($_canChangeProductCode): ?>
48
  <?php $_cifHelper = $this->helper('postnl/cif'); ?>
@@ -75,12 +78,43 @@
75
  <td class="label"><label><?php echo $this->__('Expected delivery date'); ?></label></td>
76
  <td class="value"><strong><?php echo $this->formatDate($_postnlShipment->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
77
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  <tr>
79
  <td class="label"><label><?php echo $this->__('Product option'); ?></label></td>
80
  <td class="value">
81
  <strong><?php echo $_postnlShipment->getProductOption(); ?> (<?php echo $_postnlShipment->getProductCode() ?>)</strong>
82
- <?php if ($_canChangeProductCode): ?><?php echo $this->getChangeProductCodeButtonHtml(); ?><?php endif; ?>
83
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
84
  </tr>
85
  <?php if ($this->hasExtraOptions()): ?>
86
  <tr>
@@ -198,6 +232,45 @@
198
  changeProductCodeDialog.open(url);
199
  };
200
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  //]]>
202
  </script>
203
  <?php endif; ?>
43
 
44
  <?php $_postnlShipment = $this->getPostnlShipment(); ?>
45
 
46
+ <?php $_deliveryTimeInfo = $this->getDeliveryTimeInfo(); ?>
47
+
48
+ <?php $_canChangeParcelCount = $this->canChangeParcelCount(); ?>
49
  <?php $_canChangeProductCode = $this->canChangeProductCode(); ?>
50
  <?php if($_canChangeProductCode): ?>
51
  <?php $_cifHelper = $this->helper('postnl/cif'); ?>
78
  <td class="label"><label><?php echo $this->__('Expected delivery date'); ?></label></td>
79
  <td class="value"><strong><?php echo $this->formatDate($_postnlShipment->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
80
  </tr>
81
+ <?php if ($_deliveryTimeInfo): ?>
82
+ <tr>
83
+ <td class="label"><label><?php echo $this->__('Expected delivery time'); ?></label></td>
84
+ <?php if (!empty($_deliveryTimeInfo['delivery_time_end'])): ?>
85
+ <td class="value">
86
+ <strong><?php echo $_deliveryTimeInfo['delivery_time_start']; ?> - <?php echo $_deliveryTimeInfo['delivery_time_end']; ?></strong><?php if ($_deliveryTimeInfo['timezone_differ']): ?> (<?php echo $_deliveryTimeInfo['store_delivery_time_start']; ?> - <?php echo $_deliveryTimeInfo['store_delivery_time_end']; ?>)<?php endif;?>
87
+ <div class="field-tooltip">
88
+ <div><?php echo $this->__('The actual delivery time may have changed. Please check MijnPakket for the most up to date delivery time estimate.'); ?></div>
89
+ </div>
90
+ </td>
91
+ <?php else: ?>
92
+ <td class="value">
93
+ <strong><?php echo $this->__('from'); ?> <?php echo $_deliveryTimeInfo['delivery_time_start']; ?><?php if ($_deliveryTimeInfo['timezone_differ']): ?> (<?php echo $_deliveryTimeInfo['store_delivery_time_start'] ?>)<?php endif;?></strong>
94
+ <div class="field-tooltip">
95
+ <div><?php echo $this->__('The actual delivery time may have changed. Please check MijnPakket for the most up to date delivery time estimate.'); ?></div>
96
+ </div>
97
+ </td>
98
+ <?php endif; ?>
99
+ </tr>
100
+ <?php endif; ?>
101
  <tr>
102
  <td class="label"><label><?php echo $this->__('Product option'); ?></label></td>
103
  <td class="value">
104
  <strong><?php echo $_postnlShipment->getProductOption(); ?> (<?php echo $_postnlShipment->getProductCode() ?>)</strong>
 
105
  </td>
106
+ <?php if ($_canChangeProductCode): ?>
107
+ <td class="value"><?php echo $this->getChangeProductCodeButtonHtml(); ?></td>
108
+ <?php endif; ?>
109
+ </tr>
110
+ <tr>
111
+ <td class="label"><label><?php echo $this->__('Number of parcels'); ?></label></td>
112
+ <td class="value" id="postnl_parcel_count" data-parcel-count="<?php echo $_postnlShipment->getParcelCount(); ?>">
113
+ <strong><?php echo $_postnlShipment->getParcelCount(); ?></strong>
114
+ </td>
115
+ <?php if ($_canChangeParcelCount): ?>
116
+ <td class="value"><?php echo $this->getChangeParcelCountButtonHtml(); ?></td>
117
+ <?php endif; ?>
118
  </tr>
119
  <?php if ($this->hasExtraOptions()): ?>
120
  <tr>
232
  changeProductCodeDialog.open(url);
233
  };
234
  <?php endif; ?>
235
+ <?php if($_canChangeParcelCount): ?>
236
+ var parcelCountForm;
237
+ var parcelCountTd = $('postnl_parcel_count');
238
+ var buttonTd = parcelCountTd.next();
239
+ var changeParcelCount = function(url) {
240
+ parcelCountTd.update(
241
+ "<form id='postnl_parcel_count_form' action='"
242
+ + url
243
+ + "' method='post'><input id='parcel_count_field' name='parcel_count' type='text' class='required-entry validate-digits' value='" +
244
+ + parcelCountTd.getAttribute('data-parcel-count')
245
+ + "'/><input type='hidden' name='form_key' value='<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>'/></form>"
246
+ );
247
+
248
+ buttonTd.select('button').invoke('hide');
249
+ buttonTd.insert({
250
+ top : "<button title='<?php echo $this->__('Submit'); ?>' class='temp-btn scalable save' type='button' onclick='parcelCountForm.submit();'>" +
251
+ "<span>" +
252
+ "<span>" +
253
+ "<?php echo $this->__('Submit'); ?>" +
254
+ "</span>" +
255
+ "</span>" +
256
+ "</button>" +
257
+ "<button title='<?php echo $this->__('Cancel'); ?>' onclick='cancelChangeParcelCount()' class='temp-btn scalable delete' type='button'>" +
258
+ "<span>" +
259
+ "<span>" +
260
+ "<?php echo $this->__('Cancel'); ?>" +
261
+ "</span>" +
262
+ "</span>" +
263
+ "</button>"
264
+ });
265
+
266
+ parcelCountForm = new VarienForm('postnl_parcel_count_form');
267
+ };
268
+ var cancelChangeParcelCount = function() {
269
+ parcelCountTd.update(parcelCountTd.getAttribute('data-parcel-count'));
270
+ buttonTd.select('.temp-btn').invoke('remove');
271
+ buttonTd.select('button').invoke('show');
272
+ };
273
+ <?php endif; ?>
274
  //]]>
275
  </script>
276
  <?php endif; ?>
app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/shipping_status.phtml CHANGED
@@ -35,40 +35,71 @@
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
 
 
38
  */
39
  ?>
40
  <?php $_helper = $this->helper('postnl'); ?>
41
  <?php $_shipment = Mage::registry('current_shipment'); ?>
42
  <?php $_progressStatus = $this->getShippingStatus($_shipment) ?>
43
- <div id="postnl_status_bar" class="progress-wrapper <?php echo $_progressStatus; ?>">
44
- <div class="progress progress-collection">
45
- <span class="begin"></span>
46
- <strong><?php echo $_helper->__('Reported at PostNL') ?></strong>
47
- <span class="seperator"></span>
48
- </div>
 
 
49
 
50
- <div class="progress progress-distribution">
51
- <strong><?php echo $_helper->__('Sorted') ?></strong>
52
- <span class="seperator"></span>
53
- </div>
54
 
55
- <div class="progress progress-transit">
56
- <strong><?php echo $_helper->__('In Distribution') ?></strong>
57
- <span class="seperator"></span>
58
- </div>
59
 
60
- <div class="progress progress-delivered">
61
- <strong><?php echo $_helper->__('Delivered') ?></strong>
62
- <span class="end"></span>
 
63
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
 
66
  <script type="text/javascript">
67
  //<![CDATA[
68
  document.observe('dom:loaded', function() {
69
- statusBar = $('postnl_status_bar');
70
- //insert the status bar at the top of the information tab
71
- $('sales_shipment_view_tabs_shipment_info_content').insert({
 
72
  top: statusBar
73
  });
74
  });
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus $this
40
  */
41
  ?>
42
  <?php $_helper = $this->helper('postnl'); ?>
43
  <?php $_shipment = Mage::registry('current_shipment'); ?>
44
  <?php $_progressStatus = $this->getShippingStatus($_shipment) ?>
45
+ <div id="postnl_status_bar_wrapper">
46
+ <span><strong><?php echo $this->__('Shipping status') ?></strong></span>
47
+ <div id="postnl_status_bar" class="progress-wrapper <?php echo $_progressStatus; ?>">
48
+ <div class="progress progress-collection">
49
+ <span class="begin"></span>
50
+ <strong><?php echo $this->__('Reported at PostNL') ?></strong>
51
+ <span class="seperator"></span>
52
+ </div>
53
 
54
+ <div class="progress progress-distribution">
55
+ <strong><?php echo $this->__('Sorted') ?></strong>
56
+ <span class="seperator"></span>
57
+ </div>
58
 
59
+ <div class="progress progress-transit">
60
+ <strong><?php echo $this->__('In Distribution') ?></strong>
61
+ <span class="seperator"></span>
62
+ </div>
63
 
64
+ <div class="progress progress-delivered">
65
+ <strong><?php echo $this->__('Delivered') ?></strong>
66
+ <span class="end"></span>
67
+ </div>
68
  </div>
69
+ <?php $_returnStatus = $this->getReturnStatus($_shipment) ?>
70
+ <?php if ($_returnStatus): ?>
71
+ <div id="postnl_return_bar" class="progress-wrapper return <?php echo $_returnStatus; ?>">
72
+ <div class="progress progress-delivered">
73
+ <span class="end"></span>
74
+ <strong><?php echo $this->__('Delivered') ?></strong>
75
+ <span class="seperator"></span>
76
+ </div>
77
+
78
+ <div class="progress progress-transit">
79
+ <strong><?php echo $this->__('In Distribution') ?></strong>
80
+ <span class="seperator"></span>
81
+ </div>
82
+
83
+ <div class="progress progress-distribution">
84
+ <strong><?php echo $this->__('Sorted') ?></strong>
85
+ <span class="seperator"></span>
86
+ </div>
87
+
88
+ <div class="progress progress-collection">
89
+ <strong><?php echo $this->__('Reported at PostNL') ?></strong>
90
+ <span class="begin"></span>
91
+ </div>
92
+ </div>
93
+ <?php endif; ?>
94
  </div>
95
 
96
  <script type="text/javascript">
97
  //<![CDATA[
98
  document.observe('dom:loaded', function() {
99
+ var contentTop = $('sales_shipment_view_tabs_shipment_info_content');
100
+
101
+ var statusBar = $('postnl_status_bar_wrapper');
102
+ contentTop.insert({
103
  top: statusBar
104
  });
105
  });
app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/view/delivery_options.phtml CHANGED
@@ -42,6 +42,8 @@
42
  <?php $_helper = Mage::helper('postnl'); ?>
43
 
44
  <?php $_postnlOrder = $this->getPostnlOrder(); ?>
 
 
45
  <?php if ($_postnlOrder->getId() && $_postnlOrder->getType()): ?>
46
  <div class="hor-scroll" id="postnl_delivery_option_info">
47
  <table cellspacing="0" class="form-list">
@@ -62,6 +64,16 @@
62
  <td class="label"><label><?php echo $this->__('Requested delivery date'); ?></label></td>
63
  <td class="value"><strong><?php echo $this->formatDate($_postnlOrder->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
64
  </tr>
 
 
 
 
 
 
 
 
 
 
65
  <?php if ($this->hasExtraOptions()): ?>
66
  <tr>
67
  <td class="label"><label><?php echo $this->__('Extra options'); ?></label></td>
42
  <?php $_helper = Mage::helper('postnl'); ?>
43
 
44
  <?php $_postnlOrder = $this->getPostnlOrder(); ?>
45
+
46
+ <?php $_deliveryTimeInfo = $this->getDeliveryTimeInfo(); ?>
47
  <?php if ($_postnlOrder->getId() && $_postnlOrder->getType()): ?>
48
  <div class="hor-scroll" id="postnl_delivery_option_info">
49
  <table cellspacing="0" class="form-list">
64
  <td class="label"><label><?php echo $this->__('Requested delivery date'); ?></label></td>
65
  <td class="value"><strong><?php echo $this->formatDate($_postnlOrder->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
66
  </tr>
67
+ <?php if ($_deliveryTimeInfo): ?>
68
+ <tr>
69
+ <td class="label"><label><?php echo $this->__('Requested delivery time'); ?></label></td>
70
+ <?php if (!empty($_deliveryTimeInfo['delivery_time_end'])): ?>
71
+ <td class="value"><strong><?php echo $_deliveryTimeInfo['delivery_time_start']; ?> - <?php echo $_deliveryTimeInfo['delivery_time_end']; ?></strong><?php if ($_deliveryTimeInfo['timezone_differ']): ?> (<?php echo $_deliveryTimeInfo['store_delivery_time_start']; ?> - <?php echo $_deliveryTimeInfo['store_delivery_time_end']; ?>)<?php endif;?></td>
72
+ <?php else: ?>
73
+ <td class="value"><strong><?php echo $this->__('from'); ?> <?php echo $_deliveryTimeInfo['delivery_time_start']; ?><?php if ($_deliveryTimeInfo['timezone_differ']): ?> (<?php echo $_deliveryTimeInfo['store_delivery_time_start'] ?>)<?php endif;?></strong></td>
74
+ <?php endif; ?>
75
+ </tr>
76
+ <?php endif; ?>
77
  <?php if ($this->hasExtraOptions()): ?>
78
  <tr>
79
  <td class="label"><label><?php echo $this->__('Extra options'); ?></label></td>
app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/customize_link.phtml CHANGED
@@ -37,6 +37,7 @@
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  */
39
  ?>
 
40
  <?php $_helper = $this->helper('postnl'); ?>
41
  <span id="postnl_customize_grid_link">
42
  <a href="<?php echo $this->getUrl('adminhtml/system_config/edit', array('section' => 'postnl', 'fieldset' => 'cif_labels_and_confirming', '_secure' => true, '_fragment' => 'shipment_grid_columns')); ?>" target="_blank"><?php echo $_helper->__('Customize this grid.'); ?></a>
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
  */
39
  ?>
40
+ <?php return $this; /** @todo fix the customize link so it works with the new configuration design */ ?>
41
  <?php $_helper = $this->helper('postnl'); ?>
42
  <span id="postnl_customize_grid_link">
43
  <a href="<?php echo $this->getUrl('adminhtml/system_config/edit', array('section' => 'postnl', 'fieldset' => 'cif_labels_and_confirming', '_secure' => true, '_fragment' => 'shipment_grid_columns')); ?>" target="_blank"><?php echo $_helper->__('Customize this grid.'); ?></a>
app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/js.phtml CHANGED
@@ -84,6 +84,7 @@
84
  });
85
  } else if(item.url) {
86
  if (item.id == 'postnl_print_labels_and_confirm'
 
87
  || item.id == 'postnl_print_labels'
88
  || item.id == 'postnl_print_packing_slips'
89
  ) {
84
  });
85
  } else if(item.url) {
86
  if (item.id == 'postnl_print_labels_and_confirm'
87
+ || item.id == 'postnl_print_packing_slips_and_confirm'
88
  || item.id == 'postnl_print_labels'
89
  || item.id == 'postnl_print_packing_slips'
90
  ) {
app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/info_box.phtml CHANGED
@@ -35,13 +35,15 @@
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
 
 
38
  */
39
  ?>
40
  <?php $_htmlId = $this->getHtmlId(); ?>
41
  <?php $_comment = $this->getElement()->getComment(); ?>
42
  <tr id='row_<?php echo $_htmlId; ?>'>
43
  <td colspan='4'>
44
- <div class="box">
45
  <p>
46
  <?php echo $_comment; ?>
47
  </p>
35
  *
36
  * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
  * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_InfoBox $this
40
  */
41
  ?>
42
  <?php $_htmlId = $this->getHtmlId(); ?>
43
  <?php $_comment = $this->getElement()->getComment(); ?>
44
  <tr id='row_<?php echo $_htmlId; ?>'>
45
  <td colspan='4'>
46
+ <div class="box" id='<?php echo $_htmlId ?>'>
47
  <p>
48
  <?php echo $_comment; ?>
49
  </p>
app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/js.phtml CHANGED
@@ -223,6 +223,8 @@
223
  nextStepRel = currentStepRel;
224
  }
225
 
 
 
226
  /**
227
  * Go to the next step.
228
  */
@@ -231,9 +233,14 @@
231
  /**
232
  * Add a success message.
233
  */
 
 
 
 
 
234
  var successMessage = new Element('div', {
235
  'class' : 'wizard-success'
236
- }).update(Translator.translate('The previous has been saved successfully!'));
237
 
238
  $(nextStepRel).insert({
239
  top:successMessage
223
  nextStepRel = currentStepRel;
224
  }
225
 
226
+ window.location.hash = nextStepHash;
227
+
228
  /**
229
  * Go to the next step.
230
  */
233
  /**
234
  * Add a success message.
235
  */
236
+ var successMessageText = Translator.translate('The previous step has been saved successfully!');
237
+ if (nextStepRel == currentStepRel) {
238
+ successMessageText = Translator.translate('This step has been saved successfully!');
239
+ }
240
+
241
  var successMessage = new Element('div', {
242
  'class' : 'wizard-success'
243
+ }).update(successMessageText);
244
 
245
  $(nextStepRel).insert({
246
  top:successMessage
app/design/adminhtml/default/default/template/TIG/PostNL/upgrade_notification.phtml CHANGED
@@ -48,7 +48,7 @@
48
  <strong>[POSTNL-0198] <?php echo $this->__('The PostNL extension is currently being upgraded.'); ?></strong>
49
  <?php echo $this->__('Depending on the number of products in your store, this could take several hours.'); ?>
50
  <?php if ($_errorUrl): ?>
51
- <a href="<?php echo $_helper->getErrorUrl('POSTNL-0198'); ?>" target="blank"><?php echo $this->__('Click here for more information from the TiG knowledgebase.') ?></a>
52
  <?php endif; ?>
53
  </div>
54
  <?php endif;?>
48
  <strong>[POSTNL-0198] <?php echo $this->__('The PostNL extension is currently being upgraded.'); ?></strong>
49
  <?php echo $this->__('Depending on the number of products in your store, this could take several hours.'); ?>
50
  <?php if ($_errorUrl): ?>
51
+ <a href="<?php echo $_errorUrl; ?>" target="blank"><?php echo $this->__('Click here for more information from the TiG knowledgebase.') ?></a>
52
  <?php endif; ?>
53
  </div>
54
  <?php endif;?>
app/design/frontend/base/default/layout/TIG/postnl.xml CHANGED
@@ -82,6 +82,34 @@
82
  </reference>
83
  </sales_order_creditmemo>
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  <!-- SHIPPING STATUS, PAKJE GEMAK ADDRESS -->
86
 
87
  <sales_order_shipment>
@@ -93,6 +121,129 @@
93
  </reference>
94
  </sales_order_shipment>
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  <!-- POSTNL CHECKOUT -->
97
 
98
  <checkout_cart_index>
@@ -101,6 +252,9 @@
101
  <type>skin_css</type>
102
  <file>css/TIG/PostNL/cart.css</file>
103
  </action>
 
 
 
104
  <action method="addItem">
105
  <type>skin_js</type>
106
  <file>js/TIG/PostNL/checkout.js</file>
@@ -126,9 +280,7 @@
126
  </action>
127
  </reference>
128
  <reference name="root">
129
- <action method="setTemplate">
130
- <template>page/1column.phtml</template>
131
- </action>
132
  </reference>
133
  <reference name="content">
134
  <block type="postnl_checkout/summary" name="postnl_checkout_summary" template="TIG/PostNL/checkout/summary.phtml">
@@ -156,6 +308,9 @@
156
  <type>skin_css</type>
157
  <file>css/TIG/PostNL/postcodecheck.css</file>
158
  </action>
 
 
 
159
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
160
  </reference>
161
  <reference name="customer_address_edit">
@@ -219,6 +374,9 @@
219
  <reference name="checkout.onepage.shipping">
220
  <block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
221
  </reference>
 
 
 
222
  <reference name="before_body_end">
223
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
224
  <block type="postnl_deliveryoptions/js" name="postnl_deliveryoptions_js" template="TIG/PostNL/delivery_options/js.phtml"/>
@@ -246,6 +404,19 @@
246
  </reference>
247
  </checkout_onepage_progress_shipping_method>
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  <!-- MIJNPAKKET ACCOUNTNOTIFICATION -->
250
 
251
  <checkout_onepage_success>
@@ -267,6 +438,7 @@
267
  <action method="addCss"><stylesheet>css/TIG/PostNL/deliveryoptions/default.css</stylesheet></action>
268
  <action method="addCss"><stylesheet>css/TIG/PostNL/deliveryoptions/onestepcheckout.css</stylesheet></action>
269
  <action method="addCss"><stylesheet>css/TIG/PostNL/mijnpakket.css</stylesheet></action>
 
270
  <action method="addItem"><type>skin_css</type><name>css/TIG/PostNL/deliveryoptions/ie8.css</name><params/><if>lt IE 9</if></action>
271
  <action method="addCss"><stylesheet>css/TIG/PostNL/postcodecheck.css</stylesheet></action>
272
  <action method="addItem"><type>skin_js</type><file>js/TIG/PostNL/ajax.js</file></action>
@@ -352,4 +524,15 @@
352
  <block type="postnl/payment_sales_order_creditmemo_totals_codFee" before="tax" name="postnl_cod_fee" />
353
  </reference>
354
  </sales_email_order_creditmemo_items>
 
 
 
 
 
 
 
 
 
 
 
355
  </layout>
82
  </reference>
83
  </sales_order_creditmemo>
84
 
85
+ <sales_guest_view>
86
+ <reference name="content">
87
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
88
+ <block type="core/template" name="delivery_options_info" template="TIG/PostNL/delivery_options/sales/order/delivery_options_info.phtml"/>
89
+ </reference>
90
+ <reference name="order_totals">
91
+ <block type="postnl/payment_sales_order_totals_codFee" before="tax" name="postnl_cod_fee" />
92
+ </reference>
93
+ </sales_guest_view>
94
+
95
+ <sales_guest_invoice>
96
+ <reference name="content">
97
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
98
+ </reference>
99
+ <reference name="invoice_totals">
100
+ <block type="postnl/payment_sales_order_invoice_totals_codFee" before="tax" name="postnl_cod_fee" />
101
+ </reference>
102
+ </sales_guest_invoice>
103
+
104
+ <sales_guest_creditmemo>
105
+ <reference name="content">
106
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
107
+ </reference>
108
+ <reference name="creditmemo_totals">
109
+ <block type="postnl/payment_sales_order_creditmemo_totals_codFee" before="tax" name="postnl_cod_fee" />
110
+ </reference>
111
+ </sales_guest_creditmemo>
112
+
113
  <!-- SHIPPING STATUS, PAKJE GEMAK ADDRESS -->
114
 
115
  <sales_order_shipment>
121
  </reference>
122
  </sales_order_shipment>
123
 
124
+ <sales_guest_shipment>
125
+ <reference name="my.account.wrapper">
126
+ <block type="postnl_core/shippingStatus" name="postnl_shipping_status" template="TIG/PostNL/core/sales/order/shipment/shipping_status.phtml" after="-"/>
127
+ </reference>
128
+ <reference name="content">
129
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
130
+ </reference>
131
+ </sales_guest_shipment>
132
+
133
+ <!-- RETURNS -->
134
+
135
+ <postnl_order_returns translate="label">
136
+ <label>Customer My Account Order PostNL Returns View</label>
137
+ <update handle="customer_account"/>
138
+ <reference name="head">
139
+ <action method="addItem">
140
+ <type>skin_css</type>
141
+ <file>css/TIG/PostNL/returns.css</file>
142
+ </action>
143
+ </reference>
144
+ <reference name="my.account.wrapper">
145
+ <block type="postnl_core/order_returns_info" as="info" name="sales.order.info">
146
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
147
+ <action method="addLink" translate="label" module="sales">
148
+ <name>view</name>
149
+ <path>sales/order/view</path>
150
+ <label>Order Information</label>
151
+ </action>
152
+ <action method="addLink" translate="label" module="sales">
153
+ <name>invoice</name>
154
+ <path>sales/order/invoice</path>
155
+ <label>Invoices</label>
156
+ </action>
157
+ <action method="addLink" translate="label" module="sales">
158
+ <name>shipment</name>
159
+ <path>sales/order/shipment</path>
160
+ <label>Shipments</label>
161
+ </action>
162
+ <action method="addLink" translate="label" module="sales">
163
+ <name>creditmemo</name>
164
+ <path>sales/order/creditmemo</path>
165
+ <label>Refunds</label>
166
+ </action>
167
+ <action method="addLink" translate="label" module="postnl">
168
+ <name>postnl_returns</name>
169
+ <path/>
170
+ <label>Returns</label>
171
+ </action>
172
+ </block>
173
+ <block type="sales/order_shipment" name="sales.order.shipment">
174
+ <block type="postnl_core/order_returns_shipment_items" name="shipment_items" template="TIG/PostNL/core/order/returns/shipment/items.phtml">
175
+ <action method="addItemRender">
176
+ <type>default</type>
177
+ <block>sales/order_item_renderer_default</block>
178
+ <template>sales/order/shipment/items/renderer/default.phtml</template>
179
+ </action>
180
+ <block type="sales/order_comments" name="shipment_comments" template="sales/order/comments.phtml"/>
181
+ </block>
182
+ </block>
183
+ </reference>
184
+ <reference name="content">
185
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
186
+ </reference>
187
+ <block type="core/text_list" name="additional.product.info" />
188
+ </postnl_order_returns>
189
+
190
+ <postnl_guest_returns translate="label">
191
+ <label>Customer My Account Order PostNL Returns View</label>
192
+ <reference name="root">
193
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
194
+ </reference>
195
+ <reference name="head">
196
+ <action method="addItem">
197
+ <type>skin_css</type>
198
+ <file>css/TIG/PostNL/returns.css</file>
199
+ </action>
200
+ </reference>
201
+ <reference name="content">
202
+ <block type="postnl_core/order_returns_info" as="info" name="sales.order.info">
203
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
204
+ <action method="addLink" translate="label" module="sales">
205
+ <name>view</name>
206
+ <path>sales/guest/view</path>
207
+ <label>Order Information</label>
208
+ </action>
209
+ <action method="addLink" translate="label" module="sales">
210
+ <name>invoice</name>
211
+ <path>sales/guest/invoice</path>
212
+ <label>Invoices</label>
213
+ </action>
214
+ <action method="addLink" translate="label" module="sales">
215
+ <name>shipment</name>
216
+ <path>sales/guest/shipment</path>
217
+ <label>Shipments</label>
218
+ </action>
219
+ <action method="addLink" translate="label" module="sales">
220
+ <name>creditmemo</name>
221
+ <path>sales/guest/creditmemo</path>
222
+ <label>Refunds</label>
223
+ </action>
224
+ <action method="addLink" translate="label" module="postnl">
225
+ <name>postnl_returns</name>
226
+ <path/>
227
+ <label>Returns</label>
228
+ </action>
229
+ </block>
230
+ <block type="sales/order_shipment" name="sales.order.shipment">
231
+ <block type="postnl_core/order_returns_shipment_items" name="shipment_items" template="TIG/PostNL/core/order/returns/shipment/items.phtml">
232
+ <action method="addItemRender">
233
+ <type>default</type>
234
+ <block>sales/order_item_renderer_default</block>
235
+ <template>sales/order/shipment/items/renderer/default.phtml</template>
236
+ </action>
237
+ <block type="sales/order_comments" name="shipment_comments" template="sales/order/comments.phtml"/>
238
+ </block>
239
+ </block>
240
+ </reference>
241
+ <reference name="content">
242
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
243
+ </reference>
244
+ <block type="core/text_list" name="additional.product.info" />
245
+ </postnl_guest_returns>
246
+
247
  <!-- POSTNL CHECKOUT -->
248
 
249
  <checkout_cart_index>
252
  <type>skin_css</type>
253
  <file>css/TIG/PostNL/cart.css</file>
254
  </action>
255
+ <action method="addCss">
256
+ <stylesheet>css/TIG/PostNL/rwd.css</stylesheet>
257
+ </action>
258
  <action method="addItem">
259
  <type>skin_js</type>
260
  <file>js/TIG/PostNL/checkout.js</file>
280
  </action>
281
  </reference>
282
  <reference name="root">
283
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
 
 
284
  </reference>
285
  <reference name="content">
286
  <block type="postnl_checkout/summary" name="postnl_checkout_summary" template="TIG/PostNL/checkout/summary.phtml">
308
  <type>skin_css</type>
309
  <file>css/TIG/PostNL/postcodecheck.css</file>
310
  </action>
311
+ <action method="addCss">
312
+ <stylesheet>css/TIG/PostNL/rwd.css</stylesheet>
313
+ </action>
314
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
315
  </reference>
316
  <reference name="customer_address_edit">
374
  <reference name="checkout.onepage.shipping">
375
  <block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
376
  </reference>
377
+ <reference name="right">
378
+ <block type="postnl_deliveryoptions/checkout_progress" name="postnl_deliveryoptions.progress" template="TIG/PostNL/delivery_options/progress.phtml"/>
379
+ </reference>
380
  <reference name="before_body_end">
381
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
382
  <block type="postnl_deliveryoptions/js" name="postnl_deliveryoptions_js" template="TIG/PostNL/delivery_options/js.phtml"/>
404
  </reference>
405
  </checkout_onepage_progress_shipping_method>
406
 
407
+ <checkout_onepage_progress>
408
+ <reference name="root">
409
+ <block type="postnl_deliveryoptions/checkout_progress" name="postnl_deliveryoptions.progress" template="TIG/PostNL/delivery_options/progress.phtml"/>
410
+ </reference>
411
+ </checkout_onepage_progress>
412
+
413
+ <checkout_onepage_progress_postnl_deliveryoptions>
414
+ <remove name="right"/>
415
+ <remove name="left"/>
416
+
417
+ <block type="postnl_deliveryoptions/checkout_progress" name="root" template="TIG/PostNL/delivery_options/onepage/progress/pakje_gemak.phtml" output="toHtml"/>
418
+ </checkout_onepage_progress_postnl_deliveryoptions>
419
+
420
  <!-- MIJNPAKKET ACCOUNTNOTIFICATION -->
421
 
422
  <checkout_onepage_success>
438
  <action method="addCss"><stylesheet>css/TIG/PostNL/deliveryoptions/default.css</stylesheet></action>
439
  <action method="addCss"><stylesheet>css/TIG/PostNL/deliveryoptions/onestepcheckout.css</stylesheet></action>
440
  <action method="addCss"><stylesheet>css/TIG/PostNL/mijnpakket.css</stylesheet></action>
441
+ <action method="addCss"><stylesheet>css/TIG/PostNL/rwd_osc.css</stylesheet></action>
442
  <action method="addItem"><type>skin_css</type><name>css/TIG/PostNL/deliveryoptions/ie8.css</name><params/><if>lt IE 9</if></action>
443
  <action method="addCss"><stylesheet>css/TIG/PostNL/postcodecheck.css</stylesheet></action>
444
  <action method="addItem"><type>skin_js</type><file>js/TIG/PostNL/ajax.js</file></action>
524
  <block type="postnl/payment_sales_order_creditmemo_totals_codFee" before="tax" name="postnl_cod_fee" />
525
  </reference>
526
  </sales_email_order_creditmemo_items>
527
+
528
+ <!-- EMAIL TEMPLATES -->
529
+
530
+ <postnl_email_order_pakjegemak_address>
531
+ <block type="core/template" template="TIG/PostNL/core/sales/order/email/pakjegemak_address.phtml"/>
532
+ </postnl_email_order_pakjegemak_address>
533
+
534
+ <postnl_email_order_delivery_options>
535
+ <block type="core/template" template="TIG/PostNL/core/sales/order/email/delivery_options.phtml"/>
536
+ </postnl_email_order_delivery_options>
537
+
538
  </layout>
app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/postcode_check.phtml CHANGED
@@ -103,7 +103,7 @@
103
  </li>
104
  <li class="clearfix">
105
  <div class="input-box input-address">
106
- <label for="<?php echo $_addressType; ?>:street1" class="required">
107
  <?php echo $_postnlHelper->__('Street name') ?>
108
  <span class="required">*</span>
109
  </label>
@@ -128,20 +128,20 @@
128
  <li class="clearfix">
129
  <div class="input-box input-address">
130
  <?php endif; ?>
131
- <input type="text" title="<?php echo $_postnlHelper->__('Street Address %s', $_i) ?>" name="virtual_<?php echo $_addressType; ?>[street][]" id="virtual:<?php echo $_addressType; ?>:street<?php echo $_i ?>" value="<?php echo $_dataHelper->clearDash($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClassNotRequired ?> onestepcheckout-address-line" />
132
  <?php if ($_i <= $_n): ?>
133
  </div>
134
  </li>
135
  <?php endif; ?>
136
  <?php endfor; ?>
137
 
138
- <?php /* Hidden fields for all the street lines to force them in the proper order regardless of the order in which they are displayed. */ ?>
139
  <div style="display:none;">
140
- <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street1"/>
141
- <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street2"/>
142
- <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street3"/>
143
  <?php for ($_i = 4, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
144
- <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street<?php echo $_i ?>"/>
145
  <?php endfor; ?>
146
  </div>
147
  <script type="text/javascript">
103
  </li>
104
  <li class="clearfix">
105
  <div class="input-box input-address">
106
+ <label for="<?php echo $_addressType; ?>:street1">
107
  <?php echo $_postnlHelper->__('Street name') ?>
108
  <span class="required">*</span>
109
  </label>
128
  <li class="clearfix">
129
  <div class="input-box input-address">
130
  <?php endif; ?>
131
+ <input type="text" title="<?php echo $_postnlHelper->__('Street Address %s', $_i) ?>" name="virtual_<?php echo $_addressType; ?>[street][]" id="virtual:<?php echo $_addressType; ?>:street<?php echo $_i ?>" value="<?php echo $_dataHelper->clearDash($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClassNotRequired ?> onestepcheckout-address-line" />
132
  <?php if ($_i <= $_n): ?>
133
  </div>
134
  </li>
135
  <?php endif; ?>
136
  <?php endfor; ?>
137
 
138
+ <?php /* Hidden fields for all the street lines to force them in the proper order regardless of the order in which they are displayed. The 'display:block' is a hack for OSC's JS which checks get Style('display') value for these elements. */ ?>
139
  <div style="display:none;">
140
+ <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street1" style="display:block;"/>
141
+ <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street2" style="display:block;"/>
142
+ <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street3" style="display:block;"/>
143
  <?php for ($_i = 4, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
144
+ <input type="hidden" name="<?php echo $_addressType; ?>[street][]" id="<?php echo $_addressType; ?>:street<?php echo $_i ?>" style="display:block;"/>
145
  <?php endfor; ?>
146
  </div>
147
  <script type="text/javascript">
app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/info.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ ?>
40
+ <?php /** @var $this TIG_PostNL_Block_Core_Order_Returns_Info */ ?>
41
+ <?php $_order = $this->getOrder() ?>
42
+ <?php $_returnInfoBlockHtml = $this->getReturnInfoBlockHtml(); ?>
43
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
44
+ <div class="page-title title-buttons">
45
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
46
+ <?php echo $this->getChildHtml('buttons') ?>
47
+ </div>
48
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
49
+ <dl class="order-info">
50
+ <dt><?php echo $this->__('About This Order:') ?></dt>
51
+ <dd>
52
+ <?php $_links = $this->getLinks(); ?>
53
+ <ul id="order-info-tabs">
54
+ <?php foreach ($_links as $_link): ?>
55
+ <?php if($_link->getUrl()): ?>
56
+ <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
57
+ <?php else: ?>
58
+ <li class="current"><?php echo $_link->getLabel() ?></li>
59
+ <?php endif; ?>
60
+ <?php endforeach; ?>
61
+ </ul>
62
+ <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
63
+ </dd>
64
+ </dl>
65
+ <div id="return_info" class="order-info-box">
66
+ <?php echo $_returnInfoBlockHtml; ?>
67
+ </div>
app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/shipment/items.phtml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_Core_Order_Returns_Shipment_Items $this
40
+ * @var TIG_postNL_Model_Core_Shipment $_postnlShipment
41
+ */
42
+ ?>
43
+ <?php $_postnlShipmentCollection = $this->getPostnlShipmentCollection(); ?>
44
+ <?php foreach ($_postnlShipmentCollection as $_postnlShipment): ?>
45
+ <?php $_shipment = $_postnlShipment->getShipment(); ?>
46
+ <h2 class="sub-title" id="print_return_label_title"><?php echo $this->__('Shipment #') ?><?php echo $_shipment->getIncrementId(); ?></h2>
47
+ <?php if ($_postnlShipment->isConfirmed() && $_postnlShipment->canPrintReturnLabels()): ?>
48
+ <button type="button" title="<?php echo $this->__('Print return label'); ?>" class="button print-return-label-button" onclick="setLocation('<?php echo $this->getPrintLabelUrl($_shipment->getIncrementId()); ?>')">
49
+ <span>
50
+ <span><?php echo $this->__('Print return label'); ?></span>
51
+ </span>
52
+ </button>
53
+ <?php endif; ?>
54
+ <?php $tracks = $_shipment->getTracksCollection(); ?>
55
+ <?php if ($tracks->count()): ?>
56
+ <table class="data-table tracking-table" id="my-tracking-table-<?php echo $_shipment->getId(); ?>">
57
+ <tbody>
58
+ <tr>
59
+ <th class="label"><?php echo $this->__('Tracking Number(s):') ?></th>
60
+ <td>&nbsp;
61
+ <?php
62
+ $i = 1;
63
+ $_size = $tracks->count();
64
+ foreach($tracks as $track): ?>
65
+ <?php
66
+ /**
67
+ * @var Mage_Sales_Model_Order_Shipment_Track $track
68
+ */
69
+ ?>
70
+ <?php if($track->isCustom()): ?>
71
+ <?php echo $this->escapeHtml($track->getNumber()) ?>
72
+ <?php else: ?>
73
+ <a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($track) ?>','trackorder','width=800,height=600,left=0,top=0,resizable=yes,scrollbars=yes')" ><?php echo $this->escapeHtml($track->getNumber()) ?></a>
74
+ <?php endif; ?>
75
+ <?php if($i!=$_size): ?>, <?php endif; ?>
76
+ <?php $i++;
77
+ endforeach; ?>
78
+ </td>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+ <script type="text/javascript">decorateTable('my-tracking-table-<?php echo $_shipment->getId(); ?>')</script>
83
+ <?php endif; ?>
84
+ <h3 class="table-caption print-return-label-caption"><?php echo $this->__('Items Shipped') ?></h3>
85
+ <table class="data-table" id="my-shipment-table-<?php echo $_shipment->getId(); ?>">
86
+ <col />
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-center"><span class="nobr"><?php echo $this->__('Qty Shipped') ?></span></th>
94
+ </tr>
95
+ </thead>
96
+ <?php $_items = $_shipment->getAllItems(); ?>
97
+ <?php $_count = count($_items) ?>
98
+ <?php foreach ($_items as $_item): ?>
99
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
100
+ <tbody>
101
+ <?php echo $this->getItemHtml($_item) ?>
102
+ </tbody>
103
+ <?php endforeach; ?>
104
+ </table>
105
+ <script type="text/javascript">decorateTable('my-shipment-table-<?php echo $_shipment->getId(); ?>', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
106
+ <?php echo $this->getCommentsHtml($_shipment)?>
107
+ <?php endforeach; ?>
app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/delivery_options.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ ?>
40
+ <?php /** @var Mage_Sales_Model_Order $_order */ ?>
41
+ <?php $_order = $this->getOrder(); ?>
42
+ <?php $_helper = Mage::helper('postnl/deliveryOptions'); ?>
43
+ <?php $_deliveryOptions = $_helper->getDeliveryOptionsInfo($_order, false); ?>
44
+ <?php if ($_deliveryOptions && $_helper->canUseDeliveryDays(false)): ?>
45
+ <br />
46
+ <?php echo $this->formatDate($_deliveryOptions['store_delivery_date']); ?>
47
+ <?php if ($_deliveryOptions['store_delivery_time_start'] && $_deliveryOptions['store_delivery_time_end'] && $_helper->canUseTimeframes(false)): ?>
48
+ &nbsp;(<?php echo $this->formatTime($_deliveryOptions['store_delivery_time_start']); ?> - <?php echo $this->formatTime($_deliveryOptions['store_delivery_time_end']); ?>)
49
+ <?php elseif ($_deliveryOptions['store_delivery_time_start'] && $_helper->canUseTimeframes(false)): ?>
50
+ &nbsp;(<?php echo $_helper->__('from')?> <?php echo $this->formatTime($_deliveryOptions['store_delivery_time_start']); ?>)
51
+ <?php endif; ?>
52
+ <?php endif; ?>
app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/pakjegemak_address.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ */
39
+ ?>
40
+ <?php /** @var Mage_Sales_Model_Order $_order */ ?>
41
+ <?php $_order = $this->getOrder(); ?>
42
+ <?php $_helper = Mage::helper('postnl'); ?>
43
+ <?php $_pakjeGemakAddress = Mage::helper('postnl')->getPakjeGemakAddressForOrder($_order); ?>
44
+ <?php if ($_pakjeGemakAddress): ?>
45
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
46
+ <thead>
47
+ <tr>
48
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><?php echo $this->__('Post office address:'); ?></th>
49
+ </tr>
50
+ </thead>
51
+ <tbody>
52
+ <tr>
53
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
54
+ <?php echo $_pakjeGemakAddress->format('html'); ?>
55
+ </td>
56
+ </tr>
57
+ </tbody>
58
+ </table>
59
+ <br/>
60
+ <?php endif; ?>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/addlocation.phtml CHANGED
@@ -62,6 +62,12 @@
62
  <div><?php echo $_helper->__('Select this checkbox to only show post office locations that are open after 7:00 P.M. on the next possible delivery date.'); ?></div>
63
  </div>
64
  </li>
 
 
 
 
 
 
65
  </ul>
66
  <em id="search_error_message" class="no-results" style="display:none;"><?php echo $_helper->__('The address you searched for was not found. Please try again.'); ?></em>
67
  </div>
@@ -121,6 +127,9 @@
121
  <li class="filter">
122
  <a class="input-box" id="evening-filter-responsive"><?php echo $_helper->__('open in the evening');?></a>
123
  </li>
 
 
 
124
  </ul>
125
  </div>
126
  <div id="responsive_locations_loader" class="postnl-loader" style="display:none;"></div>
62
  <div><?php echo $_helper->__('Select this checkbox to only show post office locations that are open after 7:00 P.M. on the next possible delivery date.'); ?></div>
63
  </div>
64
  </li>
65
+ <li>
66
+ <a id="pa-filter" class="location-option-checkbox"><?php echo $_helper->__('parcel dispenser');?></a>
67
+ <div id="pa_filter_tooltip" class="postnl-tooltip">
68
+ <div><?php echo $_helper->__('Select this checkbox to only show parcel dispensers.'); ?></div>
69
+ </div>
70
+ </li>
71
  </ul>
72
  <em id="search_error_message" class="no-results" style="display:none;"><?php echo $_helper->__('The address you searched for was not found. Please try again.'); ?></em>
73
  </div>
127
  <li class="filter">
128
  <a class="input-box" id="evening-filter-responsive"><?php echo $_helper->__('open in the evening');?></a>
129
  </li>
130
+ <li class="filter">
131
+ <a class="input-box" id="pa-filter-responsive"><?php echo $_helper->__('parcel dispenser');?></a>
132
+ </li>
133
  </ul>
134
  </div>
135
  <div id="responsive_locations_loader" class="postnl-loader" style="display:none;"></div>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/js.phtml CHANGED
@@ -45,4 +45,4 @@
45
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-yui.js'); ?>" type="text/javascript"></script>
46
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-fonts.js'); ?>" type="text/javascript"></script>
47
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-settings.js'); ?>" type="text/javascript"></script>
48
- <script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $this->getApiKey(); ?>&sensor=false&libraries=places" type="text/javascript"></script>
45
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-yui.js'); ?>" type="text/javascript"></script>
46
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-fonts.js'); ?>" type="text/javascript"></script>
47
  <script src="<?php echo $this->getSkinUrl('js/TIG/PostNL/deliveryoptions/cufon-settings.js'); ?>" type="text/javascript"></script>
48
+ <script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $this->getApiKey(); ?>&sensor=false&libraries=places&v=3.17" type="text/javascript"></script>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/deliveryoptions.phtml CHANGED
@@ -269,6 +269,7 @@
269
  document.stopObserving('postnl:selectOptionSaved');
270
  document.observe('postnl:selectOptionSaved', function() {
271
  checkout.reloadProgressBlock('shipping_method');
 
272
  });
273
 
274
  /**
269
  document.stopObserving('postnl:selectOptionSaved');
270
  document.observe('postnl:selectOptionSaved', function() {
271
  checkout.reloadProgressBlock('shipping_method');
272
+ checkout.reloadProgressBlock('postnl_deliveryoptions');
273
  });
274
 
275
  /**
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/progress/pakje_gemak.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_DeliveryOptions_Checkout_Progress $this
40
+ */
41
+ ?>
42
+ <?php if ($this->getCheckout()->getStepData('shipping_method', 'complete')): ?>
43
+ <?php $_pakjeGemakAddress = $this->getPakjeGemakAddress(); ?>
44
+ <?php if($_pakjeGemakAddress): ?>
45
+ <dt class="complete"><?php echo $this->__('Post Office Address') ?> <span class="changelink"><span class="separator">|</span> <a href="#shipping_method" onclick="checkout.changeSection('opc-shipping_method'); return false;"><?php echo $this->__('Change') ?></a></span></dt>
46
+ <dd class="complete"><?php echo $_pakjeGemakAddress; ?></dd>
47
+ <?php endif; ?>
48
+ <?php endif; ?>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onepage/progress/shipping_method.phtml CHANGED
@@ -1,27 +1,40 @@
1
  <?php
2
  /**
3
- * Magento Enterprise Edition
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * NOTICE OF LICENSE
6
  *
7
- * This source file is subject to the Magento Enterprise Edition License
8
- * that is bundled with this package in the file LICENSE_EE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://www.magentocommerce.com/license/enterprise-edition
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 base_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://www.magentocommerce.com/license/enterprise-edition
25
  */
26
  ?>
27
  <?php if ($this->getCheckout()->getStepData('shipping_method', 'complete')): ?>
@@ -44,6 +57,21 @@
44
  (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
45
  <?php endif; ?>
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  <?php else: ?>
48
  <?php echo $this->__('Shipping method has not been selected yet') ?>
49
  <?php endif; ?>
1
  <?php
2
  /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
  *
22
  * NOTICE OF LICENSE
23
  *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
 
 
29
  *
30
  * DISCLAIMER
31
  *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
  *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
 
 
38
  */
39
  ?>
40
  <?php if ($this->getCheckout()->getStepData('shipping_method', 'complete')): ?>
57
  (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
58
  <?php endif; ?>
59
 
60
+ <?php if (Mage::helper('postnl/carrier')->isPostnlShippingMethod($this->getShippingMethod())): ?>
61
+ <?php $_deliveryOptionsHelper = Mage::helper('postnl/deliveryOptions'); ?>
62
+ <?php $_deliveryOptionsInfo = $_deliveryOptionsHelper->getDeliveryOptionsInfo($this->getQuote(), false) ?>
63
+ <?php if ($_deliveryOptionsInfo && $_deliveryOptionsHelper->canUseDeliveryDays() && !empty($_deliveryOptionsInfo['store_delivery_date'])): ?>
64
+ <br />
65
+ <?php echo $this->formatDate($_deliveryOptionsInfo['store_delivery_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM); ?>
66
+ <?php if ($_deliveryOptionsHelper->canUseTimeframes() && !empty($_deliveryOptionsInfo['store_delivery_time_start'])): ?>
67
+ <?php if (!empty($_deliveryOptionsInfo['store_delivery_time_end'])): ?>
68
+ (<?php echo $_deliveryOptionsInfo['store_delivery_time_start']; ?> - <?php echo $_deliveryOptionsInfo['store_delivery_time_end']; ?>)
69
+ <?php else: ?>
70
+ (<?php echo $_deliveryOptionsHelper->__('from'); ?> <?php echo $_deliveryOptionsInfo['store_delivery_time_start']; ?>)
71
+ <?php endif; ?>
72
+ <?php endif; ?>
73
+ <?php endif; ?>
74
+ <?php endif; ?>
75
  <?php else: ?>
76
  <?php echo $this->__('Shipping method has not been selected yet') ?>
77
  <?php endif; ?>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml CHANGED
@@ -257,7 +257,11 @@
257
 
258
  function initDeliveryOptions() {
259
  var billingOrShipping;
260
- if ($('billing:use_for_shipping_yes').checked) {
 
 
 
 
261
  billingOrShipping = 'billing';
262
  } else {
263
  billingOrShipping = 'shipping';
@@ -437,8 +441,8 @@
437
  */
438
  if (!postcode
439
  || (
440
- (!addressSelectField || addressSelectField.getValue() == '')
441
- && postcode != $(billingOrShipping + ':postcode').getValue()
442
  )
443
  ) {
444
  var postcodeFieldValue = $(billingOrShipping + ':postcode').getValue();
@@ -910,6 +914,170 @@
910
  deliveryOptions.saveOscOptions();
911
  }
912
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
  <?php endif; ?>
914
  //]]>
915
  </script>
257
 
258
  function initDeliveryOptions() {
259
  var billingOrShipping;
260
+ var billingOrShippingCheckbox = $('billing:use_for_shipping_yes');
261
+ if (!billingOrShippingCheckbox
262
+ || billingOrShippingCheckbox.type == 'hidden'
263
+ || billingOrShippingCheckbox.checked
264
+ ) {
265
  billingOrShipping = 'billing';
266
  } else {
267
  billingOrShipping = 'shipping';
441
  */
442
  if (!postcode
443
  || (
444
+ (!addressSelectField || addressSelectField.getValue() == '')
445
+ && postcode != $(billingOrShipping + ':postcode').getValue()
446
  )
447
  ) {
448
  var postcodeFieldValue = $(billingOrShipping + ':postcode').getValue();
914
  deliveryOptions.saveOscOptions();
915
  }
916
  });
917
+
918
+ function addressPreview(templates, target) {
919
+ var bparams = {};
920
+ var sparams = {};
921
+ var savedBillingItems = $('billing-address-select');
922
+ if(savedBillingItems && savedBillingItems.getValue()){
923
+ index = savedBillingItems.selectedIndex;
924
+ bparams = customerBAddresses[index];
925
+ } else {
926
+ var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
927
+ items.each(function(s) {
928
+ if(s.getStyle('display') != 'none'){
929
+ selectText = s.options
930
+ if(selectText){
931
+ value = selectText[s.selectedIndex].text;
932
+ } else {
933
+ value = s.getValue();
934
+ }
935
+ if(value){
936
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
937
+ }
938
+ if(s.id == 'billing:region_id'){
939
+ bparams['billing:region'] = value;
940
+ } else {
941
+ bparams[s.id] = value;
942
+ }
943
+ }
944
+ });
945
+ }
946
+
947
+
948
+
949
+ var savedShippingItems = $('shipping-address-select');
950
+ if(savedShippingItems && savedShippingItems.getValue()){
951
+ index = savedShippingItems.selectedIndex;
952
+ sparams = customerSAddresses[index];
953
+ } else {
954
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
955
+ items.each(function(s) {
956
+ if(s.getStyle('display') != 'none'){
957
+ selectText = s.options
958
+ if(selectText){
959
+ value = selectText[s.selectedIndex].text;
960
+ } else {
961
+ value = s.getValue();
962
+ }
963
+ if(value){
964
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
965
+ }
966
+ if(s.id == 'shipping:region_id'){
967
+ sparams['shipping:region'] = value;
968
+ } else {
969
+ sparams[s.id] = value;
970
+ }
971
+ }
972
+ });
973
+ }
974
+
975
+
976
+ var form = $('onestepcheckout-form');
977
+
978
+ var shipping_method = $RF(form, 'shipping_method');
979
+ if(shipping_method){
980
+ var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
981
+ var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
982
+ var shipping_row = shipping_title + ' - ' + shipping_label
983
+ }
984
+
985
+ var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
986
+ billinga_template = new Template(templates.billing);
987
+
988
+ if(useOnlyBilling){
989
+ shippinga_template = new Template(templates.billing);
990
+ }else{
991
+ shippinga_template = new Template(templates.shipping);
992
+ }
993
+
994
+ var payment_method = payment.currentMethod;
995
+
996
+ if(payment_method){
997
+ var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
998
+ }
999
+
1000
+ var targetelem = $(target + '_billinga').childElements()[1];
1001
+ if(targetelem){
1002
+ targetelem.update(billinga_template.evaluate(bparams));
1003
+ }
1004
+
1005
+ targetelem = $(target + '_shippinga').childElements()[1];
1006
+ if(targetelem){
1007
+ if(useOnlyBilling){
1008
+ targetelem.update(shippinga_template.evaluate(bparams));
1009
+ }else{
1010
+ targetelem.update(shippinga_template.evaluate(sparams));
1011
+ }
1012
+ }
1013
+
1014
+ targetelem = $(target + '_shipping').childElements()[1];
1015
+ if(targetelem){
1016
+ targetelem.update(shipping_row);
1017
+ }
1018
+
1019
+ targetelem = $(target + '_payment').childElements()[1];
1020
+ if(targetelem){
1021
+ targetelem.update(payment_label);
1022
+ }
1023
+
1024
+ targetelem = $(target + '_summary').childElements()[1];
1025
+ if(targetelem){
1026
+ targetelem.update('');
1027
+ targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
1028
+ targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
1029
+ }
1030
+
1031
+ if (deliveryOptions
1032
+ && (deliveryOptions.selectedType == 'PG'
1033
+ || deliveryOptions.selectedType == 'PGE'
1034
+ || deliveryOptions.selectedType == 'PA'
1035
+ )
1036
+ ) {
1037
+ targetelem = $(target + '_pakjegemak');
1038
+ if (!targetelem) {
1039
+ var pakjeGemakAddressElement = new Element('div');
1040
+ pakjeGemakAddressElement.id = 'addressreview_pakjegemak';
1041
+
1042
+ var pakjeGemakAddressHeader = new Element('h4');
1043
+ pakjeGemakAddressHeader.addClassName('title')
1044
+ .update(Translator.translate('Post Office Address'));
1045
+
1046
+ var pakjeGemakAddressData = new Element('div');
1047
+ pakjeGemakAddressData.addClassName('data');
1048
+
1049
+ var selectedAddress = deliveryOptions.selectedOption.address;
1050
+ var pakjeGemakAddressObject = {};
1051
+ var pakjeGemakAddressObjectPrefix = 'shipping:';
1052
+ if(useOnlyBilling) {
1053
+ pakjeGemakAddressObjectPrefix = 'billing:';
1054
+ }
1055
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'company'] = selectedAddress.Name;
1056
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'country_id'] = selectedAddress.Countrycode;
1057
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'postcode'] = selectedAddress.Zipcode;
1058
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'city'] = selectedAddress.City;
1059
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'street1'] = selectedAddress.Street;
1060
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'street2'] = selectedAddress.HouseNr;
1061
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'street3'] = selectedAddress.HouseNrExt;
1062
+ pakjeGemakAddressObject[pakjeGemakAddressObjectPrefix + 'telephone'] = selectedAddress.PhoneNumber;
1063
+
1064
+ pakjeGemakAddressData.update(shippinga_template.evaluate(pakjeGemakAddressObject));
1065
+
1066
+ pakjeGemakAddressElement.insert(pakjeGemakAddressHeader)
1067
+ .insert(pakjeGemakAddressData);
1068
+
1069
+ $(target + '_shippinga').insert({
1070
+ after : pakjeGemakAddressElement
1071
+ });
1072
+ }
1073
+ } else {
1074
+ targetelem = $(target + '_pakjegemak');
1075
+ if (targetelem) {
1076
+ targetelem.remove();
1077
+ }
1078
+ }
1079
+ }
1080
+
1081
  <?php endif; ?>
1082
  //]]>
1083
  </script>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/progress.phtml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ___________ __ __
4
+ * \__ ___/____ _/ |_ _____ | |
5
+ * | | / _ \\ __\\__ \ | |
6
+ * | | | |_| || | / __ \_| |__
7
+ * |____| \____/ |__| (____ /|____/
8
+ * \/
9
+ * ___ __ __
10
+ * | | ____ _/ |_ ____ _______ ____ ____ _/ |_
11
+ * | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
12
+ * | || | \| | \ ___/ | | \/| | \\ ___/ | |
13
+ * |___||___| /|__| \_____>|__| |___| / \_____>|__|
14
+ * \/ \/
15
+ * ________
16
+ * / _____/_______ ____ __ __ ______
17
+ * / \ ___\_ __ \ / _ \ | | \\____ \
18
+ * \ \_\ \| | \/| |_| || | /| |_| |
19
+ * \______ /|__| \____/ |____/ | __/
20
+ * \/ |__|
21
+ *
22
+ * NOTICE OF LICENSE
23
+ *
24
+ * This source file is subject to the Creative Commons License.
25
+ * It is available through the world-wide-web at this URL:
26
+ * http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
27
+ * If you are unable to obtain it through the world-wide-web, please send an email
28
+ * to servicedesk@tig.nl so we can send you a copy immediately.
29
+ *
30
+ * DISCLAIMER
31
+ *
32
+ * Do not edit or add to this file if you wish to upgrade this module to newer
33
+ * versions in the future. If you wish to customize this module for your
34
+ * needs please contact servicedesk@tig.nl for more information.
35
+ *
36
+ * @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
37
+ * @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
38
+ *
39
+ * @var TIG_PostNL_Block_DeliveryOptions_Checkout_Progress $this
40
+ */
41
+ ?>
42
+ <div id="postnl_deliveryoptions-progress-opcheckout">
43
+ </div>
44
+ <script type="text/javascript">
45
+ //<![CDATA[
46
+ var shippingAddressProgress = $('shipping-progress-opcheckout');
47
+ if (shippingAddressProgress) {
48
+ shippingAddressProgress.insert({
49
+ after : $('postnl_deliveryoptions-progress-opcheckout')
50
+ });
51
+ }
52
+
53
+ if (checkout) {
54
+ checkout.steps = ['login', 'billing', 'shipping', 'shipping_method', 'postnl_deliveryoptions', 'payment', 'review'];
55
+ }
56
+ //]]>
57
+ </script>
app/design/frontend/base/default/template/TIG/PostNL/delivery_options/sales/order/delivery_options_info.phtml CHANGED
@@ -46,7 +46,7 @@
46
  <?php endif; ?>
47
 
48
  <div id="delivery_options_info">
49
- <?php if ($_deliveryOptionsInfo->getDeliveryDate()): ?>
50
  <?php $_deliveryDateComment = '';?>
51
  <?php if ($_deliveryOptionsInfo->getType() == 'Avond'): ?>
52
  <?php $_deliveryDateComment = ' ' . $_helper->__('(evening)'); ?>
46
  <?php endif; ?>
47
 
48
  <div id="delivery_options_info">
49
+ <?php if ($_helper->canUseDeliveryDays(false) && $_deliveryOptionsInfo->getDeliveryDate()): ?>
50
  <?php $_deliveryDateComment = '';?>
51
  <?php if ($_deliveryOptionsInfo->getType() == 'Avond'): ?>
52
  <?php $_deliveryDateComment = ' ' . $_helper->__('(evening)'); ?>
app/design/frontend/base/default/template/TIG/PostNL/mijnpakket/onestepcheckout/login_button.phtml CHANGED
@@ -77,8 +77,10 @@
77
 
78
  mijnpakketLogin.setCheckout(checkout)
79
  .setBilling(billing)
80
- .setShipping(shipping)
81
  .setFailureUrl('<?php echo $this->getUrl('checkout/cart'); ?>');
 
 
 
82
 
83
  <?php if ($_savedData): ?>
84
  var mijnpakketData = '<?php echo Mage::helper('core')->jsonEncode($_savedData); ?>';
77
 
78
  mijnpakketLogin.setCheckout(checkout)
79
  .setBilling(billing)
 
80
  .setFailureUrl('<?php echo $this->getUrl('checkout/cart'); ?>');
81
+ if (typeof shipping != 'undefined') {
82
+ mijnpakketLogin.setShipping(shipping);
83
+ }
84
 
85
  <?php if ($_savedData): ?>
86
  var mijnpakketData = '<?php echo Mage::helper('core')->jsonEncode($_savedData); ?>';
app/design/frontend/rwd/default/layout/TIG/postnl.xml CHANGED
@@ -82,6 +82,35 @@
82
  </reference>
83
  </sales_order_creditmemo>
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  <!-- SHIPPING STATUS, PAKJE GEMAK ADDRESS -->
86
 
87
  <sales_order_shipment>
@@ -93,6 +122,129 @@
93
  </reference>
94
  </sales_order_shipment>
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  <!-- POSTNL CHECKOUT -->
97
 
98
  <checkout_cart_index>
@@ -226,6 +378,9 @@
226
  <reference name="checkout.onepage.shipping">
227
  <block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
228
  </reference>
 
 
 
229
  <reference name="before_body_end">
230
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
231
  <block type="postnl_deliveryoptions/js" name="postnl_deliveryoptions_js" template="TIG/PostNL/delivery_options/js.phtml"/>
@@ -253,6 +408,19 @@
253
  </reference>
254
  </checkout_onepage_progress_shipping_method>
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  <!-- MIJNPAKKET ACCOUNTNOTIFICATION -->
257
 
258
  <checkout_onepage_success>
@@ -361,4 +529,14 @@
361
  </reference>
362
  </sales_email_order_creditmemo_items>
363
 
 
 
 
 
 
 
 
 
 
 
364
  </layout>
82
  </reference>
83
  </sales_order_creditmemo>
84
 
85
+ <sales_guest_view>
86
+ <reference name="content">
87
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
88
+ <block type="core/template" name="delivery_options_info" template="TIG/PostNL/delivery_options/sales/order/delivery_options_info.phtml"/>
89
+ </reference>
90
+ <reference name="order_totals">
91
+ <block type="postnl/payment_sales_order_totals_codFee" before="tax" name="postnl_cod_fee" />
92
+ </reference>
93
+ </sales_guest_view>
94
+
95
+ <sales_guest_invoice>
96
+ <reference name="content">
97
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
98
+ </reference>
99
+ <reference name="invoice_totals">
100
+ <block type="postnl/payment_sales_order_invoice_totals_codFee" before="tax" name="postnl_cod_fee" />
101
+ </reference>
102
+ </sales_guest_invoice>
103
+
104
+ <sales_guest_creditmemo>
105
+ <reference name="content">
106
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
107
+ </reference>
108
+ <reference name="creditmemo_totals">
109
+ <block type="postnl/payment_sales_order_creditmemo_totals_codFee" before="tax" name="postnl_cod_fee" />
110
+ </reference>
111
+ </sales_guest_creditmemo>
112
+
113
+
114
  <!-- SHIPPING STATUS, PAKJE GEMAK ADDRESS -->
115
 
116
  <sales_order_shipment>
122
  </reference>
123
  </sales_order_shipment>
124
 
125
+ <sales_guest_shipment>
126
+ <reference name="my.account.wrapper">
127
+ <block type="postnl_core/shippingStatus" name="postnl_shipping_status" template="TIG/PostNL/core/sales/order/shipment/shipping_status.phtml" after="-"/>
128
+ </reference>
129
+ <reference name="content">
130
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
131
+ </reference>
132
+ </sales_guest_shipment>
133
+
134
+ <!-- RETURNS -->
135
+
136
+ <postnl_order_returns translate="label">
137
+ <label>Customer My Account Order PostNL Returns View</label>
138
+ <update handle="customer_account"/>
139
+ <reference name="head">
140
+ <action method="addItem">
141
+ <type>skin_css</type>
142
+ <file>css/TIG/PostNL/returns.css</file>
143
+ </action>
144
+ </reference>
145
+ <reference name="my.account.wrapper">
146
+ <block type="postnl_core/order_returns_info" as="info" name="sales.order.info">
147
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
148
+ <action method="addLink" translate="label" module="sales">
149
+ <name>view</name>
150
+ <path>sales/order/view</path>
151
+ <label>Order Information</label>
152
+ </action>
153
+ <action method="addLink" translate="label" module="sales">
154
+ <name>invoice</name>
155
+ <path>sales/order/invoice</path>
156
+ <label>Invoices</label>
157
+ </action>
158
+ <action method="addLink" translate="label" module="sales">
159
+ <name>shipment</name>
160
+ <path>sales/order/shipment</path>
161
+ <label>Shipments</label>
162
+ </action>
163
+ <action method="addLink" translate="label" module="sales">
164
+ <name>creditmemo</name>
165
+ <path>sales/order/creditmemo</path>
166
+ <label>Refunds</label>
167
+ </action>
168
+ <action method="addLink" translate="label" module="postnl">
169
+ <name>postnl_returns</name>
170
+ <path/>
171
+ <label>Returns</label>
172
+ </action>
173
+ </block>
174
+ <block type="sales/order_shipment" name="sales.order.shipment">
175
+ <block type="postnl_core/order_returns_shipment_items" name="shipment_items" template="TIG/PostNL/core/order/returns/shipment/items.phtml">
176
+ <action method="addItemRender">
177
+ <type>default</type>
178
+ <block>sales/order_item_renderer_default</block>
179
+ <template>sales/order/shipment/items/renderer/default.phtml</template>
180
+ </action>
181
+ <block type="sales/order_comments" name="shipment_comments" template="sales/order/comments.phtml"/>
182
+ </block>
183
+ </block>
184
+ </reference>
185
+ <reference name="content">
186
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
187
+ </reference>
188
+ <block type="core/text_list" name="additional.product.info" />
189
+ </postnl_order_returns>
190
+
191
+ <postnl_guest_returns translate="label">
192
+ <label>Customer My Account Order PostNL Returns View</label>
193
+ <reference name="root">
194
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
195
+ </reference>
196
+ <reference name="head">
197
+ <action method="addItem">
198
+ <type>skin_css</type>
199
+ <file>css/TIG/PostNL/returns.css</file>
200
+ </action>
201
+ </reference>
202
+ <reference name="content">
203
+ <block type="postnl_core/order_returns_info" as="info" name="sales.order.info">
204
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
205
+ <action method="addLink" translate="label" module="sales">
206
+ <name>view</name>
207
+ <path>sales/guest/view</path>
208
+ <label>Order Information</label>
209
+ </action>
210
+ <action method="addLink" translate="label" module="sales">
211
+ <name>invoice</name>
212
+ <path>sales/guest/invoice</path>
213
+ <label>Invoices</label>
214
+ </action>
215
+ <action method="addLink" translate="label" module="sales">
216
+ <name>shipment</name>
217
+ <path>sales/guest/shipment</path>
218
+ <label>Shipments</label>
219
+ </action>
220
+ <action method="addLink" translate="label" module="sales">
221
+ <name>creditmemo</name>
222
+ <path>sales/guest/creditmemo</path>
223
+ <label>Refunds</label>
224
+ </action>
225
+ <action method="addLink" translate="label" module="postnl">
226
+ <name>postnl_returns</name>
227
+ <path/>
228
+ <label>Returns</label>
229
+ </action>
230
+ </block>
231
+ <block type="sales/order_shipment" name="sales.order.shipment">
232
+ <block type="postnl_core/order_returns_shipment_items" name="shipment_items" template="TIG/PostNL/core/order/returns/shipment/items.phtml">
233
+ <action method="addItemRender">
234
+ <type>default</type>
235
+ <block>sales/order_item_renderer_default</block>
236
+ <template>sales/order/shipment/items/renderer/default.phtml</template>
237
+ </action>
238
+ <block type="sales/order_comments" name="shipment_comments" template="sales/order/comments.phtml"/>
239
+ </block>
240
+ </block>
241
+ </reference>
242
+ <reference name="content">
243
+ <block type="core/template" name="pakje_gemak_address" template="TIG/PostNL/core/sales/order/pakje_gemak_address.phtml"/>
244
+ </reference>
245
+ <block type="core/text_list" name="additional.product.info" />
246
+ </postnl_guest_returns>
247
+
248
  <!-- POSTNL CHECKOUT -->
249
 
250
  <checkout_cart_index>
378
  <reference name="checkout.onepage.shipping">
379
  <block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
380
  </reference>
381
+ <reference name="right">
382
+ <block type="postnl_deliveryoptions/checkout_progress" name="postnl_deliveryoptions.progress" template="TIG/PostNL/delivery_options/progress.phtml"/>
383
+ </reference>
384
  <reference name="before_body_end">
385
  <block type="core/template" name="postnl_validation" template="TIG/PostNL/address_validation/validate.phtml"/>
386
  <block type="postnl_deliveryoptions/js" name="postnl_deliveryoptions_js" template="TIG/PostNL/delivery_options/js.phtml"/>
408
  </reference>
409
  </checkout_onepage_progress_shipping_method>
410
 
411
+ <checkout_onepage_progress>
412
+ <reference name="root">
413
+ <block type="postnl_deliveryoptions/checkout_progress" name="postnl_deliveryoptions.progress" template="TIG/PostNL/delivery_options/progress.phtml"/>
414
+ </reference>
415
+ </checkout_onepage_progress>
416
+
417
+ <checkout_onepage_progress_postnl_deliveryoptions>
418
+ <remove name="right"/>
419
+ <remove name="left"/>
420
+
421
+ <block type="postnl_deliveryoptions/checkout_progress" name="root" template="TIG/PostNL/delivery_options/onepage/progress/pakje_gemak.phtml" output="toHtml"/>
422
+ </checkout_onepage_progress_postnl_deliveryoptions>
423
+
424
  <!-- MIJNPAKKET ACCOUNTNOTIFICATION -->
425
 
426
  <checkout_onepage_success>
529
  </reference>
530
  </sales_email_order_creditmemo_items>
531
 
532
+ <!-- EMAIL TEMPLATES -->
533
+
534
+ <postnl_email_order_pakjegemak_address>
535
+ <block type="core/template" template="TIG/PostNL/core/sales/order/email/pakjegemak_address.phtml"/>
536
+ </postnl_email_order_pakjegemak_address>
537
+
538
+ <postnl_email_order_delivery_options>
539
+ <block type="core/template" template="TIG/PostNL/core/sales/order/email/delivery_options.phtml"/>
540
+ </postnl_email_order_delivery_options>
541
+
542
  </layout>
app/locale/en_US/TIG_PostNL.csv CHANGED
@@ -59,7 +59,6 @@ TIG_PostNL::From this menu you can add columns containing PostNL specific inform
59
  TIG_PostNL::Show product options in order grid,Show product options in order grid
60
  TIG_PostNL::Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.,Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.
61
  TIG_PostNL::Optional shipment grid columns,Optional shipment grid columns
62
- ,
63
  TIG_PostNL::Select a default option for the shipment grid mass action.,Select a default option for the shipment grid mass action.
64
  TIG_PostNL::You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.,You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.
65
  TIG_PostNL::Automatically send track & trace email to customer,Automatically send track & trace email to customer
@@ -89,11 +88,9 @@ TIG_PostNL::House Nr. Extension,House Nr. Extension
89
  TIG_PostNL::Postcode,Postcode
90
  TIG_PostNL::City,City
91
  TIG_PostNL::Region,Region
92
- ,
93
- TIG_PostNL::Use the sender address as the return adress,Use the sender address as the return adress
94
  TIG_PostNL::Product Options,Product Options
95
  TIG_PostNL::Select selectable option,Select selectable option
96
- ,
97
  TIG_PostNL::Default shipping option,Default shipping option
98
  TIG_PostNL::This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.,This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.
99
  TIG_PostNL::Use an alternative default option,Use an alternative default option
@@ -111,15 +108,10 @@ TIG_PostNL::Customs certificate number,Customs certificate number
111
  "TIG_PostNL::If you do not own a customs certificate, leave this field empty.","If you do not own a customs certificate, leave this field empty."
112
  TIG_PostNL::Product attributes,Product attributes
113
  TIG_PostNL::Use HS Tariff,Use HS Tariff
114
- ,
115
  TIG_PostNL::HS Tariff attribute,HS Tariff attribute
116
- ,
117
  TIG_PostNL::Customs value attribute,Customs value attribute
118
- ,
119
  TIG_PostNL::Country of origin attribute,Country of origin attribute
120
- ,
121
  TIG_PostNL::Product description attribute,Product description attribute
122
- ,
123
  TIG_PostNL::Product sorting,Product sorting
124
  TIG_PostNL::Product sorting attribute,Product sorting attribute
125
  TIG_PostNL::Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.,Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.
@@ -127,28 +119,22 @@ TIG_PostNL::Product sorting direction,Product sorting direction
127
  TIG_PostNL::PostNL Checkout Settings,PostNL Checkout Settings
128
  TIG_PostNL::Enable PostNL Checkout,Enable PostNL Checkout
129
  TIG_PostNL::Mode,Mode
130
- ,
131
  TIG_PostNL::Enable PostNL Checkout for orders under 2 kg,Enable PostNL Checkout for orders under 2 kg
132
  TIG_PostNL::Enable PostNL Checkout for orders containing out of stock products,Enable PostNL Checkout for orders containing out of stock products
133
  TIG_PostNL::PostNL Checkout settings,PostNL Checkout settings
134
  TIG_PostNL::Show order summary page,Show order summary page
135
  TIG_PostNL::Whether or not to show the customer a final order summary page before finalizing the order.,Whether or not to show the customer a final order summary page before finalizing the order.
136
  TIG_PostNL::Newsletter subscription,Newsletter subscription
137
- ,
138
  TIG_PostNL::Remark,Remark
139
  TIG_PostNL::Whether or not the customer can leave a remark.,Whether or not the customer can leave a remark.
140
  TIG_PostNL::Use mobile phonenumber,Use mobile phonenumber
141
- ,
142
  TIG_PostNL::Use date of birth,Use date of birth
143
  TIG_PostNL::Whether or not the customer's date of birth will be returned by PostNL if available.,Whether or not the customer's date of birth will be returned by PostNL if available.
144
  TIG_PostNL::Allow post office locations,Allow post office locations
145
  TIG_PostNL::Whether or not the customer may choose a retail location as their delivery address.,Whether or not the customer may choose a retail location as their delivery address.
146
  TIG_PostNL::Allow foreign addresses,Allow foreign addresses
147
- ,
148
  TIG_PostNL::Allow price overview,Allow price overview
149
- ,
150
  TIG_PostNL::Terms and conditions,Terms and conditions
151
- ,
152
  TIG_PostNL::Contact settings,Contact settings
153
  TIG_PostNL::Contact URL,Contact URL
154
  TIG_PostNL::URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.,URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.
@@ -411,13 +397,10 @@ TIG_PostNL::Invalid ReadOrder response: %s,Invalid ReadOrder response: %s
411
  TIG_PostNL::Invalid ConfirmOrder response: %s,Invalid ConfirmOrder response: %s
412
  TIG_PostNL::Invalid reference type requested: %s,Invalid reference type requested: %s
413
  TIG_PostNL::Invalid object specified: %s,Invalid object specified: %s
414
- ,
415
  TIG_PostNL::Number of Parcels,Number of Parcels
416
  "TIG_PostNL::You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. ","You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. "
417
- ,
418
  "TIG_PostNL::If you are unsure which options to select, ask your PostNL account manager.","If you are unsure which options to select, ask your PostNL account manager."
419
  "TIG_PostNL::We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead.","We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead."
420
- ,
421
  TIG_PostNL::The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.,The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.
422
  TIG_PostNL::Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.,Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.
423
  TIG_PostNL::All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.,All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.
@@ -444,7 +427,6 @@ TIG_PostNL::Invalid confirmShipment response: %s,Invalid confirmShipment respons
444
  "TIG_PostNL::Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure.","Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure."
445
  TIG_PostNL::The quote's total weight is below the miniumum required to use PostNL Checkout.,The quote's total weight is below the miniumum required to use PostNL Checkout.
446
  TIG_PostNL::One or more items in the cart are out of stock.,One or more items in the cart are out of stock.
447
- ,
448
  TIG_PostNL::Shipping event history,Shipping event history
449
  TIG_PostNL::PostNL version %s,PostNL version %s
450
  TIG_PostNL::Status Code,Status Code
@@ -533,7 +515,6 @@ TIG_PostNL::Use PostNL Checkout and Mijnpakket login,Use PostNL Checkout and Mij
533
  "TIG_PostNL::If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'.","If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'."
534
  TIG_PostNL::You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.,You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.
535
  TIG_PostNL::You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.,You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.
536
- ,
537
  TIG_PostNL::Account settings have been succesfully validated. Please save this page to keep these settings.,Account settings have been succesfully validated. Please save this page to keep these settings.
538
  TIG_PostNL::One or more fields are missing. Please fill these fields and try again.,One or more fields are missing. Please fill these fields and try again.
539
  "TIG_PostNL::Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.","Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL."
@@ -554,20 +535,15 @@ TIG_PostNL::Enable Parcelware export,Enable Parcelware export
554
  TIG_PostNL::Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.,Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.
555
  TIG_PostNL::Automatically confirm exported shipments,Automatically confirm exported shipments
556
  "TIG_PostNL::This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare.","This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare."
557
- ,
558
  TIG_PostNL::Contract reference number,Contract reference number
559
  TIG_PostNL::Contract name,Contract name
560
  TIG_PostNL::Sender address reference number,Sender address reference number
561
  TIG_PostNL::Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.,Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.
562
  TIG_PostNL::Product option,Product option
563
  TIG_PostNL::Use postcode check,Use postcode check
564
- ,
565
  TIG_PostNL::Automatically complete Dutch addresses after your customer fills in his postcode and house number.,Automatically complete Dutch addresses after your customer fills in his postcode and house number.
566
  TIG_PostNL::Use postcode check on checkout page,Use postcode check on checkout page
567
- ,
568
- ,
569
  TIG_PostNL::Use postcode check in customer's address book,Use postcode check in customer's address book
570
- ,
571
  TIG_PostNL::Shipping Product,Shipping Product
572
  TIG_PostNL::Delivery Date,Delivery Date
573
  TIG_PostNL::Customize this grid.,Customize this grid.
@@ -575,7 +551,6 @@ TIG_PostNL::Selecting too many columns may cause the shipment grid to no longer
575
  TIG_PostNL::Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.,Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.
576
  TIG_PostNL::Maximum number of attempts,Maximum number of attempts
577
  "TIG_PostNL::After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.","After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts."
578
- ,
579
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.,Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.
580
  TIG_PostNL::Please enter a postcode and housenumber.,Please enter a postcode and housenumber.
581
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.,Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.
@@ -613,7 +588,6 @@ TIG_PostNL::Sa,Sa
613
  TIG_PostNL::in,in
614
  TIG_PostNL::Business Hours,Business Hours
615
  TIG_PostNL::Closed,Closed
616
- ,
617
  TIG_PostNL::Delivery,Delivery
618
  TIG_PostNL::or Pickup,or Pickup
619
  TIG_PostNL::More Info,More Info
@@ -633,9 +607,7 @@ TIG_PostNL::Evening pickup available,Evening pickup available
633
  TIG_PostNL::Or pick your own delivery moment,Or pick your own delivery moment
634
  TIG_PostNL::Connection timeout duration,Connection timeout duration
635
  TIG_PostNL::After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.,After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.
636
- ,
637
  TIG_PostNL::Show PostNL Checkout exclusively to MijnPakket users,Show PostNL Checkout exclusively to MijnPakket users
638
- ,
639
  TIG_PostNL::Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.,Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.
640
  TIG_PostNL::Delivery Options,Delivery Options
641
  "TIG_PostNL::Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning.","Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning."
@@ -649,7 +621,7 @@ TIG_PostNL::Shipment days and timing,Shipment days and timing
649
  TIG_PostNL::Shipping duration,Shipping duration
650
  TIG_PostNL::The number of days shipping will take after a customer finishes their order.,The number of days shipping will take after a customer finishes their order.
651
  TIG_PostNL::Order cut-off time,Order cut-off time
652
- "TIG_PostNL::When an order is placed after this time, another day will be added to the shipping duration.","When an order is placed after this time, another day will be added to the shipping duration."
653
  TIG_PostNL::Allow weekend sorting,Allow weekend sorting
654
  "TIG_PostNL::Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday.","Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday."
655
  TIG_PostNL::Please ask your PostNL account manager if this service is available for your webshop.,Please ask your PostNL account manager if this service is available for your webshop.
@@ -659,21 +631,16 @@ TIG_PostNL::Delivery options on the checkout page,Delivery options on the checko
659
  TIG_PostNL::Enable timeframes,Enable timeframes
660
  TIG_PostNL::Enable timeframes to show the expected delivery times for each delivery day.,Enable timeframes to show the expected delivery times for each delivery day.
661
  TIG_PostNL::Enable evening delivery,Enable evening delivery
662
- ,
663
  TIG_PostNL::Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.,Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.
664
  TIG_PostNL::Evening timeframe fee,Evening timeframe fee
665
  TIG_PostNL::Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.,Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.
666
- ,
667
  TIG_PostNL::Enable post office locations,Enable post office locations
668
  TIG_PostNL::Whether or not customers may choose to have their order delivered to a nearby post office.,Whether or not customers may choose to have their order delivered to a nearby post office.
669
  TIG_PostNL::Enable early delivery locations,Enable early delivery locations
670
- ,
671
  TIG_PostNL::Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments. ,Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments.
672
  TIG_PostNL::Early delivery fee,Early delivery fee
673
  TIG_PostNL::Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.,Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.
674
- ,
675
  TIG_PostNL::Enable package dispenser locations,Enable package dispenser locations
676
- ,
677
  TIG_PostNL::Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size. ,Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size.
678
  TIG_PostNL::Allow Google Streetview,Allow Google Streetview
679
  "TIG_PostNL::If enabled, users may use Google Streetview when choosing a post office location.","If enabled, users may use Google Streetview when choosing a post office location."
@@ -708,7 +675,7 @@ TIG_PostNL::Confirmation Expired,Confirmation Expired
708
  "TIG_PostNL::Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required.","Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required."
709
  TIG_PostNL::Invalid type supplied: %s,Invalid type supplied: %s
710
  TIG_PostNL::Invalid extra costs supplied: %s Extra costs must be supplied as a float.,Invalid extra costs supplied: %s Extra costs must be supplied as a float.
711
- "TIG_PostNL::Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number, phonenumber and zipcode.","Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number, phonenumber and zipcode."
712
  TIG_PostNL::Invalid arguments supplied. The 'costs' parameter is required.,Invalid arguments supplied. The 'costs' parameter is required.
713
  TIG_PostNL::Please enter a valid Dutch mobile phone number using only digits.,Please enter a valid Dutch mobile phone number using only digits.
714
  TIG_PostNL::Phone number for Package Dispenser service,Phone number for Package Dispenser service
@@ -811,7 +778,6 @@ TIG_PostNL::Enable MijnPakket login,Enable MijnPakket login
811
  "TIG_PostNL::You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked.","You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked."
812
  TIG_PostNL::Maximum number of delivery days,Maximum number of delivery days
813
  TIG_PostNL::Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.,Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.
814
- ,
815
  TIG_PostNL::Post Office Address,Post Office Address
816
  TIG_PostNL::Choose printing start position,Choose printing start position
817
  TIG_PostNL::When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.,When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.
@@ -930,7 +896,7 @@ TIG_PostNL::Comment text,Comment text
930
  TIG_PostNL::Show shipping label,Show shipping label
931
  "TIG_PostNL::If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page.","If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page."
932
  TIG_PostNL::Pre-configured message,Pre-configured message
933
- TIG_PostNL::Last shipment comment,Last shipment comment
934
  TIG_PostNL::None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.,None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.
935
  TIG_PostNL::Print packing slips,Print packing slips
936
  Download PostNL log files,Download PostNL log files
@@ -957,7 +923,6 @@ TIG_PostNL::Fee label,Fee label
957
  "TIG_PostNL::<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>","<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>"
958
  TIG_PostNL::Send date,Send date
959
  TIG_PostNL::Optional order grid columns,Optional order grid columns
960
- ,
961
  TIG_PostNL::Selecting too many columns may cause the order grid to no longer fit on your monitor.,Selecting too many columns may cause the order grid to no longer fit on your monitor.
962
  TIG_PostNL::Delivery option,Delivery option
963
  TIG_PostNL::Requested delivery date,Requested delivery date
@@ -980,10 +945,8 @@ TIG_PostNL::Show letter box parcel option in order grid,Show letter box parcel o
980
  TIG_PostNL::This will add the option to mark shipments as being letter box parcels when creating shipments from the order grid.,This will add the option to mark shipments as being letter box parcels when creating shipments from the order grid.
981
  TIG_PostNL::Calculation mode,Calculation mode
982
  TIG_PostNL::You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.,You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.
983
- ,
984
  TIG_PostNL::Use letter box parcels,Use letter box parcels
985
  TIG_PostNL::If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.,If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.
986
- ,
987
  TIG_PostNL::Manual,Manual
988
  TIG_PostNL::Automatic,Automatic
989
  TIG_PostNL::This shipment will probably fit as a letter box parcel.,This shipment will probably fit as a letter box parcel.
@@ -1173,7 +1136,7 @@ TIG_PostNL::PostNL delivery options are only available for Magento's One Page Ch
1173
  TIG_PostNL::Specify checkout extension,Specify checkout extension
1174
  TIG_PostNL::Checkout Settings,Checkout Settings
1175
  TIG_PostNL::As soon as possible,As soon as possible
1176
- TIG_PostNL::The previous has been saved successfully!,The previous has been saved successfully!
1177
  TIG_PostNL::These settings are only available on the 'global' and 'website' scopes.,These settings are only available on the 'global' and 'website' scopes.
1178
  TIG_PostNL::Extension registration is only available on the 'global' scope.,Extension registration is only available on the 'global' scope.
1179
  TIG_PostNL::Frequently asked questions.,Frequently asked questions.
@@ -1193,6 +1156,79 @@ TIG_PostNL::Return address,Return address
1193
  TIG_PostNL::PostNL account credentials,PostNL account credentials
1194
  "TIG_PostNL::You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>.","You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>."
1195
  "TIG_PostNL::You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1196
  TIG_PostNL::Direct Debit,Direct Debit
1197
  TIG_PostNL::Creditcard,Creditcard
1198
- TIG_PostNL::Giftcard,Giftcard
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  TIG_PostNL::Show product options in order grid,Show product options in order grid
60
  TIG_PostNL::Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.,Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.
61
  TIG_PostNL::Optional shipment grid columns,Optional shipment grid columns
 
62
  TIG_PostNL::Select a default option for the shipment grid mass action.,Select a default option for the shipment grid mass action.
63
  TIG_PostNL::You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.,You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.
64
  TIG_PostNL::Automatically send track & trace email to customer,Automatically send track & trace email to customer
88
  TIG_PostNL::Postcode,Postcode
89
  TIG_PostNL::City,City
90
  TIG_PostNL::Region,Region
91
+ TIG_PostNL::Use only the primary sender address,Use only the primary sender address
 
92
  TIG_PostNL::Product Options,Product Options
93
  TIG_PostNL::Select selectable option,Select selectable option
 
94
  TIG_PostNL::Default shipping option,Default shipping option
95
  TIG_PostNL::This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.,This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.
96
  TIG_PostNL::Use an alternative default option,Use an alternative default option
108
  "TIG_PostNL::If you do not own a customs certificate, leave this field empty.","If you do not own a customs certificate, leave this field empty."
109
  TIG_PostNL::Product attributes,Product attributes
110
  TIG_PostNL::Use HS Tariff,Use HS Tariff
 
111
  TIG_PostNL::HS Tariff attribute,HS Tariff attribute
 
112
  TIG_PostNL::Customs value attribute,Customs value attribute
 
113
  TIG_PostNL::Country of origin attribute,Country of origin attribute
 
114
  TIG_PostNL::Product description attribute,Product description attribute
 
115
  TIG_PostNL::Product sorting,Product sorting
116
  TIG_PostNL::Product sorting attribute,Product sorting attribute
117
  TIG_PostNL::Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.,Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.
119
  TIG_PostNL::PostNL Checkout Settings,PostNL Checkout Settings
120
  TIG_PostNL::Enable PostNL Checkout,Enable PostNL Checkout
121
  TIG_PostNL::Mode,Mode
 
122
  TIG_PostNL::Enable PostNL Checkout for orders under 2 kg,Enable PostNL Checkout for orders under 2 kg
123
  TIG_PostNL::Enable PostNL Checkout for orders containing out of stock products,Enable PostNL Checkout for orders containing out of stock products
124
  TIG_PostNL::PostNL Checkout settings,PostNL Checkout settings
125
  TIG_PostNL::Show order summary page,Show order summary page
126
  TIG_PostNL::Whether or not to show the customer a final order summary page before finalizing the order.,Whether or not to show the customer a final order summary page before finalizing the order.
127
  TIG_PostNL::Newsletter subscription,Newsletter subscription
 
128
  TIG_PostNL::Remark,Remark
129
  TIG_PostNL::Whether or not the customer can leave a remark.,Whether or not the customer can leave a remark.
130
  TIG_PostNL::Use mobile phonenumber,Use mobile phonenumber
 
131
  TIG_PostNL::Use date of birth,Use date of birth
132
  TIG_PostNL::Whether or not the customer's date of birth will be returned by PostNL if available.,Whether or not the customer's date of birth will be returned by PostNL if available.
133
  TIG_PostNL::Allow post office locations,Allow post office locations
134
  TIG_PostNL::Whether or not the customer may choose a retail location as their delivery address.,Whether or not the customer may choose a retail location as their delivery address.
135
  TIG_PostNL::Allow foreign addresses,Allow foreign addresses
 
136
  TIG_PostNL::Allow price overview,Allow price overview
 
137
  TIG_PostNL::Terms and conditions,Terms and conditions
 
138
  TIG_PostNL::Contact settings,Contact settings
139
  TIG_PostNL::Contact URL,Contact URL
140
  TIG_PostNL::URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.,URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.
397
  TIG_PostNL::Invalid ConfirmOrder response: %s,Invalid ConfirmOrder response: %s
398
  TIG_PostNL::Invalid reference type requested: %s,Invalid reference type requested: %s
399
  TIG_PostNL::Invalid object specified: %s,Invalid object specified: %s
 
400
  TIG_PostNL::Number of Parcels,Number of Parcels
401
  "TIG_PostNL::You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. ","You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. "
 
402
  "TIG_PostNL::If you are unsure which options to select, ask your PostNL account manager.","If you are unsure which options to select, ask your PostNL account manager."
403
  "TIG_PostNL::We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead.","We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead."
 
404
  TIG_PostNL::The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.,The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.
405
  TIG_PostNL::Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.,Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.
406
  TIG_PostNL::All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.,All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.
427
  "TIG_PostNL::Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure.","Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure."
428
  TIG_PostNL::The quote's total weight is below the miniumum required to use PostNL Checkout.,The quote's total weight is below the miniumum required to use PostNL Checkout.
429
  TIG_PostNL::One or more items in the cart are out of stock.,One or more items in the cart are out of stock.
 
430
  TIG_PostNL::Shipping event history,Shipping event history
431
  TIG_PostNL::PostNL version %s,PostNL version %s
432
  TIG_PostNL::Status Code,Status Code
515
  "TIG_PostNL::If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'.","If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'."
516
  TIG_PostNL::You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.,You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.
517
  TIG_PostNL::You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.,You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.
 
518
  TIG_PostNL::Account settings have been succesfully validated. Please save this page to keep these settings.,Account settings have been succesfully validated. Please save this page to keep these settings.
519
  TIG_PostNL::One or more fields are missing. Please fill these fields and try again.,One or more fields are missing. Please fill these fields and try again.
520
  "TIG_PostNL::Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.","Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL."
535
  TIG_PostNL::Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.,Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.
536
  TIG_PostNL::Automatically confirm exported shipments,Automatically confirm exported shipments
537
  "TIG_PostNL::This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare.","This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare."
 
538
  TIG_PostNL::Contract reference number,Contract reference number
539
  TIG_PostNL::Contract name,Contract name
540
  TIG_PostNL::Sender address reference number,Sender address reference number
541
  TIG_PostNL::Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.,Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.
542
  TIG_PostNL::Product option,Product option
543
  TIG_PostNL::Use postcode check,Use postcode check
 
544
  TIG_PostNL::Automatically complete Dutch addresses after your customer fills in his postcode and house number.,Automatically complete Dutch addresses after your customer fills in his postcode and house number.
545
  TIG_PostNL::Use postcode check on checkout page,Use postcode check on checkout page
 
 
546
  TIG_PostNL::Use postcode check in customer's address book,Use postcode check in customer's address book
 
547
  TIG_PostNL::Shipping Product,Shipping Product
548
  TIG_PostNL::Delivery Date,Delivery Date
549
  TIG_PostNL::Customize this grid.,Customize this grid.
551
  TIG_PostNL::Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.,Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.
552
  TIG_PostNL::Maximum number of attempts,Maximum number of attempts
553
  "TIG_PostNL::After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.","After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts."
 
554
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.,Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.
555
  TIG_PostNL::Please enter a postcode and housenumber.,Please enter a postcode and housenumber.
556
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.,Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.
588
  TIG_PostNL::in,in
589
  TIG_PostNL::Business Hours,Business Hours
590
  TIG_PostNL::Closed,Closed
 
591
  TIG_PostNL::Delivery,Delivery
592
  TIG_PostNL::or Pickup,or Pickup
593
  TIG_PostNL::More Info,More Info
607
  TIG_PostNL::Or pick your own delivery moment,Or pick your own delivery moment
608
  TIG_PostNL::Connection timeout duration,Connection timeout duration
609
  TIG_PostNL::After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.,After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.
 
610
  TIG_PostNL::Show PostNL Checkout exclusively to MijnPakket users,Show PostNL Checkout exclusively to MijnPakket users
 
611
  TIG_PostNL::Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.,Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.
612
  TIG_PostNL::Delivery Options,Delivery Options
613
  "TIG_PostNL::Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning.","Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning."
621
  TIG_PostNL::Shipping duration,Shipping duration
622
  TIG_PostNL::The number of days shipping will take after a customer finishes their order.,The number of days shipping will take after a customer finishes their order.
623
  TIG_PostNL::Order cut-off time,Order cut-off time
624
+ "TIG_PostNL::When an order is placed after this time, another day will be added to the shipping duration. Please enter this time in the %s time zone.","When an order is placed after this time, another day will be added to the shipping duration. Please enter this time in the %s time zone."
625
  TIG_PostNL::Allow weekend sorting,Allow weekend sorting
626
  "TIG_PostNL::Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday.","Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday."
627
  TIG_PostNL::Please ask your PostNL account manager if this service is available for your webshop.,Please ask your PostNL account manager if this service is available for your webshop.
631
  TIG_PostNL::Enable timeframes,Enable timeframes
632
  TIG_PostNL::Enable timeframes to show the expected delivery times for each delivery day.,Enable timeframes to show the expected delivery times for each delivery day.
633
  TIG_PostNL::Enable evening delivery,Enable evening delivery
 
634
  TIG_PostNL::Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.,Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.
635
  TIG_PostNL::Evening timeframe fee,Evening timeframe fee
636
  TIG_PostNL::Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.,Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.
 
637
  TIG_PostNL::Enable post office locations,Enable post office locations
638
  TIG_PostNL::Whether or not customers may choose to have their order delivered to a nearby post office.,Whether or not customers may choose to have their order delivered to a nearby post office.
639
  TIG_PostNL::Enable early delivery locations,Enable early delivery locations
 
640
  TIG_PostNL::Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments. ,Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments.
641
  TIG_PostNL::Early delivery fee,Early delivery fee
642
  TIG_PostNL::Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.,Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.
 
643
  TIG_PostNL::Enable package dispenser locations,Enable package dispenser locations
 
644
  TIG_PostNL::Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size. ,Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size.
645
  TIG_PostNL::Allow Google Streetview,Allow Google Streetview
646
  "TIG_PostNL::If enabled, users may use Google Streetview when choosing a post office location.","If enabled, users may use Google Streetview when choosing a post office location."
675
  "TIG_PostNL::Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required.","Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required."
676
  TIG_PostNL::Invalid type supplied: %s,Invalid type supplied: %s
677
  TIG_PostNL::Invalid extra costs supplied: %s Extra costs must be supplied as a float.,Invalid extra costs supplied: %s Extra costs must be supplied as a float.
678
+ "TIG_PostNL::Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number and zipcode.","Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number and zipcode."
679
  TIG_PostNL::Invalid arguments supplied. The 'costs' parameter is required.,Invalid arguments supplied. The 'costs' parameter is required.
680
  TIG_PostNL::Please enter a valid Dutch mobile phone number using only digits.,Please enter a valid Dutch mobile phone number using only digits.
681
  TIG_PostNL::Phone number for Package Dispenser service,Phone number for Package Dispenser service
778
  "TIG_PostNL::You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked.","You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked."
779
  TIG_PostNL::Maximum number of delivery days,Maximum number of delivery days
780
  TIG_PostNL::Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.,Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.
 
781
  TIG_PostNL::Post Office Address,Post Office Address
782
  TIG_PostNL::Choose printing start position,Choose printing start position
783
  TIG_PostNL::When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.,When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.
896
  TIG_PostNL::Show shipping label,Show shipping label
897
  "TIG_PostNL::If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page.","If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page."
898
  TIG_PostNL::Pre-configured message,Pre-configured message
899
+ TIG_PostNL::Last shipment comment (as shown on the shipment detail page),Last shipment comment (as shown on the shipment detail page)
900
  TIG_PostNL::None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.,None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.
901
  TIG_PostNL::Print packing slips,Print packing slips
902
  Download PostNL log files,Download PostNL log files
923
  "TIG_PostNL::<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>","<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>"
924
  TIG_PostNL::Send date,Send date
925
  TIG_PostNL::Optional order grid columns,Optional order grid columns
 
926
  TIG_PostNL::Selecting too many columns may cause the order grid to no longer fit on your monitor.,Selecting too many columns may cause the order grid to no longer fit on your monitor.
927
  TIG_PostNL::Delivery option,Delivery option
928
  TIG_PostNL::Requested delivery date,Requested delivery date
945
  TIG_PostNL::This will add the option to mark shipments as being letter box parcels when creating shipments from the order grid.,This will add the option to mark shipments as being letter box parcels when creating shipments from the order grid.
946
  TIG_PostNL::Calculation mode,Calculation mode
947
  TIG_PostNL::You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.,You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.
 
948
  TIG_PostNL::Use letter box parcels,Use letter box parcels
949
  TIG_PostNL::If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.,If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.
 
950
  TIG_PostNL::Manual,Manual
951
  TIG_PostNL::Automatic,Automatic
952
  TIG_PostNL::This shipment will probably fit as a letter box parcel.,This shipment will probably fit as a letter box parcel.
1136
  TIG_PostNL::Specify checkout extension,Specify checkout extension
1137
  TIG_PostNL::Checkout Settings,Checkout Settings
1138
  TIG_PostNL::As soon as possible,As soon as possible
1139
+ TIG_PostNL::The previous step has been saved successfully!,The previous step has been saved successfully!
1140
  TIG_PostNL::These settings are only available on the 'global' and 'website' scopes.,These settings are only available on the 'global' and 'website' scopes.
1141
  TIG_PostNL::Extension registration is only available on the 'global' scope.,Extension registration is only available on the 'global' scope.
1142
  TIG_PostNL::Frequently asked questions.,Frequently asked questions.
1156
  TIG_PostNL::PostNL account credentials,PostNL account credentials
1157
  "TIG_PostNL::You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>.","You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>."
1158
  "TIG_PostNL::You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>."
1159
+ TIG_PostNL::PostNL - Print Return Label,PostNL - Print Return Label
1160
+ TIG_PostNL::Unable to retrieve return labels for this shipment.,Unable to retrieve return labels for this shipment.
1161
+ TIG_PostNL::The generateReturnBarcode action is currently unavailable.,The generateReturnBarcode action is currently unavailable.
1162
+ TIG_PostNL::Print Return Label,Print Return Label
1163
+ TIG_PostNL::Activate returns,Activate returns
1164
+ TIG_PostNL::Print the return label along with regular shipping labels,Print the return label along with regular shipping labels
1165
+ TIG_PostNL::Activate this option to ship the order and returnlabel together.,Activate this option to ship the order and returnlabel together.
1166
+ TIG_PostNL::Allow customers to print the return label from the webshop,Allow customers to print the return label from the webshop
1167
+ TIG_PostNL::This will add a button to the customer's account to print the return label for this shipment.,This will add a button to the customer's account to print the return label for this shipment.
1168
+ TIG_PostNL::Allow guests to print the return labels,Allow guests to print the return labels
1169
+ TIG_PostNL::This will add a button to the sales/guest/shipment page so that guests can print a return label for this shipment.,This will add a button to the sales/guest/shipment page so that guests can print a return label for this shipment.
1170
+ TIG_PostNL::Freepost number,Freepost number
1171
+ TIG_PostNL::These settings are only available on the 'global' scope.,These settings are only available on the 'global' scope.
1172
+ TIG_PostNL::Return Settings,Return Settings
1173
+ TIG_PostNL::Returns,Returns
1174
+ TIG_PostNL::Return labels instructions block,Return labels instructions block
1175
+ TIG_PostNL::Please select a static block that contains instructions for customers on how to use the return labels.,Please select a static block that contains instructions for customers on how to use the return labels.
1176
+ TIG_PostNL::Alternative sender address,Alternative sender address
1177
+ TIG_PostNL::Print return label,Print return label
1178
+ TIG_PostNL::An error occurred while retrieving the return labels. Please try again.,An error occurred while retrieving the return labels. Please try again.
1179
+ TIG_PostNL::A freepost number is a requisite for using return labels.,A freepost number is a requisite for using return labels.
1180
  TIG_PostNL::Direct Debit,Direct Debit
1181
  TIG_PostNL::Creditcard,Creditcard
1182
+ TIG_PostNL::Giftcard,Giftcard
1183
+ TIG_PostNL::The shipment's parcel count has been changed succesfully.,The shipment's parcel count has been changed succesfully.
1184
+ TIG_PostNL::The changeParcelCount action is currently unavailable.,The changeParcelCount action is currently unavailable.
1185
+ TIG_PostNL::Expected delivery time,Expected delivery time
1186
+ TIG_PostNL::Requested delivery time,Requested delivery time
1187
+ TIG_PostNL::Post office address:,Post office address:
1188
+ TIG_PostNL::Return Phase,Return Phase
1189
+ TIG_PostNL::Return Labels Printed,Return Labels Printed
1190
+ TIG_PostNL::PostNL Returns,PostNL Returns
1191
+ TIG_PostNL::Return shipment,Return shipment
1192
+ TIG_PostNL::Update shipping status,Update shipping status
1193
+ TIG_PostNL::PostNL - Update shipping status,PostNL - Update shipping status
1194
+ TIG_PostNL::The shipping status has been updated successfully.,The shipping status has been updated successfully.
1195
+ "TIG_PostNL::The shipping status of shipment #%s cannot be updated, because it has not yet been confirmed.","The shipping status of shipment #%s cannot be updated, because it has not yet been confirmed."
1196
+ TIG_PostNL::The shipping status of shipment #%s cannot be updated.,The shipping status of shipment #%s cannot be updated.
1197
+ TIG_PostNL::Print packing slips & confirm shipment,Print packing slips & confirm shipment
1198
+ TIG_PostNL::PostNL - Print packing slips & confirm shipment,PostNL - Print packing slips & confirm shipment
1199
+ TIG_PostNL::This step has been saved successfully!,This step has been saved successfully!
1200
+ TIG_PostNL::The actual delivery time may have changed. Please check MijnPakket for the most up to date delivery time estimate.,The actual delivery time may have changed. Please check MijnPakket for the most up to date delivery time estimate.
1201
+ TIG_PostNL::Shipping status,Shipping status
1202
+ TIG_PostNL::Unable to save return_status cron expression: %s,Unable to save return_status cron expression: %s
1203
+ TIG_PostNL::Unable to save update_date_time_zone cron expression: %s,Unable to save update_date_time_zone cron expression: %s
1204
+ TIG_PostNL::Unable to send track and trace email for shipment #%s.,Unable to send track and trace email for shipment #%s.
1205
+ TIG_PostNL::The sendReturnLabelEmail action is currently unavailable.,The sendReturnLabelEmail action is currently unavailable.
1206
+ TIG_PostNL::Unable to send return email for shipment #%s.,Unable to send return email for shipment #%s.
1207
+ TIG_PostNL::PostNL return label email has been sent.,PostNL return label email has been sent.
1208
+ TIG_PostNL::PostNL return label email has been sent for shipment #%s.,PostNL return label email has been sent for shipment #%s.
1209
+ TIG_PostNL::Unable to send return label email due to missing shipment parameters.,Unable to send return label email due to missing shipment parameters.
1210
+ TIG_PostNL::You can send the customer an email with the return label attached as a pdf. Please select which transactional email template you would like to use for this email.,You can send the customer an email with the return label attached as a pdf. Please select which transactional email template you would like to use for this email.
1211
+ Send Return Label Email,Send Return Label Email
1212
+ Print Return Label,Print Return Label
1213
+ TIG_PostNL::PostNL - Send Return Label Email,PostNL - Send Return Label Email
1214
+ TIG_PostNL::The return label email was sent.,The return label email was sent.
1215
+ TIG_PostNL::Return label email template,Return label email template
1216
+ PostNL Return Label Email,PostNL Return Label Email
1217
+ "TIG_PostNL::The installed version of PHP is too low. The installed PHP version is %s, the minimum required PHP version is %s.","The installed version of PHP is too low. The installed PHP version is %s, the minimum required PHP version is %s."
1218
+ TIG_PostNL::Invalid settings provided.,Invalid settings provided.
1219
+ TIG_PostNL::Invalid config value provided.,Invalid config value provided.
1220
+ TIG_PostNL::Invalid updateConfigSettings response: %s,Invalid updateConfigSettings response: %s
1221
+ TIG_PostNL::The PostNL extension has detected some issues with the PostNL extension's data integrity.,The PostNL extension has detected some issues with the PostNL extension's data integrity.
1222
+ TIG_PostNL::Order IDs do not match.,Order IDs do not match.
1223
+ TIG_PostNL::Quote IDs do not match.,Quote IDs do not match.
1224
+ TIG_PostNL::Missing Magento shipment.,Missing Magento shipment.
1225
+ TIG_PostNL::Missing Magento quote.,Missing Magento quote.
1226
+ TIG_PostNL::Missing Magento order.,Missing Magento order.
1227
+ TIG_PostNL::Sunday,Sunday
1228
+ TIG_PostNL::Sunday cut-off time,Sunday cut-off time
1229
+ "TIG_PostNL::You can apply for a freepost number on <a href=""http://www.postnl.nl/zakelijke-oplossingen/ontvangen/antwoordnummer/?searchResult=position1"" target=""_blank"" title=""Request a freepost number."">this</a> page.","You can apply for a freepost number on <a href=""http://www.postnl.nl/zakelijke-oplossingen/ontvangen/antwoordnummer/?searchResult=position1"" target=""_blank"" title=""Request a freepost number."">this</a> page."
1230
+ TIG_PostNL::parcel dispenser,parcel dispenser
1231
+ TIG_PostNL::Select this checkbox to only show parcel dispensers.,Select this checkbox to only show parcel dispensers.
1232
+ TIG_PostNL::Choose date,Choose date
1233
+ "TIG_PostNL::You are currently using fewer than 2 address lines. In order to guarantee proper address processing, the PostNL extension requires at least 2 address lines. You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","You are currently using fewer than 2 address lines. In order to guarantee proper address processing, the PostNL extension requires at least 2 address lines. You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>."
1234
+ TIG_PostNL::Hide this warning.,Hide this warning.
app/locale/en_US/template/email/TIG/PostNL/return_label.html ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject PostNL - return label for your shipment {{var shipment.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "var barcode":"Barcode",
7
+ "var barcode_url":"Barcode URL",
8
+ "var return_barcode":"Return Barcode",
9
+ "var return_barcode_url":"Return Barcode URL",
10
+ "store url=\"customer/account/\"":"Customer Account Url",
11
+ "var shipment.increment_id":"Shipment Id"}
12
+ @-->
13
+
14
+ <body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; margin:0; padding:0;">
15
+ <div style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; margin:0; padding:0;">
16
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
17
+ <tr>
18
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
19
+ <!-- [ header starts here] -->
20
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="470">
21
+ <tr>
22
+ <td valign="top">
23
+ <a href='{{store url=""}}' style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/></a>
24
+ <img src='{{skin url="images/TIG/PostNL/postnl_email_logo.png" _area="frontend"}}' alt="PostNL" border="0" style="float:right"/>
25
+ </td>
26
+ </tr>
27
+ <!-- [ middle starts here] -->
28
+ <tr>
29
+ <td valign="top">
30
+ <p style="font-size:11px; font-weight:normal; line-height:1.5em; margin:0 0 11px 0;">Dear Sir, Madam {{htmlescape var=$customer_name}},</p>
31
+ <p style="font-size:11px; line-height:1.5em; margin:0 0 8px 0;">Enclosed you will find a PostNL return label with which you may return your order to {{var store.getFrontendName()}}.</p>
32
+ <p style="font-size:11px; line-height:1.5em; margin:0;">Please make sure the product is securely packaged. You can then attach the label to the top of the parcel. Please make sure the barcode is clearly visible.<p>
33
+ <p style="font-size:11px; line-height:1.5em; margin:0;">To track the progress of your return shipment click <a href="{{var return_barcode_url}}" target="_blank">here</a>.<p>
34
+ <p style="font-size:11px; line-height:1.5em; margin:0;">Kind Regards,</p>
35
+ <p style="font-size:11px; line-height:1.5em; margin:0;">{{var store.getFrontendName()}}</p>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+ </td>
40
+ </tr>
41
+ </table>
42
+ </div>
43
+ </body>
app/locale/nl_NL/TIG_PostNL.csv CHANGED
@@ -30,7 +30,7 @@ TIG_PostNL::Customer Number,Klantnummer
30
  TIG_PostNL::Customer Code,Klantcode
31
  "TIG_PostNL::Your customer code as supplied by PostNL. Must contain between 3 and 4 letters. If you are a contract customer of PostNL, you will have received an email containing this setting. If you cannot find this email, please contact PostNL support at 058-2333343.","Uw klantnummers zoals aangeleverd door PostNL. Moet bestaan uit 3 tot 4 letters. Als u een contractklant bent van PostNL heeft u een e-mail ontvangen met deze informatie. Indien u deze e-mail niet kan vinden, neem dan contact op met PostNL support op 058-2333343."
32
  TIG_PostNL::BLS (location) Code,BLS (locatie) code
33
- "TIG_PostNL::The internal code of the nearest PostNL sorting centre. Must contain 6 numbers. If you are a contract customer of PostNL, you will have received an email containing this setting. If you cannot find this email, please contact PostNL support at 058-2333343","De interne code van het dichtsbijzijnde PostNL sorteer centrum. Moet bestaan uit 6 nummers. Als u een contractklant bent van PostNL heeft u een e-mail ontvangen met deze informatie. Indien u deze e-mail niet kan vinden, neem dan contact op met PostNL support op 058-2333343."
34
  TIG_PostNL::These fields are only required if you intend to send products to countries outside the EU.,Deze velden zijn alleen verplicht als u van plan bent om producten buiten de EU te gaan versturen.
35
  TIG_PostNL::Global Barcode Type,Globaal barcode type
36
  TIG_PostNL::The current global barcode type as supplied by PostNL. Must contain 2 letters.,De huidige barcodetype zoals aangeleverd door PostNL. Moet bestaan uit 2 letters
@@ -59,7 +59,6 @@ TIG_PostNL::From this menu you can add columns containing PostNL specific inform
59
  TIG_PostNL::Show product options in order grid,Toon productopties in het bestellingen overzicht
60
  TIG_PostNL::Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.,Activeer om in het bestellingenoverzicht naast het bulk actie dropdown menu de mogelijkheid tot het selecteren van andere productopties te tonen. Deactiveer om altijd de standaardwaardes te gebruiken.
61
  TIG_PostNL::Optional shipment grid columns,Optionele kolommen voor verzendoverzicht
62
- ,
63
  TIG_PostNL::Select a default option for the shipment grid mass action.,Selecteer een standaardwaarde voor de massa-actie voor het zendingenoverzicht.
64
  TIG_PostNL::You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.,Track & Trace e-mails kunnen automatisch verstuurd worden nadat u een zending heeft voorgemeld. Configureer hier hoe u Track & Trace e-mails verstuurd wil hebben.
65
  TIG_PostNL::Automatically send track & trace email to customer,Stuur de Track & Trace e-mail automatisch naar de klant
@@ -89,11 +88,9 @@ TIG_PostNL::House Nr. Extension,Huisnummer toevoeging
89
  TIG_PostNL::Postcode,Postcode
90
  TIG_PostNL::City,Plaats
91
  TIG_PostNL::Region,Provincie
92
- ,
93
- TIG_PostNL::Use the sender address as the return adress,Gebruik afzenderadres als retouradres
94
  TIG_PostNL::Product Options,Productopties
95
  TIG_PostNL::Select selectable option,Selecteer de beschikbare opties
96
- ,
97
  TIG_PostNL::Default shipping option,Standaard verzendoptie
98
  TIG_PostNL::This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.,Deze instelling kan overschreven worden door handmatig een zending aan te maken. Deze instelling is enkel van toepassing op binnenlandse zendingen.
99
  TIG_PostNL::Use an alternative default option,Gebruik een alternatieve standaard optie
@@ -111,15 +108,10 @@ TIG_PostNL::Customs certificate number,Douane certificaat nummer
111
  "TIG_PostNL::If you do not own a customs certificate, leave this field empty.","Als u geen douane certificaat heeft, laat dit veld dan leeg"
112
  TIG_PostNL::Product attributes,Productattributen
113
  TIG_PostNL::Use HS Tariff,Gebruik het HS tarief
114
- ,
115
  TIG_PostNL::HS Tariff attribute,HS tarief
116
- ,
117
  TIG_PostNL::Customs value attribute,Douane waarde
118
- ,
119
  TIG_PostNL::Country of origin attribute,Land van herkomst
120
- ,
121
  TIG_PostNL::Product description attribute,Productbeschrijving
122
- ,
123
  TIG_PostNL::Product sorting,Productsortering
124
  TIG_PostNL::Product sorting attribute,Product sortering attribuut
125
  TIG_PostNL::Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.,Global shipping labels bevatten maximaal 5 producten. Bepaal met de sortering welke 5 producten getoond worden. Let op: overige producten zullen dus niet zichtbaar zijn op het label.
@@ -127,28 +119,22 @@ TIG_PostNL::Product sorting direction,Product sortering richting
127
  TIG_PostNL::PostNL Checkout Settings,PostNL Checkout Instellingen
128
  TIG_PostNL::Enable PostNL Checkout,Activeer PostNL Checkout
129
  TIG_PostNL::Mode,Modus
130
- ,
131
  TIG_PostNL::Enable PostNL Checkout for orders under 2 kg,Activeer PostNL Checkout voor orders onder de 2 kg
132
  TIG_PostNL::Enable PostNL Checkout for orders containing out of stock products,Activeer PostNL Checkout voor orders die producten bevatten die niet op voorraad zijn.
133
  TIG_PostNL::PostNL Checkout settings,PostNL Checkout instellingen
134
  TIG_PostNL::Show order summary page,Toon de bestelling overzichtspagina.
135
  TIG_PostNL::Whether or not to show the customer a final order summary page before finalizing the order.,De klant wel of geen bestelling overzichtspagina tonen voor de order definitief afgerond wordt.
136
  TIG_PostNL::Newsletter subscription,Aanmelden nieuwsbrief
137
- ,
138
  TIG_PostNL::Remark,Opmerking
139
  TIG_PostNL::Whether or not the customer can leave a remark.,Of de klant wel of geen opmerkingen mag plaatsen
140
  TIG_PostNL::Use mobile phonenumber,Gebruik mobiel nummer
141
- ,
142
  TIG_PostNL::Use date of birth,Gebruik geboortedatum
143
  TIG_PostNL::Whether or not the customer's date of birth will be returned by PostNL if available.,Dit veld bepaalt of de geboortedatum van de klant wordt uitgevraagd in PostNL Checkout.
144
  TIG_PostNL::Allow post office locations,Sta postkantoor locaties toe
145
  TIG_PostNL::Whether or not the customer may choose a retail location as their delivery address.,Mag de klant wel of niet een winkellokatie kiezen als verzendadres
146
  TIG_PostNL::Allow foreign addresses,Sta buitenlande adressen toe
147
- ,
148
  TIG_PostNL::Allow price overview,Sta prijsoverzicht toe
149
- ,
150
  TIG_PostNL::Terms and conditions,Algemene voorwaarden
151
- ,
152
  TIG_PostNL::Contact settings,Contact instellingen
153
  TIG_PostNL::Contact URL,Contact URL
154
  TIG_PostNL::URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.,Pagina van een website waar klanten contactinformatie van uw webshop kunnen vinden. Laat leeg om niet te gebruiken
@@ -156,13 +142,13 @@ TIG_PostNL::Service URL,Service URL
156
  TIG_PostNL::URL of a page where customers can find information regarding the webshop's customer service department. Leave empty to disable this feature.,Pagina van een website waar klanten informatie over de serviceafdeling van uw webshop kunnen vinden. Laat leeg om niet te gebruiken.
157
  TIG_PostNL::PostNL Checkout Payment Settings,PostNL Checkout Betalingsinstellingen
158
  TIG_PostNL::PostNL Checkout is disabled. please enable PostNL Checkout in order to configure these settings.,PostNL Checkout is niet geactiveerd. Activeer PostNL Checkout om deze instellingen te configureren.
159
- TIG_PostNL::Use iDEAL,Gebruik iDEAL
160
- TIG_PostNL::iDEAL payment method,iDEAL betaalmethode
161
- TIG_PostNL::iDeal Bank Field,iDEAL bank
162
  TIG_PostNL::Enter the field name used by the selected payment method for the 'bank' field.,Vul de veldnaam in die de gekozen betaalmethode gebruikt om de bankkeuze te verwerken.
163
- TIG_PostNL::Use creditcard,Gebruik credit card
164
- TIG_PostNL::Creditcard payment method,Credit card betaalmethode
165
- TIG_PostNL::Creditcard card type field,Credit card type
166
  TIG_PostNL::Enter the field name used by the selected payment method for the 'creditcard type' field.,Vul de veldnaam in die de gekozen betaalmethode gebruikt om dekaartkeuze te verwerken.
167
  TIG_PostNL::Use CheckPay,Gebruik CheckPay
168
  TIG_PostNL::CheckPay payment method,CheckPay betaalmethode
@@ -371,7 +357,7 @@ TIG_PostNL::Subtotal,Subtotaal
371
  TIG_PostNL::Return to the shopping cart.,Terug naar winkelmandje.
372
  TIG_PostNL::Confirm Order,Bevestig bestelling
373
  TIG_PostNL::Cancel,Annuleer
374
- TIG_PostNL::Your credit card will be charged for,Uw credit zard wordt belast met
375
  TIG_PostNL::Loading...,Laden…
376
  TIG_PostNL::How does it work?,Hoe werkt het?
377
  TIG_PostNL::An error occurred. Please use our regular checkout instead.,Er is een fout opgetreden. Gebruikt u alstublieft de normale afreken pagina.
@@ -411,13 +397,10 @@ TIG_PostNL::Invalid ReadOrder response: %s,Ongeldig OrderOrder antwoord: %s
411
  TIG_PostNL::Invalid ConfirmOrder response: %s,Ongeldig ConfirmOrder antwoord: %s
412
  TIG_PostNL::Invalid reference type requested: %s,Ongeldige referentie type opgevraagd: %s
413
  TIG_PostNL::Invalid object specified: %s,Ongeldig object gespecificeerd: %s
414
- ,
415
  TIG_PostNL::Number of Parcels,Aantal pakketten
416
  "TIG_PostNL::You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. ","U kunt dit veld bijvoorbeeld gebruiken om een voorvoegsel toe te voegen aan het zending increment ID. Ook kunt u ervoor zorgen dat het voor de klant duidelijk is dat het pakketje van uw webshop komt. U kunt de volgende variabelen gebruiken: {{var shipment_increment_id}}, {{var order_increment_id}} en {{var store_frontend_name}}. De uiteindelijke tekst mag niet meer zijn dan 28 karakters."
417
- ,
418
  "TIG_PostNL::If you are unsure which options to select, ask your PostNL account manager.","Indien u niet zeker weet welke opties voor uw webshop van toepassing zijn, dan kunt u dit vragen aan uw PostNL account manager."
419
  "TIG_PostNL::We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead.","Wij raden aan het gekozen attribuut verplicht te maken. Mocht het zo zijn dat het attribuut leeg is voor een bepaald product, dan zal op het label '000000' getoond worden."
420
- ,
421
  TIG_PostNL::The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.,De 2kg limiet wordt gebaseerd op het gewicht van de producten en de gewichtseenheid die u heeft geselecteerd in de 'voormelden en labels printen' groep.
422
  TIG_PostNL::Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.,Vraag het mobiele nummer uit bij uw klanten. Dit nummer wordt opgeslagen als het normale telefoonnummer van de klant.
423
  TIG_PostNL::All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.,"Alle adressen buiten Nederland worden gezien als buitenlandse adressen. Adressen buiten de EU worden, ongeacht deze instelling, niet toegestaan."
@@ -444,8 +427,7 @@ TIG_PostNL::Invalid confirmShipment response: %s,Ongeldige voormeldbevestigings
444
  "TIG_PostNL::Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure.","Vul s.v.p. de onderstaande velden in om de registratieprocedure af te ronden. Klik <a href=""#"" onclick=""%s"">hier</a> om de registratieprocedure te resetten."
445
  TIG_PostNL::The quote's total weight is below the miniumum required to use PostNL Checkout.,Het totale gewicht van de bestelling is beneden het minimum om gebruik te kunnen maken van PostNL Checkout.
446
  TIG_PostNL::One or more items in the cart are out of stock.,Eén of meer producten in de winkelwagen zijn niet op voorraad.
447
- ,
448
- TIG_PostNL::Shipping event history,Zending status geschiedenis
449
  TIG_PostNL::PostNL version %s,PostNL versie %s
450
  TIG_PostNL::Status Code,Status Code
451
  TIG_PostNL::Description,Beschrijving
@@ -535,7 +517,6 @@ TIG_PostNL::Use PostNL Checkout and Mijnpakket login,Gebruik PostNL Checkout en
535
  "TIG_PostNL::If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'.",Indien u gebruik wilt maken van PostNL Checkout of Mijnpakket login moet u deze instelling op 'ja' zetten.
536
  TIG_PostNL::You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.,U heeft GlobalPack niet geactiveerd. Activeer GlobalPack onder 'Account Instellingen' om uw GlobalPack voorkeuren te configureren.
537
  TIG_PostNL::You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.,U heeft PostNL Checkout niet geactiveerd. Activeer PostNL Checkout onder 'Account Instellingen' om uw PostNL Checkout voorkeuren te configureren.
538
- ,
539
  TIG_PostNL::Account settings have been succesfully validated. Please save this page to keep these settings.,De account instellingen zijn succesvol gevalideerd. Sla deze pagina op om deze instellingen te bewaren.
540
  TIG_PostNL::One or more fields are missing. Please fill these fields and try again.,Eén of meerdere velden zijn niet ingevuld. Vul deze velden a.u.b. alsnog in en probeer het dan nog eens.
541
  "TIG_PostNL::Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.","De account instellingen zijn incorrect. Controleer alle velden a.u.b. zorgvuldig en probeer het dan nog eens. Als deze melding zich blijft voordoen, kunt u het beste contact opnemen met PostNL."
@@ -556,20 +537,15 @@ TIG_PostNL::Enable Parcelware export,Activeer Parcelware export
556
  TIG_PostNL::Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.,Parcelware export is gedeactiveerd. Activeer Parcelware export om deze instellingen te kunnen aanpassen. Houd er rekening mee dat Parcelware export enkel vanuit op globaal niveau kunt activeren.
557
  TIG_PostNL::Automatically confirm exported shipments,Geëxporteerde zendingen automatisch voormelden
558
  "TIG_PostNL::This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare.","Deze instelling meldt de producten niet daadwerkelijk voor, maar zorgt enkel dat ze deze status in Magento krijgen. Dit voorkomt dat u de orders dubbel voormeldt in Magento en Parcelware."
559
- ,
560
  TIG_PostNL::Contract reference number,Contract referentie nummer
561
  TIG_PostNL::Contract name,Contract naam
562
  TIG_PostNL::Sender address reference number,Afzender adres referentie nummer
563
  TIG_PostNL::Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.,"Uw webshop is geregisteerd. Binnen enkele minuten ontvangt u een e-mail op het adres dat u heeft opgegeven. Lees deze e-mail s.v.p. zorgvuldig, aangezien deze verdere instructies bevat om de registratieprocedure af te ronden."
564
  TIG_PostNL::Product option,Productoptie
565
- TIG_PostNL::Use postcode check,Gebruik postode check
566
- ,
567
  TIG_PostNL::Automatically complete Dutch addresses after your customer fills in his postcode and house number.,Nederlandse adressen worden automatisch aangevuld en gecontroleerd als uw klant zijn postcode en huisnummer invult.
568
  TIG_PostNL::Use postcode check on checkout page,Gebruik de postcode check op de afreken pagina
569
- ,
570
- ,
571
  TIG_PostNL::Use postcode check in customer's address book,Gebruik de postcode check in het adresboek van de klant
572
- ,
573
  TIG_PostNL::Shipping Product,Verzendproduct
574
  TIG_PostNL::Delivery Date,Bezorgdatum
575
  TIG_PostNL::Customize this grid.,Pas dit overzicht aan.
@@ -577,7 +553,6 @@ TIG_PostNL::Selecting too many columns may cause the shipment grid to no longer
577
  TIG_PostNL::Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.,Uw PostNL account gegevens konden niet gevalideerd worden. Vul s.v.p. valide PostNL account gegevens in voordat u de postcode check functionaliteit activeert.
578
  TIG_PostNL::Maximum number of attempts,Maximum aantal pogingen
579
  "TIG_PostNL::After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.",Na dit aantal pogingen kan uw klant het adres handmatig invullen. Laat dit veld leeg om een oneindig aantal pogingen toe te staan. Let op: In zeldzame situaties kan het voorkomen dat een correct adres niet gevalideerd kan worden. We raden u daarom aan om altijd een maximaal aantal pogingen in te voeren.
580
- ,
581
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.,Uw postcode/huisnummer combinatie is niet gevonden. Vul s.v.p. handmatig uw straatnaam en woonplaats in.
582
  TIG_PostNL::Please enter a postcode and housenumber.,Vul s.v.p. een postcode en huisnummer in.
583
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.,Uw postcode/huisnummer combinatie is niet gevonden. Controleer s.v.p. of u uw huisnummer en postcode correct ingevuld heeft.
@@ -601,7 +576,7 @@ TIG_PostNL::early delivery,extra vroeg
601
  TIG_PostNL::available,beschikbaar
602
  TIG_PostNL::evening,avond
603
  TIG_PostNL::Post Office,Postkantoor
604
- TIG_PostNL::Package Dispenser,Pakket Automaat
605
  TIG_PostNL::Delivery Options,Bezorgopties
606
  TIG_PostNL::Delivery,Bezorgen
607
  TIG_PostNL::or Pickup,of Ophalen
@@ -615,7 +590,6 @@ TIG_PostNL::Sa,Za
615
  TIG_PostNL::in,te
616
  TIG_PostNL::Business Hours,Openingstijden
617
  TIG_PostNL::Closed,Gesloten
618
- ,
619
  TIG_PostNL::Delivery,Bezorgen
620
  TIG_PostNL::or Pickup,of Ophalen
621
  TIG_PostNL::More Info,Meer informatie
@@ -635,9 +609,7 @@ TIG_PostNL::Evening pickup available,'s Avonds ophalen mogelijk
635
  TIG_PostNL::Or pick your own delivery moment,Of kies zelf uw bezorgmoment
636
  TIG_PostNL::Connection timeout duration,Connectie time-out duur
637
  TIG_PostNL::After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.,Na dit aantal seconden kan uw klant het adres handmatig invullen. Laat dit veld leeg om de functionaliteit uit te schakelen. Let op: als een klant te lang moet wachten verlaat hij wellicht het bestelproces.
638
- ,
639
  TIG_PostNL::Show PostNL Checkout exclusively to MijnPakket users,Toon PostNL Checkout exclusief aan Mijnpakket gebruikers
640
- ,
641
  TIG_PostNL::Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.,Activeer om de PostNL Checkout enkel te tonen aan uw klanten die beschikken over een MijnPakket account. Let op: de bezorgopties moeten geactiveerd zijn.
642
  TIG_PostNL::Delivery Options,Bezorgopties
643
  "TIG_PostNL::Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning.","Met de PostNL bezorgopties kunnen uw klanten kiezen waar, wanneer en hoe zij hun bestelling willen ontvangen. Zo kunnen uw klanten de dag van ontvangst kiezen en wordt er direct aangegeven op welk moment ze het pakket kunnen verwachten. Op dinsdag en donderdag bezorgt PostNL zelfs ‘s avonds. Halen uw klanten het pakket liever af op één van de 2000 PostNL pakketpunten? Dit kan vanaf 16:00 uur en op sommige locaties zelfs vanaf 8:30 uur."
@@ -651,7 +623,7 @@ TIG_PostNL::Shipment days and timing,Aanleverdagen en tijden
651
  TIG_PostNL::Shipping duration,Overkomstduur
652
  TIG_PostNL::The number of days shipping will take after a customer finishes their order.,Het aantal dagen dat de bestelling nodig heeft om bezorgd te worden nadat de bestelling geplaatst is.
653
  TIG_PostNL::Order cut-off time,Bestelling cut-off tijd
654
- "TIG_PostNL::When an order is placed after this time, another day will be added to the shipping duration.","Indien een bestelling na dit tijdstip besteld wordt, zal er een dag bij de overkomstduur opgeteld worden."
655
  TIG_PostNL::Allow weekend sorting,gebruik weekend sortering
656
  "TIG_PostNL::Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday.","Weekend sortering is een speciale dienst van PostNL waarbij PostNL zendingen sorteert gedurende het weekend zodat deze op maandagen bezorgd kunnen worden. Indien u deze instelling activeert, maar weekend sortering niet beschikbaar is voor uw webshop zullen zendingen NIET op maandagen bezorgd worden."
657
  TIG_PostNL::Please ask your PostNL account manager if this service is available for your webshop.,Vraag aan uw PostNL account manager of weekend sortering voor uw webshop beschikbaar is.
@@ -661,21 +633,16 @@ TIG_PostNL::Delivery options on the checkout page,Bezorgopties in eigen checkout
661
  TIG_PostNL::Enable timeframes,Activeer tijdvensters
662
  TIG_PostNL::Enable timeframes to show the expected delivery times for each delivery day.,Activeer tijdsvensters om per dag het verwachte bezorgmoment te tonen.
663
  TIG_PostNL::Enable evening delivery,Activeer avondbezorging
664
- ,
665
  TIG_PostNL::Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.,Activeer avondbezorging voor uw klanten. Avondbezorging is niet in elk gebied mogelijk. De extensie toont deze optie automatisch voor afleveradressen waar avondlevering mogelijk is.
666
  TIG_PostNL::Evening timeframe fee,Avondbezorging toeslag
667
  TIG_PostNL::Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.,"Additionele kosten voor het gebruik van avondbezorging in de basis valuta van de storeview. Deze kosten zullen opgeteld worden bij de verzendkosten. Deze kosten moeten tussen de 0,00 en 2,00 EUR liggen incl. BTW. Laat dit veld leeg om geen extra kosten in rekening te brengen voor het gebruik van avondbezorging."
668
- ,
669
  TIG_PostNL::Enable post office locations,Activeer postkantoor locaties
670
  TIG_PostNL::Whether or not customers may choose to have their order delivered to a nearby post office.,Deze instelling bepaalt of klanten ervoor kunnen kiezen om hun bestelling te laten bezorgen op een postkantoor locatie.
671
  TIG_PostNL::Enable early delivery locations,Activeer extra vroeg postkantoor locaties
672
- ,
673
  TIG_PostNL::Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments. ,Op sommige pakketpunten kunnen uw klanten een pakket na 8:30 ophalen in plaats van na 16:00. De extensie bepaalt automatisch of deze optie beschikbaar is in de regio van uw klant. Deze pakketten kunnen niet meegeleverd worden in de Premium Sortering en zondagsortering.
674
  TIG_PostNL::Early delivery fee,Extra vroege bezorging toeslag
675
  TIG_PostNL::Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.,"Additionele kosten voor het gebruik van extra vroege bezorging in de basis valuta van de storeview. Deze kosten zullen opgeteld worden bij de verzendkosten. Deze kosten moeten tussen de 0,00 en 2,00 EUR liggen incl. BTW. Laat dit veld leeg om geen extra kosten in rekening te brengen voor het gebruik van extra vroege bezorging."
676
- ,
677
  TIG_PostNL::Enable package dispenser locations,Activeer pakketautomaat locaties
678
- ,
679
  TIG_PostNL::Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size. ,Activeer zodat uw klanten bestellingen af kunnen halen bij een pakketautomaat. De extensie bepaalt automatisch of deze optie beschikbaar is in de regio van uw klant. Pakketten die naar een pakketautomaat gestuurd worden moeten voldoen aan bepaalde afmetingen.
680
  TIG_PostNL::Allow Google Streetview,Sta Google Streetview toe
681
  "TIG_PostNL::If enabled, users may use Google Streetview when choosing a post office location.","Indien geactiveerd, kunnen klanten Google Streetview gebruiken wanneer zij een postkantoor zoeken."
@@ -710,7 +677,7 @@ TIG_PostNL::Confirmation Expired,Voormelding Verlopen
710
  "TIG_PostNL::Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required.","Ongeldige parameters opgegeven. Om een geselecteerde bezorgoptie op te slaan zijn een type, een bezorgdatum en optioneel extra kosten verplicht."
711
  TIG_PostNL::Invalid type supplied: %s,Ongeldig type opgegeven: %s
712
  TIG_PostNL::Invalid extra costs supplied: %s Extra costs must be supplied as a float.,Ongeldige extra kosten opgegeven: %s Extra kosten moeten opgegegevn worden als een float waarde.
713
- "TIG_PostNL::Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number, phonenumber and zipcode.","Ongeldig argument opgegeven. Een valide PakjeGemak adres moet minstens een plaatsnaam, een landcode, een straatnaam, een huisnummer, een telefoonnummer en een postcode bevatten."
714
  TIG_PostNL::Invalid arguments supplied. The 'costs' parameter is required.,Ongeldige parameters opgegeven. De 'costs' parameter is verplicht.
715
  TIG_PostNL::Please enter a valid Dutch mobile phone number using only digits.,Vul s.v.p. een correct Nederlands mobiel telefoonnummer in met enkel cijfers.
716
  TIG_PostNL::Phone number for Package Dispenser service,Mobiel telefoonnummer voor pakketautomaat dienst
@@ -813,7 +780,6 @@ TIG_PostNL::Enable MijnPakket login,Activeer MijnPakket login
813
  "TIG_PostNL::You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked.","U kunt deze knop gebruiken om uw account gegevens te valideren zonder de configuratie op te slaan. Dit zal een 'test' verzoek sturen naar PostNL. Indien bovenstaande velden niet correct ingevuld zijn, zal dit resulteren in een foutmelding. De PostNL extensie moet hiervoor actief staan. <br />N.B.: uw webshop ID en publiek webshop ID zullen niet gevalideerd worden. Enkel uw CIF account gegevens worden gecontroleerd."
814
  TIG_PostNL::Maximum number of delivery days,Maximum aantal bezorgdagen
815
  TIG_PostNL::Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.,Geef hier aan hoeveel dagen in te toekomst na het eerste bezorgmoment de klant de bestelling mag ontvangen.
816
- ,
817
  TIG_PostNL::Post Office Address,Postkantoor Adres
818
  TIG_PostNL::Choose printing start position,Kies printer startpositie
819
  TIG_PostNL::When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.,"Wanneer u meerdere labels tegelijk afdrukt, kunt u aangeven waar de printer moet beginnen op de pagina. De printer zal voor alle pagina's na de eerste op positie 1 beginnen."
@@ -932,7 +898,7 @@ TIG_PostNL::Comment text,Opmerking tekst
932
  TIG_PostNL::Show shipping label,Toon verzendlabel
933
  "TIG_PostNL::If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page.","Indien geactiveerd, zal het verzendlabel direct op de pakbon geprint worden, indien mogelijk. Anders zal deze op een losse pagina toegevoegd worden."
934
  TIG_PostNL::Pre-configured message,Voorgeconfigureerd bericht
935
- TIG_PostNL::Last shipment comment,Laatste zending opmerking
936
  TIG_PostNL::None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.,"Geen van de bestellingen die u heeft geselecteerd, bevat een zending. Kies s.v.p. tenminste één bestelling die een zending bevat."
937
  TIG_PostNL::Print packing slips,Print pakbonnen
938
  Download PostNL log files,Download PostNL log bestanden
@@ -959,7 +925,6 @@ TIG_PostNL::Fee label,Toeslag label
959
  "TIG_PostNL::<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>","<p>Als u een toeslag bedrag heeft ingevuld in het veld hieronder, kunt u gebruik maken van de tekst ""%s"" in de titel. Dit zal vervangen worden door het toeslagbedrag in de valuta waarin de klant afrekent.</p><p>Bijvoorbeeld: de toeslag is 17,45 EUR en de titel die u heeft ingevuld is ""PostNL rembours (+%s)"". De titel van de betaalmethode zal dan getoond worden als ""PostNL rembours (+€17,45)"". Indien de klant heeft gekozen om te betalen in USD zal de getoonde titel ""PostNL rembours (+$23.73)"" zijn.</p>"
960
  TIG_PostNL::Send date,Verzenddatum
961
  TIG_PostNL::Optional order grid columns,Optionele kolommen voor besteloverzicht
962
- ,
963
  TIG_PostNL::Selecting too many columns may cause the order grid to no longer fit on your monitor.,"Indien u teveel kolommen selecteert, kan dit er toe leiden dat het overzicht niet langer op uw beeldscherm past."
964
  TIG_PostNL::Delivery option,Gekozen bezorgoptie
965
  TIG_PostNL::Requested delivery date,Gekozen bezorgdag
@@ -983,10 +948,8 @@ TIG_PostNL::This will add the option to mark shipments as being letter box parce
983
  TIG_PostNL::Calculation mode,Berekeningsmodus
984
  TIG_PostNL::You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.,"U kunt de PostNL extensie automatisch laten bepalen of een zending door de brievenbus past of u kunt dit handmatig aangeven wanneer u zendingen aanmaakt. U kunt de PostNL extensie automatisch laten bepalen of een zending door de brievenbus past of u kunt dit handmatig aangeven wanneer u zendingen aanmaakt.
985
  Indien deze instelling op 'automatisch' staat, zal de extensie de 'Gewicht' en 'PostNL Max Hoeveelheid voor Brievenbuspakjes' productattributen gebruiken om te bepalen of een zending door de brievenbus past. U kunt dit altijd overschrijven door zelf aan te geven of een zending een brievenbuspakje is wanneer u handmatig een zending aanmaakt."
986
- ,
987
  TIG_PostNL::Use letter box parcels,Gebruik brievenbuspakjes
988
  TIG_PostNL::If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.,"Indien u deze instelling uit zet, zullen alle zendingen beschouwd worden als reguliere pakketzendingen.<br/>Het is zeer belangrijk dat u alle producten correct geconfigureerd heeft als u gebruik wilt maken van brievenbuspakjes. Bestellingen die meer wegen dan <strong>2kg</strong> of groter zijn dan <strong>38 x 26,5 x 3,2 cm</strong> kunnen niet verstuurd worden als brievenbuspakjes."
989
- ,
990
  TIG_PostNL::Manual,Handmatig
991
  TIG_PostNL::Automatic,Automatisch
992
  TIG_PostNL::This shipment will probably fit as a letter box parcel.,Deze zending past waarschijnlijk door de brievenbus.
@@ -1088,7 +1051,7 @@ To Letter Box Parcel,Naar Pakket
1088
  To Package,Naar Brievenbuspakje
1089
  Change Product Option,Wijzig Productoptie
1090
  TIG_PostNL::Fits through the mailslot,Past door de brievenbus
1091
- TIG_PostNL::Nearest PostNL pickup points,Resultaat van dichtsbijzijnde PostNL ophaalpunten
1092
  TIG_PostNL::Filter,Filter
1093
  TIG_PostNL::Select location,Selecteer locatie
1094
  TIG_PostNL::Show map,Toon kaart
@@ -1176,7 +1139,7 @@ TIG_PostNL::PostNL delivery options are only available for Magento's One Page Ch
1176
  TIG_PostNL::Specify checkout extension,Specificeer checkout extensie
1177
  TIG_PostNL::Checkout Settings,Checkout instellingen
1178
  TIG_PostNL::As soon as possible,Eerst volgende mogelijkheid
1179
- TIG_PostNL::The previous has been saved successfully!,De vorige stap is succesvol opgeslagen!
1180
  TIG_PostNL::These settings are only available on the 'global' and 'website' scopes.,Deze instellingen zijn enkel beschikbaar op de 'globaal' en 'website' niveaus.
1181
  TIG_PostNL::Extension registration is only available on the 'global' scope.,Extensie registratie is enkel beschikbaar op het 'globaal' niveau.
1182
  TIG_PostNL::Frequently asked questions.,Veelgestelde vragen.
@@ -1196,6 +1159,79 @@ TIG_PostNL::Return address,Retouradres
1196
  TIG_PostNL::PostNL account credentials,PostNL accountgegevens
1197
  "TIG_PostNL::You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>.","U kunt <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">hier</a> meer lezen over de wijze waarop de extensie bepaalt of een bestelling een brievenbuspakje is."
1198
  "TIG_PostNL::You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","U kunt <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">hier</a> meer lezen over het instellen van gesplitste adresregels in Magento."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1199
  TIG_PostNL::Direct Debit,Automatische Incasso
1200
- TIG_PostNL::Credit Card,Credit Card
1201
- TIG_PostNL::Giftcard,Cadeaubon
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  TIG_PostNL::Customer Code,Klantcode
31
  "TIG_PostNL::Your customer code as supplied by PostNL. Must contain between 3 and 4 letters. If you are a contract customer of PostNL, you will have received an email containing this setting. If you cannot find this email, please contact PostNL support at 058-2333343.","Uw klantnummers zoals aangeleverd door PostNL. Moet bestaan uit 3 tot 4 letters. Als u een contractklant bent van PostNL heeft u een e-mail ontvangen met deze informatie. Indien u deze e-mail niet kan vinden, neem dan contact op met PostNL support op 058-2333343."
32
  TIG_PostNL::BLS (location) Code,BLS (locatie) code
33
+ "TIG_PostNL::The internal code of the nearest PostNL sorting centre. Must contain 6 numbers. If you are a contract customer of PostNL, you will have received an email containing this setting. If you cannot find this email, please contact PostNL support at 058-2333343","De interne code van het dichtstbijzijnde PostNL sorteer centrum. Moet bestaan uit 6 nummers. Als u een contractklant bent van PostNL heeft u een e-mail ontvangen met deze informatie. Indien u deze e-mail niet kan vinden, neem dan contact op met PostNL support op 058-2333343."
34
  TIG_PostNL::These fields are only required if you intend to send products to countries outside the EU.,Deze velden zijn alleen verplicht als u van plan bent om producten buiten de EU te gaan versturen.
35
  TIG_PostNL::Global Barcode Type,Globaal barcode type
36
  TIG_PostNL::The current global barcode type as supplied by PostNL. Must contain 2 letters.,De huidige barcodetype zoals aangeleverd door PostNL. Moet bestaan uit 2 letters
59
  TIG_PostNL::Show product options in order grid,Toon productopties in het bestellingen overzicht
60
  TIG_PostNL::Activate to show a drop down menu in the order grid containing the product options alongside the bulk action drop down menu. Deactivate to use the default values.,Activeer om in het bestellingenoverzicht naast het bulk actie dropdown menu de mogelijkheid tot het selecteren van andere productopties te tonen. Deactiveer om altijd de standaardwaardes te gebruiken.
61
  TIG_PostNL::Optional shipment grid columns,Optionele kolommen voor verzendoverzicht
 
62
  TIG_PostNL::Select a default option for the shipment grid mass action.,Selecteer een standaardwaarde voor de massa-actie voor het zendingenoverzicht.
63
  TIG_PostNL::You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.,Track & Trace e-mails kunnen automatisch verstuurd worden nadat u een zending heeft voorgemeld. Configureer hier hoe u Track & Trace e-mails verstuurd wil hebben.
64
  TIG_PostNL::Automatically send track & trace email to customer,Stuur de Track & Trace e-mail automatisch naar de klant
88
  TIG_PostNL::Postcode,Postcode
89
  TIG_PostNL::City,Plaats
90
  TIG_PostNL::Region,Provincie
91
+ TIG_PostNL::Use only the primary sender address,Gebruik enkel het primaire afzenderadres
 
92
  TIG_PostNL::Product Options,Productopties
93
  TIG_PostNL::Select selectable option,Selecteer de beschikbare opties
 
94
  TIG_PostNL::Default shipping option,Standaard verzendoptie
95
  TIG_PostNL::This setting may be overwritten by manualy creating shipments. This option is only applicable to domestic shipments.,Deze instelling kan overschreven worden door handmatig een zending aan te maken. Deze instelling is enkel van toepassing op binnenlandse zendingen.
96
  TIG_PostNL::Use an alternative default option,Gebruik een alternatieve standaard optie
108
  "TIG_PostNL::If you do not own a customs certificate, leave this field empty.","Als u geen douane certificaat heeft, laat dit veld dan leeg"
109
  TIG_PostNL::Product attributes,Productattributen
110
  TIG_PostNL::Use HS Tariff,Gebruik het HS tarief
 
111
  TIG_PostNL::HS Tariff attribute,HS tarief
 
112
  TIG_PostNL::Customs value attribute,Douane waarde
 
113
  TIG_PostNL::Country of origin attribute,Land van herkomst
 
114
  TIG_PostNL::Product description attribute,Productbeschrijving
 
115
  TIG_PostNL::Product sorting,Productsortering
116
  TIG_PostNL::Product sorting attribute,Product sortering attribuut
117
  TIG_PostNL::Global shipping labels contain a maximum of 5 products. The sorting method will determine which 5 products are shown. Please note: the remaining products will not be shown on the label.,Global shipping labels bevatten maximaal 5 producten. Bepaal met de sortering welke 5 producten getoond worden. Let op: overige producten zullen dus niet zichtbaar zijn op het label.
119
  TIG_PostNL::PostNL Checkout Settings,PostNL Checkout Instellingen
120
  TIG_PostNL::Enable PostNL Checkout,Activeer PostNL Checkout
121
  TIG_PostNL::Mode,Modus
 
122
  TIG_PostNL::Enable PostNL Checkout for orders under 2 kg,Activeer PostNL Checkout voor orders onder de 2 kg
123
  TIG_PostNL::Enable PostNL Checkout for orders containing out of stock products,Activeer PostNL Checkout voor orders die producten bevatten die niet op voorraad zijn.
124
  TIG_PostNL::PostNL Checkout settings,PostNL Checkout instellingen
125
  TIG_PostNL::Show order summary page,Toon de bestelling overzichtspagina.
126
  TIG_PostNL::Whether or not to show the customer a final order summary page before finalizing the order.,De klant wel of geen bestelling overzichtspagina tonen voor de order definitief afgerond wordt.
127
  TIG_PostNL::Newsletter subscription,Aanmelden nieuwsbrief
 
128
  TIG_PostNL::Remark,Opmerking
129
  TIG_PostNL::Whether or not the customer can leave a remark.,Of de klant wel of geen opmerkingen mag plaatsen
130
  TIG_PostNL::Use mobile phonenumber,Gebruik mobiel nummer
 
131
  TIG_PostNL::Use date of birth,Gebruik geboortedatum
132
  TIG_PostNL::Whether or not the customer's date of birth will be returned by PostNL if available.,Dit veld bepaalt of de geboortedatum van de klant wordt uitgevraagd in PostNL Checkout.
133
  TIG_PostNL::Allow post office locations,Sta postkantoor locaties toe
134
  TIG_PostNL::Whether or not the customer may choose a retail location as their delivery address.,Mag de klant wel of niet een winkellokatie kiezen als verzendadres
135
  TIG_PostNL::Allow foreign addresses,Sta buitenlande adressen toe
 
136
  TIG_PostNL::Allow price overview,Sta prijsoverzicht toe
 
137
  TIG_PostNL::Terms and conditions,Algemene voorwaarden
 
138
  TIG_PostNL::Contact settings,Contact instellingen
139
  TIG_PostNL::Contact URL,Contact URL
140
  TIG_PostNL::URL of a page where customers can find contact information for your webshop. Leave empty to disable this feature.,Pagina van een website waar klanten contactinformatie van uw webshop kunnen vinden. Laat leeg om niet te gebruiken
142
  TIG_PostNL::URL of a page where customers can find information regarding the webshop's customer service department. Leave empty to disable this feature.,Pagina van een website waar klanten informatie over de serviceafdeling van uw webshop kunnen vinden. Laat leeg om niet te gebruiken.
143
  TIG_PostNL::PostNL Checkout Payment Settings,PostNL Checkout Betalingsinstellingen
144
  TIG_PostNL::PostNL Checkout is disabled. please enable PostNL Checkout in order to configure these settings.,PostNL Checkout is niet geactiveerd. Activeer PostNL Checkout om deze instellingen te configureren.
145
+ TIG_PostNL::Use iDEAL,Gebruik iDeal
146
+ TIG_PostNL::iDEAL payment method,iDeal betaalmethode
147
+ TIG_PostNL::iDeal Bank Field,iDeal bank
148
  TIG_PostNL::Enter the field name used by the selected payment method for the 'bank' field.,Vul de veldnaam in die de gekozen betaalmethode gebruikt om de bankkeuze te verwerken.
149
+ TIG_PostNL::Use creditcard,Gebruik creditcard
150
+ TIG_PostNL::Creditcard payment method,Creditcard betaalmethode
151
+ TIG_PostNL::Creditcard card type field,Creditcard type
152
  TIG_PostNL::Enter the field name used by the selected payment method for the 'creditcard type' field.,Vul de veldnaam in die de gekozen betaalmethode gebruikt om dekaartkeuze te verwerken.
153
  TIG_PostNL::Use CheckPay,Gebruik CheckPay
154
  TIG_PostNL::CheckPay payment method,CheckPay betaalmethode
357
  TIG_PostNL::Return to the shopping cart.,Terug naar winkelmandje.
358
  TIG_PostNL::Confirm Order,Bevestig bestelling
359
  TIG_PostNL::Cancel,Annuleer
360
+ TIG_PostNL::Your credit card will be charged for,Uw creditcard wordt belast met
361
  TIG_PostNL::Loading...,Laden…
362
  TIG_PostNL::How does it work?,Hoe werkt het?
363
  TIG_PostNL::An error occurred. Please use our regular checkout instead.,Er is een fout opgetreden. Gebruikt u alstublieft de normale afreken pagina.
397
  TIG_PostNL::Invalid ConfirmOrder response: %s,Ongeldig ConfirmOrder antwoord: %s
398
  TIG_PostNL::Invalid reference type requested: %s,Ongeldige referentie type opgevraagd: %s
399
  TIG_PostNL::Invalid object specified: %s,Ongeldig object gespecificeerd: %s
 
400
  TIG_PostNL::Number of Parcels,Aantal pakketten
401
  "TIG_PostNL::You can use this field to for example, add a prefix to the shipment increment ID or to help identify the shipment as coming from your webshop. You can use the following variables: {{var shipment_increment_id}}, {{var order_increment_id}} and {{var store_frontend_name}}. The resulting text may not exceed 28 characters. ","U kunt dit veld bijvoorbeeld gebruiken om een voorvoegsel toe te voegen aan het zending increment ID. Ook kunt u ervoor zorgen dat het voor de klant duidelijk is dat het pakketje van uw webshop komt. U kunt de volgende variabelen gebruiken: {{var shipment_increment_id}}, {{var order_increment_id}} en {{var store_frontend_name}}. De uiteindelijke tekst mag niet meer zijn dan 28 karakters."
 
402
  "TIG_PostNL::If you are unsure which options to select, ask your PostNL account manager.","Indien u niet zeker weet welke opties voor uw webshop van toepassing zijn, dan kunt u dit vragen aan uw PostNL account manager."
403
  "TIG_PostNL::We recommend you make the chosen attribute mandatory. However, should the attribute you selected be empty for a certain product, the label will note '000000' instead.","Wij raden aan het gekozen attribuut verplicht te maken. Mocht het zo zijn dat het attribuut leeg is voor een bepaald product, dan zal op het label '000000' getoond worden."
 
404
  TIG_PostNL::The 2kg limit will be based on the product's weight and the weight unit you selected under the 'Confirm and label printing settings' group.,De 2kg limiet wordt gebaseerd op het gewicht van de producten en de gewichtseenheid die u heeft geselecteerd in de 'voormelden en labels printen' groep.
405
  TIG_PostNL::Returns your customer's mobile phone number if activated. This number will be saved as the customer's regular phone number.,Vraag het mobiele nummer uit bij uw klanten. Dit nummer wordt opgeslagen als het normale telefoonnummer van de klant.
406
  TIG_PostNL::All addresses outside of the Netherlands are considered foreign. Addresses outside of the EU are not allowed.,"Alle adressen buiten Nederland worden gezien als buitenlandse adressen. Adressen buiten de EU worden, ongeacht deze instelling, niet toegestaan."
427
  "TIG_PostNL::Please fill in the fields below to finish the extension registration procedure. Click <a href=""#"" onclick=""%s"">here</a> to reset the registration procedure.","Vul s.v.p. de onderstaande velden in om de registratieprocedure af te ronden. Klik <a href=""#"" onclick=""%s"">hier</a> om de registratieprocedure te resetten."
428
  TIG_PostNL::The quote's total weight is below the miniumum required to use PostNL Checkout.,Het totale gewicht van de bestelling is beneden het minimum om gebruik te kunnen maken van PostNL Checkout.
429
  TIG_PostNL::One or more items in the cart are out of stock.,Eén of meer producten in de winkelwagen zijn niet op voorraad.
430
+ TIG_PostNL::Shipping event history,Zending statusgeschiedenis
 
431
  TIG_PostNL::PostNL version %s,PostNL versie %s
432
  TIG_PostNL::Status Code,Status Code
433
  TIG_PostNL::Description,Beschrijving
517
  "TIG_PostNL::If you wish to make use of PostNL Checkout or Mijnpakket login, set this field to 'yes'.",Indien u gebruik wilt maken van PostNL Checkout of Mijnpakket login moet u deze instelling op 'ja' zetten.
518
  TIG_PostNL::You have not enabled GlobalPack. Please enable GlobalPack under 'Account Settings' in order to configure your GlobalPack preferences.,U heeft GlobalPack niet geactiveerd. Activeer GlobalPack onder 'Account Instellingen' om uw GlobalPack voorkeuren te configureren.
519
  TIG_PostNL::You have not enabled PostNL Checkout. Please enable PostNL Checkout under 'Account Settings' in order to configure your PostNL Checkout preferences.,U heeft PostNL Checkout niet geactiveerd. Activeer PostNL Checkout onder 'Account Instellingen' om uw PostNL Checkout voorkeuren te configureren.
 
520
  TIG_PostNL::Account settings have been succesfully validated. Please save this page to keep these settings.,De account instellingen zijn succesvol gevalideerd. Sla deze pagina op om deze instellingen te bewaren.
521
  TIG_PostNL::One or more fields are missing. Please fill these fields and try again.,Eén of meerdere velden zijn niet ingevuld. Vul deze velden a.u.b. alsnog in en probeer het dan nog eens.
522
  "TIG_PostNL::Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.","De account instellingen zijn incorrect. Controleer alle velden a.u.b. zorgvuldig en probeer het dan nog eens. Als deze melding zich blijft voordoen, kunt u het beste contact opnemen met PostNL."
537
  TIG_PostNL::Parcelware export is disabled. Activate Parcelware export in order to edit these settings. Please note that you can only activate Parcelware export from the global level.,Parcelware export is gedeactiveerd. Activeer Parcelware export om deze instellingen te kunnen aanpassen. Houd er rekening mee dat Parcelware export enkel vanuit op globaal niveau kunt activeren.
538
  TIG_PostNL::Automatically confirm exported shipments,Geëxporteerde zendingen automatisch voormelden
539
  "TIG_PostNL::This setting will not actually confirm your shipments, it will only give shipments the confirmed status in Magento. This prevents you from accidentally confirming a shipment multiple times in Magento and ParcelWare.","Deze instelling meldt de producten niet daadwerkelijk voor, maar zorgt enkel dat ze deze status in Magento krijgen. Dit voorkomt dat u de orders dubbel voormeldt in Magento en Parcelware."
 
540
  TIG_PostNL::Contract reference number,Contract referentie nummer
541
  TIG_PostNL::Contract name,Contract naam
542
  TIG_PostNL::Sender address reference number,Afzender adres referentie nummer
543
  TIG_PostNL::Your webshop has been registered. Within a few minutes you will recieve an email at the emailaddress you specified. Please read this email carefully as it contains instructions on how to finish the extension registration procedure.,"Uw webshop is geregisteerd. Binnen enkele minuten ontvangt u een e-mail op het adres dat u heeft opgegeven. Lees deze e-mail s.v.p. zorgvuldig, aangezien deze verdere instructies bevat om de registratieprocedure af te ronden."
544
  TIG_PostNL::Product option,Productoptie
545
+ TIG_PostNL::Use postcode check,Gebruik postcode check
 
546
  TIG_PostNL::Automatically complete Dutch addresses after your customer fills in his postcode and house number.,Nederlandse adressen worden automatisch aangevuld en gecontroleerd als uw klant zijn postcode en huisnummer invult.
547
  TIG_PostNL::Use postcode check on checkout page,Gebruik de postcode check op de afreken pagina
 
 
548
  TIG_PostNL::Use postcode check in customer's address book,Gebruik de postcode check in het adresboek van de klant
 
549
  TIG_PostNL::Shipping Product,Verzendproduct
550
  TIG_PostNL::Delivery Date,Bezorgdatum
551
  TIG_PostNL::Customize this grid.,Pas dit overzicht aan.
553
  TIG_PostNL::Your PostNL account credentials could not be validated. Please enter valid PostNL account credentials before activating the postcode check functionality.,Uw PostNL account gegevens konden niet gevalideerd worden. Vul s.v.p. valide PostNL account gegevens in voordat u de postcode check functionaliteit activeert.
554
  TIG_PostNL::Maximum number of attempts,Maximum aantal pogingen
555
  "TIG_PostNL::After this number of attempts your customer will be prompted to fill in his address manually. Leave this field empty to allow an infinite number of attempts. Please note however that in rare cases a correct address might not be validated, leaving your customer unable to complete the order process. We therefore recommend always filling in a maximum number of attempts.",Na dit aantal pogingen kan uw klant het adres handmatig invullen. Laat dit veld leeg om een oneindig aantal pogingen toe te staan. Let op: In zeldzame situaties kan het voorkomen dat een correct adres niet gevalideerd kan worden. We raden u daarom aan om altijd een maximaal aantal pogingen in te voeren.
 
556
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please enter your streetname and city manually.,Uw postcode/huisnummer combinatie is niet gevonden. Vul s.v.p. handmatig uw straatnaam en woonplaats in.
557
  TIG_PostNL::Please enter a postcode and housenumber.,Vul s.v.p. een postcode en huisnummer in.
558
  TIG_PostNL::Your postcode/housenumber combination could not be found. Please make sure you have entered a valid postcode and housenumber and try again.,Uw postcode/huisnummer combinatie is niet gevonden. Controleer s.v.p. of u uw huisnummer en postcode correct ingevuld heeft.
576
  TIG_PostNL::available,beschikbaar
577
  TIG_PostNL::evening,avond
578
  TIG_PostNL::Post Office,Postkantoor
579
+ TIG_PostNL::Package Dispenser,Pakketautomaat
580
  TIG_PostNL::Delivery Options,Bezorgopties
581
  TIG_PostNL::Delivery,Bezorgen
582
  TIG_PostNL::or Pickup,of Ophalen
590
  TIG_PostNL::in,te
591
  TIG_PostNL::Business Hours,Openingstijden
592
  TIG_PostNL::Closed,Gesloten
 
593
  TIG_PostNL::Delivery,Bezorgen
594
  TIG_PostNL::or Pickup,of Ophalen
595
  TIG_PostNL::More Info,Meer informatie
609
  TIG_PostNL::Or pick your own delivery moment,Of kies zelf uw bezorgmoment
610
  TIG_PostNL::Connection timeout duration,Connectie time-out duur
611
  TIG_PostNL::After this number of seconds a customer will be prompted to fill in his address manually. Leave this field empty to disable the feature. Please note: if a customer needs to wait too long he might leave the order process.,Na dit aantal seconden kan uw klant het adres handmatig invullen. Laat dit veld leeg om de functionaliteit uit te schakelen. Let op: als een klant te lang moet wachten verlaat hij wellicht het bestelproces.
 
612
  TIG_PostNL::Show PostNL Checkout exclusively to MijnPakket users,Toon PostNL Checkout exclusief aan Mijnpakket gebruikers
 
613
  TIG_PostNL::Activate the PostNL Checkout only for customers with a MijnPakket account. Please note: The Delivery Options must be activated.,Activeer om de PostNL Checkout enkel te tonen aan uw klanten die beschikken over een MijnPakket account. Let op: de bezorgopties moeten geactiveerd zijn.
614
  TIG_PostNL::Delivery Options,Bezorgopties
615
  "TIG_PostNL::Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning.","Met de PostNL bezorgopties kunnen uw klanten kiezen waar, wanneer en hoe zij hun bestelling willen ontvangen. Zo kunnen uw klanten de dag van ontvangst kiezen en wordt er direct aangegeven op welk moment ze het pakket kunnen verwachten. Op dinsdag en donderdag bezorgt PostNL zelfs ‘s avonds. Halen uw klanten het pakket liever af op één van de 2000 PostNL pakketpunten? Dit kan vanaf 16:00 uur en op sommige locaties zelfs vanaf 8:30 uur."
623
  TIG_PostNL::Shipping duration,Overkomstduur
624
  TIG_PostNL::The number of days shipping will take after a customer finishes their order.,Het aantal dagen dat de bestelling nodig heeft om bezorgd te worden nadat de bestelling geplaatst is.
625
  TIG_PostNL::Order cut-off time,Bestelling cut-off tijd
626
+ "TIG_PostNL::When an order is placed after this time, another day will be added to the shipping duration. Please enter this time in the %s time zone.","Indien een bestelling na dit tijdstip besteld wordt, zal er een dag bij de overkomstduur opgeteld worden. Vul deze tijd s.v.p. in in de %s tijdzone."
627
  TIG_PostNL::Allow weekend sorting,gebruik weekend sortering
628
  "TIG_PostNL::Weekend sorting is a special service where shipments are sorted by PostNL during the weekend, allowing shipments to be delivered on monday. If you enable this field, but weekend sorting is not available for your webshop, parcels will NOT be delivered the next monday.","Weekend sortering is een speciale dienst van PostNL waarbij PostNL zendingen sorteert gedurende het weekend zodat deze op maandagen bezorgd kunnen worden. Indien u deze instelling activeert, maar weekend sortering niet beschikbaar is voor uw webshop zullen zendingen NIET op maandagen bezorgd worden."
629
  TIG_PostNL::Please ask your PostNL account manager if this service is available for your webshop.,Vraag aan uw PostNL account manager of weekend sortering voor uw webshop beschikbaar is.
633
  TIG_PostNL::Enable timeframes,Activeer tijdvensters
634
  TIG_PostNL::Enable timeframes to show the expected delivery times for each delivery day.,Activeer tijdsvensters om per dag het verwachte bezorgmoment te tonen.
635
  TIG_PostNL::Enable evening delivery,Activeer avondbezorging
 
636
  TIG_PostNL::Activate evening delivery for your customers. Evening delivery is not enabled for every area. The extension will automatically show evening delivery as a delivery option for addresses in enabled areas.,Activeer avondbezorging voor uw klanten. Avondbezorging is niet in elk gebied mogelijk. De extensie toont deze optie automatisch voor afleveradressen waar avondlevering mogelijk is.
637
  TIG_PostNL::Evening timeframe fee,Avondbezorging toeslag
638
  TIG_PostNL::Additional costs for evening timeframes in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for evening timeframes.,"Additionele kosten voor het gebruik van avondbezorging in de basis valuta van de storeview. Deze kosten zullen opgeteld worden bij de verzendkosten. Deze kosten moeten tussen de 0,00 en 2,00 EUR liggen incl. BTW. Laat dit veld leeg om geen extra kosten in rekening te brengen voor het gebruik van avondbezorging."
 
639
  TIG_PostNL::Enable post office locations,Activeer postkantoor locaties
640
  TIG_PostNL::Whether or not customers may choose to have their order delivered to a nearby post office.,Deze instelling bepaalt of klanten ervoor kunnen kiezen om hun bestelling te laten bezorgen op een postkantoor locatie.
641
  TIG_PostNL::Enable early delivery locations,Activeer extra vroeg postkantoor locaties
 
642
  TIG_PostNL::Some locations allow package pick-ups early in the morning. The extension will automatically check if this option is available for locations in the area submitted by your customer. You cannot use Premium Sorting or Sunday Sorting for these shipments. ,Op sommige pakketpunten kunnen uw klanten een pakket na 8:30 ophalen in plaats van na 16:00. De extensie bepaalt automatisch of deze optie beschikbaar is in de regio van uw klant. Deze pakketten kunnen niet meegeleverd worden in de Premium Sortering en zondagsortering.
643
  TIG_PostNL::Early delivery fee,Extra vroege bezorging toeslag
644
  TIG_PostNL::Additional costs for early delivery locations in the store's base currency. This fee will be added to the shipping costs. This value must be between 0.00 and 2.00 EUR incl. VAT. Leave this field empty to charge no extra fee for early delivery locations.,"Additionele kosten voor het gebruik van extra vroege bezorging in de basis valuta van de storeview. Deze kosten zullen opgeteld worden bij de verzendkosten. Deze kosten moeten tussen de 0,00 en 2,00 EUR liggen incl. BTW. Laat dit veld leeg om geen extra kosten in rekening te brengen voor het gebruik van extra vroege bezorging."
 
645
  TIG_PostNL::Enable package dispenser locations,Activeer pakketautomaat locaties
 
646
  TIG_PostNL::Activate to allow your customers to pick up a parcel at a package dispenser location. The extension will automatically check if this option is available in the area submitted by your customer. Parcels delivered to a package dispenser machine must comply with a certain size. ,Activeer zodat uw klanten bestellingen af kunnen halen bij een pakketautomaat. De extensie bepaalt automatisch of deze optie beschikbaar is in de regio van uw klant. Pakketten die naar een pakketautomaat gestuurd worden moeten voldoen aan bepaalde afmetingen.
647
  TIG_PostNL::Allow Google Streetview,Sta Google Streetview toe
648
  "TIG_PostNL::If enabled, users may use Google Streetview when choosing a post office location.","Indien geactiveerd, kunnen klanten Google Streetview gebruiken wanneer zij een postkantoor zoeken."
677
  "TIG_PostNL::Invalid arguments supplied. In order to save a selected option, a type, delivery date and optional extra costs are required.","Ongeldige parameters opgegeven. Om een geselecteerde bezorgoptie op te slaan zijn een type, een bezorgdatum en optioneel extra kosten verplicht."
678
  TIG_PostNL::Invalid type supplied: %s,Ongeldig type opgegeven: %s
679
  TIG_PostNL::Invalid extra costs supplied: %s Extra costs must be supplied as a float.,Ongeldige extra kosten opgegeven: %s Extra kosten moeten opgegegevn worden als een float waarde.
680
+ "TIG_PostNL::Invalid argument supplied. A valid PakjeGemak address must contain at least a city, country code, street, house number and zipcode.","Ongeldig argument opgegeven. Een valide PakjeGemak adres moet minstens een plaatsnaam, een landcode, een straatnaam, een huisnummer en een postcode bevatten."
681
  TIG_PostNL::Invalid arguments supplied. The 'costs' parameter is required.,Ongeldige parameters opgegeven. De 'costs' parameter is verplicht.
682
  TIG_PostNL::Please enter a valid Dutch mobile phone number using only digits.,Vul s.v.p. een correct Nederlands mobiel telefoonnummer in met enkel cijfers.
683
  TIG_PostNL::Phone number for Package Dispenser service,Mobiel telefoonnummer voor pakketautomaat dienst
780
  "TIG_PostNL::You can use this button to validate your account settings without saving the configuration. This will send a 'test' request to PostNL. If the above fields are not entered correctly, this will result in an error. Please note that the PostNL extension must be active for the validation to succeed. <br />Please note that the webshop ID and public webshop ID fields will not be validated. Only your CIF credentials will be checked.","U kunt deze knop gebruiken om uw account gegevens te valideren zonder de configuratie op te slaan. Dit zal een 'test' verzoek sturen naar PostNL. Indien bovenstaande velden niet correct ingevuld zijn, zal dit resulteren in een foutmelding. De PostNL extensie moet hiervoor actief staan. <br />N.B.: uw webshop ID en publiek webshop ID zullen niet gevalideerd worden. Enkel uw CIF account gegevens worden gecontroleerd."
781
  TIG_PostNL::Maximum number of delivery days,Maximum aantal bezorgdagen
782
  TIG_PostNL::Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.,Geef hier aan hoeveel dagen in te toekomst na het eerste bezorgmoment de klant de bestelling mag ontvangen.
 
783
  TIG_PostNL::Post Office Address,Postkantoor Adres
784
  TIG_PostNL::Choose printing start position,Kies printer startpositie
785
  TIG_PostNL::When printing multiple labels simultaneously you may choose where the printer will start printing. All fields marked orange will be used. The printer will start at position 1 on all pages after the first.,"Wanneer u meerdere labels tegelijk afdrukt, kunt u aangeven waar de printer moet beginnen op de pagina. De printer zal voor alle pagina's na de eerste op positie 1 beginnen."
898
  TIG_PostNL::Show shipping label,Toon verzendlabel
899
  "TIG_PostNL::If enabled, the shipping label will be printed directly on the packing slip if possible. Otherwise it will always be printed on a separate page.","Indien geactiveerd, zal het verzendlabel direct op de pakbon geprint worden, indien mogelijk. Anders zal deze op een losse pagina toegevoegd worden."
900
  TIG_PostNL::Pre-configured message,Voorgeconfigureerd bericht
901
+ TIG_PostNL::Last shipment comment (as shown on the shipment detail page),Laatste zending opmerking (zoals getoond op de zendingdetail pagina)
902
  TIG_PostNL::None of the orders you have selected have any associated shipments. Please choose at least one order that has a shipment.,"Geen van de bestellingen die u heeft geselecteerd, bevat een zending. Kies s.v.p. tenminste één bestelling die een zending bevat."
903
  TIG_PostNL::Print packing slips,Print pakbonnen
904
  Download PostNL log files,Download PostNL log bestanden
925
  "TIG_PostNL::<p>If you have configured a fee in the field below, you may use '%s' in the title. This will be replaced with the fee amount in the customer's chosen currency.</p><p>I.e. If the fee is 17.45 EUR and the title you have entered is ""PostNL COD (+%s)"" then the title will show ""PostNL COD (+€17,45)"". If the customer has chosen to pay in USD, the title will show ""PostNL COD (+$23.73)"" instead.</p>","<p>Als u een toeslag bedrag heeft ingevuld in het veld hieronder, kunt u gebruik maken van de tekst ""%s"" in de titel. Dit zal vervangen worden door het toeslagbedrag in de valuta waarin de klant afrekent.</p><p>Bijvoorbeeld: de toeslag is 17,45 EUR en de titel die u heeft ingevuld is ""PostNL rembours (+%s)"". De titel van de betaalmethode zal dan getoond worden als ""PostNL rembours (+€17,45)"". Indien de klant heeft gekozen om te betalen in USD zal de getoonde titel ""PostNL rembours (+$23.73)"" zijn.</p>"
926
  TIG_PostNL::Send date,Verzenddatum
927
  TIG_PostNL::Optional order grid columns,Optionele kolommen voor besteloverzicht
 
928
  TIG_PostNL::Selecting too many columns may cause the order grid to no longer fit on your monitor.,"Indien u teveel kolommen selecteert, kan dit er toe leiden dat het overzicht niet langer op uw beeldscherm past."
929
  TIG_PostNL::Delivery option,Gekozen bezorgoptie
930
  TIG_PostNL::Requested delivery date,Gekozen bezorgdag
948
  TIG_PostNL::Calculation mode,Berekeningsmodus
949
  TIG_PostNL::You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.,"U kunt de PostNL extensie automatisch laten bepalen of een zending door de brievenbus past of u kunt dit handmatig aangeven wanneer u zendingen aanmaakt. U kunt de PostNL extensie automatisch laten bepalen of een zending door de brievenbus past of u kunt dit handmatig aangeven wanneer u zendingen aanmaakt.
950
  Indien deze instelling op 'automatisch' staat, zal de extensie de 'Gewicht' en 'PostNL Max Hoeveelheid voor Brievenbuspakjes' productattributen gebruiken om te bepalen of een zending door de brievenbus past. U kunt dit altijd overschrijven door zelf aan te geven of een zending een brievenbuspakje is wanneer u handmatig een zending aanmaakt."
 
951
  TIG_PostNL::Use letter box parcels,Gebruik brievenbuspakjes
952
  TIG_PostNL::If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.,"Indien u deze instelling uit zet, zullen alle zendingen beschouwd worden als reguliere pakketzendingen.<br/>Het is zeer belangrijk dat u alle producten correct geconfigureerd heeft als u gebruik wilt maken van brievenbuspakjes. Bestellingen die meer wegen dan <strong>2kg</strong> of groter zijn dan <strong>38 x 26,5 x 3,2 cm</strong> kunnen niet verstuurd worden als brievenbuspakjes."
 
953
  TIG_PostNL::Manual,Handmatig
954
  TIG_PostNL::Automatic,Automatisch
955
  TIG_PostNL::This shipment will probably fit as a letter box parcel.,Deze zending past waarschijnlijk door de brievenbus.
1051
  To Package,Naar Brievenbuspakje
1052
  Change Product Option,Wijzig Productoptie
1053
  TIG_PostNL::Fits through the mailslot,Past door de brievenbus
1054
+ TIG_PostNL::Nearest PostNL pickup points,Resultaat van dichtstbijzijnde PostNL ophaalpunten
1055
  TIG_PostNL::Filter,Filter
1056
  TIG_PostNL::Select location,Selecteer locatie
1057
  TIG_PostNL::Show map,Toon kaart
1139
  TIG_PostNL::Specify checkout extension,Specificeer checkout extensie
1140
  TIG_PostNL::Checkout Settings,Checkout instellingen
1141
  TIG_PostNL::As soon as possible,Eerst volgende mogelijkheid
1142
+ TIG_PostNL::The previous step has been saved successfully!,De vorige stap is succesvol opgeslagen!
1143
  TIG_PostNL::These settings are only available on the 'global' and 'website' scopes.,Deze instellingen zijn enkel beschikbaar op de 'globaal' en 'website' niveaus.
1144
  TIG_PostNL::Extension registration is only available on the 'global' scope.,Extensie registratie is enkel beschikbaar op het 'globaal' niveau.
1145
  TIG_PostNL::Frequently asked questions.,Veelgestelde vragen.
1159
  TIG_PostNL::PostNL account credentials,PostNL accountgegevens
1160
  "TIG_PostNL::You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">here</a>.","U kunt <a href=""http://kb.tig.nl/topic/94905773"" target=""_blank"">hier</a> meer lezen over de wijze waarop de extensie bepaalt of een bestelling een brievenbuspakje is."
1161
  "TIG_PostNL::You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","U kunt <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">hier</a> meer lezen over het instellen van gesplitste adresregels in Magento."
1162
+ TIG_PostNL::PostNL - Print Return Label,PostNL - Print retourlabel
1163
+ TIG_PostNL::Unable to retrieve return labels for this shipment.,Het is niet mogelijk om retourlabels op te halen voor deze zending.
1164
+ TIG_PostNL::The generateReturnBarcode action is currently unavailable.,De generateReturnBarcode actie is momenteel niet beschikbaar.
1165
+ TIG_PostNL::Print Return Label,Print Retourlabel
1166
+ TIG_PostNL::Activate returns,Activeer retouren
1167
+ TIG_PostNL::Print the return label along with regular shipping labels,Print het retourlabel tezamen met de verzendlabels
1168
+ TIG_PostNL::Activate this option to ship the order and returnlabel together.,Op deze manier kunt u het retourlabel met de zending meesturen.
1169
+ TIG_PostNL::Allow customers to print the return label from the webshop,Sta klanten toe om het retourlabel vanuit de webshop te printen
1170
+ TIG_PostNL::This will add a button to the customer's account to print the return label for this shipment.,Hiermee wordt een knop toegevoegd aan de accountpagina van de klant om het retourlabel te printen.
1171
+ TIG_PostNL::Allow guests to print the return labels,Sta gasten toe om het retourlabel te printen
1172
+ TIG_PostNL::This will add a button to the sales/guest/shipment page so that guests can print a return label for this shipment.,Hiermee wordt een knop toegevoegd aan de sales/guest/shipment pagina om een retourlabel te printen.
1173
+ TIG_PostNL::Freepost number,Antwoordnummer
1174
+ TIG_PostNL::These settings are only available on the 'global' scope.,Deze instellingen zijn enkel beschikbaar op het 'globaal' niveau.
1175
+ TIG_PostNL::Return Settings,Retouren Instellingen
1176
+ TIG_PostNL::Returns,Retouren
1177
+ TIG_PostNL::Return labels instructions block,Retourlabels instructieblok
1178
+ TIG_PostNL::Please select a static block that contains instructions for customers on how to use the return labels.,Selecteer s.v.p. een static block dat instructies bevat voor de klant om een zending retour te sturen.
1179
+ TIG_PostNL::Alternative sender address,Alternatief afzenderadres
1180
+ TIG_PostNL::Print return label,Print Retourlabel
1181
+ TIG_PostNL::An error occurred while retrieving the return labels. Please try again.,Er is een fout opgetreden tijdens het ophalen van het retourlabel. Probeer het s.v.p. opnieuw.
1182
+ TIG_PostNL::A freepost number is a requisite for using return labels.,Een antwoordnummer is verplicht voor het gebruik van retourlabels.
1183
  TIG_PostNL::Direct Debit,Automatische Incasso
1184
+ TIG_PostNL::Creditcard,Creditcard
1185
+ TIG_PostNL::Giftcard,Cadeaubon
1186
+ TIG_PostNL::The shipment's parcel count has been changed succesfully.,Het aantal pakketten van deze zending is succesvol gewijzigd.
1187
+ TIG_PostNL::The changeParcelCount action is currently unavailable.,De changeParcelCount actie is momenteel niet beschikbaar.
1188
+ TIG_PostNL::Expected delivery time,Verwachtte bezorgtijd
1189
+ TIG_PostNL::Requested delivery time,Gekozen bezorgtijd
1190
+ TIG_PostNL::Post office address:,Postkantoor adres:
1191
+ TIG_PostNL::Return Phase,Retourfase
1192
+ TIG_PostNL::Return Labels Printed,Retourlabels geprint
1193
+ TIG_PostNL::PostNL Returns,PostNL Retouren
1194
+ TIG_PostNL::Return shipment,Retourzending
1195
+ TIG_PostNL::Update shipping status,Verzendstatus updaten
1196
+ TIG_PostNL::PostNL - Update shipping status,PostNL - Verzendstatus updaten
1197
+ TIG_PostNL::The shipping status has been updated successfully.,De verzendstatus is succesvol geüpdatet.
1198
+ "TIG_PostNL::The shipping status of shipment #%s cannot be updated, because it has not yet been confirmed.","De verzendstatus van zending #%s kan niet geüpdatet worden, omdat de zending nog niet voorgemeld is."
1199
+ TIG_PostNL::The shipping status of shipment #%s cannot be updated.,De verzendstatus van zending #%s kan niet geüpdatet worden.
1200
+ TIG_PostNL::Print packing slips & confirm shipment,Print pakbon en zending voormelden
1201
+ TIG_PostNL::PostNL - Print packing slips & confirm shipment,PostNL - Print pakbonnen en zending voormelden
1202
+ TIG_PostNL::This step has been saved successfully!,Deze stap is succesvol opgeslagen!
1203
+ TIG_PostNL::The actual delivery time may have changed. Please check MijnPakket for the most up to date delivery time estimate.,De daadwerkelijke bezorgtijd kan veranderd zijn. Kijk op MijnPakket om de meest accurate bezorgtijd te zien.
1204
+ TIG_PostNL::Shipping status,Verzendstatus
1205
+ TIG_PostNL::Unable to save return_status cron expression: %s,Unable to save return_status cron expression: %s
1206
+ TIG_PostNL::Unable to save update_date_time_zone cron expression: %s,Unable to save update_date_time_zone cron expression: %s
1207
+ TIG_PostNL::Unable to send track and trace email for shipment #%s.,De track & trace e-mail voor zending #%s kan niet verzonden worden.
1208
+ TIG_PostNL::The sendReturnLabelEmail action is currently unavailable.,De sendReturnLabelEmail actie is momenteel niet beschikbaar.
1209
+ TIG_PostNL::Unable to send return email for shipment #%s.,Niet in staat om retourlabel te versturen voor zending #%s.
1210
+ TIG_PostNL::PostNL return label email has been sent.,PostNL retourlabel e-mail is verstuurd.
1211
+ TIG_PostNL::PostNL return label email has been sent for shipment #%s.,PostNL retourlabel e-mailis verstuurd voor zending #%s.
1212
+ TIG_PostNL::Unable to send return label email due to missing shipment parameters.,Niet in staat om de retourlabel e-mail te versturen wegens missende zendingparameters.
1213
+ TIG_PostNL::You can send the customer an email with the return label attached as a pdf. Please select which transactional email template you would like to use for this email.,Het is mogelijk om de klant een e-mail te sturen met het retourlabel bijgevoegd als pdf. Selecteer s.v.p. welk e-mail template gebruikt moet worden voor deze e-mail.
1214
+ Send Return Label Email,Stuur retourlabel e-mail
1215
+ Print Return Label,Print retourlabel
1216
+ TIG_PostNL::PostNL - Send Return Label Email,PostNL - Verstuur Retourlabel E-mail
1217
+ TIG_PostNL::The return label email was sent.,De retourlabel e-mail is verzonden.
1218
+ TIG_PostNL::Return label email template,Retourlabel e-mailtemplate
1219
+ PostNL Return Label Email,PostNL Retourlabel E-mail
1220
+ "TIG_PostNL::The installed version of PHP is too low. The installed PHP version is %s, the minimum required PHP version is %s.",De geïnstalleerde PHP versie is te laag. De geïnstalleerde PHP versie is %s. De minimale versie is %s.
1221
+ TIG_PostNL::Invalid settings provided.,Onjuiste instellingen aangeleverd.
1222
+ TIG_PostNL::Invalid config value provided.,Onjuiste configuratiewaarde aangeleverd.
1223
+ TIG_PostNL::Invalid updateConfigSettings response: %s,Invalid updateConfigSettings response: %s
1224
+ TIG_PostNL::The PostNL extension has detected some issues with the PostNL extension's data integrity.,De PostNL extensie heeft mogelijke problemen gedetecteerd in de data-integriteit van de PostNL extensie.
1225
+ TIG_PostNL::Order IDs do not match.,Order IDs do not match.
1226
+ TIG_PostNL::Quote IDs do not match.,Quote IDs do not match.
1227
+ TIG_PostNL::Missing Magento shipment.,Missing Magento shipment.
1228
+ TIG_PostNL::Missing Magento quote.,Missing Magento quote.
1229
+ TIG_PostNL::Missing Magento order.,Missing Magento order.
1230
+ TIG_PostNL::Sunday,Zondag
1231
+ TIG_PostNL::Sunday cut-off time,Zondag cut-off tijd
1232
+ "TIG_PostNL::You can apply for a freepost number on <a href=""http://www.postnl.nl/zakelijke-oplossingen/ontvangen/antwoordnummer/?searchResult=position1"" target=""_blank"" title=""Request a freepost number."">this</a> page.","U kunt <a href=""http://www.postnl.nl/zakelijke-oplossingen/ontvangen/antwoordnummer/?searchResult=position1"" target=""_blank"" title=""Vraag een antwoordnummer aan."">hier</a> een antwoordnummer aanvragen."
1233
+ TIG_PostNL::parcel dispenser,pakketautomaat
1234
+ TIG_PostNL::Select this checkbox to only show parcel dispensers.,Activeer deze filter om enkel pakketautomaten te tonen.
1235
+ TIG_PostNL::Choose date,Datum kiezen
1236
+ "TIG_PostNL::You are currently using fewer than 2 address lines. In order to guarantee proper address processing, the PostNL extension requires at least 2 address lines. You can read more on how to configure split address lines <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">here</a>.","U gebruikt momenteel minder dan 2 adresregels op uw checkout pagina. De PostNL extensie heeft minimaal 2 adresregels nodig om correcte adresverwerking te garanderen. U kunt <a href=""http://kb.tig.nl/topic/55961916"" target=""_blank"">hier</a> meer lezen over het correct configureren van gesplitste adresregels."
1237
+ TIG_PostNL::Hide this warning.,Verberg deze waarschuwing.
app/locale/nl_NL/template/email/TIG/PostNL/return_label.html ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject PostNL - retourlabel voor uw zending {{var shipment.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "var barcode":"Barcode",
7
+ "var barcode_url":"Barcode URL",
8
+ "var return_barcode":"Return Barcode",
9
+ "var return_barcode_url":"Return Barcode URL",
10
+ "store url=\"customer/account/\"":"Customer Account Url",
11
+ "var shipment.increment_id":"Shipment Id"}
12
+ @-->
13
+
14
+ <body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; margin:0; padding:0;">
15
+ <div style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; margin:0; padding:0;">
16
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
17
+ <tr>
18
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
19
+ <!-- [ header starts here] -->
20
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="470">
21
+ <tr>
22
+ <td valign="top">
23
+ <a href='{{store url=""}}' style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/></a>
24
+ <img src='{{skin url="images/TIG/PostNL/postnl_email_logo.png" _area="frontend"}}' alt="PostNL" border="0" style="float:right"/>
25
+ </td>
26
+ </tr>
27
+ <!-- [ middle starts here] -->
28
+ <tr>
29
+ <td valign="top">
30
+ <p style="font-size:11px; font-weight:normal; line-height:1.5em; margin:0 0 11px 0;">Beste heer/mevrouw {{htmlescape var=$customer_name}},</p>
31
+ <p style="font-size:11px; line-height:1.5em; margin:0 0 8px 0;">Bijgevoegd vindt u een PostNL retourlabel waarmee u uw bestelling kunt retourneren aan {{var store.getFrontendName()}}.</p>
32
+ <p style="font-size:11px; line-height:1.5em; margin:0;">Verpak de producten in een stevige verpakking en plak het retourlabel bovenop het pakket. Zorg er s.v.p. voor dat de barcode goed en duidelijk leesbaar is.<p>
33
+ <p style="font-size:11px; line-height:1.5em; margin:0;">U kunt de status van uw retourzending <a href="{{var return_barcode_url}}" target="_blank">hier</a> volgen.<p>
34
+ <p style="font-size:11px; line-height:1.5em; margin:0;">Met vriendelijke groet,</p>
35
+ <p style="font-size:11px; line-height:1.5em; margin:0;">{{var store.getFrontendName()}}</p>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+ </td>
40
+ </tr>
41
+ </table>
42
+ </div>
43
+ </body>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>tig_postnl</name>
4
- <version>1.4.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US">Creative Commons License</license>
7
  <channel>community</channel>
@@ -20,7 +20,57 @@ Services included:&#xD;
20
  - Viewing detailed shipping status information&#xD;
21
  - PostNL Checkout&#xD;
22
  - Emailing customers track &amp; trace information, allowing them to track their shipment from the moment you confirm it to the moment it arrives at their doorstep</description>
23
- <notes>==== v1.4.1 ====&#xD;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  ==== New features ====&#xD;
25
  - Completely redesigned the configuration page of the extension!&#xD;
26
  - The extension's configuration page has now been split into a wizard-style menu for the core settings and a separate advanced options menu.&#xD;
@@ -255,9 +305,9 @@ Services included:&#xD;
255
  &#xD;
256
  This is the initial beta release of the extension. If you have any questions, please contact the Total Internet Group Servicedesk</notes>
257
  <authors><author><name>TiG</name><user>supporttotal</user><email>servicedesk@totalinternetgroup.nl</email></author></authors>
258
- <date>2014-11-11</date>
259
- <time>10:46:43</time>
260
- <contents><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="e3d6f680042824837b1118ef8a9cddee"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="84043c1d8561402926445b4d364842e0"/><file name="postcode_check.phtml" hash="7c6acd718b77b449a4ede176d50a5b8e"/><file name="shipping.phtml" hash="ff44bbec353adcc3800f37cfd2970610"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="4327dd68d223063f4c0404900d9088a8"/><file name="postcode_check.phtml" hash="a73a6146daf8ed666758e53943233e17"/></dir></dir><dir name="onestepcheckout"><file name="billing_fields.phtml" hash="953919dc3e4879491cea1d0cd6fb9409"/><file name="postcode_check.phtml" hash="5beee73bf2c949f78e35159096262c92"/><file name="shipping_fields.phtml" hash="6beb31124864fa60b153967fd28e9045"/></dir><file name="validate.phtml" hash="a9518118b2e4e86d353fbebe5b59cb4d"/></dir><dir name="checkout"><dir name="cart"><file name="js.phtml" hash="ca1f64c96af24529cb7fae25649dd6ff"/><file name="link.phtml" hash="c664d663030ae0e1cd536d6634a2fc31"/><file name="spinner.phtml" hash="ef19ba5e8dc2a543e4a2db9360c9527a"/></dir><file name="summary.phtml" hash="d1892b51b7572c3c62fd63e1e0f566a5"/></dir><dir name="core"><dir name="page"><dir name="html"><file name="js_translate.phtml" hash="b8acdcccee13c6e043a465031687224f"/></dir></dir><dir name="sales"><dir name="order"><file name="pakje_gemak_address.phtml" hash="8049c0a142ba44f7be19522af429c294"/><dir name="shipment"><file name="shipping_status.phtml" hash="1d873f33eb6328a1b93eabbb4c703413"/></dir></dir></dir></dir><dir name="delivery_options"><file name="addlocation.phtml" hash="ccca6468774495eb1d7739d5e6e0c42c"/><file name="addphonenumber.phtml" hash="bbbb9dfb5016f3440071fe06646beae6"/><file name="js.phtml" hash="8fefecd5660eb02822e5a84281078101"/><dir name="onepage"><file name="available.phtml" hash="3102abf23ecf1b6b6f33dbf958887b05"/><file name="deliveryoptions.phtml" hash="8449a64d00fc6c3f72c7aeaff7412e1c"/><dir name="progress"><file name="shipping_method.phtml" hash="a330941cfb375fb881b73e40c917291a"/></dir></dir><dir name="onestepcheckout"><file name="available.phtml" hash="0bbc7fbba443275f585d645db17e845a"/><file name="deliveryoptions.phtml" hash="40d17fd0229db8d12e93f75462bdedbc"/></dir><dir name="sales"><dir name="order"><file name="delivery_options_info.phtml" hash="70f34cde320867b863d07e781138da35"/></dir></dir><file name="theme.phtml" hash="ae7cccad119f87a974243823797359b8"/></dir><dir name="mijnpakket"><file name="account_notification.phtml" hash="e6354525e0bce99bdcf4935d240a5192"/><file name="js.phtml" hash="18b8883f828796373bb1783dfaae8690"/><dir name="onepage"><file name="login_button.phtml" hash="bd0f7103b3a5abcd83e0d0db9d7dfc94"/></dir><dir name="onestepcheckout"><file name="login_button.phtml" hash="6aa76a27d66c6fc81dc361acd2c9b3ca"/></dir><file name="order_success_js.phtml" hash="ac96ac95e7cd40a3b2c5cb12432fd1b2"/></dir><dir name="payment"><dir name="checkout"><dir name="form"><file name="cod.phtml" hash="f1ab6e0226fe607a049aaa4b5402fefe"/></dir><dir name="total"><file name="cod_fee.phtml" hash="9273dca9058bc1e782ad6750be468d96"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="template"><dir name="TIG"><dir name="PostNL"><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="7c480af158d0e2503258c23418b28ea2"/><file name="postcode_check.phtml" hash="56ada1c322b86a1dac6139f22d9f674c"/><file name="shipping.phtml" hash="b0ba0336cb931eb8e6a0248de6f673ff"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="1cd43fabe60ed292d6674b2b0e7e66c2"/><file name="postcode_check.phtml" hash="c220d994561b6552d1e622a22a2e0982"/></dir></dir></dir><dir name="core"><dir name="sales"><dir name="order"><file name="pakje_gemak_address.phtml" hash="2329ff2eff3bba12b4a3aafc54c492ba"/></dir></dir></dir><dir name="mijnpakket"><dir name="onepage"><file name="login_button.phtml" hash="af0c9754a77b7cab5a4fb70ef2150df8"/></dir></dir></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="e7f39f3c6e4260af71c2d15df5847e6c"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><dir><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="postcode_check.phtml" hash="01539053fdc5269593452c69918a9e7b"/></dir></dir><dir name="customer"><dir name="address"><file name="postcode_check.phtml" hash="63a7067037a0aeb8499ed162bdc01a63"/></dir></dir></dir><dir name="checkout"><dir name="cart"><file name="link.phtml" hash="0fc6bdcc0a37dabece55462219621375"/></dir></dir><dir name="mijnpakket"><dir name="onepage"><file name="login_button.phtml" hash="31fc55787f6f64e63657b62617ec1260"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="d66db61e2a9f19c3c9354e5a3d14930f"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><file name="cron_notification.phtml" hash="68cf7bedd4b330a057ec5ced06c252f1"/><file name="log_notification.phtml" hash="87b4ab095c8d2740b7f621b2c574fd91"/><dir name="payment"><dir name="checkout"><dir name="form"><file name="cod.phtml" hash="145ff33fea020e3e3148c641c9b98bc6"/></dir></dir></dir><dir name="sales"><dir name="items"><dir name="column"><file name="qty.phtml" hash="aef5915e5d811811d7128e6d50fe94d6"/></dir></dir><dir name="order"><dir name="address"><dir name="form"><file name="container.phtml" hash="87a67abbc194820b7592e759d21976dc"/></dir></dir><dir name="create"><file name="js.phtml" hash="2e41aaae2407a1f56739197d8a5fc10e"/><dir name="totals"><file name="cod_fee.phtml" hash="024424c5e3b8f23e8f424fa015ba23b6"/></dir></dir><dir name="creditmemo"><dir name="create"><dir name="totals"><file name="cod_fee.phtml" hash="e2ce7c3302b7f53f1fcc34f0c24e954d"/></dir></dir></dir><file name="filter_massaction.phtml" hash="4b574a37f32983fed3726c69825098bd"/><file name="js.phtml" hash="06a619a67d236aaa9a301462b1f8b978"/><file name="product_options.phtml" hash="cef99b2d28c7d385200fc351b7c4d5f2"/><dir name="shipment"><dir name="create"><file name="shipment_options.phtml" hash="e6b0d60b7deb85a2d2114e2e534442df"/></dir><file name="filter_massaction.phtml" hash="c108ecf1e488111a1367b9193315d546"/><dir name="view"><file name="delivery_options.phtml" hash="e62c99b91b4d24b1da12ce2affecf69d"/><file name="pakje_gemak_address.phtml" hash="52f2105d4e4772bb6653ddcf440e9e58"/><file name="shipping_status.phtml" hash="39e6a1a9a09e05add406fad1e4bf47ed"/><dir name="tab"><file name="status_history.phtml" hash="964540928c7ba7ef3ad66c5fb0d33791"/></dir></dir><file name="view.phtml" hash="6e999fb2d3838748be573873aada22f2"/></dir><dir name="totals"><file name="tax.phtml" hash="ab09fbdc3a7673ca587d8c6de4c02ffd"/></dir><dir name="view"><file name="delivery_options.phtml" hash="d8e17fc4d53e6260792020abd6161c48"/><file name="pakje_gemak_address.phtml" hash="444ad530e9ebb95b19ecb95fae891e72"/></dir><file name="windows_theme.phtml" hash="b39af59a65373a52d7e2c3c0aa69e7b8"/></dir><dir name="shipment"><file name="customize_link.phtml" hash="c6bae2e2c206e67db4cf46e7747d8efa"/><file name="js.phtml" hash="6ec6050947bbb9100a4d2a63a39ee2ca"/><file name="testmode_warning.phtml" hash="c265436ea309fe174cc436de9aaf67a2"/></dir></dir><dir name="system"><dir name="config"><file name="edit.phtml" hash="4f073927211c81a65263953cfbe87170"/><dir name="form"><dir name="field"><file name="array.phtml" hash="6bb1f404b24129b198c9c95a28c1bd66"/><file name="config_check.phtml" hash="11640be7731cf2a8e93964ab1bfbdf46"/><file name="field_header.phtml" hash="ab35d6667e3feadaf7c61735c1b30622"/><file name="info_box.phtml" hash="3d2e75e278585c54c47571679eb96b36"/><file name="js.phtml" hash="52e0477aeaba1cb654d334d34b00cdb2"/><file name="split_address_check.phtml" hash="9bd9a3edd07d859a117f00c3acdb2390"/><file name="support_tab.phtml" hash="b5749bdd254457c2629e7ae6d7076e05"/><file name="warning_box.phtml" hash="a5dfa40b5246147d5f64547f5990cf98"/></dir></dir></dir></dir><file name="upgrade_notification.phtml" hash="7a97f0a2c532ad034d1e4b78ddca5d77"/><dir name="widget"><dir name="grid"><dir name="massaction"><file name="label_start_pos.phtml" hash="602de274a2d446bdf6e1c2859f13500e"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TIG_PostNL.xml" hash="78c34bc4e8acdcaf4ccedf930517a14d"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="cart.css" hash="d51ab6c200da5c54eb8e672c9325dbf5"/><file name="default.css" hash="7f05bf3ebd09bc4cf13d2582afe04980"/><dir name="deliveryoptions"><file name="default.css" hash="c174b05e1acd7d39c75be74792fd6a96"/><file name="ie8.css" hash="1f0e04ca6c7be6572defb3adadafd28a"/><file name="mediaqueries.css" hash="0e262ac209f829decfb1f2b592f39a0b"/><file name="neutral.css" hash="4b3b09545e3395f302e1efd487bf2739"/><file name="onestepcheckout.css" hash="fd7d786cc66c34b81555111e34c062eb"/><file name="onestepcheckout_mediaqueries.css" hash="2eb1086de2c12f7b728794fdf5ae431c"/><file name="onestepcheckout_neutral.css" hash="cb2cc910a3e96ed3fc9b23d20a6f34eb"/></dir><file name="messages.css" hash="19d03101c862b45535bc08344c12716a"/><file name="mijnpakket.css" hash="23e980e096acc95a740f5136cc38d377"/><file name="postcodecheck.css" hash="84a497060c26440c6e387d2f7a26e0fd"/><file name="shipping_status.css" hash="fcb3fe311d50ee93176dc29ef2d5a0b9"/></dir></dir></dir><dir name="images"><dir name="TIG"><dir name="PostNL"><file name="bkg_progress_small.png" hash="fc6c9f28b6a6aae6f0096d504c0952df"/><file name="bkg_tooltip.png" hash="56cfed3ed8a65b19f8de88946d1a0a01"/><dir name="deliveryoptions"><file name="bkg_add-location.png" hash="a30d4aea73b094df5f434f9856dc626b"/><file name="bkg_add-phonenumber_input.gif" hash="25fa933b55e69a552f7d1cf704a8d6f9"/><file name="bkg_back_link.png" hash="b7bd79383aa89243980329e07b55a300"/><file name="bkg_btn-close.png" hash="5438c768cd63b2476cf14418acb28709"/><file name="bkg_button.png" hash="a1bf9f994f90033e143b7e2023c0e4fb"/><file name="bkg_checkbox.png" hash="71628b28d876482b600755e577132fee"/><file name="bkg_extras.gif" hash="6b374d9759f894962259eb995a3d59f9"/><file name="bkg_info_link.png" hash="0bf3dd9b4d23c7da406fa81ccb38799e"/><file name="bkg_location-search_input.gif" hash="fcee91af0d97e50fcf698eb7485327a8"/><file name="bkg_location-selected.png" hash="efe72719a889f94f4aa24e6f6d6db8df"/><file name="bkg_location.gif" hash="937e1a367cafdcc0d4f62afb572879a1"/><file name="bkg_more-info.png" hash="3681dc9b54011dae7c81d6c4b2e74a2b"/><file name="bkg_option.gif" hash="a3b9a292d28540147bfb034060731cb3"/><file name="bkg_phonenumber_failed.png" hash="8d1a0503bfe7cdfc2e35365bba2a8f7d"/><file name="bkg_phonenumber_verify.png" hash="28f90e0364778463144004ff289d70a7"/><file name="bkg_postnl-logo.png" hash="a34b5d938234a7360e5566df9fb4273f"/><file name="bkg_postnl.png" hash="46c5f6c65f66da09b39496c7cef94e89"/><file name="bkg_radio.png" hash="3cc3ecb77e5ce62511385d59e037b398"/><file name="bkg_rwd_rate-line.png" hash="d7cc800714e0372f2bc991bc50a99ca2"/><file name="bkg_tooltip.png" hash="cbd753cc9cb873468d1bba07e70f0d2f"/><file name="bkg_tooltip_close.png" hash="6b568d6430e21e974f360f4961db9102"/><file name="ie8_bkg_transparent-white.png" hash="a603671f51cb11ed9370bcd3181741c7"/><file name="loader_default.gif" hash="9fec99d885ad6bc45aee40d1c171ca4b"/><file name="loader_mini.gif" hash="f244ab6581d4329e3dbb7e289d47dfb2"/><dir name="locations"><file name="crc_albertheijn.png" hash="57af250f9d59b9074132446e0109ee93"/><file name="crc_automaat.png" hash="e9e94287380f27f6752d89f995b1b7f4"/><file name="crc_bruna.png" hash="326912294c49e8c896a34a28a7c03127"/><file name="crc_c1000.png" hash="8628f2e6328805a84e8eac28511b6857"/><file name="crc_coop.png" hash="0250717148ab776d156371a3e0912b9e"/><file name="crc_default.png" hash="777edf1aa124f6cb13258bb510db809b"/><file name="crc_emte.png" hash="ba7841f22a08d379f1ddabbe708ffa41"/><file name="crc_gamma.png" hash="6dc0ff8b36892af40ce80a36355d311a"/><file name="crc_jumbo.png" hash="061ae156e55e3aee6130cd1beb8d1b9a"/><file name="crc_karwei.png" hash="a7b8ee695b996cb757fd5c1a98e888e4"/><file name="crc_plus.png" hash="e67e871870c87723d835db23af18d4e9"/><file name="crc_primera.png" hash="e367c1e5b3fb4e25303aff57dc1a1259"/><file name="crc_readshop.png" hash="eeef9a98c0cd68f4351154d174bfdda9"/><file name="crc_spar.png" hash="4939d469045e6c7d7e65f172d97e30b1"/><file name="crc_staples.png" hash="94136b2a8d00dfdadcad6c7088920409"/><file name="drp_albertheijn.png" hash="944b90f36d5f225fcc74d360d368e628"/><file name="drp_automaat.png" hash="ce0bd13abc5e6c647c2ac8bc0fb5c150"/><file name="drp_bruna.png" hash="feb3ea92e3d32e98edf04aa22604afe6"/><file name="drp_c1000.png" hash="9e89a865b72d182135226fc72a98e03a"/><file name="drp_coop.png" hash="ddd34926b0a306cb0b28f385a78bd972"/><file name="drp_default.png" hash="d97f2e415e54b5d9fa19893210cedbc0"/><file name="drp_emte.png" hash="34e526c095a080cf92ccf15318a56ba3"/><file name="drp_gamma.png" hash="56da28b8c2e0ad6087eb0c4408f9904c"/><file name="drp_jumbo.png" hash="f191ec9c01b807d32811d9a4f0c3ad19"/><file name="drp_karwei.png" hash="d3da2d8b7f65ddecdf13091094a8fbea"/><file name="drp_plus.png" hash="9bf96ded99d0e47b34256cdc78310754"/><file name="drp_primera.png" hash="095b1ced03087b390b96ee3d525dce7e"/><file name="drp_readshop.png" hash="d2884c0bdd81103e9319469727bc9855"/><file name="drp_spar.png" hash="9ff6bb1fc489ba714d3249c35fb01c77"/><file name="drp_staples.png" hash="2196de7813fa6db34f8b0abb1aedecd5"/><file name="tmb_albertheijn.png" hash="58ae464ff7bb420f075e53cd35d9852f"/><file name="tmb_bruna.png" hash="ff523c258b47be502b335a7e8cc5032c"/><file name="tmb_c1000.png" hash="f96136426d2a2af40ef7b76953ec58b5"/><file name="tmb_coop.png" hash="b1e41c613b1876c787e9d4d5b30ba1a5"/><file name="tmb_default.png" hash="ed65f2da1032b355422db7c86a126668"/><file name="tmb_emte.png" hash="d0e9dc8f785b8db0da8bd233a0d09a11"/><file name="tmb_gamma.png" hash="55ef36ad8aa803469e28f368b7eac536"/><file name="tmb_jumbo.png" hash="3bae16290854122b2b3439de2402c5a1"/><file name="tmb_karwei.png" hash="84e1aaceb9c0ff3864b2b7aead52e033"/><file name="tmb_plus.png" hash="fd3bf32ffb591f79935bb906249ca59e"/><file name="tmb_primera.png" hash="fb32942772b4ca57a45ee0e08406c3bc"/><file name="tmb_readshop.png" hash="6a6826139698fa20e0fd4210d17b50e2"/><file name="tmb_spar.png" hash="89694e10f073619fd944d8c2c7b9e357"/><file name="tmb_staples.png" hash="115af373105f6494c74186657ddca6a6"/></dir><file name="osc_bkg_postnl-logo.png" hash="c23e987598dcd439e54f9d48e9e4777a"/><dir name="unbranded"><file name="bkg_back_link.png" hash="5797c608687a704a935b0ff03b8d3982"/><file name="bkg_checkbox.png" hash="232ad0ec83b32af770481bb1cdd1520e"/><file name="bkg_more-info.png" hash="96a0b80b2907a28489d8d87f845d8a5f"/><file name="bkg_radio.png" hash="430bea179fc0e6570c1cca905b46454e"/><file name="bkg_tooltip_close.png" hash="eac7d71f0cb14f165b6f7af55a6c4c26"/><file name="button_action.png" hash="c297cbc6aa5c44272308b660038b363f"/><file name="button_next.png" hash="768365d31d95bb5c8b1ccebb62920a95"/><file name="loader_default.gif" hash="1645395ddefeab89f51f59b2dbcbd7c0"/><file name="loader_mini.gif" hash="2fd11016727f350b98af17fc76b3a0d3"/></dir></dir><file name="icon-tooltip.png" hash="5767601cd66b23d0b6fe8defc10dd48d"/><dir name="mijnpakket"><file name="app_buttons.png" hash="74f3a4d80dafe1a0979ce7ad0bd70824"/><file name="app_logo.png" hash="e5426bac3d0b4e28ef1f3628503c2365"/><file name="logo.png" hash="6fa95b3a5e83b6887848b5feb7369bf1"/><file name="logo_small.png" hash="c23e987598dcd439e54f9d48e9e4777a"/></dir><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="overlay.png" hash="f08feb852288bea420ba3af68ae34a1f"/><file name="postnl_email_logo.png" hash="8bd358b514e04e7ceca03efb38f8fded"/><file name="postnl_spinner.gif" hash="cef321b68ab934932ee317986823db67"/></dir></dir></dir><dir name="js"><dir name="TIG"><dir name="PostNL"><file name="ajax.js" hash="70e95fb34c21b4bdaa0c6dbf746cc6bc"/><file name="checkout.js" hash="12cdd910e633ded6e8a45b2c70168efe"/><file name="deliveryOptions.js" hash="fa9f06028b39ba791542ca73053cd0b7"/><dir name="deliveryoptions"><file name="cufon-fonts.js" hash="7605bb17619f1a55e3521a700dfe7b1a"/><file name="cufon-settings.js" hash="9bb0303049c178db309438c26f7def2c"/><file name="cufon-yui.js" hash="2d0f7f2a050cc1a9c9456d97d29f5eda"/></dir><file name="livepipe.js" hash="b9f5e38a94ce3f4f6f6ebcabca23d8c3"/><file name="mijnpakketLogin.js" hash="c677d7ba978c80efbff3a5edad0a7c7b"/><file name="placeholder.min.js" hash="c2824272a822d3fb8429a239e7d20c24"/><file name="postcodecheck.js" hash="864882d849033b308b29181dea7ce09c"/><file name="scrollbar.js" hash="b6780bb325e0ac78bc37e7b9d1bac863"/><file name="slider.js" hash="1679e9ff9a8d3784387040fc7cef9203"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="images"><dir name="TIG"><dir name="PostNL"><dir name="deliveryoptions"><dir name="locations"><file name="crc_albertheijn.png" hash="57af250f9d59b9074132446e0109ee93"/><file name="crc_automaat.png" hash="e9e94287380f27f6752d89f995b1b7f4"/><file name="crc_bruna.png" hash="326912294c49e8c896a34a28a7c03127"/><file name="crc_c1000.png" hash="8628f2e6328805a84e8eac28511b6857"/><file name="crc_coop.png" hash="0250717148ab776d156371a3e0912b9e"/><file name="crc_default.png" hash="777edf1aa124f6cb13258bb510db809b"/><file name="crc_emte.png" hash="ba7841f22a08d379f1ddabbe708ffa41"/><file name="crc_gamma.png" hash="6dc0ff8b36892af40ce80a36355d311a"/><file name="crc_jumbo.png" hash="061ae156e55e3aee6130cd1beb8d1b9a"/><file name="crc_karwei.png" hash="a7b8ee695b996cb757fd5c1a98e888e4"/><file name="crc_plus.png" hash="e67e871870c87723d835db23af18d4e9"/><file name="crc_primera.png" hash="e367c1e5b3fb4e25303aff57dc1a1259"/><file name="crc_readshop.png" hash="eeef9a98c0cd68f4351154d174bfdda9"/><file name="crc_spar.png" hash="4939d469045e6c7d7e65f172d97e30b1"/><file name="crc_staples.png" hash="94136b2a8d00dfdadcad6c7088920409"/><file name="drp_albertheijn.png" hash="944b90f36d5f225fcc74d360d368e628"/><file name="drp_automaat.png" hash="ce0bd13abc5e6c647c2ac8bc0fb5c150"/><file name="drp_bruna.png" hash="feb3ea92e3d32e98edf04aa22604afe6"/><file name="drp_c1000.png" hash="9e89a865b72d182135226fc72a98e03a"/><file name="drp_coop.png" hash="ddd34926b0a306cb0b28f385a78bd972"/><file name="drp_default.png" hash="d97f2e415e54b5d9fa19893210cedbc0"/><file name="drp_emte.png" hash="34e526c095a080cf92ccf15318a56ba3"/><file name="drp_gamma.png" hash="56da28b8c2e0ad6087eb0c4408f9904c"/><file name="drp_jumbo.png" hash="f191ec9c01b807d32811d9a4f0c3ad19"/><file name="drp_karwei.png" hash="d3da2d8b7f65ddecdf13091094a8fbea"/><file name="drp_plus.png" hash="9bf96ded99d0e47b34256cdc78310754"/><file name="drp_primera.png" hash="095b1ced03087b390b96ee3d525dce7e"/><file name="drp_readshop.png" hash="d2884c0bdd81103e9319469727bc9855"/><file name="drp_spar.png" hash="9ff6bb1fc489ba714d3249c35fb01c77"/><file name="drp_staples.png" hash="2196de7813fa6db34f8b0abb1aedecd5"/><file name="tmb_albertheijn.png" hash="58ae464ff7bb420f075e53cd35d9852f"/><file name="tmb_bruna.png" hash="ff523c258b47be502b335a7e8cc5032c"/><file name="tmb_c1000.png" hash="f96136426d2a2af40ef7b76953ec58b5"/><file name="tmb_coop.png" hash="b1e41c613b1876c787e9d4d5b30ba1a5"/><file name="tmb_default.png" hash="ed65f2da1032b355422db7c86a126668"/><file name="tmb_emte.png" hash="d0e9dc8f785b8db0da8bd233a0d09a11"/><file name="tmb_gamma.png" hash="55ef36ad8aa803469e28f368b7eac536"/><file name="tmb_jumbo.png" hash="3bae16290854122b2b3439de2402c5a1"/><file name="tmb_karwei.png" hash="84e1aaceb9c0ff3864b2b7aead52e033"/><file name="tmb_plus.png" hash="fd3bf32ffb591f79935bb906249ca59e"/><file name="tmb_primera.png" hash="fb32942772b4ca57a45ee0e08406c3bc"/><file name="tmb_readshop.png" hash="6a6826139698fa20e0fd4210d17b50e2"/><file name="tmb_spar.png" hash="89694e10f073619fd944d8c2c7b9e357"/><file name="tmb_staples.png" hash="115af373105f6494c74186657ddca6a6"/><file name="tmp_maps.jpg" hash="c8d8e93fe427b236489b2904e276e124"/></dir></dir><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="overlay.png" hash="f08feb852288bea420ba3af68ae34a1f"/><file name="postnl_spinner.gif" hash="c97d0bd9ccc8fa0b460c07caeb63c293"/></dir></dir></dir><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="cart.css" hash="4f8b417defed03e6ae8c4ec292b2e2c3"/><file name="postcodecheck.css" hash="dcc017ca8f6b882c8dd8127ab5eea42a"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="rwd.css" hash="4d14fe3ff05c4bf41a5161b113b15767"/><file name="rwd_osc.css" hash="d3b7cc449980f3dba097db6127a45f0c"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="shipping_status.css" hash="a1409f9340e4bd9962390e4f0d672512"/><file name="styles.css" hash="3b7148423e489f5a99081e585310b5d1"/><file name="system_config_edit.css" hash="103eaeae2d9e2a4a43b48a83ea7f2dad"/><file name="system_config_edit_postnl.css" hash="1c60cf93dffae89c7be8f640e3d540a2"/><file name="system_config_edit_postnl_magento16.css" hash="f9a8479639e2fe8d0da9cf602b1607c3"/></dir></dir></dir><dir name="images"><dir name="TIG"><dir name="PostNL"><file name="bkg_progress_grey.png" hash="8d4d5144292b98a23475367ede717b17"/><file name="bkg_progress_grey_begin.png" hash="6815c9264e78f8f9d2805c595f8800c4"/><file name="bkg_progress_grey_end.png" hash="dae90fdb38adf65e6ccc209b6a80372c"/><file name="bkg_progress_grey_seperator.png" hash="10178e12fd14fb783b4ae0fbd55a4a81"/><file name="bkg_progress_orange.png" hash="8a59f76e36ee0492f5341b8e5e7ee79b"/><file name="bkg_progress_orange_begin.png" hash="ecc84d5252e397f4a783ee7e0c426d63"/><file name="bkg_progress_orange_end.png" hash="d0a81dfea1a3eddc699482a62af01fc9"/><file name="bkg_progress_orange_grey_seperator.png" hash="ab558953ec4c40ef44653ab481084345"/><file name="bkg_progress_orange_seperator.png" hash="a774eb89763d95f2e60d03f8702fba86"/><file name="bkg_progress_sprite.png" hash="3230379a4544f85062a6ba91fa8083e2"/><file name="bkg_tooltip.png" hash="56cfed3ed8a65b19f8de88946d1a0a01"/><file name="btn_download_icon.png" hash="142d5ebbe43ad09dde97cd32e1ef4303"/><file name="glyph_error.gif" hash="a138b803d772f552aa2e49e1c506edbd"/><file name="glyph_go.png" hash="343996189e35c6685b90993b43059ecd"/><file name="glyph_info.gif" hash="40f72d28be63ecf2b6ef44c7ea730104"/><file name="glyph_manual.png" hash="771db63b6ffc9de1c06da564796adc6e"/><file name="glyph_pdf.png" hash="a5ea929f4014a88d7320d0293913ace3"/><file name="glyph_success.gif" hash="465a056a3ba3d94367f51c3c0b751391"/><file name="glyph_warning.gif" hash="fa817cb6d49efb9855942ef2b739fc6c"/><file name="icon-tooltip.png" hash="5767601cd66b23d0b6fe8defc10dd48d"/><file name="legend.gif" hash="d8fb0642901868d489d31b426f3e3406"/><file name="loader_default.gif" hash="9fec99d885ad6bc45aee40d1c171ca4b"/><file name="logo_postnl.png" hash="10b9ae4ad2c5365312c257dcdac1fc64"/><file name="tig_logo_medium.gif" hash="3e1071908cfdb7b472438482c3331ac7"/></dir></dir></dir><dir name="js"><dir name="TIG"><dir name="PostNL"><file name="configuration.js" hash="aeb62627c57f62eb7cbc80cd79ff00b6"/><file name="form.js" hash="473084adbee8d85843364ff4c3684201"/><file name="mass_action_filter.js" hash="b9a6163278258772b78d44214f050963"/><file name="validate.js" hash="5e3a8ecdf2a2c7830e097796348365da"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="TIG"><dir name="PostNL"><dir name="Fpdf"><dir name="font"><file name="courier.php" hash="ca6fb483549604fb4a675f9e28a73b02"/><file name="courierb.php" hash="a58d7dadf3cf564ca5d5138cea76a3a9"/><file name="courierbi.php" hash="c0e416771dc56cb2397390978d112dc2"/><file name="courieri.php" hash="419961dbeeb20f08da780dccb427dec8"/><file name="helvetica.php" hash="fc53162b924ddd522bd6cfe86fab48f4"/><file name="helveticab.php" hash="4e9ffda682a131fef2e04ccd94aa342d"/><file name="helveticabi.php" hash="6db8943bd91bf13514b82872cf160d45"/><file name="helveticai.php" hash="13b795df0c33eb93c48621792f2ea12d"/><file name="symbol.php" hash="fbd9250c21af99f6398d6f817511f91f"/><file name="times.php" hash="82bc100f1f3bd8b2d9b7fb5ee8f44b3a"/><file name="timesb.php" hash="3a241a1658bf9ea2062e63f464166c31"/><file name="timesbi.php" hash="bfdd0235a71793becefff778c2b16243"/><file name="timesi.php" hash="17fd69f176915a2113fe28057b43a75e"/><file name="zapfdingbats.php" hash="2848ab2daf3128f310b5cf713ca4acee"/></dir><file name="fpdf.css" hash="84befac49464a9aac54aa511bc1fd754"/><file name="fpdf.php" hash="4ebda2283504bfd34b85753433d7e098"/><file name="helvetica.php" hash="fc53162b924ddd522bd6cfe86fab48f4"/><file name="license.txt" hash="fb784726cfe3615da38bc23a3cac445b"/></dir><file name="Fpdf.php" hash="663a4148360bdd4b4bdb58f53079597d"/><dir name="Fpdi"><dir name="filters"><file name="FilterASCII85.php" hash="c6b756ac5874cc6f6f986349b605af64"/><file name="FilterASCII85_FPDI.php" hash="1240e0c64602864401f886546e09fe7b"/><file name="FilterLZW.php" hash="fcba53a4dd3a1f78e62c7aeac726c7b5"/><file name="FilterLZW_FPDI.php" hash="b11c50e66e20744ad20f176cae4af284"/></dir><file name="fpdf_tpl.php" hash="3966b13c398c94509e2fb6199593b104"/><file name="fpdi.php" hash="abb524d17a2cbdd3c3b7e89184aad443"/><file name="fpdi2tcpdf_bridge.php" hash="bcc317cbcfdd3faeae4a1eb480bded0f"/><file name="fpdi_pdf_parser.php" hash="d7a3bf0153ae9ad57976afb0be5d195d"/><file name="pdf_context.php" hash="0b69a25dbb830f3b68c054c2e43b876e"/><file name="pdf_parser.php" hash="5ff22a8c1ce5b1eee82c8017311a797e"/></dir><file name="Fpdi.php" hash="45a966fd0dc62d3a8399ad119e2b1222"/></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="TIG"><dir name="PostNL"><file name="track_and_trace.html" hash="b77871334fc82d5811954024b3f8058d"/></dir></dir></dir></dir><file name="TIG_PostNL.csv" hash="79fbbef7647c9adf165e94373f7eba0b"/></dir><dir name="nl_NL"><dir name="template"><dir name="email"><dir name="TIG"><dir name="PostNL"><file name="track_and_trace.html" hash="cd179f991f38cd735c834abdaa40e1a8"/></dir></dir></dir></dir><file name="TIG_PostNL.csv" hash="6ded1d298e9ba98354d4c84c90fe112a"/></dir></target><target name="magecommunity"><dir name="TIG"><dir name="PostNL"><dir name="Block"><dir name="Adminhtml"><dir name="Carrier"><dir name="Postnl"><dir name="Matrixrate"><file name="Grid.php" hash="0bb3eac6dd6c3837bf14bf50060d3f4b"/></dir><dir name="Tablerate"><file name="Grid.php" hash="f943fe7faa915d54409309663e056cdf"/></dir></dir></dir><file name="CronNotification.php" hash="8d9d7d1bdde0371cde713fd419ea8856"/><file name="LogNotification.php" hash="25465e6ab2f1885e38aff40113215539"/><dir name="Sales"><dir name="Items"><dir name="Column"><file name="Qty.php" hash="2cdbd9c2fb1f43f58ede71ab01a1fa2e"/></dir></dir><dir name="Order"><dir name="Create"><dir name="Totals"><file name="CodFee.php" hash="60fc38a411fc0e0cc76d97617876dc6a"/></dir></dir><dir name="Creditmemo"><dir name="Create"><file name="CodFee.php" hash="0efae3e6baa6b22e393df7dba77d615e"/></dir><dir name="Totals"><file name="CodFee.php" hash="6c71fc777e634298ba5d934786fd2835"/></dir></dir><dir name="Invoice"><dir name="Totals"><file name="CodFee.php" hash="71ea3fd7327c533101d437c774757b9a"/></dir></dir><file name="ProductOptions.php" hash="5e5d86afaee335f2756d640dff4ba9bd"/><dir name="Shipment"><dir name="Create"><file name="ShipmentOptions.php" hash="8db4f7c59b0efdcf66ffa9a282a3675b"/></dir><dir name="View"><file name="DeliveryOptions.php" hash="2095d9e63e01b86f15ee1912db8a99fd"/><file name="ShippingStatus.php" hash="ebfff77cb5a0359ad389d1d26213899a"/><dir name="Tab"><file name="StatusHistory.php" hash="b00b794d8c6be31587833a74e9666258"/></dir><file name="Tabs.php" hash="b30393596097cc28b153f3bea608daa4"/></dir></dir><dir name="Totals"><file name="CodFee.php" hash="97a9a7a257b77c84982248725d508082"/></dir><dir name="View"><file name="DeliveryOptions.php" hash="83981e3354a748541c702a7b854977bc"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="ActivateButton.php" hash="33e9b80d19073164a2e365b0d8d356b2"/><file name="ActivatedFieldHeader.php" hash="1e186108515469f4fb39389dc452f0f5"/><file name="Anchor.php" hash="f127dc0f0e26cd75f59327d25df1aa5f"/><file name="Checkbox.php" hash="ab2bd5412fade8ec687921b9497fe0f8"/><file name="ConfigCheck.php" hash="dbabeeb4655f867a91729ff18fc05d57"/><file name="HourMinute.php" hash="85b89538b5f78aa10ea52181e32a5cab"/><file name="InfoBox.php" hash="11a95769c25e485b9b4b949c46e90719"/><file name="MatrixrateExport.php" hash="c7bcb8da6fb432cf44e7d384a912a9be"/><file name="MatrixrateImport.php" hash="bff71a9704881bc8d0065f7e08761bd6"/><file name="Obscure.php" hash="76e85a70650159c77d041bc6f76406b5"/><file name="PackingSlipItemColumns.php" hash="a2bd2453d5af9ef28a9166db8bc25e25"/><file name="Radios.php" hash="b0fd87974970d84936f437d36dbe4ee9"/><file name="SplitAddressCheck.php" hash="794d55152b458682723a3b5fc4c5817d"/><file name="SupportTab.php" hash="81740bbec0e2d9e1d86987478aef7e4c"/><file name="TablerateExport.php" hash="c1b20095899026e0db2673fbc2e9fe25"/><file name="TablerateImport.php" hash="28a5a7d00aa8e930cbfde05c28496bb5"/><dir name="TextBox"><file name="Abstract.php" hash="e06fd34b79e5dcd990f801dc84969513"/></dir><file name="ValidateButton.php" hash="15df40ad054f16d000916cdbe2562e4a"/><file name="WarningBox.php" hash="94f6480b7e65591f3ca1847d1c9a56b1"/><file name="WizardSaveButton.php" hash="fc34edbab4fe63466f32de41986e17d8"/></dir><file name="Fieldset.php" hash="c5e88454063f63f40c1c6616f631c3f4"/></dir><file name="Form.php" hash="79272aff1dc8cd57cf2c1970240cf229"/><file name="Js.php" hash="fd5b8fbc4a36cb8a71f42e67867323e6"/></dir></dir><file name="Template.php" hash="d6ce29ba17d19e41766d2cc6aca6f07a"/><file name="UpgradeNotification.php" hash="0a89d41671a74bab8d127dcd6ced088f"/><dir name="Widget"><dir name="Form"><dir name="Element"><file name="Dependence.php" hash="136f45c0012a6443730fc081a3d60887"/></dir></dir><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Action.php" hash="1ac9ddf57b36b3c1386bb615497825c5"/><file name="Barcode.php" hash="69920c80dea7b13030b1d65870c925ca"/><file name="ConfirmDate.php" hash="fea70465fb85c6bb85e686d2b2e2e1d0"/><file name="ConfirmStatus.php" hash="7f1ec5831bb43169d6dfeeae447d6de9"/><file name="CountryArray.php" hash="db7d69073eaaa4316968faff1f0388da"/><file name="DeliveryDate.php" hash="9a9578b13bffe89c67b02a8142be359b"/><file name="OrderConfirmDate.php" hash="ea5ccdc81afda8a58ce40767a154765c"/><file name="OrderConfirmStatus.php" hash="71838dfb638b95c9bd86a717153a43a4"/><file name="OrderType.php" hash="033f58f32b0b9afa44e7305cd68c4a72"/><file name="ShipmentType.php" hash="77909f55313d7ff70c40aaef6cb64fe6"/><file name="ShippingDescription.php" hash="45bd32a5cae72f8cb39495cd063ebb2d"/><file name="ShippingPhase.php" hash="86e3b289d913c5cb4d61602adb735991"/><file name="Time.php" hash="763e60df40cc7ffd0a74dd1627e9407a"/><file name="Translate.php" hash="d52bfd19d268ccd534e14d81bd180602"/><dir name="Type"><file name="Abstract.php" hash="a3065b1b3b5b821f0d712fbfc091e0d7"/></dir><file name="YesNo.php" hash="e70fffd3ebe45e8228e3e56a44e4a1ad"/></dir></dir><dir name="Massaction"><dir name="Item"><dir name="Additional"><file name="LabelStartPos.php" hash="8d7689be432c7d03202326fd65dacf61"/><file name="ProductOptions.php" hash="6ae961fa45f61571cf9a03e9d1b5cdeb"/></dir></dir></dir></dir></dir><file name="WindowsTheme.php" hash="3edb76809f4c80ffc2d881973cd38600"/></dir><dir name="Checkout"><dir name="Cart"><file name="CheckoutLink.php" hash="b4e3201509a6d4cab10c25773ff64af8"/><file name="Js.php" hash="df28c4e6ba211d2253c323f0a8cc0451"/></dir><file name="Summary.php" hash="304b58343765950a1c0e7c9d845be9c4"/></dir><dir name="Core"><file name="JsTranslate.php" hash="9149ad01a91abd529964a6cc87417a1e"/><file name="ShippingStatus.php" hash="3d83bb7365f3fa884b244034dec1d7de"/><file name="Template.php" hash="e0c1bd6a855a39b35a69816724d28798"/></dir><dir name="DeliveryOptions"><dir name="Checkout"><file name="AddPhoneNumber.php" hash="ba4c84bcb13afd3ac45727384888f2cf"/><file name="DeliveryOptions.php" hash="d5c2656bdfc701d1b1c858e2108743c6"/></dir><file name="Js.php" hash="f20d4796a59bbb7ee3c16f21d8fd9176"/><file name="Template.php" hash="d0789924a9a8daecec789228532196d4"/><file name="Theme.php" hash="c6584155f29b7223c2f65691b172f603"/></dir><dir name="Mijnpakket"><file name="AccountNotification.php" hash="ddaf89c4ad231155a9d1a517cb87f9a3"/><file name="Js.php" hash="44b03d17d02ab6f81d6a0e208c0d6f70"/><file name="LoginButton.php" hash="a010076a745e9987750c4c3f34c2274c"/><file name="OrderSuccessJs.php" hash="47cb89ad5dbcd00e2fc11197ef0aad3b"/></dir><dir name="Payment"><dir name="Checkout"><dir name="Total"><file name="CodFee.php" hash="5a85a42e98d9862cc9ae93aa38cbdf0d"/></dir></dir><dir name="Form"><file name="Cod.php" hash="a9e8baf6862d03301f52aab14464b1b0"/></dir><file name="Info.php" hash="d48ea6ffc7bf5b1e5ba006ad851aa244"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Totals"><file name="CodFee.php" hash="c7af4f2619d3dc94e202e3f421aeb76a"/></dir></dir><dir name="Invoice"><dir name="Totals"><file name="CodFee.php" hash="ad655d6a1ed32f27862399efa5b92da3"/></dir></dir><dir name="Totals"><file name="CodFee.php" hash="9ae886d28d5b06f796081b898169443d"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AddressValidationController.php" hash="43d0df21d62477bc4bb81d151f04d721"/><dir name="Adminhtml"><file name="ConfigController.php" hash="23f42c4b445a5c9aa3fb374b5dedf9df"/><file name="ExtensionControlController.php" hash="e5b60f6df245fcb5ea268b65e0b73087"/><file name="ShipmentController.php" hash="addfc8c713ea2dbe6ee5acf0059e6df2"/></dir><file name="CheckoutController.php" hash="aaa8cdc31860c848d5ae0324289bed83"/><file name="DeliveryOptionsController.php" hash="33cea23f789c99fcd436ab7860f09291"/><file name="MijnpakketController.php" hash="bddbca0069c32c23a59405d46fe2dde3"/></dir><dir name="data"><dir name="postnl_setup"><file name="data-install-1.0.0.php" hash="4e1416ef10c0d845292e96cf1136e8cd"/><file name="data-install-1.0.3.php" hash="1513327dc5814083fc94d40ca0119980"/><file name="data-install-1.1.4.php" hash="f9b0335de97ca3d6aa204ed4737c5ad0"/><file name="data-install-1.3.0.php" hash="0fe0a6cb8d6ffac3d639cd18c794f45c"/><file name="data-install-1.4.0.php" hash="7fa08e2d5507910abad5f8304c4dce67"/><file name="data-install-1.4.1.php" hash="7fa08e2d5507910abad5f8304c4dce67"/><file name="data-upgrade-1.1.5-1.2.0.php" hash="da29d32919d5a08ec521c2e1cd1874aa"/><file name="data-upgrade-1.2.2-1.3.0.php" hash="2bbf0c4405be253a875f8f59c1442821"/><file name="data-upgrade-1.2.2-1.4.0.php" hash="594ef7e9206d640d526f5e1442d84f2a"/><file name="data-upgrade-1.3.1-1.4.0.php" hash="eff43da4dc9a0a352bb266025ee3a885"/><file name="data-upgrade-1.4.0-1.4.1.php" hash="73b0c09cde478f9e6d7108c83d55058f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="fe434232e207df1a435ca0c81c04a8fa"/><file name="config.xml" hash="c9115679dbeeeb47afeebb19c51453b2"/><file name="jstranslator.xml" hash="e236f820c0da3a671c22181e02cb5ba2"/><file name="logging.xml" hash="312538b0415b7b1b49fc4e02c0d5676c"/><file name="system.xml" hash="9a5c796f1eaa116ef19ce4891521e8a8"/></dir><dir name="Helper"><file name="AddressValidation.php" hash="7e064f22877d12a7e209f385990c513a"/><file name="Carrier.php" hash="a54d503e1f13971f960f9528a8944512"/><file name="Checkout.php" hash="1a2d78eb62c2e40bf23d8c1c49a23883"/><file name="Cif.php" hash="6f1efbcb170e5986431581c646dd1f34"/><file name="Data.php" hash="f89552da0c84858b806541775f1e4f9c"/><file name="DeliveryOptions.php" hash="4513226793f4b789131957a7ec3f8e84"/><file name="Mijnpakket.php" hash="dddb6611c326fe07d073db9f3d050b4d"/><file name="Parcelware.php" hash="9fe3d50fec782d977a8e932ee1d2f2ae"/><file name="Payment.php" hash="7e49c4aa3080904631d314196fa4c74e"/><file name="Webservices.php" hash="17e69184adb2e7d332f34b9ecda73427"/></dir><dir name="Model"><dir name="AddressValidation"><dir name="Cendris"><file name="Abstract.php" hash="93dac29ee69b1d65c602a5ede48e6c8e"/></dir><file name="Cendris.php" hash="4224a8ad05077b7897073ece6e0c4b23"/><dir name="Observer"><file name="AddressBook.php" hash="38fb2c6e676e91c5d3695d0a11fcc701"/><file name="OneStepCheckout.php" hash="0fc1a9059277fb18554e29450bbf0d95"/><file name="Onepage.php" hash="34a91f37d0cddbf98bc717f2c130cfea"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="ValidateAccount.php" hash="5ac53c664167847599c6ae4c7114e525"/></dir></dir></dir></dir><dir name="Admin"><file name="Inbox.php" hash="0d037d1d0c8ae1fd1fefa1b624ffa19d"/><dir name="Logging"><dir name="Handler"><file name="Postnl.php" hash="2b4915fdadfc2583be4366ec0bf4ffc2"/></dir><file name="Observer.php" hash="1c3aaf2c953327c9399a717810a39c2e"/></dir></dir><dir name="Adminhtml"><dir name="Form"><dir name="Element"><file name="Checkbox.php" hash="8253510969012a3a830ad5b0bfded46b"/></dir></dir><dir name="Observer"><file name="OrderGrid.php" hash="a2a9c40360c0099bc8d1bce623df5d00"/><file name="ShipmentGrid.php" hash="2bf580341a0ee2a093124b5297a6d293"/><file name="ShipmentView.php" hash="b2e29cc8df8473e0ec60fd396ef94b99"/><file name="SystemConfig.php" hash="4862b191cd4c19115c7cc43805a21759"/></dir><dir name="Support"><file name="Logs.php" hash="fe0c03278b20ef4e019e150ac2933b27"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="OrderGridColumns.php" hash="3818b302b7507e39e9002b40b667cf59"/><file name="OrderGridMassaction.php" hash="0fda13f03b2dc8663e64664fbba4c0cf"/><file name="ShipmentGridColumns.php" hash="1e382428770c61bd8881cbe1922908a4"/><file name="ShipmentGridMassaction.php" hash="7cb5725fda18eb1e0d80701b456da027"/></dir></dir></dir></dir><dir name="Carrier"><file name="Matrixrate.php" hash="19046713336a5e4532b41dd3be5f8763"/><file name="Postnl.php" hash="dce479a0796a009ecdd8a38e0ade9253"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="d63b56b522e13e9778e681d187a84852"/></dir></dir></dir><dir name="Resource"><dir name="Matrixrate"><file name="Collection.php" hash="404b6a72976e304953dccdeeb5c2443d"/></dir><file name="Matrixrate.php" hash="c3e038928829325eb4f4476a02d16040"/><dir name="Tablerate"><file name="Collection.php" hash="a4d4c9efac4dacfce2c206fa7b49a2e9"/></dir><file name="Tablerate.php" hash="8ec130f89f3376218a9c5b1d48445fbd"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Matrixrate.php" hash="3f81a596f0ea00895056af484dd3344c"/><file name="Tablerate.php" hash="92c6db2347344e9700b1e73bb4b1e942"/></dir><dir name="Source"><file name="RateType.php" hash="0f232b95f4fa39ec73bf0af7f9b6629d"/><file name="TablerateSource.php" hash="95e0c803ca2499870b14389c344d4e53"/></dir></dir></dir><file name="Tablerate.php" hash="8ce6ea57fbfd9036d2b29bed7c8eff37"/></dir><dir name="Checkout"><file name="Cif.php" hash="2424f4afac606ef2f8f53027fe0645c7"/><dir name="Observer"><file name="Order.php" hash="50f6b00c183d20d15fe7861ce9b0a360"/><file name="Shipment.php" hash="66ab0f71742fc0763628f76e1fcd7246"/></dir><file name="Order.php" hash="73e3daf62a7ea46c347d0529046377cb"/><file name="Service.php" hash="68c104b366fdfb375a430b46a8d6260b"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ActivePaymentMethods.php" hash="ec6d8b61904454f08e02bc623a560c96"/><file name="CmsPage.php" hash="efef30fccf6f01d143885bf7abf7579d"/></dir></dir></dir></dir><dir name="Core"><file name="Cache.php" hash="f986c088a0754208840c123f0eb06b21"/><dir name="Cif"><file name="Abstract.php" hash="492cb7a619de9ccb9fbd74d3cbfe6a44"/><file name="Exception.php" hash="a260a4ee2bd7535e2e7c83587c408666"/></dir><file name="Cif.php" hash="e9e73049332e469771c8233ac7a7896f"/><file name="Label.php" hash="1bbe6962e91dad40d1650dc0ac388aad"/><dir name="Observer"><file name="Barcode.php" hash="3b28a42b008bfe668585f62cf2203056"/><file name="Cache.php" hash="2050c7f64f9f80e1d9128afe2211c690"/><file name="Cron.php" hash="8364d78e60e0046204a765d56272f780"/><file name="SaveShipment.php" hash="dd6f2abea49ad9f7f55b4587bae3df81"/></dir><file name="Order.php" hash="a667a9c071c9b4be3125fc2f3bd2bdd0"/><file name="PackingSlip.php" hash="6ab101b71f7b309bba347f54308d8e6e"/><dir name="Packingslip"><dir name="Pdf"><dir name="Items"><dir name="Invoice"><file name="Default.php" hash="e2561de6907ab70e12c2c863b9e91519"/></dir></dir></dir></dir><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="27f753a23bec9e1f4cf172bc2af27e81"/></dir><file name="Order.php" hash="4956f8f4815775d98e8ce4b9345ab07d"/><dir name="Shipment"><dir name="Barcode"><file name="Collection.php" hash="9f4e6a430f88dfae411e16e10fa66ba7"/></dir><file name="Barcode.php" hash="185cd4e124fba3f4119acbd79e564c71"/><file name="Collection.php" hash="d5592876800dad736cf245754e14a6bc"/><dir name="Label"><file name="Collection.php" hash="1d9d238804a610859cb33a448730ce2c"/></dir><file name="Label.php" hash="5e4fd390edf90cd016376458471f10e6"/><dir name="Status"><dir name="History"><file name="Collection.php" hash="582b00d76a13587caa1c09ecf36af799"/></dir><file name="History.php" hash="4a3a9df70ba8e234a08301e6d9c83226"/></dir></dir><file name="Shipment.php" hash="22d40a72e475d06f35c1190549244532"/></dir><dir name="Service"><file name="InvoiceDummy.php" hash="344735e07fda436f2104d38781ef2eb1"/><file name="OrderDummy.php" hash="ecc86dead87bc875de9da25dbd526726"/></dir><file name="Service.php" hash="0ab2fade061d46eb5f3d1cae0117295d"/><dir name="Shipment"><file name="Barcode.php" hash="4952c13c19a1fb66f07067be4724d94e"/><file name="Label.php" hash="49fb6ba20c4b5c33640aad6afd402dec"/><file name="Process.php" hash="d89ca9b6fa028c3004eb722a1d23f90d"/><dir name="Status"><file name="History.php" hash="f44772e3958a06b6cb1d372d202e8754"/></dir></dir><file name="Shipment.php" hash="53cf70bc6ac36fef51fe5fba4600c46e"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="HourMinute.php" hash="b1371a9b156178516a2b8a3d6a6fbc95"/><dir name="Image"><file name="Pdf.php" hash="3bde0a9e0b6971c278bff0ddab4d752e"/></dir><file name="ValidateDefaultOption.php" hash="9342572e615f83b48536c409c5106dd1"/></dir><dir name="Source"><file name="AllProductOptions.php" hash="8e29ceffedecb3ee759d2d49f8165bc9"/><file name="Attributes.php" hash="c2954f4d6fda0f571259045001ef793f"/><file name="BuspakjeProductOptions.php" hash="c3783682c0f70c53ad1c7ce5df9444f9"/><file name="CheckoutExtensions.php" hash="ff7450fc76386d19fab7a4918cf3a8d1"/><file name="CommentType.php" hash="3bb1feb399ef1a86e5979f0c7576d9d2"/><file name="CutOffTime.php" hash="69be9922cdfd52b6be7357d5eced4e00"/><file name="DebugMode.php" hash="5049c8e87605139ff9191e2a985e86ba"/><file name="Direction.php" hash="e889a99644f2c65594fb7a42c40baca8"/><file name="EuProductOptions.php" hash="d165cfb8a457205bfaa098e8d27b7627"/><file name="GlobalProductOptions.php" hash="cf9986b69eab032c0723345bbe7a0486"/><file name="GlobalpackShipmentType.php" hash="6dcc55b6dfc837cb90ab76eb4de99075"/><file name="HourMinute.php" hash="0a1fd22a4722a2fbdf1d19c476dcaa5a"/><file name="LabelSize.php" hash="d2ca669ee577787ee53889f91675883b"/><file name="ManualAutomatic.php" hash="c91fa25d279900be653f36c6115df8b3"/><file name="PackingSlipItemFields.php" hash="407f7c52218c487301104487e595f2a0"/><file name="PakjeGemakProductOptions.php" hash="44fb7f004a98757eaf26fa9b94eeb50c"/><file name="PakketautomaatProductOptions.php" hash="54f8f5765875d2fd59b96e040c87010a"/><dir name="ProductOptions"><file name="Abstract.php" hash="79605898f197357114a1a57e562b93b0"/></dir><file name="ReferenceType.php" hash="c5d36804fab3e6029aac855973de0c0a"/><file name="ShippingDays.php" hash="cc022f570ae830d3cd36dcbe98f2bb53"/><file name="ShippingDuration.php" hash="14fd5eb486136c82f1b050b487bfebff"/><file name="ShippingMethods.php" hash="664c94c4661a3a3203bd0532f7807cc7"/><file name="StandardProductOptions.php" hash="0e0ad50ba2be0e18f4fb70edda7c535c"/><file name="StreetField.php" hash="4f0bcca87f8c14f17b6f50b95a88a43b"/><file name="StreetFieldWithDefault.php" hash="68d1a08ce9261108ad46954c213a56a2"/><file name="WeightUnit.php" hash="f87db80b4ed016f12091b897ef3876a4"/></dir></dir></dir></dir><dir name="DeliveryOptions"><file name="Cif.php" hash="6e8f84563950eff7acc0b6f81184d1e3"/><dir name="Observer"><file name="ShippingMethodAvailable.php" hash="5dde5bf6be6b1cfc6600d56f3f681b8e"/><file name="UpdatePostnlOrder.php" hash="fabef6a2e029b9fa387579eb4d584367"/></dir><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="ShippingDuration.php" hash="5a8d2656de7901700256eb85ab0857ff"/></dir></dir></dir><file name="Service.php" hash="66da6a059530ad08684424a90c29982a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="ValidateFee.php" hash="4f0b114f151c283b877bff3eec115f93"/></dir><dir name="Source"><file name="DeliveryDaysNumber.php" hash="f6d4d2635deae45d7da9ffe4dbda3b0c"/><file name="Themes.php" hash="cfdc49c7d90b66f42b57abb7724085ab"/></dir></dir></dir></dir><dir name="ExtensionControl"><file name="Feed.php" hash="8dd0a4e12b76420f578faaa0f0aa0550"/><dir name="Observer"><file name="Cron.php" hash="cc061653561f2f04b9cda32d1a98f5d3"/></dir><dir name="Webservices"><file name="Abstract.php" hash="514cbdb84c1564a1daebd9adc22e9302"/></dir><file name="Webservices.php" hash="dbc56806888de476ef81710d2c65eb03"/></dir><file name="Inbox.php" hash="ee448dbce949ba1617dae12bf3c19bee"/><dir name="Mijnpakket"><file name="Cif.php" hash="8b11581aed9412ce4d4584406d220c1f"/><file name="Service.php" hash="69d2d16472f9483f3b8b9060da0747dd"/></dir><dir name="Parcelware"><file name="Export.php" hash="59db7cc5a878983d004caf7c31c68cfc"/></dir><dir name="Payment"><file name="Cod.php" hash="ad81b6820d12448aefcd18f2c4373478"/><dir name="Observer"><file name="Cod.php" hash="886dcba29c9d0624ef5e140a6736bacb"/></dir><dir name="Order"><dir name="Creditmemo"><dir name="Total"><dir name="CodFee"><file name="Abstract.php" hash="837596f4123051513513642ad293a134"/></dir><file name="CodFee.php" hash="408441b1cd61fe3e951307e590763721"/><file name="CodFeeTax.php" hash="06bedba27001f95893e9e5bd26aab4a7"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="CodFee.php" hash="1345e1506b8cb44734b572f98e09f2ed"/><file name="CodFeeTax.php" hash="0ecb4c12a78a9fce875d675b142dc86d"/><file name="Subtotal.php" hash="cb5d753adf6c64965d9795c128d39adc"/></dir></dir><dir name="Pdf"><dir name="Total"><file name="CodFee.php" hash="318019eca0b1d998947b85ed820a6417"/><file name="Grandtotal.php" hash="531d76807d06b8f3ea824b378cede384"/><file name="Tax.php" hash="4f64ea0f29048b9e4f7140633595d8e9"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><dir name="CodFee"><file name="Abstract.php" hash="c75c2d60c9d677901fcbc3e024db5ccc"/></dir><file name="CodFee.php" hash="48c19ac6f4a480d908c88a3df6f2a9d4"/><file name="CodFeeTax.php" hash="d9697548b173663c83717428f8511322"/></dir></dir></dir><file name="Service.php" hash="03aae700a5c2ad22c2d814903cd2c447"/><dir name="System"><dir name="Config"><dir name="Source"><file name="CodFeeTaxClass.php" hash="eb6496506ef59702f4bad91045c5057f"/></dir></dir></dir></dir><dir name="Resource"><dir name="Catalog"><file name="Product.php" hash="4e3be14b3a02e60621d1f7ea884b25ab"/></dir><dir name="Db"><file name="Abstract.php" hash="71aadf67293622844145f2b612683f45"/><dir name="Collection"><file name="Postnl.php" hash="dac9729cc2c08f7ee58a9d76dab75895"/></dir></dir><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="acffdb84d3eb6f011bb3937b40134146"/></dir><dir name="Shipment"><dir name="Grid"><file name="Collection.php" hash="8ae806ead56458285892a45650cbfa95"/></dir></dir></dir><file name="Setup.php" hash="2b9090edff46cc78ee6f518091ea455b"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Checkbox.php" hash="b618fc97a1e03f04d2a72981c1696702"/></dir><dir name="Source"><file name="Testlive.php" hash="fd7cc1d769033796b9bd3ca881e65ca8"/><file name="Yesno.php" hash="43a6af0cd42ab949e114849a71682a88"/></dir></dir></dir></dir><dir name="sql"><dir name="postnl_setup"><file name="install-1.0.0.php" hash="0d46454bd70fbcd965b82b2ba8c6c241"/><file name="upgrade-1.1.5-1.2.0.php" hash="b0927fba2c4062f3235d1f6717c63ff9"/><file name="upgrade-1.2.2-1.3.0.php" hash="a55e174766cefceed7906e82a3b19a50"/><file name="upgrade-1.3.1-1.4.0.php" hash="89783d42eb8be33502c4c469c7aa3d0c"/></dir></dir><file name="Exception.php" hash="2b01ad1111201ece698fb7a336b02150"/><dir name="Controller"><dir name="Adminhtml"><file name="Config.php" hash="433bf480caaf32d0f2fd4df82a68e03b"/><file name="Shipment.php" hash="6414d91bc37fa5913460c7b445d01b4f"/></dir></dir></dir></dir></target></contents>
261
  <compatible/>
262
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
263
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>tig_postnl</name>
4
+ <version>1.5.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US">Creative Commons License</license>
7
  <channel>community</channel>
20
  - Viewing detailed shipping status information&#xD;
21
  - PostNL Checkout&#xD;
22
  - Emailing customers track &amp; trace information, allowing them to track their shipment from the moment you confirm it to the moment it arrives at their doorstep</description>
23
+ <notes>==== v1.5.1 ====&#xD;
24
+ - Added a parcel dispenser filter to the delivery options location picker.&#xD;
25
+ &#xD;
26
+ ==== Improvements ====&#xD;
27
+ - Improved the available filter options for the shipping date columns in the order and shipment grids.&#xD;
28
+ - Improved the way parcel dispenser pick-up locations are shown in the delivery options interface.&#xD;
29
+ - The chosen pick up location is now shown in Idev's OneStepCheckout's order preview pop-up.&#xD;
30
+ - It is no longer possible to configure the extension to use split address lines when there is only 1 address line available.&#xD;
31
+ - When using split address lines it is no longer possible to use the same address line for multiple fields.&#xD;
32
+ &#xD;
33
+ ==== Bug fixes ====&#xD;
34
+ - Fixed a problem that prevented PostNL Checkout orders from being placed.&#xD;
35
+ - Removed an unnecessary css link in the default Magento theme.&#xD;
36
+ - Phone numbers are no longer mandatory for PostNL post office locations. &#xD;
37
+ &#xD;
38
+ ==== v1.5.0 ====&#xD;
39
+ ==== New features ====&#xD;
40
+ - Added support for printing return labels and tracking return shipments.&#xD;
41
+ - You may now change the number of parcels in a shipment as long as the shipment has not yet been confirmed with PostNL.&#xD;
42
+ - Added the option to show the chosen delivery options and post office pick-up location in transactional e-mails.&#xD;
43
+ - Added a new mass action to the shipment grid to update the shipping status of selected shipments.&#xD;
44
+ &#xD;
45
+ ==== Improvements ====&#xD;
46
+ - The extension has been updated to CIF 1.10 specifications.&#xD;
47
+ - Cut-off times now take the store's time zone into account.&#xD;
48
+ - Improved performance in the webshop's backend.&#xD;
49
+ - Reduced the risk of extension conflicts in the order and shipment grids.&#xD;
50
+ - It is now possible to print GlobalPack shipping labels even when one of the products in the shipment is missing a country of origin value.&#xD;
51
+ - Address lines on the PostNL packing slip now have a maximum size of 33 characters (up from 20).&#xD;
52
+ - The selected post office location is now shown on the sales/guest/form pages in Magento.&#xD;
53
+ - The confirm and delivery dates of a shipment are now stored in the UTC time zone in the database.&#xD;
54
+ - The selected post office location is now shown on the OnePage Checkout progress bar during checkout.&#xD;
55
+ - The schedules of several cronjobs related to background processes have been redistributed over the day to reduce the load on the sever's cron during peak hours.&#xD;
56
+ - VAT and discounts are now taken into account when calculating a shipment's base grandtotal amount.&#xD;
57
+ - The extension will now shown a proper error message when the sever's PHP version is below the minimum version required by the PostNL extension (PHP 5.3.0).&#xD;
58
+ - Decimal values are now allowed in the alternative standard product option field.&#xD;
59
+ - Shipping labels will now be deleted from the database 30 days after the shipment has been delivered in order to give the consumer enough time to return the shipments without allowing the database to become too bloated.&#xD;
60
+ &#xD;
61
+ ==== Bug fixes ====&#xD;
62
+ - The Track &amp; Trace URL for orders which are shipped to post office locations has been modified to correctly use the postcode of the intended recipient.&#xD;
63
+ - PostNL mass actions in the order grid will no longer affect non-PostNL mass actions which may have been added by other extensions.&#xD;
64
+ - Postcodes are no longer required in order to create a Track &amp; Trace URL.&#xD;
65
+ - It is no longer possible to modify the confirmation of letter box parcel shipments without Track &amp; Trace.&#xD;
66
+ - An issue in Magento CE 1.6 and EE 1.11 has been resolved by no longer relying on the 'DEFAULT_DEST_STREET' constant value.&#xD;
67
+ - MijnPakket login and delivery options are now also compatible with Idev's OneStepCheckout when the shipping address form has been disabled.&#xD;
68
+ - Letter box parcel configuration options are now also applied to grouped products.&#xD;
69
+ - The chosen delivery day is no longer shown on the customer's account page when delivery days have been disabled in the extension's configuration.&#xD;
70
+ - Product's alternative shipping duration values are now taken into account when calculating the probable delivery day for orders when no specific delivery day was chosen during checkout.&#xD;
71
+ - Tuesday is no longer shown as a valid delivery day when monday is not a shipping day and it is already past saturday.&#xD;
72
+ &#xD;
73
+ ==== v1.4.1 ====&#xD;
74
  ==== New features ====&#xD;
75
  - Completely redesigned the configuration page of the extension!&#xD;
76
  - The extension's configuration page has now been split into a wizard-style menu for the core settings and a separate advanced options menu.&#xD;
305
  &#xD;
306
  This is the initial beta release of the extension. If you have any questions, please contact the Total Internet Group Servicedesk</notes>
307
  <authors><author><name>TiG</name><user>supporttotal</user><email>servicedesk@totalinternetgroup.nl</email></author></authors>
308
+ <date>2015-01-28</date>
309
+ <time>10:07:16</time>
310
+ <contents><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="30a82b67ec4e50a15665e4d87f71cafc"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="84043c1d8561402926445b4d364842e0"/><file name="postcode_check.phtml" hash="7c6acd718b77b449a4ede176d50a5b8e"/><file name="shipping.phtml" hash="ff44bbec353adcc3800f37cfd2970610"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="4327dd68d223063f4c0404900d9088a8"/><file name="postcode_check.phtml" hash="a73a6146daf8ed666758e53943233e17"/></dir></dir><dir name="onestepcheckout"><file name="billing_fields.phtml" hash="953919dc3e4879491cea1d0cd6fb9409"/><file name="postcode_check.phtml" hash="8cb2a6224ea6d9793c4e95b6fc2d33a6"/><file name="shipping_fields.phtml" hash="6beb31124864fa60b153967fd28e9045"/></dir><file name="validate.phtml" hash="a9518118b2e4e86d353fbebe5b59cb4d"/></dir><dir name="checkout"><dir name="cart"><file name="js.phtml" hash="ca1f64c96af24529cb7fae25649dd6ff"/><file name="link.phtml" hash="c664d663030ae0e1cd536d6634a2fc31"/><file name="spinner.phtml" hash="ef19ba5e8dc2a543e4a2db9360c9527a"/></dir><file name="summary.phtml" hash="d1892b51b7572c3c62fd63e1e0f566a5"/></dir><dir name="core"><dir name="order"><dir name="returns"><file name="info.phtml" hash="0a87220b8c30ee692e0281d92f7b7022"/><dir name="shipment"><file name="items.phtml" hash="095e421a88cf6e8e5a3f8bd741533598"/></dir></dir></dir><dir name="page"><dir name="html"><file name="js_translate.phtml" hash="b8acdcccee13c6e043a465031687224f"/></dir></dir><dir name="sales"><dir name="order"><dir name="email"><file name="delivery_options.phtml" hash="8ca9cd00da21ab0843b61f631e8e262f"/><file name="pakjegemak_address.phtml" hash="7d9370689d4c6d051b4f834fe175243f"/></dir><file name="pakje_gemak_address.phtml" hash="8049c0a142ba44f7be19522af429c294"/><dir name="shipment"><file name="shipping_status.phtml" hash="1d873f33eb6328a1b93eabbb4c703413"/></dir></dir></dir></dir><dir name="delivery_options"><file name="addlocation.phtml" hash="3d3e970cc6067c8213411f48f8066aaf"/><file name="addphonenumber.phtml" hash="bbbb9dfb5016f3440071fe06646beae6"/><file name="js.phtml" hash="999c0651e6db7f76144bd00a2e9cda13"/><dir name="onepage"><file name="available.phtml" hash="3102abf23ecf1b6b6f33dbf958887b05"/><file name="deliveryoptions.phtml" hash="a4d5637a42e85337cf8f9ed0640ede05"/><dir name="progress"><file name="pakje_gemak.phtml" hash="e1912498e50d8d06f5c0948f360d46f6"/><file name="shipping_method.phtml" hash="18af739c3aa844ffceaf0303dd4bd102"/></dir></dir><dir name="onestepcheckout"><file name="available.phtml" hash="0bbc7fbba443275f585d645db17e845a"/><file name="deliveryoptions.phtml" hash="0505c72305469ac096d486a18c2d6e5d"/></dir><file name="progress.phtml" hash="2bda26c05d53a0d34ab7424e0f9252cd"/><dir name="sales"><dir name="order"><file name="delivery_options_info.phtml" hash="ef7216d6a46e047dc0e1bac8f5efdbfc"/></dir></dir><file name="theme.phtml" hash="ae7cccad119f87a974243823797359b8"/></dir><dir name="mijnpakket"><file name="account_notification.phtml" hash="e6354525e0bce99bdcf4935d240a5192"/><file name="js.phtml" hash="18b8883f828796373bb1783dfaae8690"/><dir name="onepage"><file name="login_button.phtml" hash="bd0f7103b3a5abcd83e0d0db9d7dfc94"/></dir><dir name="onestepcheckout"><file name="login_button.phtml" hash="b6f7f1161be2f3364f9df112d131b01b"/></dir><file name="order_success_js.phtml" hash="ac96ac95e7cd40a3b2c5cb12432fd1b2"/></dir><dir name="payment"><dir name="checkout"><dir name="form"><file name="cod.phtml" hash="f1ab6e0226fe607a049aaa4b5402fefe"/></dir><dir name="total"><file name="cod_fee.phtml" hash="9273dca9058bc1e782ad6750be468d96"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="template"><dir name="TIG"><dir name="PostNL"><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="7c480af158d0e2503258c23418b28ea2"/><file name="postcode_check.phtml" hash="56ada1c322b86a1dac6139f22d9f674c"/><file name="shipping.phtml" hash="b0ba0336cb931eb8e6a0248de6f673ff"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="1cd43fabe60ed292d6674b2b0e7e66c2"/><file name="postcode_check.phtml" hash="c220d994561b6552d1e622a22a2e0982"/></dir></dir></dir><dir name="core"><dir name="sales"><dir name="order"><file name="pakje_gemak_address.phtml" hash="2329ff2eff3bba12b4a3aafc54c492ba"/></dir></dir></dir><dir name="mijnpakket"><dir name="onepage"><file name="login_button.phtml" hash="af0c9754a77b7cab5a4fb70ef2150df8"/></dir></dir></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="5213399d727c0f81439c777a4ad2032f"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><dir><dir name="address_validation"><dir name="checkout"><dir name="onepage"><file name="postcode_check.phtml" hash="01539053fdc5269593452c69918a9e7b"/></dir></dir><dir name="customer"><dir name="address"><file name="postcode_check.phtml" hash="63a7067037a0aeb8499ed162bdc01a63"/></dir></dir></dir><dir name="checkout"><dir name="cart"><file name="link.phtml" hash="0fc6bdcc0a37dabece55462219621375"/></dir></dir><dir name="mijnpakket"><dir name="onepage"><file name="login_button.phtml" hash="31fc55787f6f64e63657b62617ec1260"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="TIG"><file name="postnl.xml" hash="e10c3de8077bd5b61c33051cfeb83cac"/></dir></dir><dir name="template"><dir name="TIG"><dir name="PostNL"><file name="cron_notification.phtml" hash="68cf7bedd4b330a057ec5ced06c252f1"/><file name="integrity_notification.phtml" hash="a416c1dd905c2af75a53e50dcdbc62e5"/><file name="log_notification.phtml" hash="87b4ab095c8d2740b7f621b2c574fd91"/><dir name="payment"><dir name="checkout"><dir name="form"><file name="cod.phtml" hash="145ff33fea020e3e3148c641c9b98bc6"/></dir></dir></dir><dir name="sales"><dir name="items"><dir name="column"><file name="qty.phtml" hash="aef5915e5d811811d7128e6d50fe94d6"/></dir></dir><dir name="order"><dir name="address"><dir name="form"><file name="container.phtml" hash="87a67abbc194820b7592e759d21976dc"/></dir></dir><dir name="create"><file name="js.phtml" hash="2e41aaae2407a1f56739197d8a5fc10e"/><dir name="totals"><file name="cod_fee.phtml" hash="024424c5e3b8f23e8f424fa015ba23b6"/></dir></dir><dir name="creditmemo"><dir name="create"><dir name="totals"><file name="cod_fee.phtml" hash="e2ce7c3302b7f53f1fcc34f0c24e954d"/></dir></dir></dir><file name="filter_massaction.phtml" hash="4b574a37f32983fed3726c69825098bd"/><file name="js.phtml" hash="06a619a67d236aaa9a301462b1f8b978"/><file name="product_options.phtml" hash="cef99b2d28c7d385200fc351b7c4d5f2"/><dir name="shipment"><dir name="create"><file name="shipment_options.phtml" hash="e6b0d60b7deb85a2d2114e2e534442df"/></dir><file name="filter_massaction.phtml" hash="c108ecf1e488111a1367b9193315d546"/><dir name="view"><file name="delivery_options.phtml" hash="f589a1481601ee380b3e07941b4d16e6"/><file name="pakje_gemak_address.phtml" hash="52f2105d4e4772bb6653ddcf440e9e58"/><file name="shipping_status.phtml" hash="25bec612c31f5010e5bdf320a3f0360d"/><dir name="tab"><file name="status_history.phtml" hash="964540928c7ba7ef3ad66c5fb0d33791"/></dir></dir><file name="view.phtml" hash="6e999fb2d3838748be573873aada22f2"/></dir><dir name="totals"><file name="tax.phtml" hash="ab09fbdc3a7673ca587d8c6de4c02ffd"/></dir><dir name="view"><file name="delivery_options.phtml" hash="28fb50f8a86804b1500ab43847d4dbea"/><file name="pakje_gemak_address.phtml" hash="444ad530e9ebb95b19ecb95fae891e72"/></dir><file name="windows_theme.phtml" hash="b39af59a65373a52d7e2c3c0aa69e7b8"/></dir><dir name="shipment"><file name="customize_link.phtml" hash="a031386b81552f2c0ec02cbce6c503c4"/><file name="js.phtml" hash="44e257f8f231b817566742f569c4b452"/><file name="testmode_warning.phtml" hash="c265436ea309fe174cc436de9aaf67a2"/></dir></dir><dir name="system"><dir name="config"><file name="edit.phtml" hash="4f073927211c81a65263953cfbe87170"/><dir name="form"><dir name="field"><file name="array.phtml" hash="6bb1f404b24129b198c9c95a28c1bd66"/><file name="config_check.phtml" hash="11640be7731cf2a8e93964ab1bfbdf46"/><file name="field_header.phtml" hash="ab35d6667e3feadaf7c61735c1b30622"/><file name="info_box.phtml" hash="8479c68af9a865c17bdbea93dab39a65"/><file name="js.phtml" hash="03bb9136424511a5b83e394682ab99fe"/><file name="split_address_check.phtml" hash="9bd9a3edd07d859a117f00c3acdb2390"/><file name="support_tab.phtml" hash="b5749bdd254457c2629e7ae6d7076e05"/><file name="warning_box.phtml" hash="a5dfa40b5246147d5f64547f5990cf98"/></dir></dir></dir></dir><file name="upgrade_notification.phtml" hash="8cbd0f916da857bee9d28120f342ef08"/><dir name="widget"><dir name="grid"><dir name="massaction"><file name="label_start_pos.phtml" hash="602de274a2d446bdf6e1c2859f13500e"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TIG_PostNL.xml" hash="78c34bc4e8acdcaf4ccedf930517a14d"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="cart.css" hash="d51ab6c200da5c54eb8e672c9325dbf5"/><file name="default.css" hash="7f05bf3ebd09bc4cf13d2582afe04980"/><dir name="deliveryoptions"><file name="default.css" hash="571855c5e1ee8c0465c1fbd86334f253"/><file name="ie8.css" hash="1f0e04ca6c7be6572defb3adadafd28a"/><file name="mediaqueries.css" hash="e6356d2f85ca4fc3894911bf396cccdb"/><file name="neutral.css" hash="4b3b09545e3395f302e1efd487bf2739"/><file name="onestepcheckout.css" hash="fd7d786cc66c34b81555111e34c062eb"/><file name="onestepcheckout_mediaqueries.css" hash="2eb1086de2c12f7b728794fdf5ae431c"/><file name="onestepcheckout_neutral.css" hash="cb2cc910a3e96ed3fc9b23d20a6f34eb"/></dir><file name="messages.css" hash="19d03101c862b45535bc08344c12716a"/><file name="mijnpakket.css" hash="23e980e096acc95a740f5136cc38d377"/><file name="postcodecheck.css" hash="84a497060c26440c6e387d2f7a26e0fd"/><file name="returns.css" hash="23a6cb90aa662d2f866459e8ddf9a38a"/><file name="shipping_status.css" hash="fcb3fe311d50ee93176dc29ef2d5a0b9"/></dir></dir></dir><dir name="images"><dir name="TIG"><dir name="PostNL"><file name="bkg_progress_small.png" hash="fc6c9f28b6a6aae6f0096d504c0952df"/><file name="bkg_tooltip.png" hash="56cfed3ed8a65b19f8de88946d1a0a01"/><dir name="deliveryoptions"><file name="bkg_add-location.png" hash="a30d4aea73b094df5f434f9856dc626b"/><file name="bkg_add-phonenumber_input.gif" hash="25fa933b55e69a552f7d1cf704a8d6f9"/><file name="bkg_back_link.png" hash="b7bd79383aa89243980329e07b55a300"/><file name="bkg_btn-close.png" hash="5438c768cd63b2476cf14418acb28709"/><file name="bkg_button.png" hash="a1bf9f994f90033e143b7e2023c0e4fb"/><file name="bkg_checkbox.png" hash="71628b28d876482b600755e577132fee"/><file name="bkg_extras.gif" hash="6b374d9759f894962259eb995a3d59f9"/><file name="bkg_info_link.png" hash="0bf3dd9b4d23c7da406fa81ccb38799e"/><file name="bkg_location-search_input.gif" hash="fcee91af0d97e50fcf698eb7485327a8"/><file name="bkg_location-selected.png" hash="efe72719a889f94f4aa24e6f6d6db8df"/><file name="bkg_location.gif" hash="937e1a367cafdcc0d4f62afb572879a1"/><file name="bkg_more-info.png" hash="3681dc9b54011dae7c81d6c4b2e74a2b"/><file name="bkg_option.gif" hash="a3b9a292d28540147bfb034060731cb3"/><file name="bkg_phonenumber_failed.png" hash="8d1a0503bfe7cdfc2e35365bba2a8f7d"/><file name="bkg_phonenumber_verify.png" hash="28f90e0364778463144004ff289d70a7"/><file name="bkg_postnl-logo.png" hash="a34b5d938234a7360e5566df9fb4273f"/><file name="bkg_postnl.png" hash="46c5f6c65f66da09b39496c7cef94e89"/><file name="bkg_radio.png" hash="3cc3ecb77e5ce62511385d59e037b398"/><file name="bkg_rwd_rate-line.png" hash="d7cc800714e0372f2bc991bc50a99ca2"/><file name="bkg_tooltip.png" hash="cbd753cc9cb873468d1bba07e70f0d2f"/><file name="bkg_tooltip_close.png" hash="6b568d6430e21e974f360f4961db9102"/><file name="ie8_bkg_transparent-white.png" hash="a603671f51cb11ed9370bcd3181741c7"/><file name="loader_default.gif" hash="9fec99d885ad6bc45aee40d1c171ca4b"/><file name="loader_mini.gif" hash="f244ab6581d4329e3dbb7e289d47dfb2"/><dir name="locations"><file name="crc_albertheijn.png" hash="57af250f9d59b9074132446e0109ee93"/><file name="crc_automaat.png" hash="e9e94287380f27f6752d89f995b1b7f4"/><file name="crc_bruna.png" hash="326912294c49e8c896a34a28a7c03127"/><file name="crc_c1000.png" hash="8628f2e6328805a84e8eac28511b6857"/><file name="crc_coop.png" hash="0250717148ab776d156371a3e0912b9e"/><file name="crc_default.png" hash="777edf1aa124f6cb13258bb510db809b"/><file name="crc_emte.png" hash="ba7841f22a08d379f1ddabbe708ffa41"/><file name="crc_gamma.png" hash="6dc0ff8b36892af40ce80a36355d311a"/><file name="crc_jumbo.png" hash="061ae156e55e3aee6130cd1beb8d1b9a"/><file name="crc_karwei.png" hash="a7b8ee695b996cb757fd5c1a98e888e4"/><file name="crc_plus.png" hash="e67e871870c87723d835db23af18d4e9"/><file name="crc_primera.png" hash="e367c1e5b3fb4e25303aff57dc1a1259"/><file name="crc_readshop.png" hash="eeef9a98c0cd68f4351154d174bfdda9"/><file name="crc_spar.png" hash="4939d469045e6c7d7e65f172d97e30b1"/><file name="crc_staples.png" hash="94136b2a8d00dfdadcad6c7088920409"/><file name="drp_albertheijn.png" hash="944b90f36d5f225fcc74d360d368e628"/><file name="drp_automaat.png" hash="ce0bd13abc5e6c647c2ac8bc0fb5c150"/><file name="drp_bruna.png" hash="feb3ea92e3d32e98edf04aa22604afe6"/><file name="drp_c1000.png" hash="9e89a865b72d182135226fc72a98e03a"/><file name="drp_coop.png" hash="ddd34926b0a306cb0b28f385a78bd972"/><file name="drp_default.png" hash="d97f2e415e54b5d9fa19893210cedbc0"/><file name="drp_emte.png" hash="34e526c095a080cf92ccf15318a56ba3"/><file name="drp_gamma.png" hash="56da28b8c2e0ad6087eb0c4408f9904c"/><file name="drp_jumbo.png" hash="f191ec9c01b807d32811d9a4f0c3ad19"/><file name="drp_karwei.png" hash="d3da2d8b7f65ddecdf13091094a8fbea"/><file name="drp_plus.png" hash="9bf96ded99d0e47b34256cdc78310754"/><file name="drp_primera.png" hash="095b1ced03087b390b96ee3d525dce7e"/><file name="drp_readshop.png" hash="d2884c0bdd81103e9319469727bc9855"/><file name="drp_spar.png" hash="9ff6bb1fc489ba714d3249c35fb01c77"/><file name="drp_staples.png" hash="2196de7813fa6db34f8b0abb1aedecd5"/><file name="tmb_albertheijn.png" hash="58ae464ff7bb420f075e53cd35d9852f"/><file name="tmb_bruna.png" hash="ff523c258b47be502b335a7e8cc5032c"/><file name="tmb_c1000.png" hash="f96136426d2a2af40ef7b76953ec58b5"/><file name="tmb_coop.png" hash="b1e41c613b1876c787e9d4d5b30ba1a5"/><file name="tmb_default.png" hash="ed65f2da1032b355422db7c86a126668"/><file name="tmb_emte.png" hash="d0e9dc8f785b8db0da8bd233a0d09a11"/><file name="tmb_gamma.png" hash="55ef36ad8aa803469e28f368b7eac536"/><file name="tmb_jumbo.png" hash="3bae16290854122b2b3439de2402c5a1"/><file name="tmb_karwei.png" hash="84e1aaceb9c0ff3864b2b7aead52e033"/><file name="tmb_plus.png" hash="fd3bf32ffb591f79935bb906249ca59e"/><file name="tmb_primera.png" hash="fb32942772b4ca57a45ee0e08406c3bc"/><file name="tmb_readshop.png" hash="6a6826139698fa20e0fd4210d17b50e2"/><file name="tmb_spar.png" hash="89694e10f073619fd944d8c2c7b9e357"/><file name="tmb_staples.png" hash="115af373105f6494c74186657ddca6a6"/></dir><file name="osc_bkg_postnl-logo.png" hash="c23e987598dcd439e54f9d48e9e4777a"/><dir name="unbranded"><file name="bkg_back_link.png" hash="5797c608687a704a935b0ff03b8d3982"/><file name="bkg_checkbox.png" hash="232ad0ec83b32af770481bb1cdd1520e"/><file name="bkg_more-info.png" hash="96a0b80b2907a28489d8d87f845d8a5f"/><file name="bkg_radio.png" hash="430bea179fc0e6570c1cca905b46454e"/><file name="bkg_tooltip_close.png" hash="eac7d71f0cb14f165b6f7af55a6c4c26"/><file name="button_action.png" hash="c297cbc6aa5c44272308b660038b363f"/><file name="button_next.png" hash="768365d31d95bb5c8b1ccebb62920a95"/><file name="loader_default.gif" hash="1645395ddefeab89f51f59b2dbcbd7c0"/><file name="loader_mini.gif" hash="2fd11016727f350b98af17fc76b3a0d3"/></dir></dir><file name="icon-tooltip.png" hash="5767601cd66b23d0b6fe8defc10dd48d"/><dir name="mijnpakket"><file name="app_buttons.png" hash="74f3a4d80dafe1a0979ce7ad0bd70824"/><file name="app_logo.png" hash="e5426bac3d0b4e28ef1f3628503c2365"/><file name="logo.png" hash="6fa95b3a5e83b6887848b5feb7369bf1"/><file name="logo_small.png" hash="c23e987598dcd439e54f9d48e9e4777a"/></dir><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="overlay.png" hash="f08feb852288bea420ba3af68ae34a1f"/><file name="postnl_email_logo.png" hash="8bd358b514e04e7ceca03efb38f8fded"/><file name="postnl_spinner.gif" hash="cef321b68ab934932ee317986823db67"/></dir></dir></dir><dir name="js"><dir name="TIG"><dir name="PostNL"><file name="ajax.js" hash="70e95fb34c21b4bdaa0c6dbf746cc6bc"/><file name="checkout.js" hash="12cdd910e633ded6e8a45b2c70168efe"/><file name="deliveryOptions.js" hash="1fc224efcf08ff7f6a6fdadb419b0ad1"/><dir name="deliveryoptions"><file name="cufon-fonts.js" hash="7605bb17619f1a55e3521a700dfe7b1a"/><file name="cufon-settings.js" hash="9bb0303049c178db309438c26f7def2c"/><file name="cufon-yui.js" hash="2d0f7f2a050cc1a9c9456d97d29f5eda"/></dir><file name="livepipe.js" hash="b9f5e38a94ce3f4f6f6ebcabca23d8c3"/><file name="mijnpakketLogin.js" hash="897b60e83cee04e31763236b9fce9dae"/><file name="placeholder.min.js" hash="c2824272a822d3fb8429a239e7d20c24"/><file name="postcodecheck.js" hash="864882d849033b308b29181dea7ce09c"/><file name="scrollbar.js" hash="b6780bb325e0ac78bc37e7b9d1bac863"/><file name="slider.js" hash="1679e9ff9a8d3784387040fc7cef9203"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="images"><dir name="TIG"><dir name="PostNL"><dir name="deliveryoptions"><dir name="locations"><file name="crc_albertheijn.png" hash="57af250f9d59b9074132446e0109ee93"/><file name="crc_automaat.png" hash="e9e94287380f27f6752d89f995b1b7f4"/><file name="crc_bruna.png" hash="326912294c49e8c896a34a28a7c03127"/><file name="crc_c1000.png" hash="8628f2e6328805a84e8eac28511b6857"/><file name="crc_coop.png" hash="0250717148ab776d156371a3e0912b9e"/><file name="crc_default.png" hash="777edf1aa124f6cb13258bb510db809b"/><file name="crc_emte.png" hash="ba7841f22a08d379f1ddabbe708ffa41"/><file name="crc_gamma.png" hash="6dc0ff8b36892af40ce80a36355d311a"/><file name="crc_jumbo.png" hash="061ae156e55e3aee6130cd1beb8d1b9a"/><file name="crc_karwei.png" hash="a7b8ee695b996cb757fd5c1a98e888e4"/><file name="crc_plus.png" hash="e67e871870c87723d835db23af18d4e9"/><file name="crc_primera.png" hash="e367c1e5b3fb4e25303aff57dc1a1259"/><file name="crc_readshop.png" hash="eeef9a98c0cd68f4351154d174bfdda9"/><file name="crc_spar.png" hash="4939d469045e6c7d7e65f172d97e30b1"/><file name="crc_staples.png" hash="94136b2a8d00dfdadcad6c7088920409"/><file name="drp_albertheijn.png" hash="944b90f36d5f225fcc74d360d368e628"/><file name="drp_automaat.png" hash="ce0bd13abc5e6c647c2ac8bc0fb5c150"/><file name="drp_bruna.png" hash="feb3ea92e3d32e98edf04aa22604afe6"/><file name="drp_c1000.png" hash="9e89a865b72d182135226fc72a98e03a"/><file name="drp_coop.png" hash="ddd34926b0a306cb0b28f385a78bd972"/><file name="drp_default.png" hash="d97f2e415e54b5d9fa19893210cedbc0"/><file name="drp_emte.png" hash="34e526c095a080cf92ccf15318a56ba3"/><file name="drp_gamma.png" hash="56da28b8c2e0ad6087eb0c4408f9904c"/><file name="drp_jumbo.png" hash="f191ec9c01b807d32811d9a4f0c3ad19"/><file name="drp_karwei.png" hash="d3da2d8b7f65ddecdf13091094a8fbea"/><file name="drp_plus.png" hash="9bf96ded99d0e47b34256cdc78310754"/><file name="drp_primera.png" hash="095b1ced03087b390b96ee3d525dce7e"/><file name="drp_readshop.png" hash="d2884c0bdd81103e9319469727bc9855"/><file name="drp_spar.png" hash="9ff6bb1fc489ba714d3249c35fb01c77"/><file name="drp_staples.png" hash="2196de7813fa6db34f8b0abb1aedecd5"/><file name="tmb_albertheijn.png" hash="58ae464ff7bb420f075e53cd35d9852f"/><file name="tmb_bruna.png" hash="ff523c258b47be502b335a7e8cc5032c"/><file name="tmb_c1000.png" hash="f96136426d2a2af40ef7b76953ec58b5"/><file name="tmb_coop.png" hash="b1e41c613b1876c787e9d4d5b30ba1a5"/><file name="tmb_default.png" hash="ed65f2da1032b355422db7c86a126668"/><file name="tmb_emte.png" hash="d0e9dc8f785b8db0da8bd233a0d09a11"/><file name="tmb_gamma.png" hash="55ef36ad8aa803469e28f368b7eac536"/><file name="tmb_jumbo.png" hash="3bae16290854122b2b3439de2402c5a1"/><file name="tmb_karwei.png" hash="84e1aaceb9c0ff3864b2b7aead52e033"/><file name="tmb_plus.png" hash="fd3bf32ffb591f79935bb906249ca59e"/><file name="tmb_primera.png" hash="fb32942772b4ca57a45ee0e08406c3bc"/><file name="tmb_readshop.png" hash="6a6826139698fa20e0fd4210d17b50e2"/><file name="tmb_spar.png" hash="89694e10f073619fd944d8c2c7b9e357"/><file name="tmb_staples.png" hash="115af373105f6494c74186657ddca6a6"/><file name="tmp_maps.jpg" hash="c8d8e93fe427b236489b2904e276e124"/></dir></dir><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="overlay.png" hash="f08feb852288bea420ba3af68ae34a1f"/><file name="postnl_spinner.gif" hash="c97d0bd9ccc8fa0b460c07caeb63c293"/></dir></dir></dir><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="cart.css" hash="4f8b417defed03e6ae8c4ec292b2e2c3"/><file name="postcodecheck.css" hash="dcc017ca8f6b882c8dd8127ab5eea42a"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="rwd.css" hash="4d14fe3ff05c4bf41a5161b113b15767"/><file name="rwd_osc.css" hash="d3b7cc449980f3dba097db6127a45f0c"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="TIG"><dir name="PostNL"><file name="shipping_status.css" hash="d70f88078aa443807d249b3bf51320bf"/><file name="styles.css" hash="99c3298ef947a3e2d4a8aec7c88248cd"/><file name="system_config_edit.css" hash="103eaeae2d9e2a4a43b48a83ea7f2dad"/><file name="system_config_edit_postnl.css" hash="d25851e44a1d5c9beff046c2c0450ad0"/><file name="system_config_edit_postnl_magento16.css" hash="f9a8479639e2fe8d0da9cf602b1607c3"/></dir></dir></dir><dir name="images"><dir name="TIG"><dir name="PostNL"><file name="bkg_progress_grey.png" hash="8d4d5144292b98a23475367ede717b17"/><file name="bkg_progress_grey_begin.png" hash="6815c9264e78f8f9d2805c595f8800c4"/><file name="bkg_progress_grey_end.png" hash="dae90fdb38adf65e6ccc209b6a80372c"/><file name="bkg_progress_grey_seperator.png" hash="10178e12fd14fb783b4ae0fbd55a4a81"/><file name="bkg_progress_orange.png" hash="8a59f76e36ee0492f5341b8e5e7ee79b"/><file name="bkg_progress_orange_begin.png" hash="ecc84d5252e397f4a783ee7e0c426d63"/><file name="bkg_progress_orange_end.png" hash="d0a81dfea1a3eddc699482a62af01fc9"/><file name="bkg_progress_orange_grey_seperator.png" hash="ab558953ec4c40ef44653ab481084345"/><file name="bkg_progress_orange_seperator.png" hash="a774eb89763d95f2e60d03f8702fba86"/><file name="bkg_progress_sprite.png" hash="3230379a4544f85062a6ba91fa8083e2"/><file name="bkg_progress_sprite_reverse.png" hash="c27c9ac49dd3c82f6351307d7b63f36a"/><file name="bkg_tooltip.png" hash="56cfed3ed8a65b19f8de88946d1a0a01"/><file name="btn_download_icon.png" hash="142d5ebbe43ad09dde97cd32e1ef4303"/><file name="glyph_error.gif" hash="a138b803d772f552aa2e49e1c506edbd"/><file name="glyph_go.png" hash="343996189e35c6685b90993b43059ecd"/><file name="glyph_info.gif" hash="40f72d28be63ecf2b6ef44c7ea730104"/><file name="glyph_manual.png" hash="771db63b6ffc9de1c06da564796adc6e"/><file name="glyph_pdf.png" hash="a5ea929f4014a88d7320d0293913ace3"/><file name="glyph_success.gif" hash="465a056a3ba3d94367f51c3c0b751391"/><file name="glyph_warning.gif" hash="fa817cb6d49efb9855942ef2b739fc6c"/><file name="icon-tooltip.png" hash="5767601cd66b23d0b6fe8defc10dd48d"/><file name="legend.gif" hash="d8fb0642901868d489d31b426f3e3406"/><file name="loader_default.gif" hash="9fec99d885ad6bc45aee40d1c171ca4b"/><file name="logo_postnl.png" hash="10b9ae4ad2c5365312c257dcdac1fc64"/><file name="tig_logo_medium.gif" hash="3e1071908cfdb7b472438482c3331ac7"/></dir></dir></dir><dir name="js"><dir name="TIG"><dir name="PostNL"><file name="configuration.js" hash="aeb62627c57f62eb7cbc80cd79ff00b6"/><file name="form.js" hash="319106ff0367204958686e496ab27682"/><file name="mass_action_filter.js" hash="7daee0fd9088b90618aae7b63b16567c"/><file name="validate.js" hash="0db7b6629c718490f57a071121dfb108"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="TIG"><dir name="PostNL"><dir name="Fpdf"><dir name="font"><file name="courier.php" hash="ca6fb483549604fb4a675f9e28a73b02"/><file name="courierb.php" hash="a58d7dadf3cf564ca5d5138cea76a3a9"/><file name="courierbi.php" hash="c0e416771dc56cb2397390978d112dc2"/><file name="courieri.php" hash="419961dbeeb20f08da780dccb427dec8"/><file name="helvetica.php" hash="fc53162b924ddd522bd6cfe86fab48f4"/><file name="helveticab.php" hash="4e9ffda682a131fef2e04ccd94aa342d"/><file name="helveticabi.php" hash="6db8943bd91bf13514b82872cf160d45"/><file name="helveticai.php" hash="13b795df0c33eb93c48621792f2ea12d"/><file name="symbol.php" hash="fbd9250c21af99f6398d6f817511f91f"/><file name="times.php" hash="82bc100f1f3bd8b2d9b7fb5ee8f44b3a"/><file name="timesb.php" hash="3a241a1658bf9ea2062e63f464166c31"/><file name="timesbi.php" hash="bfdd0235a71793becefff778c2b16243"/><file name="timesi.php" hash="17fd69f176915a2113fe28057b43a75e"/><file name="zapfdingbats.php" hash="2848ab2daf3128f310b5cf713ca4acee"/></dir><file name="fpdf.css" hash="84befac49464a9aac54aa511bc1fd754"/><file name="fpdf.php" hash="4ebda2283504bfd34b85753433d7e098"/><file name="helvetica.php" hash="fc53162b924ddd522bd6cfe86fab48f4"/><file name="license.txt" hash="fb784726cfe3615da38bc23a3cac445b"/></dir><file name="Fpdf.php" hash="663a4148360bdd4b4bdb58f53079597d"/><dir name="Fpdi"><dir name="filters"><file name="FilterASCII85.php" hash="c6b756ac5874cc6f6f986349b605af64"/><file name="FilterASCII85_FPDI.php" hash="1240e0c64602864401f886546e09fe7b"/><file name="FilterLZW.php" hash="fcba53a4dd3a1f78e62c7aeac726c7b5"/><file name="FilterLZW_FPDI.php" hash="b11c50e66e20744ad20f176cae4af284"/></dir><file name="fpdf_tpl.php" hash="3966b13c398c94509e2fb6199593b104"/><file name="fpdi.php" hash="abb524d17a2cbdd3c3b7e89184aad443"/><file name="fpdi2tcpdf_bridge.php" hash="bcc317cbcfdd3faeae4a1eb480bded0f"/><file name="fpdi_pdf_parser.php" hash="d7a3bf0153ae9ad57976afb0be5d195d"/><file name="pdf_context.php" hash="0b69a25dbb830f3b68c054c2e43b876e"/><file name="pdf_parser.php" hash="5ff22a8c1ce5b1eee82c8017311a797e"/></dir><file name="Fpdi.php" hash="45a966fd0dc62d3a8399ad119e2b1222"/></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="TIG"><dir name="PostNL"><file name="return_label.html" hash="dd2ad306d092b7dd481a0a972733f8bb"/><file name="track_and_trace.html" hash="b77871334fc82d5811954024b3f8058d"/></dir></dir></dir></dir><file name="TIG_PostNL.csv" hash="028fbaa7e2adb3f73200a41865caafc3"/></dir><dir name="nl_NL"><dir name="template"><dir name="email"><dir name="TIG"><dir name="PostNL"><file name="return_label.html" hash="cd54d668b8e1958cb50aa7abf1bc280b"/><file name="track_and_trace.html" hash="cd179f991f38cd735c834abdaa40e1a8"/></dir></dir></dir></dir><file name="TIG_PostNL.csv" hash="e29c685868af7675fd0dfba3132bf428"/></dir></target><target name="magecommunity"><dir name="TIG"><dir name="PostNL"><dir name="Block"><dir name="Adminhtml"><dir name="Carrier"><dir name="Postnl"><dir name="Matrixrate"><file name="Grid.php" hash="0bb3eac6dd6c3837bf14bf50060d3f4b"/></dir><dir name="Tablerate"><file name="Grid.php" hash="f943fe7faa915d54409309663e056cdf"/></dir></dir></dir><file name="CronNotification.php" hash="8d9d7d1bdde0371cde713fd419ea8856"/><file name="IntegrityNotification.php" hash="c517659ba1b61d7b00bc95fa0ffdc33c"/><file name="LogNotification.php" hash="220b897112bf5f0e5a8d95e90e221cf8"/><dir name="Sales"><dir name="Items"><dir name="Column"><file name="Qty.php" hash="2cdbd9c2fb1f43f58ede71ab01a1fa2e"/></dir></dir><dir name="Order"><dir name="Create"><dir name="Totals"><file name="CodFee.php" hash="60fc38a411fc0e0cc76d97617876dc6a"/></dir></dir><dir name="Creditmemo"><dir name="Create"><file name="CodFee.php" hash="0efae3e6baa6b22e393df7dba77d615e"/></dir><dir name="Totals"><file name="CodFee.php" hash="6c71fc777e634298ba5d934786fd2835"/></dir></dir><dir name="Invoice"><dir name="Totals"><file name="CodFee.php" hash="71ea3fd7327c533101d437c774757b9a"/></dir></dir><file name="ProductOptions.php" hash="5e5d86afaee335f2756d640dff4ba9bd"/><dir name="Shipment"><dir name="Create"><file name="ShipmentOptions.php" hash="8db4f7c59b0efdcf66ffa9a282a3675b"/></dir><dir name="View"><file name="DeliveryOptions.php" hash="b3e8881b565e1b48915235ac8a6744ae"/><file name="ShippingStatus.php" hash="97f9cad6432e2ac12924539048b7d0ba"/><dir name="Tab"><file name="StatusHistory.php" hash="6dd5cd70e509fb164b17585efbce7d2f"/></dir><file name="Tabs.php" hash="b30393596097cc28b153f3bea608daa4"/></dir></dir><dir name="Totals"><file name="CodFee.php" hash="97a9a7a257b77c84982248725d508082"/></dir><dir name="View"><file name="DeliveryOptions.php" hash="921c6ca54e49e84f473a2590af68e3a9"/></dir></dir><dir name="Returns"><file name="Grid.php" hash="26d384aa33d8462147810ed39ec60f8e"/></dir><file name="Returns.php" hash="4bac3a7614c8b3f2a52c2877551ab49e"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="ActivateButton.php" hash="33e9b80d19073164a2e365b0d8d356b2"/><file name="ActivatedFieldHeader.php" hash="1e186108515469f4fb39389dc452f0f5"/><file name="AddressLines.php" hash="75cde5b91d30e50a2898239439bd9f6e"/><file name="Anchor.php" hash="f127dc0f0e26cd75f59327d25df1aa5f"/><file name="Checkbox.php" hash="ab2bd5412fade8ec687921b9497fe0f8"/><file name="ConfigCheck.php" hash="dbabeeb4655f867a91729ff18fc05d57"/><file name="HourMinute.php" hash="4d75dceadf75cb2d21e55521816cf11a"/><file name="InfoBox.php" hash="11a95769c25e485b9b4b949c46e90719"/><file name="MatrixrateExport.php" hash="c7bcb8da6fb432cf44e7d384a912a9be"/><file name="MatrixrateImport.php" hash="bff71a9704881bc8d0065f7e08761bd6"/><file name="Obscure.php" hash="76e85a70650159c77d041bc6f76406b5"/><file name="PackingSlipItemColumns.php" hash="a2bd2453d5af9ef28a9166db8bc25e25"/><file name="Radios.php" hash="b0fd87974970d84936f437d36dbe4ee9"/><file name="SplitAddressCheck.php" hash="794d55152b458682723a3b5fc4c5817d"/><file name="SupportTab.php" hash="81740bbec0e2d9e1d86987478aef7e4c"/><file name="TablerateExport.php" hash="c1b20095899026e0db2673fbc2e9fe25"/><file name="TablerateImport.php" hash="28a5a7d00aa8e930cbfde05c28496bb5"/><dir name="TextBox"><file name="Abstract.php" hash="e06fd34b79e5dcd990f801dc84969513"/></dir><dir name="Tooltip"><file name="HourMinute.php" hash="036220bfec18f65be691383155d9ba8d"/></dir><file name="ValidateButton.php" hash="15df40ad054f16d000916cdbe2562e4a"/><file name="WarningBox.php" hash="94f6480b7e65591f3ca1847d1c9a56b1"/><file name="WizardSaveButton.php" hash="fc34edbab4fe63466f32de41986e17d8"/></dir><file name="Fieldset.php" hash="c8b49c29b9ac4446d5fe1a3b9f4a5047"/></dir><file name="Form.php" hash="fb36f7aceeb2d8f24841be0f00ce854a"/><file name="Js.php" hash="fd5b8fbc4a36cb8a71f42e67867323e6"/></dir></dir><file name="Template.php" hash="d6ce29ba17d19e41766d2cc6aca6f07a"/><file name="UpgradeNotification.php" hash="e47f682df3628237dbd4c793caeb35f9"/><dir name="Widget"><dir name="Form"><dir name="Element"><file name="Dependence.php" hash="136f45c0012a6443730fc081a3d60887"/></dir></dir><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="ConfirmDate.php" hash="c3a25e3a16ef03b92ff3dc7a18466c2b"/></dir><dir name="Renderer"><file name="Action.php" hash="1ac9ddf57b36b3c1386bb615497825c5"/><file name="Barcode.php" hash="69920c80dea7b13030b1d65870c925ca"/><file name="ConfirmDate.php" hash="c2a451a240a3ebba3f1bacc90d34c5ac"/><file name="ConfirmStatus.php" hash="7f1ec5831bb43169d6dfeeae447d6de9"/><file name="CountryArray.php" hash="db7d69073eaaa4316968faff1f0388da"/><file name="DeliveryDate.php" hash="1f199a2a305ffeffdb47ae49289fbfa5"/><file name="OrderConfirmDate.php" hash="46acb6b1fed0e07cb5fc0e6bc12532bd"/><file name="OrderConfirmStatus.php" hash="71838dfb638b95c9bd86a717153a43a4"/><file name="OrderType.php" hash="033f58f32b0b9afa44e7305cd68c4a72"/><file name="ShipmentType.php" hash="77909f55313d7ff70c40aaef6cb64fe6"/><file name="ShippingDescription.php" hash="45bd32a5cae72f8cb39495cd063ebb2d"/><file name="ShippingPhase.php" hash="86e3b289d913c5cb4d61602adb735991"/><file name="Time.php" hash="763e60df40cc7ffd0a74dd1627e9407a"/><file name="Translate.php" hash="d52bfd19d268ccd534e14d81bd180602"/><dir name="Type"><file name="Abstract.php" hash="a3065b1b3b5b821f0d712fbfc091e0d7"/></dir><file name="YesNo.php" hash="e70fffd3ebe45e8228e3e56a44e4a1ad"/></dir></dir><dir name="Massaction"><dir name="Item"><dir name="Additional"><file name="LabelStartPos.php" hash="8d7689be432c7d03202326fd65dacf61"/><file name="ProductOptions.php" hash="6ae961fa45f61571cf9a03e9d1b5cdeb"/></dir></dir></dir></dir></dir><file name="WindowsTheme.php" hash="3edb76809f4c80ffc2d881973cd38600"/></dir><dir name="Checkout"><dir name="Cart"><file name="CheckoutLink.php" hash="b4e3201509a6d4cab10c25773ff64af8"/><file name="Js.php" hash="df28c4e6ba211d2253c323f0a8cc0451"/></dir><file name="Summary.php" hash="304b58343765950a1c0e7c9d845be9c4"/></dir><dir name="Core"><file name="JsTranslate.php" hash="9149ad01a91abd529964a6cc87417a1e"/><dir name="Order"><dir name="Returns"><file name="Info.php" hash="77bb5b78ce6091bc9fbb2bef12e6ca8b"/><dir name="Shipment"><file name="Items.php" hash="32830c84fdc977e05c668d665a85aa70"/></dir></dir></dir><file name="ShippingStatus.php" hash="3d83bb7365f3fa884b244034dec1d7de"/><file name="Template.php" hash="e0c1bd6a855a39b35a69816724d28798"/></dir><dir name="DeliveryOptions"><dir name="Checkout"><file name="AddPhoneNumber.php" hash="ba4c84bcb13afd3ac45727384888f2cf"/><file name="DeliveryOptions.php" hash="737c39fa9a836e6c8eb9415cfdc538e2"/><file name="Progress.php" hash="3262dc937d55fdf466963cd18257c539"/></dir><file name="Js.php" hash="7a9eb3d08d47fe7ec1b7b0bac478e40e"/><file name="Template.php" hash="d0789924a9a8daecec789228532196d4"/><file name="Theme.php" hash="c6584155f29b7223c2f65691b172f603"/></dir><dir name="Mijnpakket"><file name="AccountNotification.php" hash="ddaf89c4ad231155a9d1a517cb87f9a3"/><file name="Js.php" hash="44b03d17d02ab6f81d6a0e208c0d6f70"/><file name="LoginButton.php" hash="8f91459a72b8b0c2559b6f1a3c94d452"/><file name="OrderSuccessJs.php" hash="47cb89ad5dbcd00e2fc11197ef0aad3b"/></dir><dir name="Payment"><dir name="Checkout"><dir name="Total"><file name="CodFee.php" hash="5a85a42e98d9862cc9ae93aa38cbdf0d"/></dir></dir><dir name="Form"><file name="Cod.php" hash="a9e8baf6862d03301f52aab14464b1b0"/></dir><file name="Info.php" hash="d48ea6ffc7bf5b1e5ba006ad851aa244"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Totals"><file name="CodFee.php" hash="c7af4f2619d3dc94e202e3f421aeb76a"/></dir></dir><dir name="Invoice"><dir name="Totals"><file name="CodFee.php" hash="ad655d6a1ed32f27862399efa5b92da3"/></dir></dir><dir name="Totals"><file name="CodFee.php" hash="9ae886d28d5b06f796081b898169443d"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AddressValidationController.php" hash="43d0df21d62477bc4bb81d151f04d721"/><dir name="Adminhtml"><file name="ConfigController.php" hash="db8176c86cd3df2020e43f3f3e052557"/><file name="ExtensionControlController.php" hash="6a0ba1a1a7f6fa8b4e943ebb22a4560b"/><file name="ReturnsController.php" hash="e5bbe1843b7309763b50db1d6f083536"/><file name="ShipmentController.php" hash="ff91facbc4d9726b209da27dab04fe3c"/></dir><file name="CheckoutController.php" hash="1f2dd7a16caa9a0598829ca550198d07"/><file name="DeliveryOptionsController.php" hash="a133264803897d6758b2504e361939b4"/><file name="GuestController.php" hash="3d45907a9fa20ac6bc0ae896ecad8965"/><file name="MijnpakketController.php" hash="bddbca0069c32c23a59405d46fe2dde3"/><file name="OrderController.php" hash="f453ab0d907cc5da2ba06450f9e23722"/></dir><dir name="data"><dir name="postnl_setup"><file name="data-install-1.0.0.php" hash="4e1416ef10c0d845292e96cf1136e8cd"/><file name="data-install-1.0.3.php" hash="1513327dc5814083fc94d40ca0119980"/><file name="data-install-1.1.4.php" hash="f9b0335de97ca3d6aa204ed4737c5ad0"/><file name="data-install-1.3.0.php" hash="0fe0a6cb8d6ffac3d639cd18c794f45c"/><file name="data-install-1.4.0.php" hash="7fa08e2d5507910abad5f8304c4dce67"/><file name="data-install-1.4.1.php" hash="7fa08e2d5507910abad5f8304c4dce67"/><file name="data-upgrade-1.1.5-1.2.0.php" hash="da29d32919d5a08ec521c2e1cd1874aa"/><file name="data-upgrade-1.2.2-1.3.0.php" hash="2bbf0c4405be253a875f8f59c1442821"/><file name="data-upgrade-1.2.2-1.4.0.php" hash="594ef7e9206d640d526f5e1442d84f2a"/><file name="data-upgrade-1.3.1-1.4.0.php" hash="eff43da4dc9a0a352bb266025ee3a885"/><file name="data-upgrade-1.4.0-1.4.1.php" hash="73b0c09cde478f9e6d7108c83d55058f"/><file name="data-upgrade-1.4.1-1.5.0.php" hash="e284b78cbeb1fb5c340e30679215c5e8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="fef4eb6b01497c7f6d1a4ad5b47e5c6c"/><file name="config.xml" hash="634d5931cbc9aa7a886e4dd936813ef7"/><file name="jstranslator.xml" hash="2dc873aaf53943d0a4c1d18b752e1c0e"/><file name="logging.xml" hash="245a6833e6099eb66cf3307714267760"/><file name="system.xml" hash="ceda77ef45be1660d2347ded80f9c912"/></dir><dir name="Helper"><file name="AddressValidation.php" hash="74cb844b29c499a0a4b1abdc5bbab23c"/><file name="Carrier.php" hash="f94f284ac65bd4dce016fe9c28ea6c57"/><file name="Checkout.php" hash="23d54a63440207f6d7d11a1118df4532"/><file name="Cif.php" hash="0734a810a51ae9e40d2e20404c63a468"/><file name="Data.php" hash="2d760475327b01526b18135c4d517e09"/><file name="DeliveryOptions.php" hash="3861d4d68c88862d35a7578fc3d7fe76"/><file name="Mijnpakket.php" hash="dddb6611c326fe07d073db9f3d050b4d"/><file name="Parcelware.php" hash="9fe3d50fec782d977a8e932ee1d2f2ae"/><file name="Payment.php" hash="7e49c4aa3080904631d314196fa4c74e"/><file name="Webservices.php" hash="17e69184adb2e7d332f34b9ecda73427"/></dir><dir name="Model"><dir name="AddressValidation"><dir name="Cendris"><file name="Abstract.php" hash="93dac29ee69b1d65c602a5ede48e6c8e"/></dir><file name="Cendris.php" hash="4224a8ad05077b7897073ece6e0c4b23"/><dir name="Observer"><file name="AddressBook.php" hash="38fb2c6e676e91c5d3695d0a11fcc701"/><file name="OneStepCheckout.php" hash="0fc1a9059277fb18554e29450bbf0d95"/><file name="Onepage.php" hash="34a91f37d0cddbf98bc717f2c130cfea"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="ValidateAccount.php" hash="5ac53c664167847599c6ae4c7114e525"/></dir></dir></dir></dir><dir name="Admin"><file name="Inbox.php" hash="0d037d1d0c8ae1fd1fefa1b624ffa19d"/><dir name="Logging"><dir name="Handler"><file name="Postnl.php" hash="d15b8932a3b02bdc0cc4efbaff15e009"/></dir><file name="Observer.php" hash="1c3aaf2c953327c9399a717810a39c2e"/></dir></dir><dir name="Adminhtml"><dir name="Form"><dir name="Element"><file name="Checkbox.php" hash="8253510969012a3a830ad5b0bfded46b"/></dir></dir><dir name="Observer"><file name="OrderGrid.php" hash="66ab6e6ae4c4bfaff52a9d4aa0fcc49c"/><file name="ShipmentGrid.php" hash="8f53beccfa175c79f11e6909590b5968"/><file name="ShipmentView.php" hash="ed9b413e38b48e6390b93c614a990db9"/><file name="SystemConfig.php" hash="4862b191cd4c19115c7cc43805a21759"/></dir><dir name="Support"><file name="Logs.php" hash="fe0c03278b20ef4e019e150ac2933b27"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="OrderGridColumns.php" hash="3818b302b7507e39e9002b40b667cf59"/><file name="OrderGridMassaction.php" hash="0fda13f03b2dc8663e64664fbba4c0cf"/><file name="ShipmentGridColumns.php" hash="248a75d2c60fa0b46e0436560eb7c300"/><file name="ShipmentGridMassaction.php" hash="cc9ff2b62d4394aa1f2bade6172dfe21"/></dir></dir></dir></dir><dir name="Carrier"><file name="Matrixrate.php" hash="19046713336a5e4532b41dd3be5f8763"/><file name="Postnl.php" hash="de84ca33c776d3a544a17a24ac8dae9d"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="d63b56b522e13e9778e681d187a84852"/></dir></dir></dir><dir name="Resource"><dir name="Matrixrate"><file name="Collection.php" hash="404b6a72976e304953dccdeeb5c2443d"/></dir><file name="Matrixrate.php" hash="c3e038928829325eb4f4476a02d16040"/><dir name="Tablerate"><file name="Collection.php" hash="a4d4c9efac4dacfce2c206fa7b49a2e9"/></dir><file name="Tablerate.php" hash="8ec130f89f3376218a9c5b1d48445fbd"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Matrixrate.php" hash="3f81a596f0ea00895056af484dd3344c"/><file name="Tablerate.php" hash="92c6db2347344e9700b1e73bb4b1e942"/></dir><dir name="Source"><file name="RateType.php" hash="0f232b95f4fa39ec73bf0af7f9b6629d"/><file name="TablerateSource.php" hash="95e0c803ca2499870b14389c344d4e53"/></dir></dir></dir><file name="Tablerate.php" hash="8ce6ea57fbfd9036d2b29bed7c8eff37"/></dir><dir name="Checkout"><file name="Cif.php" hash="2424f4afac606ef2f8f53027fe0645c7"/><dir name="Observer"><file name="Order.php" hash="50f6b00c183d20d15fe7861ce9b0a360"/><file name="Shipment.php" hash="66ab0f71742fc0763628f76e1fcd7246"/></dir><file name="Order.php" hash="73e3daf62a7ea46c347d0529046377cb"/><file name="Service.php" hash="087ebf2c45fabc469f6cb10a99ba2fba"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ActivePaymentMethods.php" hash="ec6d8b61904454f08e02bc623a560c96"/><file name="CmsPage.php" hash="efef30fccf6f01d143885bf7abf7579d"/></dir></dir></dir></dir><dir name="Core"><file name="Cache.php" hash="f986c088a0754208840c123f0eb06b21"/><dir name="Cif"><file name="Abstract.php" hash="138dae936778d09eee32017ea97cc3c4"/><file name="Exception.php" hash="a260a4ee2bd7535e2e7c83587c408666"/></dir><file name="Cif.php" hash="d90fc4bba36eb50f21b27a05d7ec1b23"/><file name="Label.php" hash="d917b56fd388b329b9ba78b931988bcc"/><dir name="Observer"><file name="Barcode.php" hash="b3b90729949538f7485ca30de9b1d65c"/><file name="Cache.php" hash="2050c7f64f9f80e1d9128afe2211c690"/><file name="Cron.php" hash="eb270498b88cd07a5251ad6bf70a5a34"/><file name="Returns.php" hash="44653ff37f7cf3aabf12cf8a56e6a310"/><file name="SaveShipment.php" hash="dd6f2abea49ad9f7f55b4587bae3df81"/></dir><file name="Order.php" hash="f967e8846482752d71ea875f273a8a42"/><file name="PackingSlip.php" hash="a7c07818cecb474e08c73010adc33ffd"/><dir name="Packingslip"><dir name="Pdf"><dir name="Items"><dir name="Invoice"><file name="Default.php" hash="e2561de6907ab70e12c2c863b9e91519"/></dir></dir></dir></dir><dir name="Resource"><dir name="Integrity"><file name="Collection.php" hash="540de0e07435d3e9b015d1cdb4826ba8"/></dir><file name="Integrity.php" hash="919c166146701e3a63ef6a0262b9b4f3"/><dir name="Order"><file name="Collection.php" hash="27f753a23bec9e1f4cf172bc2af27e81"/></dir><file name="Order.php" hash="18b235e5ff33e16572f0cea3e3d5733d"/><dir name="Shipment"><dir name="Barcode"><file name="Collection.php" hash="9f4e6a430f88dfae411e16e10fa66ba7"/></dir><file name="Barcode.php" hash="185cd4e124fba3f4119acbd79e564c71"/><file name="Collection.php" hash="d5592876800dad736cf245754e14a6bc"/><dir name="Label"><file name="Collection.php" hash="1d9d238804a610859cb33a448730ce2c"/></dir><file name="Label.php" hash="5e4fd390edf90cd016376458471f10e6"/><dir name="Status"><dir name="History"><file name="Collection.php" hash="fb0cf3a36d15b265823df5702ef7dab7"/></dir><file name="History.php" hash="4a3a9df70ba8e234a08301e6d9c83226"/></dir></dir><file name="Shipment.php" hash="dcf064a2011a49e935137e3358562772"/></dir><dir name="Service"><file name="IntegrityCheck.php" hash="3abbf58a3fca6d479ce0c44442c7d747"/><file name="InvoiceDummy.php" hash="344735e07fda436f2104d38781ef2eb1"/><file name="OrderDummy.php" hash="ecc86dead87bc875de9da25dbd526726"/><file name="PaymentDummy.php" hash="ac4188658dcef27445ca3bae8f1b3607"/><file name="PaymentMethodDummy.php" hash="b61ae0196d8e4d5261b19e39fa42ad07"/></dir><file name="Service.php" hash="16d733fc5ccf3cd4acb3584a22e50b6a"/><dir name="Shipment"><file name="Barcode.php" hash="c6a935c3939d9dd4231f8f8d470aa481"/><file name="Label.php" hash="aebc6b0839115c159c4312aded20a1a4"/><file name="Process.php" hash="d89ca9b6fa028c3004eb722a1d23f90d"/><dir name="Status"><file name="History.php" hash="0ec7ec0a695b10fffb3c3d3614474e78"/></dir></dir><file name="Shipment.php" hash="8945e91c38b5438c66f710f7cb73215d"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="HourMinute.php" hash="b1371a9b156178516a2b8a3d6a6fbc95"/><dir name="Image"><file name="Pdf.php" hash="3bde0a9e0b6971c278bff0ddab4d752e"/></dir><file name="ValidateDefaultOption.php" hash="9342572e615f83b48536c409c5106dd1"/></dir><dir name="Source"><file name="AllProductOptions.php" hash="175b584e2d510167e7fec866ed05c086"/><file name="Attributes.php" hash="c2954f4d6fda0f571259045001ef793f"/><file name="BuspakjeProductOptions.php" hash="c3783682c0f70c53ad1c7ce5df9444f9"/><file name="CheckoutExtensions.php" hash="ff7450fc76386d19fab7a4918cf3a8d1"/><file name="CommentType.php" hash="be9b0760241f17cd56dcddf2a3b5d462"/><file name="CutOffTime.php" hash="69be9922cdfd52b6be7357d5eced4e00"/><file name="DebugMode.php" hash="5049c8e87605139ff9191e2a985e86ba"/><file name="Direction.php" hash="e889a99644f2c65594fb7a42c40baca8"/><file name="EuProductOptions.php" hash="d165cfb8a457205bfaa098e8d27b7627"/><file name="GlobalProductOptions.php" hash="cf9986b69eab032c0723345bbe7a0486"/><file name="GlobalpackShipmentType.php" hash="6dcc55b6dfc837cb90ab76eb4de99075"/><file name="HourMinute.php" hash="0a1fd22a4722a2fbdf1d19c476dcaa5a"/><file name="LabelSize.php" hash="d2ca669ee577787ee53889f91675883b"/><file name="ManualAutomatic.php" hash="c91fa25d279900be653f36c6115df8b3"/><file name="PackingSlipItemFields.php" hash="407f7c52218c487301104487e595f2a0"/><file name="PakjeGemakProductOptions.php" hash="44fb7f004a98757eaf26fa9b94eeb50c"/><file name="PakketautomaatProductOptions.php" hash="54f8f5765875d2fd59b96e040c87010a"/><dir name="ProductOptions"><file name="Abstract.php" hash="79605898f197357114a1a57e562b93b0"/></dir><file name="ReferenceType.php" hash="c5d36804fab3e6029aac855973de0c0a"/><file name="ShippingDays.php" hash="9a6e02ebbf394cb4e3a38c34153ee74c"/><file name="ShippingDuration.php" hash="14fd5eb486136c82f1b050b487bfebff"/><file name="ShippingMethods.php" hash="664c94c4661a3a3203bd0532f7807cc7"/><file name="StandardProductOptions.php" hash="0e0ad50ba2be0e18f4fb70edda7c535c"/><file name="StaticBlocks.php" hash="518e9cd78f5d5074ddd83e0fd1bbf7c8"/><file name="StreetField.php" hash="0898af8ea2a5358fdce9494d78406f7d"/><file name="StreetFieldWithDefault.php" hash="68d1a08ce9261108ad46954c213a56a2"/><file name="WeightUnit.php" hash="f87db80b4ed016f12091b897ef3876a4"/></dir></dir></dir></dir><dir name="DeliveryOptions"><file name="Cif.php" hash="233d335e7b3186a3c6205e1a45bef7d9"/><dir name="Observer"><file name="ShippingMethodAvailable.php" hash="5dde5bf6be6b1cfc6600d56f3f681b8e"/><file name="UpdatePostnlOrder.php" hash="fabef6a2e029b9fa387579eb4d584367"/></dir><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="ShippingDuration.php" hash="310975088d003ed149fbaec627cfc1aa"/></dir></dir></dir><file name="Service.php" hash="ecaff03df04c7923a8ac33bd0c218c19"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="ValidateFee.php" hash="4f0b114f151c283b877bff3eec115f93"/></dir><dir name="Source"><file name="DeliveryDaysNumber.php" hash="f6d4d2635deae45d7da9ffe4dbda3b0c"/><file name="Themes.php" hash="cfdc49c7d90b66f42b57abb7724085ab"/></dir></dir></dir></dir><dir name="ExtensionControl"><file name="Config.php" hash="4952952a3b3ae5cfd9606c6e35e3a757"/><file name="Feed.php" hash="8dd0a4e12b76420f578faaa0f0aa0550"/><dir name="Observer"><file name="Cron.php" hash="e7aa63be6ac3689c535e2d239f0cf627"/></dir><dir name="Webservices"><file name="Abstract.php" hash="023fd15659e73abee4292dda2c85173e"/></dir><file name="Webservices.php" hash="05454f45903f2f9829a1c11d2c05bd37"/></dir><file name="Inbox.php" hash="ee448dbce949ba1617dae12bf3c19bee"/><dir name="Mijnpakket"><file name="Cif.php" hash="8b11581aed9412ce4d4584406d220c1f"/><file name="Service.php" hash="69d2d16472f9483f3b8b9060da0747dd"/></dir><dir name="Parcelware"><file name="Export.php" hash="59db7cc5a878983d004caf7c31c68cfc"/></dir><dir name="Payment"><file name="Cod.php" hash="ad81b6820d12448aefcd18f2c4373478"/><dir name="Observer"><file name="Cod.php" hash="886dcba29c9d0624ef5e140a6736bacb"/></dir><dir name="Order"><dir name="Creditmemo"><dir name="Total"><dir name="CodFee"><file name="Abstract.php" hash="837596f4123051513513642ad293a134"/></dir><file name="CodFee.php" hash="408441b1cd61fe3e951307e590763721"/><file name="CodFeeTax.php" hash="06bedba27001f95893e9e5bd26aab4a7"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="CodFee.php" hash="1345e1506b8cb44734b572f98e09f2ed"/><file name="CodFeeTax.php" hash="0ecb4c12a78a9fce875d675b142dc86d"/><file name="Subtotal.php" hash="cb5d753adf6c64965d9795c128d39adc"/></dir></dir><dir name="Pdf"><dir name="Total"><file name="CodFee.php" hash="318019eca0b1d998947b85ed820a6417"/><file name="Grandtotal.php" hash="531d76807d06b8f3ea824b378cede384"/><file name="Tax.php" hash="4f64ea0f29048b9e4f7140633595d8e9"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><dir name="CodFee"><file name="Abstract.php" hash="c75c2d60c9d677901fcbc3e024db5ccc"/></dir><file name="CodFee.php" hash="48c19ac6f4a480d908c88a3df6f2a9d4"/><file name="CodFeeTax.php" hash="d9697548b173663c83717428f8511322"/></dir></dir></dir><file name="Service.php" hash="03aae700a5c2ad22c2d814903cd2c447"/><dir name="System"><dir name="Config"><dir name="Source"><file name="CodFeeTaxClass.php" hash="eb6496506ef59702f4bad91045c5057f"/></dir></dir></dir></dir><dir name="Resource"><dir name="Catalog"><file name="Product.php" hash="4e3be14b3a02e60621d1f7ea884b25ab"/></dir><dir name="Db"><file name="Abstract.php" hash="71aadf67293622844145f2b612683f45"/><dir name="Collection"><file name="Postnl.php" hash="dac9729cc2c08f7ee58a9d76dab75895"/></dir></dir><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="acffdb84d3eb6f011bb3937b40134146"/></dir><dir name="Shipment"><dir name="Grid"><file name="Collection.php" hash="8ae806ead56458285892a45650cbfa95"/></dir></dir><file name="Shipment.php" hash="b46ad0f74b111408bc58a63a05d73eca"/></dir><file name="Setup.php" hash="ebebe9a24131049cf07ad59a9a8fb2b5"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Checkbox.php" hash="b618fc97a1e03f04d2a72981c1696702"/></dir><dir name="Source"><file name="Testlive.php" hash="fd7cc1d769033796b9bd3ca881e65ca8"/><file name="Yesno.php" hash="43a6af0cd42ab949e114849a71682a88"/></dir></dir></dir></dir><dir name="sql"><dir name="postnl_setup"><file name="install-1.0.0.php" hash="0d46454bd70fbcd965b82b2ba8c6c241"/><file name="upgrade-1.1.5-1.2.0.php" hash="b0927fba2c4062f3235d1f6717c63ff9"/><file name="upgrade-1.2.2-1.3.0.php" hash="a55e174766cefceed7906e82a3b19a50"/><file name="upgrade-1.3.1-1.4.0.php" hash="89783d42eb8be33502c4c469c7aa3d0c"/><file name="upgrade-1.4.1-1.5.0.php" hash="8cefe4cbe234ed19eb3fd082b6260ff0"/></dir></dir><file name="Exception.php" hash="2b01ad1111201ece698fb7a336b02150"/><dir name="Controller"><dir name="Adminhtml"><file name="Config.php" hash="9a93641ee31eff0994cac065106123df"/><file name="Shipment.php" hash="51f27daea9829253ac40f0f6d89425e1"/></dir><file name="Sales.php" hash="b77ac98167f0e56bafb32bb9ccfdfaa4"/></dir></dir></dir></target></contents>
311
  <compatible/>
312
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
313
  </package>
skin/adminhtml/default/default/css/TIG/PostNL/shipping_status.css CHANGED
@@ -1,4 +1,4 @@
1
- .progress-wrapper { color:#555; height:34px; width:100%; background:url(../../../images/TIG/PostNL/bkg_progress_sprite.png) 0 0 repeat-x; margin:20px 0; position:relative; }
2
  .progress-wrapper .progress { width:25%; float:left; text-align:center; height:34px; }
3
  .progress-wrapper .progress strong { display:inline-block; padding-top:8px; }
4
  .progress-wrapper .progress span { display:block; position:absolute; top:0; }
@@ -47,4 +47,30 @@
47
 
48
  .status-delivered .progress-delivered .end { background:url(../../../images/TIG/PostNL/bkg_progress_sprite.png) 0 -238px no-repeat; }
49
 
50
- .hidden { display:none !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .progress-wrapper { color:#555; height:34px; width:100%; background:url(../../../images/TIG/PostNL/bkg_progress_sprite.png) 0 0 repeat-x; margin:5px 0 20px; position:relative; }
2
  .progress-wrapper .progress { width:25%; float:left; text-align:center; height:34px; }
3
  .progress-wrapper .progress strong { display:inline-block; padding-top:8px; }
4
  .progress-wrapper .progress span { display:block; position:absolute; top:0; }
47
 
48
  .status-delivered .progress-delivered .end { background:url(../../../images/TIG/PostNL/bkg_progress_sprite.png) 0 -238px no-repeat; }
49
 
50
+
51
+ #postnl_return_bar .seperator { background:url(../../../images/TIG/PostNL/bkg_progress_sprite_reverse.png) 0 -136px no-repeat; }
52
+ #postnl_return_bar .begin { background:url(../../../images/TIG/PostNL/bkg_progress_sprite_reverse.png) 0 -170px no-repeat; }
53
+ #postnl_return_bar .end { background:url(../../../images/TIG/PostNL/bkg_progress_sprite_reverse.png) 0 -238px no-repeat; }
54
+
55
+ #postnl_return_bar.status-delivered .begin { background-position:0 -204px; }
56
+ #postnl_return_bar.status-delivered .seperator { background-position:0 -68px; }
57
+ #postnl_return_bar.status-collection .end,
58
+ #postnl_return_bar.status-distribution .end,
59
+ #postnl_return_bar.status-transit .end,
60
+ #postnl_return_bar.status-delivered .end { background-position:0 -272px; }
61
+
62
+ #postnl_return_bar.status-transit .begin { background-position:0 -170px; }
63
+
64
+ #postnl_return_bar.status-collection .progress-distribution .seperator,
65
+ #postnl_return_bar.status-distribution .progress-transit .seperator,
66
+ #postnl_return_bar.status-transit .progress-delivered .seperator { background-position:0 -102px; }
67
+
68
+ #postnl_return_bar.status-distribution .progress-distribution .seperator,
69
+ #postnl_return_bar.status-transit .progress-transit .seperator,
70
+ #postnl_return_bar.status-transit .progress-distribution .seperator,
71
+ #postnl_return_bar.status-transit .progress progress-collection .seperator { background-position:0 -68px; }
72
+
73
+ .hidden { display:none !important; }
74
+
75
+
76
+
skin/adminhtml/default/default/css/TIG/PostNL/styles.css CHANGED
@@ -12,7 +12,7 @@ a.postnl-message {color:#EA7601 !important; text-decoration:underline;}
12
 
13
  /* Waiting notification */
14
  .waiting-notification { width:100%; height:999em; position:absolute; top:83px; left:0; background:rgba(255, 255, 255, .7); }
15
- .waiting-notification .content { text-align:center; background:#fef4eb; border:4px solid #f5bf8c; height:136px; width:436px; position:fixed; left:50%; top:50%; margin:-68px 0 0 -218px; z-index:100; }
16
  .waiting-notification .content img { margin:20px 0 15px; }
17
 
18
  /* General */
@@ -44,6 +44,7 @@ button.download span span { background:none !important; padding:0 !important; }
44
 
45
  /* Delivery options info */
46
  div#postnl_delivery_option_info { border: 1px solid #D6D6D6; margin:10px 0 10px 0; }
 
47
 
48
  /* Shipping options */
49
  div#postnl_is_buspakje_container p { display: inline-block; }
12
 
13
  /* Waiting notification */
14
  .waiting-notification { width:100%; height:999em; position:absolute; top:83px; left:0; background:rgba(255, 255, 255, .7); }
15
+ .waiting-notification .content { text-align:center; background:#fef4eb; border:4px solid #f5bf8c; min-height:136px; width:436px; position:fixed; left:50%; top:50%; margin:-68px 0 0 -218px; z-index:100; }
16
  .waiting-notification .content img { margin:20px 0 15px; }
17
 
18
  /* General */
44
 
45
  /* Delivery options info */
46
  div#postnl_delivery_option_info { border: 1px solid #D6D6D6; margin:10px 0 10px 0; }
47
+ div#postnl_delivery_option_info.hor-scroll { overflow:visible; }
48
 
49
  /* Shipping options */
50
  div#postnl_is_buspakje_container p { display: inline-block; }
skin/adminhtml/default/default/css/TIG/PostNL/system_config_edit_postnl.css CHANGED
@@ -39,8 +39,10 @@ input.postnl-validate-empty-failed.input-text { border-color:#f00 !important; }
39
  /* PostNL specific fields */
40
  .columns .postnl-support .form-list td.value input[type="checkbox"][id*="use_"] { margin: inherit; vertical-align: middle; }
41
  button.postnl-button { width:280px; margin-right:5px; }
42
- #row_postnl_cif_labels_and_confirming_cutoff_time td.value label { margin: 0 10px; }
43
- #row_postnl_cif_labels_and_confirming_cutoff_time td.value select { width:50px !important; }
 
 
44
  #postnl_config_loader { width:100%; height:60px; text-align:center; background:url(../../../images/TIG/PostNL/loader_default.gif) center top no-repeat; padding-top:42px; }
45
  #row_postnl_packing_slip_item_columns .value.with-tooltip {width:680px; }
46
  #row_postnl_packing_slip_item_columns .grid { width:650px; float:left; }
39
  /* PostNL specific fields */
40
  .columns .postnl-support .form-list td.value input[type="checkbox"][id*="use_"] { margin: inherit; vertical-align: middle; }
41
  button.postnl-button { width:280px; margin-right:5px; }
42
+ #row_postnl_cif_labels_and_confirming_cutoff_time td.value label,
43
+ #row_postnl_cif_labels_and_confirming_sunday_cutoff_time td.value label{ margin: 0 10px; }
44
+ #row_postnl_cif_labels_and_confirming_cutoff_time td.value select,
45
+ #row_postnl_cif_labels_and_confirming_sunday_cutoff_time td.value select{ width:50px !important; }
46
  #postnl_config_loader { width:100%; height:60px; text-align:center; background:url(../../../images/TIG/PostNL/loader_default.gif) center top no-repeat; padding-top:42px; }
47
  #row_postnl_packing_slip_item_columns .value.with-tooltip {width:680px; }
48
  #row_postnl_packing_slip_item_columns .grid { width:650px; float:left; }
skin/adminhtml/default/default/images/TIG/PostNL/bkg_progress_sprite_reverse.png ADDED
Binary file
skin/adminhtml/default/default/js/TIG/PostNL/form.js CHANGED
@@ -528,6 +528,12 @@ FormElementDependenceController.prototype = {
528
  if (!from || valuesFrom[idFrom].indexOf(from.value) == -1) {
529
  shouldShowUp = false;
530
  }
 
 
 
 
 
 
531
  } else {
532
  if (from && from.type == 'checkbox') {
533
  var shouldBeChecked = (valuesFrom[idFrom] === '1');
@@ -561,4 +567,4 @@ FormElementDependenceController.prototype = {
561
  $(idTo).up(this._config.levels_up).hide();
562
  }
563
  }
564
- }
528
  if (!from || valuesFrom[idFrom].indexOf(from.value) == -1) {
529
  shouldShowUp = false;
530
  }
531
+ } else if ((typeof valuesFrom[idFrom]) == 'object' && valuesFrom[idFrom].eval) {
532
+ var fromValue = from.value;
533
+
534
+ if (!eval(valuesFrom[idFrom].eval.replace('{{value}}', fromValue))) {
535
+ shouldShowUp = false;
536
+ }
537
  } else {
538
  if (from && from.type == 'checkbox') {
539
  var shouldBeChecked = (valuesFrom[idFrom] === '1');
567
  $(idTo).up(this._config.levels_up).hide();
568
  }
569
  }
570
+ };
skin/adminhtml/default/default/js/TIG/PostNL/mass_action_filter.js CHANGED
@@ -263,6 +263,16 @@ PostnlMassActionFilter.prototype = {
263
  },
264
 
265
  hideOptions : function() {
 
 
 
 
 
 
 
 
 
 
266
  this.massactionObject.formAdditional.select('select').each(function(element) {
267
  element.up().hide();
268
  });
263
  },
264
 
265
  hideOptions : function() {
266
+ var selectedOption = this.massactionObject.form.select('select')[0];
267
+ if (!selectedOption) {
268
+ return;
269
+ }
270
+
271
+ var selectedOptionValue = selectedOption.getValue();
272
+ if (!(/^postnl_(.?)*$/.test(selectedOptionValue))) {
273
+ return;
274
+ }
275
+
276
  this.massactionObject.formAdditional.select('select').each(function(element) {
277
  element.up().hide();
278
  });
skin/adminhtml/default/default/js/TIG/PostNL/validate.js CHANGED
@@ -63,6 +63,49 @@ document.observe('dom:loaded', function() {
63
 
64
  checkEmptyGroup(element);
65
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  });
67
 
68
  function checkEmpty(eventElement) {
@@ -117,3 +160,26 @@ function checkEmptyGroup(eventElement) {
117
  );
118
  }
119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  checkEmptyGroup(element);
65
  });
66
+
67
+ var streetFields = $$('.postnl-street-field');
68
+ validateStreetFields = function() {
69
+ var postnlStreetFieldsUsed = [];
70
+
71
+ streetFields.each(function(streetField) {
72
+ var streetFieldOptions = streetField.select('option');
73
+ var fieldValue = streetField.getValue();
74
+ var valueMustChange = false;
75
+
76
+ streetFieldOptions.each(function(option) {
77
+ var optionValue = option.value;
78
+ if (postnlStreetFieldsUsed.indexOf(optionValue) > -1) {
79
+ option.hide();
80
+
81
+ if (optionValue == fieldValue) {
82
+ valueMustChange = true;
83
+ }
84
+ } else {
85
+ option.show();
86
+ }
87
+ });
88
+
89
+ if (valueMustChange) {
90
+ streetFieldOptions.each(function(option) {
91
+ if (!valueMustChange) {
92
+ return;
93
+ }
94
+
95
+ if (option.getStyle('display') != 'none') {
96
+ option.selected = true;
97
+ valueMustChange = false;
98
+ fieldValue = option.value;
99
+ }
100
+ });
101
+ }
102
+
103
+ postnlStreetFieldsUsed.push(fieldValue);
104
+ });
105
+ };
106
+
107
+ streetFields.invoke('observe', 'change', validateStreetFields);
108
+ validateStreetFields();
109
  });
110
 
111
  function checkEmpty(eventElement) {
160
  );
161
  }
162
  }
163
+
164
+ if (typeof indexOf == 'undefined') {
165
+ var indexOf = function(needle) {
166
+ if(typeof Array.prototype.indexOf === 'function') {
167
+ indexOf = Array.prototype.indexOf;
168
+ } else {
169
+ indexOf = function(needle) {
170
+ var i = -1, index = -1;
171
+
172
+ for(i = 0; i < this.length; i++) {
173
+ if(this[i] === needle) {
174
+ index = i;
175
+ break;
176
+ }
177
+ }
178
+
179
+ return index;
180
+ };
181
+ }
182
+
183
+ return indexOf.call(this, needle);
184
+ };
185
+ }
skin/frontend/base/default/css/TIG/PostNL/deliveryoptions/default.css CHANGED
@@ -231,8 +231,6 @@ div.pac-container { z-index:5000; width:380px !important; }
231
  #postnl_delivery .location-name.overflow-protect { width:100%; }
232
  #postnl_pickup .location-name.overflow-protect { max-width:158px; float:left; }
233
  .location-list .overflow-protect { float:left; width:528px; }
234
- #palocation .location-type,
235
- .pa-location .location-type { display:none; }
236
  #palocation .location-name.overflow-protect,
237
  .pa-location .location-name.overflow-protect { max-width:251px !important; }
238
  body.noscroll { overflow:hidden; }
231
  #postnl_delivery .location-name.overflow-protect { width:100%; }
232
  #postnl_pickup .location-name.overflow-protect { max-width:158px; float:left; }
233
  .location-list .overflow-protect { float:left; width:528px; }
 
 
234
  #palocation .location-name.overflow-protect,
235
  .pa-location .location-name.overflow-protect { max-width:251px !important; }
236
  body.noscroll { overflow:hidden; }
skin/frontend/base/default/css/TIG/PostNL/deliveryoptions/mediaqueries.css CHANGED
@@ -65,7 +65,7 @@
65
  .responsive-tooltip .location-address { font-size:13px; }
66
  .responsive-tooltip .business-hours { line-height:18px; font-size:12px !important; color:#333 !important; }
67
  .responsive-tooltip .business-hours tbody th { width:40px; }
68
-
69
  body.noscroll { overflow:auto; }
70
  #postnl_add_phonenumber .popup-overlay { background:none; position:static; }
71
  #postnl_add_phonenumber .popup-window { position:static; width:auto; height:auto; margin:0; box-shadow:none; -webkit-box-shadow:none; -moz-box-shadow:none; }
@@ -76,11 +76,11 @@
76
  #postnl_add_phonenumber .text p { padding:0; }
77
  #postnl_add_phonenumber .button-set { background:none; height:auto; padding:0; margin-top:20px; }
78
  #postnl_add_phonenumber .button-set button { float:none; }
79
- #postnl_add_phonenumber .number-verify,
80
  #postnl_add_phonenumber .number-failed { font-size:12px; }
81
-
82
  #add_phone_close { display:none; }
83
-
84
  #postnl_add_location { display:none; }
85
  .responsive-hidden { display:none; }
86
  }
@@ -95,6 +95,19 @@
95
  .responsive-hidden { display:none; }
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /* Both Mobile and Tablet */
99
  @media only screen and (max-width: 1023px) {
100
  .postnl-container { padding-left:0; padding-right:0; font-size:12px; }
@@ -127,6 +140,7 @@
127
  .responsive-location-results .location-filters li { display:block; float:left; height:26px; line-height:25px; }
128
  .responsive-location-results .location-filters .label { margin-right:40px; }
129
  .responsive-location-results .location-filters .filter { margin-right:20px; }
 
130
  .responsive-location-results .location-filters .filter .input-box { display:block; line-height:20px; padding-left:26px; background:url(../../../../images/TIG/PostNL/deliveryoptions/bkg_checkbox.png) 0 0 no-repeat; }
131
  .responsive-location-results .location-filters .filter .input-box.selected { background-position:0 -26px; }
132
 
@@ -167,7 +181,7 @@
167
 
168
  /* Retina compatibility */
169
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) {
170
-
171
  .option-list.extras .option .bkg,
172
  .option-list.extras .location .bkg,
173
  .option-list .option .bkg,
65
  .responsive-tooltip .location-address { font-size:13px; }
66
  .responsive-tooltip .business-hours { line-height:18px; font-size:12px !important; color:#333 !important; }
67
  .responsive-tooltip .business-hours tbody th { width:40px; }
68
+
69
  body.noscroll { overflow:auto; }
70
  #postnl_add_phonenumber .popup-overlay { background:none; position:static; }
71
  #postnl_add_phonenumber .popup-window { position:static; width:auto; height:auto; margin:0; box-shadow:none; -webkit-box-shadow:none; -moz-box-shadow:none; }
76
  #postnl_add_phonenumber .text p { padding:0; }
77
  #postnl_add_phonenumber .button-set { background:none; height:auto; padding:0; margin-top:20px; }
78
  #postnl_add_phonenumber .button-set button { float:none; }
79
+ #postnl_add_phonenumber .number-verify,
80
  #postnl_add_phonenumber .number-failed { font-size:12px; }
81
+
82
  #add_phone_close { display:none; }
83
+
84
  #postnl_add_location { display:none; }
85
  .responsive-hidden { display:none; }
86
  }
95
  .responsive-hidden { display:none; }
96
  }
97
 
98
+ /* Filter alignment */
99
+ @media only screen and (max-width: 399px) {
100
+ .responsive-location-results .location-filters .filter { margin-left:0 !important; }
101
+ }
102
+
103
+ @media only screen and (min-width: 400px) and (max-width: 413px) {
104
+ .responsive-location-results .location-filters .filter:nth-child(n+3) { margin-left:69px !important; }
105
+ }
106
+
107
+ @media only screen and (min-width: 644px) and (max-width: 1023px) {
108
+ .responsive-location-results .location-filters .filter:nth-child(4) { margin-left:0 !important; }
109
+ }
110
+
111
  /* Both Mobile and Tablet */
112
  @media only screen and (max-width: 1023px) {
113
  .postnl-container { padding-left:0; padding-right:0; font-size:12px; }
140
  .responsive-location-results .location-filters li { display:block; float:left; height:26px; line-height:25px; }
141
  .responsive-location-results .location-filters .label { margin-right:40px; }
142
  .responsive-location-results .location-filters .filter { margin-right:20px; }
143
+ .responsive-location-results .location-filters .filter:nth-child(4) { margin-left:69px; }
144
  .responsive-location-results .location-filters .filter .input-box { display:block; line-height:20px; padding-left:26px; background:url(../../../../images/TIG/PostNL/deliveryoptions/bkg_checkbox.png) 0 0 no-repeat; }
145
  .responsive-location-results .location-filters .filter .input-box.selected { background-position:0 -26px; }
146
 
181
 
182
  /* Retina compatibility */
183
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) {
184
+
185
  .option-list.extras .option .bkg,
186
  .option-list.extras .location .bkg,
187
  .option-list .option .bkg,
skin/frontend/base/default/css/TIG/PostNL/returns.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #print_return_label_title { float:left; width:auto; }
2
+ .print-return-label-button { float:right; }
3
+ .print-return-label-caption { clear:both; }
skin/frontend/base/default/js/TIG/PostNL/deliveryOptions.js CHANGED
@@ -1429,10 +1429,19 @@ PostnlDeliveryOptions.prototype = {
1429
  excl : this.getExtraCosts(false)
1430
  };
1431
 
 
 
 
 
 
 
 
1432
  var params = {
1433
  isAjax : true,
1434
  type : selectedType,
1435
  date : selectedOption.getDate(),
 
 
1436
  costs : Object.toJSON(extraCosts)
1437
  };
1438
 
@@ -1694,6 +1703,7 @@ PostnlDeliveryOptions.Map = new Class.create({
1694
 
1695
  filterEarly : false,
1696
  filterEvening : false,
 
1697
 
1698
  /**
1699
  * Constructor method.
@@ -1891,6 +1901,16 @@ PostnlDeliveryOptions.Map = new Class.create({
1891
  return this;
1892
  },
1893
 
 
 
 
 
 
 
 
 
 
 
1894
  getOptions : function() {
1895
  return this.getDeliveryOptions().getOptions();
1896
  },
@@ -2190,6 +2210,30 @@ PostnlDeliveryOptions.Map = new Class.create({
2190
  this.filter();
2191
  }.bind(this));
2192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2193
  /**
2194
  * Register observers specific for the google map.
2195
  */
@@ -2932,6 +2976,7 @@ PostnlDeliveryOptions.Map = new Class.create({
2932
  * icon on hover.
2933
  */
2934
  google.maps.event.addListener(marker, "click", this.markerOnClick.bind(this, marker));
 
2935
  google.maps.event.addListener(marker, "mouseover", this.markerOnMouseOver.bind(this, marker));
2936
  google.maps.event.addListener(marker, "mousedown", this.markerOnMouseDown.bind(this));
2937
  google.maps.event.addListener(marker, "mouseup", this.markerOnMouseUp.bind(this));
@@ -3261,6 +3306,22 @@ PostnlDeliveryOptions.Map = new Class.create({
3261
  return this;
3262
  },
3263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3264
  /**
3265
  * Update the marker's icon on mouseover.
3266
  *
@@ -3562,12 +3623,13 @@ PostnlDeliveryOptions.Map = new Class.create({
3562
  filter : function() {
3563
  var filterEarly = this.getFilterEarly();
3564
  var filterEvening = this.getFilterEvening();
 
3565
  var locations = this.getLocations();
3566
  var hasVisibleMarkers = false;
3567
 
3568
  locations.each(function(location) {
 
3569
  if (filterEarly) {
3570
- var type = location.getType();
3571
  if (type.indexOf('PGE') < 0 && type.indexOf('PA') < 0) {
3572
  location.getMapElement().hide();
3573
  location.getResponsiveMapElement().hide();
@@ -3587,6 +3649,16 @@ PostnlDeliveryOptions.Map = new Class.create({
3587
  }
3588
  }
3589
 
 
 
 
 
 
 
 
 
 
 
3590
  location.getMapElement().show();
3591
  location.getResponsiveMapElement().show();
3592
  location.getMarker().setVisible(true);
@@ -4186,8 +4258,6 @@ PostnlDeliveryOptions.Location = new Class.create({
4186
  }
4187
 
4188
  commentHtml = Translator.translate('early delivery') + extraCostHtml;
4189
- } else if (type == 'PA') {
4190
- commentHtml = '24/7 ' + Translator.translate('available');
4191
  }
4192
 
4193
  return commentHtml;
@@ -4501,7 +4571,7 @@ PostnlDeliveryOptions.Location = new Class.create({
4501
 
4502
  var businessHoursText = '';
4503
  if (this.getType().indexOf('PA') > -1) {
4504
- businessHoursText = Translator.translate('open 24/7');
4505
  } else {
4506
  businessHoursText = Translator.translate('business hours');
4507
  }
@@ -4570,6 +4640,39 @@ PostnlDeliveryOptions.Location = new Class.create({
4570
  return true;
4571
  }.bind(this));
4572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4573
  element.observe('mouseover', function() {
4574
  this.mouseOver = true;
4575
 
1429
  excl : this.getExtraCosts(false)
1430
  };
1431
 
1432
+ var from = selectedOption.from;
1433
+ if (selectedType == 'PG') {
1434
+ from = '16:00:00';
1435
+ } else if (selectedType == 'PGE') {
1436
+ from = '08:30:00'
1437
+ }
1438
+
1439
  var params = {
1440
  isAjax : true,
1441
  type : selectedType,
1442
  date : selectedOption.getDate(),
1443
+ from : from,
1444
+ to : selectedOption.to,
1445
  costs : Object.toJSON(extraCosts)
1446
  };
1447
 
1703
 
1704
  filterEarly : false,
1705
  filterEvening : false,
1706
+ filterPA : false,
1707
 
1708
  /**
1709
  * Constructor method.
1901
  return this;
1902
  },
1903
 
1904
+ getFilterPa : function() {
1905
+ return this.filterPa;
1906
+ },
1907
+
1908
+ setFilterPa : function(filter) {
1909
+ this.filterPa = filter;
1910
+
1911
+ return this;
1912
+ },
1913
+
1914
  getOptions : function() {
1915
  return this.getDeliveryOptions().getOptions();
1916
  },
2210
  this.filter();
2211
  }.bind(this));
2212
 
2213
+ var paPickupFilter = $('pa-filter');
2214
+ paPickupFilter.observe('click', function() {
2215
+ if (paPickupFilter.hasClassName('selected')) {
2216
+ this.setFilterPa(false);
2217
+ paPickupFilter.removeClassName('selected');
2218
+ } else {
2219
+ this.setFilterPa(true);
2220
+ paPickupFilter.addClassName('selected');
2221
+ }
2222
+ this.filter();
2223
+ }.bind(this));
2224
+
2225
+ var paPickupFilterResp = $('pa-filter-responsive');
2226
+ paPickupFilterResp.observe('click', function() {
2227
+ if (paPickupFilterResp.hasClassName('selected')) {
2228
+ this.setFilterPa(false);
2229
+ paPickupFilterResp.removeClassName('selected');
2230
+ } else {
2231
+ this.setFilterPa(true);
2232
+ paPickupFilterResp.addClassName('selected');
2233
+ }
2234
+ this.filter();
2235
+ }.bind(this));
2236
+
2237
  /**
2238
  * Register observers specific for the google map.
2239
  */
2976
  * icon on hover.
2977
  */
2978
  google.maps.event.addListener(marker, "click", this.markerOnClick.bind(this, marker));
2979
+ google.maps.event.addListener(marker, "dblclick", this.markerOnDblClick.bind(this, marker));
2980
  google.maps.event.addListener(marker, "mouseover", this.markerOnMouseOver.bind(this, marker));
2981
  google.maps.event.addListener(marker, "mousedown", this.markerOnMouseDown.bind(this));
2982
  google.maps.event.addListener(marker, "mouseup", this.markerOnMouseUp.bind(this));
3306
  return this;
3307
  },
3308
 
3309
+ /**
3310
+ * @param {*} marker
3311
+ *
3312
+ * @returns {PostnlDeliveryOptions.Map}
3313
+ */
3314
+ markerOnDblClick : function(marker) {
3315
+ if (this.getIsInfoWindowOpen()) {
3316
+ return this;
3317
+ }
3318
+
3319
+ this.selectMarker(marker, true, true);
3320
+ this.saveLocation();
3321
+
3322
+ return this;
3323
+ },
3324
+
3325
  /**
3326
  * Update the marker's icon on mouseover.
3327
  *
3623
  filter : function() {
3624
  var filterEarly = this.getFilterEarly();
3625
  var filterEvening = this.getFilterEvening();
3626
+ var filterPa = this.getFilterPa();
3627
  var locations = this.getLocations();
3628
  var hasVisibleMarkers = false;
3629
 
3630
  locations.each(function(location) {
3631
+ var type = location.getType();
3632
  if (filterEarly) {
 
3633
  if (type.indexOf('PGE') < 0 && type.indexOf('PA') < 0) {
3634
  location.getMapElement().hide();
3635
  location.getResponsiveMapElement().hide();
3649
  }
3650
  }
3651
 
3652
+ if (filterPa) {
3653
+ if (type.indexOf('PA') < 0) {
3654
+ location.getMapElement().hide();
3655
+ location.getResponsiveMapElement().hide();
3656
+ location.getMarker().setVisible(false);
3657
+
3658
+ return false;
3659
+ }
3660
+ }
3661
+
3662
  location.getMapElement().show();
3663
  location.getResponsiveMapElement().show();
3664
  location.getMarker().setVisible(true);
4258
  }
4259
 
4260
  commentHtml = Translator.translate('early delivery') + extraCostHtml;
 
 
4261
  }
4262
 
4263
  return commentHtml;
4571
 
4572
  var businessHoursText = '';
4573
  if (this.getType().indexOf('PA') > -1) {
4574
+ businessHoursText = Translator.translate('parcel dispenser');
4575
  } else {
4576
  businessHoursText = Translator.translate('business hours');
4577
  }
4640
  return true;
4641
  }.bind(this));
4642
 
4643
+ element.observe('dblclick', function(event) {
4644
+ var map = this.getMap();
4645
+
4646
+ event.stop();
4647
+
4648
+ if (Event.element(event).hasClassName('location-info')) {
4649
+ return false;
4650
+ }
4651
+
4652
+ if (!this.getMarker()) {
4653
+ return false;
4654
+ }
4655
+
4656
+ if (map.getSelectedMarker() == this.getMarker()) {
4657
+ map.saveLocation();
4658
+ return false;
4659
+ }
4660
+
4661
+ this.setOldCenter(this.getMarker().getPosition());
4662
+
4663
+ map.selectMarker(this.getMarker(), false, true);
4664
+
4665
+ if (map.getIsInfoWindowOpen()) {
4666
+ map.openLocationInfoWindow(
4667
+ this.getMapTooltipHtml(),
4668
+ this.getLocationCode()
4669
+ );
4670
+ }
4671
+
4672
+ map.saveLocation();
4673
+ return true;
4674
+ }.bind(this));
4675
+
4676
  element.observe('mouseover', function() {
4677
  this.mouseOver = true;
4678
 
skin/frontend/base/default/js/TIG/PostNL/mijnpakketLogin.js CHANGED
@@ -280,8 +280,15 @@ MijnpakketLogin.prototype = {
280
 
281
  $('billing:use_for_shipping_yes').checked = true;
282
  if (this.isOsc) {
283
- $('shipping_address').hide();
284
- $('shipping_address_list').hide();
 
 
 
 
 
 
 
285
  }
286
  }.bind(this));
287
 
@@ -551,14 +558,17 @@ MijnpakketLogin.prototype = {
551
  var virtualStreet1 = $('virtual:billing:street1');
552
  var virtualStreet2 = $('virtual:billing:street2');
553
  var virtualStreet3 = $('virtual:billing:street3');
554
- if (virtualStreet1) {
555
- $('virtual:shipping:street1').setValue(virtualStreet1.getValue());
 
 
 
556
  }
557
- if (virtualStreet2) {
558
- $('virtual:shipping:street2').setValue(virtualStreet2.getValue());
559
  }
560
- if (virtualStreet3) {
561
- $('virtual:shipping:street3').setValue(virtualStreet3.getValue());
562
  }
563
 
564
  /**
280
 
281
  $('billing:use_for_shipping_yes').checked = true;
282
  if (this.isOsc) {
283
+ var shippingAddress = $('shipping_address');
284
+ var shippingAddressList = $('shipping_address_list');
285
+ if (shippingAddress) {
286
+ shippingAddress.hide();
287
+ }
288
+
289
+ if (shippingAddressList) {
290
+ shippingAddressList.hide();
291
+ }
292
  }
293
  }.bind(this));
294
 
558
  var virtualStreet1 = $('virtual:billing:street1');
559
  var virtualStreet2 = $('virtual:billing:street2');
560
  var virtualStreet3 = $('virtual:billing:street3');
561
+ var virtualShippingStreet1 = $('virtual:billing:street1');
562
+ var virtualShippingStreet2 = $('virtual:billing:street2');
563
+ var virtualShippingStreet3 = $('virtual:billing:street3');
564
+ if (virtualStreet1 && virtualShippingStreet1) {
565
+ virtualShippingStreet1.setValue(virtualStreet1.getValue());
566
  }
567
+ if (virtualStreet2 && virtualShippingStreet2) {
568
+ virtualShippingStreet2.setValue(virtualStreet2.getValue());
569
  }
570
+ if (virtualStreet3 && virtualShippingStreet3) {
571
+ virtualShippingStreet3.setValue(virtualStreet3.getValue());
572
  }
573
 
574
  /**