This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\InventoryAdminUi\Ui\DataProvider\SourceDataProvider">
<plugin name="esun_lingxing_source_warehouse_data"
type="Esun\LingxingErp\Plugin\InventoryAdminUi\SourceDataProviderPlugin"/>
</type>
</config>
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_inventory_source_save_after">
<observer name="esun_lingxing_save_source_warehouse_mapping"
instance="Esun\LingxingErp\Observer\SaveSourceWarehouseMapping"/>
</event>
</config>
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Esun_LingxingErp::root" title="Lingxing ERP" module="Esun_LingxingErp"
sortOrder="80" parent="Esun_ImageManager::esun" resource="Esun_LingxingErp::root"/>
<add id="Esun_LingxingErp::orders" title="Order Synchronization" module="Esun_LingxingErp"
sortOrder="20" parent="Esun_LingxingErp::root" action="esun_lingxing/order/index"
resource="Esun_LingxingErp::orders"/>
<add id="Esun_LingxingErp::store_list" title="Stores" module="Esun_LingxingErp"
sortOrder="10" parent="Esun_LingxingErp::root" action="esun_lingxing/store/index"
resource="Esun_LingxingErp::stores"/>
<add id="Esun_LingxingErp::shipments" title="Shipment Synchronization" module="Esun_LingxingErp"
sortOrder="30" parent="Esun_LingxingErp::root" action="esun_lingxing/shipment/index"
resource="Esun_LingxingErp::shipments"/>
<add id="Esun_LingxingErp::warehouses" title="Warehouses and Inventory" module="Esun_LingxingErp"
sortOrder="15" parent="Esun_LingxingErp::root" action="esun_lingxing/warehouse/index"
resource="Esun_LingxingErp::warehouses"/>
<add id="Esun_LingxingErp::logs" title="Synchronization Logs" module="Esun_LingxingErp"
sortOrder="40" parent="Esun_LingxingErp::root" action="esun_lingxing/log/index"
resource="Esun_LingxingErp::logs"/>
</menu>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="esun_lingxing" frontName="esun_lingxing">
<module name="Esun_LingxingErp" before="Magento_Backend"/>
</route>
</router>
</config>
@@ -0,0 +1,85 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="esun" translate="label" sortOrder="300"><label>Esun</label></tab>
<section id="esun_lingxing" translate="label" sortOrder="160" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Lingxing ERP</label>
<tab>esun</tab>
<resource>Esun_LingxingErp::config</resource>
<group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Connection and Order Mapping</label>
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enabled</label><source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="api_base_url" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>API Base URL</label>
</field>
<field id="app_id" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
<label>App ID</label>
</field>
<field id="app_secret" translate="label" type="obscure" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<label>App Secret</label><backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="store_mapping" translate="label comment" type="select" sortOrder="50" showInDefault="0" showInWebsite="1" showInStore="0" canRestore="1">
<label>Lingxing Store</label>
<source_model>Esun\LingxingErp\Model\Source\LingxingStore</source_model>
<comment>Read from the locally synchronized store list. The selected option stores both Platform Code and Lingxing Store ID for this Magento Website.</comment>
</field>
<field id="warehouse_id" translate="label comment" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Default Lingxing Warehouse</label>
<source_model>Esun\LingxingErp\Model\Source\LingxingWarehouse</source_model>
<comment>Read from synchronized warehouses. Leave both warehouse and logistics type blank to let Lingxing route the order.</comment>
</field>
<field id="logistics_type_id" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Default Logistics Type ID</label>
</field>
<field id="eligible_statuses" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Order Statuses to Export</label><comment>Comma-separated Magento order status codes, for example: processing.</comment>
</field>
</group>
<group id="orders" translate="label" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Order Synchronization</label>
<field id="batch_size" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"><label>Batch Size</label></field>
<field id="max_attempts" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0"><label>Maximum Attempts</label></field>
<field id="stock_deduction_type" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Stock Deduction Type</label><comment>Lingxing value 1 means no store-specific stock dimension; 2 means SKU plus order store.</comment>
</field>
</group>
<group id="shipments" translate="label" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Shipment Synchronization</label>
<field id="page_size" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"><label>Pull Page Size</label></field>
<field id="max_pages" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0"><label>Maximum Pages per Run</label></field>
<field id="max_attempts" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0"><label>Maximum Processing Attempts</label></field>
<field id="notify_customer" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Email Shipment to Customer</label><source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<group id="sku_sync" translate="label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<label>ERP SKU Synchronization</label>
<field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Daily Synchronization Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Runs once per day. Manual synchronization remains available under Esun &gt; Lingxing ERP &gt; Stores.</comment>
</field>
<field id="page_size" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Pair List Page Size</label>
<comment>Number of Lingxing SKU pairs requested per API page, from 1 to 200.</comment>
</field>
</group>
<group id="logging" translate="label" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Synchronization Log Retention</label>
<field id="success_retention_days" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Success Log Retention (Days)</label>
<validate>validate-number validate-greater-than-zero</validate>
<comment>Successful and ignored logs store compact summaries and are deleted after this many days.</comment>
</field>
<field id="error_retention_days" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Error Log Retention (Days)</label>
<validate>validate-number validate-greater-than-zero</validate>
<comment>Failed and retrying logs retain sanitized request and response payloads for this many days.</comment>
</field>
</group>
</section>
</system>
</config>