├── .gitignore ├── README.md ├── composer.json ├── modman └── src └── app ├── code └── community │ └── Itabs │ └── Invoice │ ├── Block │ ├── Form.php │ └── Info.php │ ├── Helper │ └── Data.php │ ├── Model │ ├── Invoice.php │ ├── Observer.php │ ├── System │ │ └── Config │ │ │ └── Source │ │ │ ├── Customer │ │ │ └── Group.php │ │ │ └── Sales │ │ │ └── Invoice │ │ │ └── State.php │ └── Validation.php │ ├── Test │ ├── Block │ │ ├── Info.php │ │ └── Info │ │ │ └── fixtures │ │ │ ├── getDueDate.yaml │ │ │ └── getDueDateNoPaymentDue.yaml │ ├── Config │ │ ├── Config.php │ │ └── Config │ │ │ └── expectations │ │ │ └── globalConfig.yaml │ └── fixtures │ │ ├── customer.yaml │ │ ├── default.yaml │ │ └── order.yaml │ └── etc │ ├── config.xml │ └── system.xml ├── design ├── adminhtml │ └── default │ │ └── default │ │ └── template │ │ └── invoice │ │ ├── form.phtml │ │ ├── info.phtml │ │ └── pdf.phtml └── frontend │ └── base │ └── default │ └── template │ └── invoice │ ├── form.phtml │ └── info.phtml ├── etc └── modules │ └── Itabs_Invoice.xml └── locale ├── de_DE └── Itabs_Invoice.csv ├── en_US └── Itabs_Invoice.csv └── nb_NO └── Itabs_Invoice.csv /.gitignore: -------------------------------------------------------------------------------- 1 | build.sh 2 | .DS_Store 3 | *.cache.properties 4 | *~ 5 | *.swp 6 | build.properties 7 | .buildpath 8 | .project 9 | .settings 10 | .settings/**/* 11 | .externalToolBuilders 12 | .externalToolBuilders/**/* 13 | .vagrant 14 | .vagrant/**/* 15 | Vagrantfile 16 | /.idea 17 | 18 | .vagrant 19 | .vagrant/**/* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Invoice 2 | ===================== 3 | This extension allows shop owners to provide the payment method "Invoice" to their customers. 4 | 5 | Facts 6 | ----- 7 | - Version: 1.5.0 8 | - [extension on GitHub](https://github.com/itabs/Itabs_Invoice) 9 | 10 | Description 11 | ----------- 12 | This extension allows shop owners to provide the payment method "Invoice" to their customers. 13 | This includes: 14 | - Complete order via Invoice 15 | - Generate invoice after order complete 16 | - Notfiy customer about invoice 17 | - Several validation rules to check if invoice payment is allowed for the customer 18 | 19 | Validation rules are: 20 | - Check if the customer is in a specified customer group 21 | - Check if the customer has a specified number of "complete" orders 22 | - Check if the customer orders reached a specified minimum order amount 23 | - Check if the customer has invoices with the invoice state "open" 24 | 25 | Requirements 26 | ------------ 27 | - PHP >= 5.3.0 28 | 29 | Compatibility 30 | ------------- 31 | - Magento >= 1.6 32 | - Versions below should work down to version 1.4 without any problems but it is not actively tested. 33 | 34 | Installation Instructions 35 | ------------------------- 36 | 1. Install the extension via Magento Connect with the key shown above or copy all the files into your document root. 37 | 2. Clear the cache, logout from the admin panel and then login again. 38 | 3. You can now enable the payment method via *System -> Configuration -> Sales -> Payment -> Invoice* 39 | 40 | Uninstallation 41 | -------------- 42 | To uninstall this extension you have to remove all extension files from your file system. 43 | 44 | Support & Feature-Wishes 45 | ------------------------ 46 | If you have any issues or you are missing an feature with this extension, please open an issue on [GitHub](https://github.com/itabs/Itabs_Invoice/issues). Thank you. 47 | 48 | Contribution 49 | ------------ 50 | Any contribution is highly appreciated. The best way to contribute code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests). 51 | 52 | Developer 53 | --------- 54 | Rouven Alexander Rieker 55 | - Website: [http://rouven-rieker.com](http://rouven-rieker.com) 56 | - Twitter: [@therouv](https://twitter.com/therouv) 57 | 58 | Licence 59 | ------- 60 | [Open Software License (OSL 3.0)](http://opensource.org/licenses/osl-3.0.php) 61 | 62 | Copyright 63 | --------- 64 | (c) 2013-2015 ITABS GmbH / Rouven Alexander Rieker 65 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "itabs/invoice", 3 | "license": "OSL-3.0", 4 | "type": "magento-module", 5 | "description": "Provides the payment method Invoice", 6 | "homepage": "https://github.com/itabs/Itabs_Invoice", 7 | "authors": [ 8 | { 9 | "name": "Rouven Alexander Rieker", 10 | "email": "therouv@googlemail.com" 11 | } 12 | ], 13 | "require": { 14 | "magento-hackathon/magento-composer-installer": "*" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modman: -------------------------------------------------------------------------------- 1 | src/app/code/community/Itabs/Invoice/ app/code/community/Itabs/Invoice/ 2 | src/app/design/adminhtml/default/default/template/invoice/ app/design/adminhtml/default/default/template/invoice/ 3 | src/app/design/frontend/base/default/template/invoice/ app/design/frontend/base/default/template/invoice/ 4 | src/app/etc/modules/Itabs_Invoice.xml app/etc/modules/Itabs_Invoice.xml 5 | src/app/locale/de_DE/Itabs_Invoice.csv app/locale/de_DE/Itabs_Invoice.csv 6 | src/app/locale/en_US/Itabs_Invoice.csv app/locale/en_US/Itabs_Invoice.csv 7 | src/app/locale/nb_NO/Itabs_Invoice.csv app/locale/nb_NO/Itabs_Invoice.csv 8 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Block/Form.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * Payment Method Form 18 | */ 19 | class Itabs_Invoice_Block_Form extends Mage_Payment_Block_Form 20 | { 21 | /** 22 | * Set the template 23 | */ 24 | protected function _construct() 25 | { 26 | parent::_construct(); 27 | $this->setTemplate('invoice/form.phtml'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Block/Info.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | /** 16 | * Payment Method Info 17 | */ 18 | class Itabs_Invoice_Block_Info extends Mage_Payment_Block_Info 19 | { 20 | /** 21 | * Set the template 22 | */ 23 | protected function _construct() 24 | { 25 | parent::_construct(); 26 | $this->setTemplate('invoice/info.phtml'); 27 | } 28 | 29 | /** 30 | * Sets the template for PDF print-outs 31 | * 32 | * @return string Text for PDF print-out 33 | */ 34 | public function toPdf() 35 | { 36 | $this->setTemplate('invoice/pdf.phtml'); 37 | 38 | return $this->toHtml(); 39 | } 40 | 41 | /** 42 | * Retrieve the payment method code 43 | * 44 | * @return string 45 | */ 46 | public function getMethodCode() 47 | { 48 | return $this->getInfo()->getMethodInstance()->getCode(); 49 | } 50 | 51 | /** 52 | * Retrieve the due date for the order 53 | * 54 | * @return bool|string 55 | */ 56 | public function getDueDate() 57 | { 58 | // Check if we are in the order mode 59 | if (!($this->getInfo() instanceof Mage_Sales_Model_Order_Payment)) { 60 | return false; 61 | } 62 | 63 | // Check if we should calculate the due date 64 | $calculateDay = (bool) $this->getMethod()->getConfigData('calculate_due_date'); 65 | if (!$calculateDay) { 66 | return false; 67 | } 68 | 69 | // Check if there is a payment due value set 70 | $paymentDue = $this->getMethod()->getConfigData('payment_due'); 71 | if (empty($paymentDue) || $paymentDue <= 0) { 72 | return false; 73 | } 74 | 75 | /* @var $order Mage_Sales_Model_Order */ 76 | $order = $this->getInfo()->getOrder(); 77 | 78 | $date = Mage::app()->getLocale()->storeDate($order->getStoreId(), strtotime($order->getCreatedAt()), false); 79 | $date->addDay($paymentDue); 80 | $dueDate = $date->toString(Mage::app()->getLocale()->getDateFormatWithLongYear()); 81 | 82 | return $dueDate; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Helper/Data.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * Helper class 18 | */ 19 | class Itabs_Invoice_Helper_Data extends Mage_Core_Helper_Abstract 20 | { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Model/Invoice.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * Invoice Model 18 | */ 19 | class Itabs_Invoice_Model_Invoice extends Mage_Payment_Model_Method_Abstract 20 | { 21 | protected $_isGateway = false; 22 | protected $_canAuthorize = false; 23 | protected $_canCapture = true; 24 | protected $_canCapturePartial = true; 25 | protected $_canRefund = false; 26 | protected $_canRefundInvoicePartial = true; 27 | protected $_canVoid = false; 28 | protected $_canUseInternal = true; 29 | protected $_canUseCheckout = true; 30 | protected $_canUseForMultishipping = false; 31 | 32 | /** 33 | * unique internal payment method identifier 34 | * 35 | * @var string [a-z0-9_] 36 | */ 37 | protected $_code = 'invoice'; 38 | 39 | /** 40 | * payment form block 41 | * 42 | * @var string MODULE/BLOCKNAME 43 | */ 44 | protected $_formBlockType = 'invoice/form'; 45 | 46 | /** 47 | * payment info block 48 | * 49 | * @var string MODULE/BLOCKNAME 50 | */ 51 | protected $_infoBlockType = 'invoice/info'; 52 | 53 | /** 54 | * Authorize the invoice, create invoice if config setting is correct 55 | * 56 | * @param Varien_Object $payment Payment Object 57 | * @param float $amount Authorize Amount 58 | * @return Itabs_Invoice_Model_Invoice 59 | * @throws Exception 60 | * @throws bool 61 | */ 62 | public function authorize(Varien_Object $payment, $amount) 63 | { 64 | if (Mage::getStoreConfigFlag('payment/' . $this->getCode() . '/create_invoice')) { 65 | /* @var $order Mage_Sales_Model_Order */ 66 | $order = $payment->getOrder(); 67 | $realOrderId = $payment->getOrder()->getRealOrderId(); 68 | $order->loadByIncrementId($realOrderId); 69 | 70 | if ($order->canInvoice()) { 71 | $invoiceState = (int)$this->getConfigData('invoice_state'); 72 | 73 | /* @var $invoice Mage_Sales_Model_Order_Invoice */ 74 | $invoice = $order->prepareInvoice(); 75 | $invoice->register(); 76 | 77 | // Capture if invoice should be marked as paid 78 | if ($invoiceState == Mage_Sales_Model_Order_Invoice::STATE_PAID) { 79 | $invoice->capture(); 80 | } 81 | 82 | Mage::getModel('core/resource_transaction') 83 | ->addObject($invoice) 84 | ->addObject($invoice->getOrder()) 85 | ->save(); 86 | $order->addRelatedObject($invoice); 87 | 88 | $invoice->setState($invoiceState); 89 | 90 | if (Mage::getStoreConfigFlag('payment/' . $this->getCode() . '/send_invoice_email')) { 91 | $invoice->sendEmail(); 92 | } 93 | 94 | // Add comment to order history 95 | $order->addStatusHistoryComment( 96 | sprintf('Invoiced order amount of %s', Mage::helper('core')->formatPrice($amount, false)) 97 | ); 98 | $order->save(); 99 | } 100 | } 101 | 102 | return $this; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Model/Observer.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * Observer for payment method availability checks 18 | */ 19 | class Itabs_Invoice_Model_Observer 20 | { 21 | /** 22 | * Checks if Invoice is allowed for specific customer groups and if a 23 | * registered customer has the required minimum amount of orders to be 24 | * allowed to order via Invoice. 25 | * 26 | * Event: 27 | * 28 | * @param Varien_Event_Observer $observer Observer 29 | * @return void 30 | */ 31 | public function paymentMethodIsActive($observer) 32 | { 33 | /* @var $methodInstance Mage_Payment_Model_Method_Abstract */ 34 | $methodInstance = $observer->getEvent()->getMethodInstance(); 35 | 36 | // Check if method is Invoice 37 | if ($methodInstance->getCode() != 'invoice') { 38 | return; 39 | } 40 | 41 | // Check if payment method is active 42 | if (!Mage::getStoreConfigFlag('payment/invoice/active')) { 43 | return; 44 | } 45 | 46 | /* @var $validationModel Itabs_Invoice_Model_Validation */ 47 | $validationModel = Mage::getModel('invoice/validation'); 48 | $observer->getEvent()->getResult()->isAvailable = $validationModel->isValid(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Model/System/Config/Source/Customer/Group.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * System Config Customer Groups 18 | */ 19 | class Itabs_Invoice_Model_System_Config_Source_Customer_Group 20 | { 21 | /** 22 | * @var array Customer Groups 23 | */ 24 | protected $_options; 25 | 26 | /** 27 | * Returns the customer groups as an array for system configuration 28 | * 29 | * @return array Customer Groups 30 | */ 31 | public function toOptionArray() 32 | { 33 | if (!$this->_options) { 34 | $collection = Mage::getResourceModel('customer/group_collection') 35 | ->loadData() 36 | ->toOptionArray(); 37 | $this->_options = $collection; 38 | 39 | array_unshift( 40 | $this->_options, 41 | array( 42 | 'value' => '', 43 | 'label' => Mage::helper('invoice')->__('-- Please Select --') 44 | ) 45 | ); 46 | } 47 | 48 | return $this->_options; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Model/System/Config/Source/Sales/Invoice/State.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * System Config Invoice States 18 | */ 19 | class Itabs_Invoice_Model_System_Config_Source_Sales_Invoice_State 20 | { 21 | /** 22 | * @var array Invoice States 23 | */ 24 | protected $_options; 25 | 26 | /** 27 | * Returns the invoice states as an array for system configuration 28 | * 29 | * @return array Invoice States 30 | */ 31 | public function toOptionArray() 32 | { 33 | if (!$this->_options) { 34 | $options = array(); 35 | $options[] = array( 36 | 'value' => Mage_Sales_Model_Order_Invoice::STATE_OPEN, 37 | 'label' => Mage::helper('invoice')->__('Open') 38 | ); 39 | $options[] = array( 40 | 'value' => Mage_Sales_Model_Order_Invoice::STATE_PAID, 41 | 'label' => Mage::helper('invoice')->__('Paid') 42 | ); 43 | $this->_options = $options; 44 | } 45 | 46 | return $this->_options; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Model/Validation.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | 16 | /** 17 | * Validation model 18 | */ 19 | class Itabs_Invoice_Model_Validation 20 | { 21 | /** 22 | * @var null|Mage_Sales_Model_Resource_Order_Collection 23 | */ 24 | protected $_customerOrders = null; 25 | 26 | /** 27 | * @var null|Mage_Sales_Model_Resource_Order_Collection 28 | */ 29 | protected $_customerOrdersEmail = null; 30 | 31 | /** 32 | * Check if the invoice payment is allowed 33 | * 34 | * @return bool 35 | */ 36 | public function isValid() 37 | { 38 | $isValid = $this->hasSpecificCustomerGroup() 39 | && $this->hasMinimumOrderCount() 40 | && $this->hasMinimumOrderAmount() 41 | && $this->hasOpenInvoices() 42 | && $this->isBillingShippingAddressDifferent() 43 | && $this->isPrefixNotAllowed(); 44 | 45 | $checkResult = new StdClass; 46 | $checkResult->isValid = $isValid; 47 | 48 | Mage::dispatchEvent('itabs_invoice_validation_result', array('result' => $checkResult)); 49 | 50 | return $checkResult->isValid; 51 | } 52 | 53 | /** 54 | * Check if the customer is in a specific customer group 55 | * 56 | * @return bool 57 | */ 58 | public function hasSpecificCustomerGroup() 59 | { 60 | if (!Mage::getStoreConfigFlag('payment/invoice/specificgroup_all')) { 61 | $allowedGroupIds = explode(',', Mage::getStoreConfig('payment/invoice/specificgroup')); 62 | if (!in_array($this->_getCustomerGroupId(), $allowedGroupIds)) { 63 | return false; 64 | } 65 | } 66 | 67 | return true; 68 | } 69 | 70 | /** 71 | * Check if the customer has placed less complete orders than required.. 72 | * 73 | * @return bool 74 | */ 75 | public function hasMinimumOrderCount() 76 | { 77 | $minOrderCount = Mage::getStoreConfig('payment/invoice/customer_order_count'); 78 | if ($minOrderCount > 0) { 79 | $customerId = $this->_getCustomer()->getId(); 80 | if (is_null($customerId)) { 81 | return false; 82 | } 83 | 84 | $orders = $this->_getCustomerOrders($customerId); 85 | if (count($orders) < $minOrderCount) { 86 | return false; 87 | } 88 | } 89 | 90 | return true; 91 | } 92 | 93 | /** 94 | * Check if the order amount of all customer order are below the 95 | * required order amount 96 | * 97 | * @return bool 98 | */ 99 | public function hasMinimumOrderAmount() 100 | { 101 | $minOrderSum = Mage::getStoreConfig('payment/invoice/customer_order_amount'); 102 | if ($minOrderSum > 0) { 103 | $customerId = $this->_getCustomer()->getId(); 104 | if (is_null($customerId)) { 105 | return false; 106 | } 107 | 108 | $orders = $this->_getCustomerOrders($customerId); 109 | $orderTotal = 0; 110 | foreach ($orders as $order) { 111 | $orderTotal += $order->getData('grand_total'); 112 | } 113 | 114 | if ($orderTotal < $minOrderSum) { 115 | return false; 116 | } 117 | } 118 | 119 | return true; 120 | } 121 | 122 | /** 123 | * Check if a customer has not paid invoices.. 124 | * 125 | * @return bool 126 | */ 127 | public function hasOpenInvoices() 128 | { 129 | if (Mage::getStoreConfig('payment/invoice/check_open_invoices')) { 130 | $email = $this->_getCustomerEmail(); 131 | 132 | // Load all customer orders by email because we need to check the guests too 133 | if (null === $this->_customerOrdersEmail) { 134 | $this->_customerOrdersEmail = Mage::getResourceModel('sales/order_collection') 135 | ->addAttributeToFilter('customer_email', $email) 136 | ->load(); 137 | } 138 | 139 | /* @var $orders Mage_Sales_Model_Resource_Order_Collection */ 140 | $orders = $this->_customerOrdersEmail; 141 | 142 | $hasOpenInvoices = false; 143 | foreach ($orders as $order) { 144 | /* @var $order Mage_Sales_Model_Order */ 145 | 146 | /* @var $invoices Mage_Sales_Model_Resource_Order_Invoice_Collection */ 147 | $invoices = $order->getInvoiceCollection(); 148 | if ($invoices->count() > 0) { 149 | foreach ($invoices as $invoice) { 150 | /* @var $invoice Mage_Sales_Model_Order_Invoice */ 151 | if ($invoice->getState() == 1) { 152 | $hasOpenInvoices = true; 153 | } 154 | } 155 | } 156 | } 157 | 158 | if ($hasOpenInvoices) { 159 | return false; 160 | } 161 | } 162 | 163 | return true; 164 | } 165 | 166 | /** 167 | * Check if the billing address of a customer is different from the shipping address 168 | * 169 | * @return bool 170 | */ 171 | public function isBillingShippingAddressDifferent() 172 | { 173 | // Check if validation is active 174 | if (!Mage::getStoreConfigFlag('payment/invoice/check_addresses')) { 175 | return true; 176 | } 177 | 178 | // Check if there is a quote 179 | $quote = $this->_getQuote(); 180 | if (!$quote || !$quote->getId() || !$quote->getBillingAddress()) { 181 | return true; 182 | } 183 | 184 | // Serialize the address data and compare if they are different 185 | $billingAddress = $this->_serializeQuoteAddress($quote->getBillingAddress()); 186 | $shippingAddress = $this->_serializeQuoteAddress($quote->getShippingAddress()); 187 | if ($billingAddress != $shippingAddress) { 188 | return false; 189 | } 190 | 191 | return true; 192 | } 193 | 194 | /** 195 | * Check if the prefix of the billing or shipping address is not allowed 196 | * 197 | * @return bool 198 | */ 199 | public function isPrefixNotAllowed() 200 | { 201 | // Check if validation is active 202 | if (!Mage::getStoreConfigFlag('payment/invoice/check_prefix')) { 203 | return true; 204 | } 205 | 206 | // Check if there are disabled prefix options 207 | $disabledPrefixes = explode(';', Mage::getStoreConfig('payment/invoice/disabled_prefix')); 208 | if (count($disabledPrefixes) == 0) { 209 | return true; 210 | } 211 | 212 | // Check if there is a quote 213 | $quote = $this->_getQuote(); 214 | if (!$quote || !$quote->getId() || !$quote->getBillingAddress()) { 215 | return true; 216 | } 217 | 218 | // Check if billing address prefix is disabled 219 | $billingAddress = $quote->getBillingAddress(); 220 | if ($billingAddress && in_array($billingAddress->getPrefix(), $disabledPrefixes)) { 221 | return false; 222 | } 223 | 224 | // Check if shipping address prefix is disabled 225 | $shippingAddress = $quote->getShippingAddress(); 226 | if ($shippingAddress && in_array($shippingAddress->getPrefix(), $disabledPrefixes)) { 227 | return false; 228 | } 229 | 230 | return true; 231 | } 232 | 233 | /** 234 | * Retrieve the current session 235 | * 236 | * @return Mage_Adminhtml_Model_Session_Quote|Mage_Customer_Model_Session 237 | */ 238 | protected function _getSession() 239 | { 240 | if (Mage::app()->getStore()->isAdmin()) { 241 | /* @var $session Mage_Adminhtml_Model_Session_Quote */ 242 | $session = Mage::getSingleton('adminhtml/session_quote'); 243 | } else { 244 | /* @var $session Mage_Customer_Model_Session */ 245 | $session = Mage::getSingleton('customer/session'); 246 | } 247 | 248 | return $session; 249 | } 250 | 251 | /** 252 | * Retrieve the quote object 253 | * 254 | * @return Mage_Sales_Model_Quote 255 | */ 256 | protected function _getQuote() 257 | { 258 | if (Mage::app()->getStore()->isAdmin()) { 259 | /* @var $quote Mage_Adminhtml_Model_Session_Quote */ 260 | $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote(); 261 | } else { 262 | /* @var $quote Mage_Customer_Model_Session */ 263 | $quote = Mage::getSingleton('checkout/session')->getQuote(); 264 | } 265 | 266 | return $quote; 267 | } 268 | 269 | /** 270 | * Retrieve the current customer 271 | * 272 | * @return Mage_Customer_Model_Customer 273 | */ 274 | protected function _getCustomer() 275 | { 276 | return $this->_getSession()->getCustomer(); 277 | } 278 | 279 | /** 280 | * Retrieve the customer group id of the current customer 281 | * 282 | * @return int 283 | */ 284 | protected function _getCustomerGroupId() 285 | { 286 | $customerGroupId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; 287 | if (Mage::app()->getStore()->isAdmin()) { 288 | $customerGroupId = $this->_getSession()->getQuote()->getCustomerGroupId(); 289 | } else { 290 | if ($this->_getSession()->isLoggedIn()) { 291 | $customerGroupId = $this->_getSession()->getCustomerGroupId(); 292 | } 293 | } 294 | 295 | return $customerGroupId; 296 | } 297 | 298 | /** 299 | * Retrieve the email address of the current customer 300 | * 301 | * @return string 302 | */ 303 | protected function _getCustomerEmail() 304 | { 305 | if (Mage::app()->getStore()->isAdmin()) { 306 | $email = $this->_getCustomer()->getEmail(); 307 | } else { 308 | if ($this->_getSession()->isLoggedIn()) { 309 | $email = $this->_getCustomer()->getEmail(); 310 | } else { 311 | /* @var $quote Mage_Sales_Model_Quote */ 312 | $quote = Mage::getSingleton('checkout/session')->getQuote(); 313 | $email = $quote->getBillingAddress()->getEmail(); 314 | } 315 | } 316 | 317 | return $email; 318 | } 319 | 320 | /** 321 | * Retrieve the order collection of a specific customer 322 | * 323 | * @param int $customerId Customer ID 324 | * @return Mage_Sales_Model_Resource_Order_Collection 325 | */ 326 | protected function _getCustomerOrders($customerId) 327 | { 328 | if (null === $this->_customerOrders) { 329 | $orders = Mage::getResourceModel('sales/order_collection') 330 | ->addAttributeToSelect('*') 331 | ->addAttributeToFilter('customer_id', $customerId) 332 | ->addAttributeToFilter('status', Mage_Sales_Model_Order::STATE_COMPLETE) 333 | ->addAttributeToFilter( 334 | 'state', 335 | array( 336 | 'in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates() 337 | ) 338 | ) 339 | ->load(); 340 | $this->_customerOrders = $orders; 341 | } 342 | 343 | return $this->_customerOrders; 344 | } 345 | 346 | /** 347 | * Serialize the given address data for comparison 348 | * 349 | * @param Mage_Sales_Model_Quote_Address $address Quote Address 350 | * @return string 351 | */ 352 | protected function _serializeQuoteAddress(Mage_Sales_Model_Quote_Address $address) 353 | { 354 | return serialize(array( 355 | 'company' => $address->getCompany(), 356 | 'prefix' => $address->getPrefix(), 357 | 'firstname' => $address->getFirstname(), 358 | 'lastname' => $address->getLastname(), 359 | 'street' => $address->getStreet(), 360 | 'postcode' => $address->getPostcode(), 361 | 'city' => $address->getCity(), 362 | 'country' => $address->getCountryId() 363 | )); 364 | } 365 | 366 | } 367 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/Block/Info.php: -------------------------------------------------------------------------------- 1 | _block = self::app()->getLayout()->createBlock('invoice/info'); 17 | } 18 | 19 | /** 20 | * @test 21 | */ 22 | public function testBlockInstance() 23 | { 24 | $this->assertInstanceOf('Itabs_Invoice_Block_Info', $this->_block); 25 | } 26 | 27 | /** 28 | * @test 29 | * @loadFixture ~Itabs_Invoice/default 30 | * @loadFixture ~Itabs_Invoice/customer 31 | * @loadFixture ~Itabs_Invoice/order 32 | */ 33 | public function getDueDateNoCalculate() 34 | { 35 | $order = Mage::getModel('sales/order')->load(1); 36 | $this->_block->setData('info', $order->getPayment()); 37 | $this->assertFalse($this->_block->getDueDate()); 38 | } 39 | 40 | /** 41 | * @test 42 | * @loadFixture ~Itabs_Invoice/default 43 | * @loadFixture ~Itabs_Invoice/customer 44 | * @loadFixture ~Itabs_Invoice/order 45 | * @loadFixture getDueDateNoPaymentDue 46 | */ 47 | public function getDueDateNoPaymentDue() 48 | { 49 | $order = Mage::getModel('sales/order')->load(1); 50 | $this->_block->setData('info', $order->getPayment()); 51 | $this->assertFalse($this->_block->getDueDate()); 52 | } 53 | 54 | /** 55 | * @test 56 | * @loadFixture ~Itabs_Invoice/default 57 | * @loadFixture ~Itabs_Invoice/customer 58 | * @loadFixture ~Itabs_Invoice/order 59 | * @loadFixture getDueDate 60 | */ 61 | public function getDueDate() 62 | { 63 | $order = Mage::getModel('sales/order')->load(1); 64 | $this->_block->setData('info', $order->getPayment()); 65 | $this->assertEquals('4/15/2014', $this->_block->getDueDate()); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/Block/Info/fixtures/getDueDate.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | default/payment/invoice/calculate_due_date: 1 3 | default/payment/invoice/payment_due: 14 4 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/Block/Info/fixtures/getDueDateNoPaymentDue.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | default/payment/invoice/calculate_due_date: 1 3 | default/payment/invoice/payment_due: 0 4 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/Config/Config.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 12 | * @version 1.5.0 13 | * @link https://github.com/itabs/Itabs_Invoice 14 | */ 15 | /** 16 | * Tests for module config 17 | * 18 | * @group Itabs_Invoice 19 | */ 20 | class Itabs_Invoice_Test_Config_Config extends EcomDev_PHPUnit_Test_Case_Config 21 | { 22 | /** 23 | * @test 24 | * @loadExpections 25 | */ 26 | public function globalConfig() 27 | { 28 | $this->assertModuleVersion($this->expected('module')->getVersion()); 29 | $this->assertModuleCodePool($this->expected('module')->getCodePool()); 30 | 31 | foreach ($this->expected('module')->getDepends() as $depends) { 32 | $this->assertModuleDepends($depends); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/Config/Config/expectations/globalConfig.yaml: -------------------------------------------------------------------------------- 1 | module: 2 | version: 1.5.0 3 | code_pool: community 4 | depends: 5 | - Mage_Payment 6 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/fixtures/customer.yaml: -------------------------------------------------------------------------------- 1 | eav: 2 | customer: 3 | - entity_id: 1 4 | website_id: 1 5 | email: test.tester@musterfirma.com 6 | firstname: Test 7 | lastname: Test 8 | group_id: 1 9 | store_id: 1 10 | is_active: 1 11 | attribute_set_id: 0 12 | default_billing: 1 13 | default_shipping: 1 14 | 15 | customer_address: 16 | - entity_id: 1 17 | attribute_set_id: 0 18 | parent_id: 1 19 | firstname: Test 20 | lastname: Tester 21 | city: Musterstadt 22 | postcode: 99999 23 | street: Musterstraße 99 24 | company: Musterfirma GmbH 25 | country_id: DE 26 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/fixtures/default.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | default/web/browser_capabilities/cookies: 0 3 | 4 | eav: 5 | catalog_category: 6 | - entity_id: 1 7 | name: Root 8 | url_key: root 9 | entity_type_id: 3 10 | attribute_set_id: 3 11 | parent_id: 0 12 | path: 1 13 | level: 0 14 | position: 0 15 | is_active: 1 16 | created_at: 2014-04-01 08:00:00 17 | updated_at: 2014-04-01 09:00:00 18 | 19 | - entity_id: 2 20 | name: Root Category 21 | url_key: root-category 22 | entity_type_id: 3 23 | attribute_set_id: 3 24 | parent_id: 1 25 | path: 1/2 26 | level: 1 27 | position: 1 28 | children_count: 3 29 | is_active: 1 30 | created_at: 2014-04-01 08:00:00 31 | updated_at: 2014-04-01 09:00:00 32 | 33 | - entity_id: 3 34 | name: Test Category 35 | url_key: test-category 36 | entity_type_id: 3 37 | attribute_set_id: 3 38 | parent_id: 2 39 | path: 1/2/3 40 | level: 2 41 | position: 1 42 | children_count: 0 43 | is_active: 1 44 | created_at: 2014-04-01 08:00:00 45 | updated_at: 2014-04-01 09:00:00 46 | 47 | catalog_product: 48 | - entity_id: 10 49 | sku: test-product-1 50 | name: Test Product 1 51 | type_id: simple 52 | price: 199.99 53 | visibility: 4 54 | status: 1 55 | stock: 56 | qty: 1000 57 | is_in_stock: 1 58 | website_ids: 59 | - base 60 | category_ids: 61 | - 2 62 | - 3 63 | created_at: 2014-04-01 08:00:00 64 | updated_at: 2014-04-01 09:00:00 65 | url_key: test-product-1 66 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/Test/fixtures/order.yaml: -------------------------------------------------------------------------------- 1 | tables: 2 | sales/order: 3 | - entity_id: 1 4 | store_id: 1 5 | customer_id: 1 6 | quote_id: 1 7 | increment_id: 100000001 8 | base_currency_code: EUR 9 | state: processing 10 | status: processing 11 | is_virtual: 0 12 | base_grand_total: 399.98 13 | base_shipping_amount: 0 14 | base_subtotal: 399.98 15 | grand_total: 399.98 16 | subtotal: 399.98 17 | billing_address_id: 1000 18 | shipping_address_id: 1001 19 | customer_email: test.tester@musterfirma.com 20 | customer_firstname: Test 21 | customer_lastname: Test 22 | created_at: "2014-04-01 19:00:00" 23 | 24 | sales/order_address: 25 | - entity_id: 1000 26 | parent_id: 1 27 | customer_address_id: 1 28 | region: Bayern 29 | postcode: 99999 30 | street: Musterstraße 99 31 | city: Musterstadt 32 | firstname: Test 33 | lastname: Tester 34 | email: test.tester@musterfirma.com 35 | country_id: DE 36 | address_type: billing 37 | 38 | - entity_id: 1001 39 | parent_id: 1 40 | customer_address_id: 1 41 | region: Bayern 42 | postcode: 99999 43 | street: Musterstraße 99 44 | city: Musterstadt 45 | firstname: Test 46 | lastname: Tester 47 | email: test.tester@musterfirma.com 48 | country_id: DE 49 | address_type: shipping 50 | 51 | sales/order_item: 52 | - item_id: 10001 53 | order_id: 1 54 | store_id: 1 55 | product_id: 10 56 | base_price: 199.99 57 | price: 199.99 58 | is_qty_decimal: 0 59 | qty_ordered: 2 60 | row_total: 399.98 61 | name: 'Test Product 1' 62 | sku: test-product-1 63 | 64 | sales/order_payment: 65 | - entity_id: 1 66 | parent_id: 1 67 | method: invoice 68 | 69 | sales/quote: 70 | - entity_id: 1 71 | store_id: 1 72 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 1.5.0 19 | 20 | 21 | 22 | 23 | 24 | Itabs_Invoice_Block 25 | 26 | 27 | 28 | 29 | Itabs_Invoice_Helper 30 | 31 | 32 | 33 | 34 | Itabs_Invoice_Model 35 | 36 | 37 | 38 | 39 | 40 | 41 | invoice/observer 42 | paymentMethodIsActive 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Itabs_Invoice.csv 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Itabs_Invoice.csv 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 0 74 | invoice/invoice 75 | pending 76 | Invoice 77 | 10 78 | authorize 79 | 0 80 | 1 81 | 0 82 | 0 83 | 0 84 | 0 85 | 0 86 | 0 87 | 0 88 | 1 89 | 1 90 | 0 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/app/code/community/Itabs/Invoice/etc/system.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | text 22 | 31 23 | 1 24 | 1 25 | 1 26 | 27 | 28 | 29 | select 30 | adminhtml/system_config_source_yesno 31 | 0 32 | 1 33 | 1 34 | 1 35 | 36 | 37 | <label>Title</label> 38 | <frontend_type>text</frontend_type> 39 | <sort_order>5</sort_order> 40 | <show_in_default>1</show_in_default> 41 | <show_in_website>1</show_in_website> 42 | <show_in_store>1</show_in_store> 43 | 44 | 45 | 46 | select 47 | adminhtml/system_config_source_order_status 48 | 10 49 | 1 50 | 1 51 | 1 52 | 53 | 54 | 55 | text 56 | 15 57 | 1 58 | 1 59 | 1 60 | 61 | 62 | 63 | allowspecific 64 | 20 65 | adminhtml/system_config_source_payment_allspecificcountries 66 | 1 67 | 1 68 | 1 69 | 70 | 71 | 72 | multiselect 73 | 25 74 | adminhtml/system_config_source_country 75 | 1 76 | 1 77 | 1 78 | 79 | 80 | 81 | text 82 | 30 83 | 1 84 | 1 85 | 1 86 | 87 | 88 | 89 | 90 | Due date: 20.03.2014).]]> 91 | select 92 | adminhtml/system_config_source_yesno 93 | 31 94 | 1 95 | 1 96 | 1 97 | 98 | 99 | 100 | textarea 101 | 32 102 | 1 103 | 1 104 | 1 105 | 106 | 107 | 108 | 109 | text 110 | 35 111 | 1 112 | 1 113 | 1 114 | 115 | 116 | 117 | 118 | text 119 | 40 120 | 1 121 | 1 122 | 1 123 | 124 | 125 | 126 | text 127 | 45 128 | 1 129 | 1 130 | 1 131 | 132 | 133 | 134 | Set to "no" if you want to enable Invoice payment only for specific customer groups. 135 | select 136 | 50 137 | adminhtml/system_config_source_yesno 138 | 1 139 | 1 140 | 1 141 | 142 | 143 | 144 | multiselect 145 | 55 146 | invoice/system_config_source_customer_group 147 | 1 148 | 1 149 | 1 150 | 151 | 0 152 | 153 | 154 | 155 | 156 | text 157 | 60 158 | Default: "0" for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method. 159 | 1 160 | 1 161 | 1 162 | 163 | 164 | 165 | text 166 | 65 167 | Default: "0" for disabled check | Minimum order amount (in the past) needed for the customer to use this payment method. 168 | 1 169 | 1 170 | 1 171 | 172 | 173 | 174 | select 175 | adminhtml/system_config_source_yesno 176 | 70 177 | Set to "yes" if you want to disallow this payment method if a customer has invoices with the invoice state "Open". 178 | 1 179 | 1 180 | 1 181 | 182 | 183 | 184 | select 185 | adminhtml/system_config_source_yesno 186 | 71 187 | Check if billing address != shipping address. If yes, invoice payment will be disabled. 188 | 1 189 | 1 190 | 1 191 | 192 | 193 | 194 | select 195 | adminhtml/system_config_source_yesno 196 | 72 197 | Check if the prefix of the billing/shipping address contains a not allowed value. If yes, invoice payment will be disabled. 198 | 1 199 | 1 200 | 1 201 | 202 | 203 | 204 | text 205 | 73 206 | 207 | 1 208 | 1 209 | 1 210 | 211 | 1 212 | 213 | 214 | 215 | 216 | select 217 | adminhtml/system_config_source_yesno 218 | 75 219 | 1 220 | 1 221 | 1 222 | 223 | 224 | 225 | select 226 | invoice/system_config_source_sales_invoice_state 227 | 80 228 | 1 229 | 1 230 | 1 231 | 232 | 1 233 | 234 | 235 | 236 | 237 | select 238 | adminhtml/system_config_source_yesno 239 | 85 240 | 1 241 | 1 242 | 1 243 | 244 | 1 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /src/app/design/adminhtml/default/default/template/invoice/form.phtml: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 9 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 10 | * @version 1.5.0 11 | * @link https://github.com/itabs/Itabs_Invoice 12 | */ 13 | ?> 14 | getMethod(); 19 | ?> 20 |
21 | 37 |
38 | -------------------------------------------------------------------------------- /src/app/design/adminhtml/default/default/template/invoice/info.phtml: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 9 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 10 | * @version 1.5.0 11 | * @link https://github.com/itabs/Itabs_Invoice 12 | */ 13 | ?> 14 | getMethod(); 19 | ?> 20 |

getTitle() ?>

21 | getDueDate()): ?> 22 |

__('Your invoice is due on %s.', $dueDate) ?>

23 | 24 | getConfigData('payment_due') > 0): ?> 25 |

__('Your invoice is payable within %s days.', 26 | $method->getConfigData('payment_due')) ?>

27 | 28 |

__('Payable promptly without deduction upon receipt of invoice.', 29 | $method->getConfigData('payment_due')) ?>

30 | 31 | 32 | getConfigData('text_block_info')): ?> 33 |

getConfigData('text_block_info') ?>

34 | 35 | -------------------------------------------------------------------------------- /src/app/design/adminhtml/default/default/template/invoice/pdf.phtml: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 9 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 10 | * @version 1.5.0 11 | * @link https://github.com/itabs/Itabs_Invoice 12 | */ 13 | ?> 14 | getMethod(); 19 | ?> 20 | escapeHtml($method->getTitle()) ?> 21 | {{pdf_row_separator}} 22 | getDueDate()): ?> 23 | __('Your invoice is due on %s.', $dueDate) ?> 24 | 25 | getConfigData('payment_due') > 0): ?> 26 | __('Your invoice is payable within %s days.', 27 | $method->getConfigData('payment_due')) ?> 28 | 29 | __('Payable promptly without deduction upon receipt of invoice.', 30 | $method->getConfigData('payment_due')) ?> 31 | 32 | 33 | {{pdf_row_separator}} 34 | getConfigData('text_block_info')): ?> 35 | getConfigData('text_block_info') ?> 36 | 37 | -------------------------------------------------------------------------------- /src/app/design/frontend/base/default/template/invoice/form.phtml: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 9 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 10 | * @version 1.5.0 11 | * @link https://github.com/itabs/Itabs_Invoice 12 | */ 13 | ?> 14 | getMethod(); 19 | ?> 20 |
21 | 37 |
38 | -------------------------------------------------------------------------------- /src/app/design/frontend/base/default/template/invoice/info.phtml: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2013-2015 ITABS GmbH (http://www.itabs.de) 9 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 10 | * @version 1.5.0 11 | * @link https://github.com/itabs/Itabs_Invoice 12 | */ 13 | ?> 14 | getMethod(); 19 | ?> 20 |

getTitle() ?>

21 | getDueDate()): ?> 22 |

__('Your invoice is due on %s.', $dueDate) ?>

23 | 24 | getConfigData('payment_due') > 0): ?> 25 |

__('Your invoice is payable within %s days.', 26 | $method->getConfigData('payment_due')) ?>

27 | 28 |

__('Payable promptly without deduction upon receipt of invoice.', 29 | $method->getConfigData('payment_due')) ?>

30 | 31 | 32 | getConfigData('text_block_info')): ?> 33 |

getConfigData('text_block_info') ?>

34 | 35 | -------------------------------------------------------------------------------- /src/app/etc/modules/Itabs_Invoice.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | true 19 | community 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/app/locale/de_DE/Itabs_Invoice.csv: -------------------------------------------------------------------------------- 1 | "Enabled","Aktiviert" 2 | "Title","Titel" 3 | "New Order Status","Neuer Bestell-Status" 4 | "Sort Order","Reihenfolge" 5 | "Payment from Applicable Countries","Zahlung aus erlaubten Ländern" 6 | "Payment from Specific Countries","Zahlung von bestimmten Ländern" 7 | "Payment Due","Zahlungsziel" 8 | "Number of days within the invoice is payable","Anzahl an Tagen in denen die Rechnung zahlbar ist" 9 | "Text for Payment Form","Text für Zahlungsmethoden-Auswahl" 10 | "Text after the selection of the payment method","Text, der nach der Auswahl der Zahlungsmethode im Checkout angezeigt werden soll" 11 | "Text for Payment Info","Text für die Zahlungsinformation" 12 | "Text for the checkout progress info","Text, der im Bestellfortschritt angezeigt werden soll" 13 | "Minimum Order Total","Mindestwert für Gesamtbestellung" 14 | "Maximum Order Total","Höchstwert für Gesamtbestellung" 15 | "Enabled for all customer groups","Aktiviert für alle Kundengruppen" 16 | "Set to ""no"" if you want to enable Invoice payment only for specific customer groups.","Auf ""nein"" setzen um die Zahlungsart nur für bestimmte Kundengruppen zu erlauben" 17 | "Enabled only for specific customer groups","Aktiviert für bestimmte Kundengruppen" 18 | "Minimum Order Count","Mindestbestellanzahl" 19 | "Default: ""0"" for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method.","Standard: ""0"" für deaktivierte Überprüfung | Mindestanzahl an Bestellungen (in der Vergangenheit) um diese Zahlungsart benutzen zu dürfen." 20 | "Minimum Order Amount","Mindestbestellsumme" 21 | "Default: ""0"" for disabled check | Minimum order amount (in the past) needed for the customer to use this payment method.","Standard: ""0"" für deaktivierte Überprüfung | Mindestbestellsumme (in der Vergangenheit) um diese Zahlungsart benutzen zu dürfen." 22 | "Check Open Invoices","Offene Rechnungen überprüfen" 23 | "Set to ""yes"" if you want to disallow this payment method if a customer has invoices with the invoice state ""Open"".","Auf ""Ja"" setzen um die Zahlungsart zu deaktivieren, wenn der Kunden Rechnungen mit dem Status ""Offen"" hat." 24 | "Automatically Create Invoice","Automatische Rechnungserstellung" 25 | "Invoice State","Rechnungs-Status" 26 | "Send Invoice Email","Rechnungsemail versenden" 27 | "Your invoice is payable within %s days.","Die Rechnung ist innerhalb %s Tagen zahlbar." 28 | "Check Address","Adressüberprüfung aktivieren" 29 | "Check if billing address != shipping address. If yes, invoice payment will be disabled.","Prüfe, ob die Rechnungsadresse != der Lieferadresse ist. Falls ja, wird die Zahlung auf Rechnung deaktiviert." 30 | "Check Prefix","Anrede überprüfen" 31 | "Check if the prefix of the billing/shipping address contains a not allowed value. If yes, invoice payment will be disabled.","Prüfe, ob die Anrede der Rechnungs-/Lieferadresse einen ungültigen Wert enthält. Falls ja, wird die Zahlung auf Rechnung deaktiviert." 32 | "Disabled Prefix Options","Nicht erlaubte Anredeoptionen" 33 | "Semicolon (;) separated values.","Semikolon (;) getrennte Werte." 34 | "Your invoice is due on %s.","Die Rechnung ist zahlbar bis zum %s." 35 | "Calculate Due Date","Berechne Fälligkeitsdatum" 36 | "Calculate the due date for the invoice based on the order date (e.g. Order Date: 10.03.2014, Payment Due: 10 days => Due date: 20.03.2014).","Berechne das Fälligkeitsdatum für die Rechnung anhand dem Bestelldatum (z.B. Bestelldatum: 10.03.2014, Zahlungsziel: 10 Tage => Fälligkeitsdatum: 20.03.2014)." 37 | "Payable promptly without deduction upon receipt of invoice.","Zahlbar nach Erhalt der Rechnung ohne Abzug." 38 | -------------------------------------------------------------------------------- /src/app/locale/en_US/Itabs_Invoice.csv: -------------------------------------------------------------------------------- 1 | "Enabled","Enabled" 2 | "Title","Title" 3 | "New Order Status","New Order Status" 4 | "Sort Order","Sort Order" 5 | "Payment from Applicable Countries","Payment from Applicable Countries" 6 | "Payment from Specific Countries","Payment from Specific Countries" 7 | "Payment Due","Payment Due" 8 | "Number of days within the invoice is payable","Number of days within the invoice is payable" 9 | "Text for Payment Form","Text for Payment Form" 10 | "Text after the selection of the payment method","Text after the selection of the payment method" 11 | "Text for Payment Info","Text for Payment Info" 12 | "Text for the checkout progress info","Text for the checkout progress info" 13 | "Minimum Order Total","Minimum Order Total" 14 | "Maximum Order Total","Maximum Order Total" 15 | "Enabled for all customer groups","Enabled for all customer groups" 16 | "Set to ""no"" if you want to enable Invoice payment only for specific customer groups.","Set to ""no"" if you want to enable Invoice payment only for specific customer groups." 17 | "Enabled only for specific customer groups","Enabled only for specific customer groups" 18 | "Minimum Order Count","Minimum Order Count" 19 | "Default: ""0"" for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method.","Default: ""0"" for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method." 20 | "Minimum Order Amount","Minimum Order Amount" 21 | "Default: ""0"" for disabled check | Minimum order amount (in the past) needed for the customer to use this payment method.","Default: ""0"" for disabled check | Minimum order amount (in the past) needed for the customer to use this payment method." 22 | "Check Open Invoices","Check Open Invoices" 23 | "Set to ""yes"" if you want to disallow this payment method if a customer has invoices with the invoice state ""Open"".","Set to ""yes"" if you want to disallow this payment method if a customer has invoices with the invoice state ""Open""." 24 | "Automatically Create Invoice","Automatically Create Invoice" 25 | "Invoice State","Invoice State" 26 | "Send Invoice Email","Send Invoice Email" 27 | "Your invoice is payable within %s days.","Your invoice is payable within %s days." 28 | "Payable promptly without deduction upon receipt of invoice.","Payable promptly without deduction upon receipt of invoice." -------------------------------------------------------------------------------- /src/app/locale/nb_NO/Itabs_Invoice.csv: -------------------------------------------------------------------------------- 1 | "Enabled","Aktivert" 2 | "Title","Tittel" 3 | "New Order Status","Ny ordrestatus" 4 | "Sort Order","Sorteringsrekkefølge" 5 | "Payment from Applicable Countries","Betaling fra tillatte land" 6 | "Payment from Specific Countries","Betaling fra spesifikke land" 7 | "Payment Due","Forfall" 8 | "Number of days within the invoice is payable","Antall dager før faktura forfaller" 9 | "Text for Payment Form","Tekst til betalingsskjema" 10 | "Text after the selection of the payment method","Tekst etter valg av betalingsmetode" 11 | "Text for Payment Info","Tekst for betalingsinformasjon" 12 | "Text for the checkout progress info","Tekst for progresjonsinformasjon i utsjekk" 13 | "Minimum Order Total","Minimum ordretotal" 14 | "Maximum Order Total","Maksimum ordretotal" 15 | "Enabled for all customer groups","Aktivert for alle kundegrupper" 16 | "Set to ""no"" if you want to enable Invoice payment only for specific customer groups.","Sett til ""nei"" dersom du ønsker å aktivere fakturabetaling kun for spesifikke kundegrupper." 17 | "Enabled only for specific customer groups","Aktivert kun for spesifikke kundegrupper" 18 | "Minimum Order Count","Minimum ordreantall" 19 | "Default: ""0"" for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method.","Standard: ""0"" for å deaktivere kontroll | Minimum antall ordrer kunden tidligere må ha gjennomført for tilgang til fakturabetaling." 20 | "Minimum Order Amount","Minimum ordrebeløp" 21 | "Default: ""0"" for disabled check | Minimum order amount (in the past) needed for the customer to use this payment method.","Standard: ""0"" for å deaktivere kontroll | Minimum ordrebeløp kunden tidligere må ha handlet for for tilgang til fakturabetaling." 22 | "Check Open Invoices","Sjekk åpne fakturaposter" 23 | "Set to ""yes"" if you want to disallow this payment method if a customer has invoices with the invoice state ""Open"".","Sett til ""ja"" dersom du ønsker å deaktivere denne betalingsmetoden om kunden har ubetalte faktura stående med status ""åpen""." 24 | "Check Address","Sjekk adresse" 25 | "Check if billing address != shipping address. If yes, invoice payment will be disabled.","Sjekk om betaling adresse er ulik leveringsadresse. Dersom ja blir faktura-betaling deaktivert." 26 | "Check Prefix","Sjekk prefiks" 27 | "Check if the prefix of the billing/shipping address contains a not allowed value. If yes, invoice payment will be disabled.","Sjekk om prefiks på betalings/leverings-adresse inneholder en ikke-tillatt verdi. Dersom ja blir faktura-betaling deaktivert." 28 | "Automatically Create Invoice","Opprett faktura automatisk" 29 | "Invoice State","Fakturastatus" 30 | "Send Invoice Email","Send faktura-epost" 31 | "Your invoice is payable within %s days.","Din faktura må betales innen %s dager." 32 | "Payable promptly without deduction upon receipt of invoice.","Betales omgående uten fradrag ved mottak av faktura." 33 | --------------------------------------------------------------------------------