Skip to content

Commit 3e086bb

Browse files
Update label & content
1 parent 45309f1 commit 3e086bb

File tree

8 files changed

+44
-6
lines changed

8 files changed

+44
-6
lines changed

Helper/Data.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,39 @@ class Data extends AbstractData
3232
{
3333
const CONFIG_MODULE_PATH = 'mpsameordernumber';
3434

35+
/**
36+
* @param null $storeId
37+
* @return array
38+
*/
3539
public function getApplyForOption($storeId = null)
3640
{
3741
return explode(",", $this->getConfigGeneral('apply', $storeId));
3842
}
3943

44+
/**
45+
* @param null $storeId
46+
* @return bool
47+
*/
4048
public function isApplyInvoice($storeId = null)
4149
{
4250
return in_array(Apply::INVOICE, $this->getApplyForOption($storeId));
4351
}
4452

53+
/**
54+
* @param null $storeId
55+
* @return bool
56+
*/
4557
public function isApplyShipment($storeId = null)
4658
{
4759
return in_array(Apply::SHIPMENT, $this->getApplyForOption($storeId));
4860
}
4961

62+
/**
63+
* @param null $storeId
64+
* @return bool
65+
*/
5066
public function isApplyCreditMemo($storeId = null)
5167
{
5268
return in_array(Apply::CREDIT_MEMO, $this->getApplyForOption($storeId));
5369
}
54-
5570
}

Model/System/Config/Source/Apply.php

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
use Magento\Framework\Option\ArrayInterface;
2525

26+
/**
27+
* Class Apply
28+
* @package Mageplaza\SameOrderNumber\Model\System\Config\Source
29+
*/
2630
class Apply implements ArrayInterface
2731
{
2832
const SHIPMENT = "Shipment";

Observer/InvoiceSaveBefore.php

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
use Magento\Framework\Registry;
2727
use Mageplaza\SameOrderNumber\Helper\Data as HelperData;
2828

29+
/**
30+
* Class InvoiceSaveBefore
31+
* @package Mageplaza\SameOrderNumber\Observer
32+
*/
2933
class InvoiceSaveBefore implements ObserverInterface
3034
{
3135
/**

Plugin/SameOrderNumber.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
use Mageplaza\SameOrderNumber\Helper\Data as HelperData;
3030
use Mageplaza\SameOrderNumber\Model\System\Config\Source\Apply;
3131

32+
/**
33+
* Class SameOrderNumber
34+
* @package Mageplaza\SameOrderNumber\Plugin
35+
*/
3236
class SameOrderNumber
3337
{
3438
/**
@@ -63,7 +67,8 @@ public function __construct(
6367
Http $request,
6468
Order $order,
6569
HelperData $helperData,
66-
Registry $registry)
70+
Registry $registry
71+
)
6772
{
6873
$this->_request = $request;
6974
$this->_order = $order;
@@ -132,7 +137,6 @@ public function processIncrementId($defaultIncrementId, $type, Invoice $invoice
132137
$creditMemoCollectionIds = $this->getOrder()->getCreditmemosCollection()->getAllIds();
133138

134139
return $this->getNextId($creditMemoCollectionIds);
135-
136140
}
137141
}
138142

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"mageplaza/module-core": "^1.4.0"
66
},
77
"type": "magento2-module",
8-
"version": "1.0.0",
8+
"version": "1.0.1",
99
"license": "proprietary",
1010
"authors": [
1111
{

etc/config.xml

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
2424
<default>
2525
<mpsameordernumber>
26+
<module>
27+
<type>1</type>
28+
</module>
2629
<general>
2730
<enabled>1</enabled>
2831
</general>

etc/events.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
-->
2323
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
2424
<event name="sales_order_invoice_save_before">
25-
<observer name="affiliateObserver" instance="Mageplaza\SameOrderNumber\Observer\InvoiceSaveBefore" />
25+
<observer name="affiliateObserver" instance="Mageplaza\SameOrderNumber\Observer\InvoiceSaveBefore"/>
2626
</event>
2727
</config>

i18n/en_US.csv

+9-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
General,General
1+
Shipment,Shipment
2+
Invoice,Invoice
3+
"Credit Memo","Credit Memo"
4+
"Same Order Number","Same Order Number"
5+
"General Configuration","General Configuration"
6+
Enable,Enable
7+
"Select <b>Yes</b> to enable this module.","Select <b>Yes</b> to enable this module."
8+
"Apply for","Apply for"
9+
"If increment id exist, a sufix number will be added. Ex: 100001-1, 100001-2","If increment id exist, a sufix number will be added. Ex: 100001-1, 100001-2"

0 commit comments

Comments
 (0)