auto-invoice-free-extension - Version 1.0.4

Version Notes

- Automatically change the status of orders
- Enable automatic invoice and shipment generation
- Automatically send invoice email

Download this release

Release Info

Developer Magento Core Team
Extension auto-invoice-free-extension
Version 1.0.4
Comparing to
See all releases


Version 1.0.4

BSS_AutoInvoice_v1.0.4/.DS_Store ADDED
Binary file
BSS_AutoInvoice_v1.0.4/app/.DS_Store ADDED
Binary file
BSS_AutoInvoice_v1.0.4/app/code/community/Bss/Autoinvoice/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BssCommerce Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://bsscommerce.com/Bss-Commerce-License.txt
11
+ *
12
+ * =================================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * =================================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * BssCommerce does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * BssCommerce does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * =================================================================
21
+ *
22
+ * @category BSS
23
+ * @package BSS_Autoinvoice
24
+ * @author Extension Team
25
+ * @copyright Copyright (c) 2014-2105 BssCommerce Co. (http://bsscommerce.com)
26
+ * @license http://bsscommerce.com/Bss-Commerce-License.txt
27
+ */
28
+ class Bss_Autoinvoice_Helper_Data extends Mage_Core_Helper_Abstract
29
+ {
30
+ public function data() {
31
+ }
32
+ }
33
+ ?>
BSS_AutoInvoice_v1.0.4/app/code/community/Bss/Autoinvoice/Model/Observer.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ob_start(); ?>
2
+ <?php
3
+ /**
4
+ * BssCommerce Co.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://bsscommerce.com/Bss-Commerce-License.txt
12
+ *
13
+ * =================================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * =================================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * BssCommerce does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * BssCommerce does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * =================================================================
22
+ *
23
+ * @category BSS
24
+ * @package BSS_Autoinvoice
25
+ * @author Extension Team
26
+ * @copyright Copyright (c) 2014-2105 BssCommerce Co. (http://bsscommerce.com)
27
+ * @license http://bsscommerce.com/Bss-Commerce-License.txt
28
+ */
29
+ class Bss_Autoinvoice_Model_Observer
30
+ {
31
+ /* @var Magento_Sales_Model_Order_Invoice */
32
+ public $_invoice;
33
+
34
+ /**
35
+ * Mage::dispatchEvent($this->_eventPrefix.'_save_after', $this->_getEventData());
36
+ * protected $_eventPrefix = 'sales_order';
37
+ * protected $_eventObject = 'order';
38
+ * event: sales_order_save_after
39
+ */
40
+ public function autoInvoice($observer)
41
+ {
42
+ if(Mage::getStoreConfig('autoinvoice/settings/active')) {
43
+ $order = $observer->getEvent()->getOrder();
44
+ $orders = Mage::getModel('sales/order_invoice')->getCollection()
45
+ ->addAttributeToFilter('order_id', array('eq'=>$order->getId()));
46
+ $orders->getSelect()->limit(1);
47
+ if ((int)$orders->count() !== 0) {
48
+ return $this;
49
+ }
50
+ if(in_array($order->getPayment()->getMethod(),explode(',',Mage::getStoreConfig('autoinvoice/settings/payment_methods')))) {
51
+ if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
52
+ try {
53
+
54
+ if(!$order->canInvoice()) {
55
+ $order->addStatusHistoryComment('Bss AutoInvoice: Order cannot be invoiced.', false);
56
+ $order->save();
57
+ }
58
+ if(Mage::getStoreConfig('autoinvoice/settings/invoice')) {
59
+ //START Handle Invoice
60
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
61
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
62
+ $invoice->register();
63
+ $invoice->getOrder()->setCustomerNoteNotify(false);
64
+ $invoice->getOrder()->setIsInProcess(true);
65
+ $order->addStatusHistoryComment('Automatically Invoiced by Bss AutoInvoice.', false);
66
+ $transactionSave = Mage::getModel('core/resource_transaction')
67
+ ->addObject($invoice)
68
+ ->addObject($invoice->getOrder());
69
+ $transactionSave->save();
70
+ //END Handle Invoice
71
+ //START Handle Shipment
72
+ if(Mage::getStoreConfig('autoinvoice/settings/shipment')) {
73
+ $shipment = $order->prepareShipment();
74
+ $shipment->register();
75
+ $order->setIsInProcess(true);
76
+ $order->addStatusHistoryComment('Automatically Shipped by Bss Autoinvoice.', false);
77
+ $transactionSave = Mage::getModel('core/resource_transaction')
78
+ ->addObject($shipment)
79
+ ->addObject($shipment->getOrder())
80
+ ->save();
81
+ }
82
+ //END Handle Shipment
83
+ }
84
+
85
+ } catch (Exception $e) {
86
+ $order->addStatusHistoryComment('Bss AutoInvoice: Exception occurred during automaticallyInvoiceShipCompleteOrder action. Exception message: '.$e->getMessage(), false);
87
+ $order->save();
88
+ }
89
+ }
90
+ }
91
+ return $this;
92
+ }
93
+ }
94
+
95
+ public function automaticallyInvoiceShipCompleteOrder($observer)
96
+ {
97
+ try {
98
+ /* @var $order Magento_Sales_Model_Order_Invoice */
99
+ $this->_invoice = $observer->getEvent()->getInvoice();
100
+ //Mage::log('automatically send invoice'.$this->_invoice, null, 'bsslog1.log');
101
+ $this->_invoice->sendEmail();
102
+
103
+ } catch (Mage_Core_Exception $e) {
104
+ Mage::log("automatically send invoice: Fehler #58 " . $e->getMessage());
105
+ }
106
+
107
+ return $this;
108
+ }
109
+ }
110
+ ?>
BSS_AutoInvoice_v1.0.4/app/code/community/Bss/Autoinvoice/etc/config.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Bss_Autoinvoice>
4
+ <version>1.0.0.3</version>
5
+ </Bss_Autoinvoice>
6
+ </modules>
7
+ <global>
8
+ <models>
9
+ <bss_autoinvoice>
10
+ <class>Bss_Autoinvoice_Model</class>
11
+ </bss_autoinvoice>
12
+ </models>
13
+ <helpers>
14
+ <autoinvoice>
15
+ <class>Bss_Autoinvoice_Helper</class>
16
+ </autoinvoice>
17
+ </helpers>
18
+ <events>
19
+ <sales_order_save_after>
20
+ <observers>
21
+ <bss_autoinvoice>
22
+ <class>bss_autoinvoice/observer</class>
23
+ <method>autoInvoice</method>
24
+ </bss_autoinvoice>
25
+ </observers>
26
+ </sales_order_save_after>
27
+ <sales_order_invoice_save_after>
28
+ <observers>
29
+ <bss_autoinvoice>
30
+ <type>singleton</type>
31
+ <class>bss_autoinvoice/observer</class>
32
+ <method>automaticallyInvoiceShipCompleteOrder</method>
33
+ </bss_autoinvoice>
34
+ </observers>
35
+ </sales_order_invoice_save_after>
36
+
37
+ </events>
38
+ </global>
39
+ <adminhtml>
40
+ <acl>
41
+ <resources>
42
+ <admin translate="title" module="adminhtml">
43
+ <children>
44
+ <autoinvoice>
45
+ <title>Bss Auto Invoice</title>
46
+ </autoinvoice>
47
+ <system>
48
+ <children>
49
+ <config>
50
+ <children>
51
+ <autoinvoice translate="title">
52
+ <title>Bss_Autoinvoice</title>
53
+ <sort_order>200</sort_order>
54
+ </autoinvoice>
55
+ </children>
56
+ </config>
57
+ </children>
58
+ </system>
59
+ </children>
60
+ </admin>
61
+ </resources>
62
+ </acl>
63
+ </adminhtml>
64
+ </config>
BSS_AutoInvoice_v1.0.4/app/code/community/Bss/Autoinvoice/etc/system.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <bss translate="label" module="autoinvoice">
5
+ <label>BSS COMMERCE</label>
6
+ <sort_order>500</sort_order>
7
+ </bss>
8
+ </tabs>
9
+ <sections>
10
+ <autoinvoice translate="label" module="autoinvoice">
11
+ <label>Bss Autoinvoice</label>
12
+ <tab>bss</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>200</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <settings translate="label">
20
+ <label>Bss Auto Invoice</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>5</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <active translate="label">
28
+ <label>Enabled</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </active>
36
+ <payment_methods translate="label">
37
+ <label>Select Payment Methods</label>
38
+ <frontend_type>multiselect</frontend_type>
39
+ <source_model>adminhtml/system_config_source_payment_allmethods</source_model>
40
+ <comment>Select payment methods for which invoice and shipment autogeneration will work</comment>
41
+ <sort_order>2</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </payment_methods>
46
+ <invoice translate="label">
47
+ <label>Enable automatic invoice generation</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>3</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </invoice>
55
+ <shipment translate="label">
56
+ <label>Enable automatic shipment generation</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>4</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <depends><invoice>1</invoice></depends>
64
+ </shipment>
65
+ </fields>
66
+ </settings>
67
+ </groups>
68
+ </autoinvoice>
69
+ </sections>
70
+ </config>
BSS_AutoInvoice_v1.0.4/app/etc/modules/Bss_Autoinvoice.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <config>
3
+ <modules>
4
+ <Bss_Autoinvoice>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Bss_Autoinvoice>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>BSSCommerceAutoInvoice</name>
4
+ <version>1.0.4</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://bsscommerce.com/Bss-Commerce-License.txt">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Auto Invoice Extension was designed to automatically change order status by sending invoice email to customers</summary>
10
+ <description>Using BSS Auto Invoice Extension, Magento e-commerce shoppers can save more time instead of spending hours to change order status manually, customers also feel more convenient because the invoice is rapidly created and automatically sent to customers.&#xD;
11
+ &#xD;
12
+ Key Features&#xD;
13
+ - Create and send invoice email with order details, payment and shipment methods&#xD;
14
+ - Automatically change the orders&#x2019; status right after purchasing process is finished and auto invoice email is sent to customer&#x2019;s inbox &#xD;
15
+ - Support all available payment methods, allow admin to choose to apply auto invoice with which kinds of payment method.&#xD;
16
+ - Enable to generate an automatic invoice and shipment.&#xD;
17
+ - Easily customized from backend and well-compatible with Magento.</description>
18
+ <notes>- Automatically change the status of orders &#xD;
19
+ - Enable automatic invoice and shipment generation&#xD;
20
+ - Automatically send invoice email</notes>
21
+ <authors><author><name>BSSCommerce</name><user>auto-converted</user><email>support@bsscommerce.com</email></author></authors>
22
+ <date>2016-01-27</date>
23
+ <time>04:56:45</time>
24
+ <contents><target name="mage"><dir name="BSS_AutoInvoice_v1.0.4"><dir name="app"><dir name="code"><dir name="community"><dir name="Bss"><dir name="Autoinvoice"><dir name="Helper"><file name="Data.php" hash="d27d40287907297d31f17c40a5ce2642"/></dir><dir name="Model"><file name="Observer.php" hash="726beafa5f0cbe6b47a46e8a6a7389de"/></dir><dir name="etc"><file name="config.xml" hash="62649d18903b2e78d03b9b67271ea602"/><file name="system.xml" hash="407e0ae898288993ea177f2d2eafafc4"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Bss_Autoinvoice.xml" hash="fea148ebae4c57b86273790f57423702"/></dir></dir><file name=".DS_Store" hash="d5e536bd1c086ddd410c06111800dda3"/></dir><file name=".DS_Store" hash="ee1c175b68653e8e3b47d3d8365b6f6f"/></dir></target></contents>
25
+ <compatible/>
26
+ <dependencies><required><package><name>Bsscommerce_Community_module</name><channel>community</channel><min>1.4.0.0</min><max>1.9.2.2</max></package></required></dependencies>
27
+ </package>