Skip to content

Prevent Adding Custom Fees To Orders Selected for Packing Slips#97

Merged
JosephLeedy merged 3 commits intomainfrom
95-fix-packing-slip-filters
Nov 26, 2025
Merged

Prevent Adding Custom Fees To Orders Selected for Packing Slips#97
JosephLeedy merged 3 commits intomainfrom
95-fix-packing-slip-filters

Conversation

@JosephLeedy
Copy link
Owner

Fixes #95

Fixes incorrect orders printed in the sales order packing slip.

Fixes #95
@JosephLeedy JosephLeedy self-assigned this Nov 25, 2025
@JosephLeedy JosephLeedy added the bug Something isn't working label Nov 25, 2025
@JosephLeedy JosephLeedy moved this from Backlog to In review in Custom Fees for Magento 2 Nov 25, 2025
@JosephLeedy
Copy link
Owner Author

Hello @avstaylime,

Could you please test this fix and let us know if it resolves your issue?

Thanks!

@github-actions
Copy link

Code Coverage Report:
  2025-11-25 23:04:48

 Summary:
  Classes: 30.77% (20/65)
  Methods: 51.63% (111/215)
  Lines:   78.03% (1616/2071)

JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Filter\Form\CustomOrderFees
  Methods:   0.00% ( 0/ 1)   Lines:  97.73% ( 43/ 44)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% (164/164)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid\Column\Renderer\Currency\LocalizedFeeAmount
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Block\Adminhtml\Sales\Order\Creditmemo\Create\Totals
  Methods:  40.00% ( 2/ 5)   Lines:  75.00% ( 39/ 52)
JosephLeedy\CustomFees\Block\Sales\Order\Creditmemo\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  94.74% ( 36/ 38)
JosephLeedy\CustomFees\Block\Sales\Order\Invoice\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  93.02% ( 40/ 43)
JosephLeedy\CustomFees\Block\Sales\Order\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  93.33% ( 28/ 30)
JosephLeedy\CustomFees\Block\System\Config\Form\Field\CustomFees\Advanced\Form
  Methods:  50.00% ( 3/ 6)   Lines:  84.62% ( 77/ 91)
JosephLeedy\CustomFees\Controller\Adminhtml\Config\Export\ExampleCsv
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  80.56% ( 29/ 36)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Csv
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Excel
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\Form
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\NewConditionHtml
  Methods:  50.00% ( 1/ 2)   Lines:  82.76% ( 24/ 29)
JosephLeedy\CustomFees\Model\Checkout\ConfigProvider\CustomFees
  Methods:  50.00% ( 1/ 2)   Lines:  80.00% (  8/ 10)
JosephLeedy\CustomFees\Model\Config
  Methods:  50.00% ( 1/ 2)   Lines:  79.55% ( 35/ 44)
JosephLeedy\CustomFees\Model\Config\Backend\File\ImportCustomFees
  Methods:  80.00% ( 4/ 5)   Lines:  93.14% ( 95/102)
JosephLeedy\CustomFees\Model\CustomOrderFees
  Methods:  63.64% ( 7/11)   Lines:  73.91% ( 34/ 46)
JosephLeedy\CustomFees\Model\CustomOrderFeesRepository
  Methods:  33.33% ( 2/ 6)   Lines:  33.33% ( 15/ 45)
JosephLeedy\CustomFees\Model\FeeStatus
  Methods:  50.00% ( 1/ 2)   Lines:  42.86% (  3/  7)
JosephLeedy\CustomFees\Model\FeeType
  Methods:  33.33% ( 1/ 3)   Lines:  27.27% (  3/ 11)
JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  50.00% (  7/ 14)
JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees\Collection
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  77.78% ( 42/ 54)
JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees\Collection
  Methods:  75.00% ( 3/ 4)   Lines:  94.29% ( 33/ 35)
JosephLeedy\CustomFees\Model\Rule\Condition\Combine
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 47/ 47)
JosephLeedy\CustomFees\Model\Rule\Condition\Product
  Methods:   0.00% ( 0/ 1)   Lines:  66.67% (  2/  3)
JosephLeedy\CustomFees\Model\Rule\Condition\Quote
  Methods:  20.00% ( 1/ 5)   Lines:  27.78% (  5/ 18)
JosephLeedy\CustomFees\Model\Rule\Condition\QuoteAddress
  Methods:  71.43% ( 5/ 7)   Lines:  86.84% ( 33/ 38)
JosephLeedy\CustomFees\Model\Rule\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  86.67% ( 13/ 15)
JosephLeedy\CustomFees\Model\Sales\Pdf\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  94.74% ( 36/ 38)
JosephLeedy\CustomFees\Model\Total\Creditmemo\CustomFees
  Methods:  75.00% ( 3/ 4)   Lines:  78.95% ( 75/ 95)
JosephLeedy\CustomFees\Model\Total\Invoice\CustomFees
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 28/ 28)
JosephLeedy\CustomFees\Model\Total\Quote\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  81.67% ( 49/ 60)
JosephLeedy\CustomFees\Observer\AddFieldToProductAttributeEditForm
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Observer\BeforeQuoteSubmitObserver
  Methods:  50.00% ( 1/ 2)   Lines:  91.67% ( 11/ 12)
JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\CollectionFactoryPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 13/ 13)
JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\DataProviderPlugin
  Methods:  50.00% ( 1/ 2)   Lines:  90.62% ( 29/ 32)
JosephLeedy\CustomFees\Plugin\Quote\Api\Data\TotalsInterfacePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 28/ 28)
JosephLeedy\CustomFees\Plugin\Reports\Model\ResourceModel\Refresh\CollectionPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Plugin\Sales\Api\CreditmemoRepositoryInterfacePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 23/ 23)
JosephLeedy\CustomFees\Plugin\Sales\Api\OrderRepositoryInterfacePlugin
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 21/ 21)
JosephLeedy\CustomFees\Plugin\Sales\Block\Order\TotalsPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 25/ 25)
JosephLeedy\CustomFees\Plugin\Sales\Model\Convert\OrderPlugin
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  6/  6)
JosephLeedy\CustomFees\Plugin\Sales\Model\Order\InvoicePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 25/ 25)
JosephLeedy\CustomFees\Plugin\Ui\Component\AbstractComponentPlugin
  Methods:  50.00% ( 1/ 2)   Lines:  93.88% ( 46/ 49)
JosephLeedy\CustomFees\Service\ConditionsApplier
  Methods:  33.33% ( 1/ 3)   Lines:  78.57% ( 11/ 14)
JosephLeedy\CustomFees\Service\ConfigUpdater
  Methods:  42.86% ( 3/ 7)   Lines:  82.76% ( 48/ 58)
JosephLeedy\CustomFees\Service\CustomFeesRetriever
  Methods:  40.00% ( 2/ 5)   Lines:  90.62% ( 29/ 32)
JosephLeedy\CustomFees\Service\InvoicedCustomFeesRecorder
  Methods:  66.67% ( 2/ 3)   Lines:  98.25% ( 56/ 57)
JosephLeedy\CustomFees\Service\RefundedCustomFeesRecorder
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 57/ 57)
JosephLeedy\CustomFees\Setup\Patch\Data\AddFieldsToCustomOrderFeesPatch
  Methods:  25.00% ( 1/ 4)   Lines:  90.32% ( 28/ 31)

@avstaylime
Copy link

Hello @avstaylime,

Could you please test this fix and let us know if it resolves your issue?

Thanks!

Hi @JosephLeedy! Thanks for the quick update. I can confirm this has addressed the issue I reported.

@JosephLeedy
Copy link
Owner Author

We're glad that it resolved your issue, @avstaylime! We plan to release version 1.3.2 containing the fixes for both of your issues soon.

@JosephLeedy JosephLeedy moved this from In review to Ready to Merge in Custom Fees for Magento 2 Nov 26, 2025
@github-actions
Copy link

Code Coverage Report:
  2025-11-26 16:39:18

 Summary:
  Classes: 30.77% (20/65)
  Methods: 51.63% (111/215)
  Lines:   78.03% (1616/2071)

JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Filter\Form\CustomOrderFees
  Methods:   0.00% ( 0/ 1)   Lines:  97.73% ( 43/ 44)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% (164/164)
JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid\Column\Renderer\Currency\LocalizedFeeAmount
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Block\Adminhtml\Sales\Order\Creditmemo\Create\Totals
  Methods:  40.00% ( 2/ 5)   Lines:  75.00% ( 39/ 52)
JosephLeedy\CustomFees\Block\Sales\Order\Creditmemo\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  94.74% ( 36/ 38)
JosephLeedy\CustomFees\Block\Sales\Order\Invoice\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  93.02% ( 40/ 43)
JosephLeedy\CustomFees\Block\Sales\Order\Totals
  Methods:  66.67% ( 2/ 3)   Lines:  93.33% ( 28/ 30)
JosephLeedy\CustomFees\Block\System\Config\Form\Field\CustomFees\Advanced\Form
  Methods:  50.00% ( 3/ 6)   Lines:  84.62% ( 77/ 91)
JosephLeedy\CustomFees\Controller\Adminhtml\Config\Export\ExampleCsv
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  80.56% ( 29/ 36)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Csv
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Excel
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\Form
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\NewConditionHtml
  Methods:  50.00% ( 1/ 2)   Lines:  82.76% ( 24/ 29)
JosephLeedy\CustomFees\Model\Checkout\ConfigProvider\CustomFees
  Methods:  50.00% ( 1/ 2)   Lines:  80.00% (  8/ 10)
JosephLeedy\CustomFees\Model\Config
  Methods:  50.00% ( 1/ 2)   Lines:  79.55% ( 35/ 44)
JosephLeedy\CustomFees\Model\Config\Backend\File\ImportCustomFees
  Methods:  80.00% ( 4/ 5)   Lines:  93.14% ( 95/102)
JosephLeedy\CustomFees\Model\CustomOrderFees
  Methods:  63.64% ( 7/11)   Lines:  73.91% ( 34/ 46)
JosephLeedy\CustomFees\Model\CustomOrderFeesRepository
  Methods:  33.33% ( 2/ 6)   Lines:  33.33% ( 15/ 45)
JosephLeedy\CustomFees\Model\FeeStatus
  Methods:  50.00% ( 1/ 2)   Lines:  42.86% (  3/  7)
JosephLeedy\CustomFees\Model\FeeType
  Methods:  33.33% ( 1/ 3)   Lines:  27.27% (  3/ 11)
JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  50.00% (  7/ 14)
JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees\Collection
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees
  Methods:  75.00% ( 3/ 4)   Lines:  77.78% ( 42/ 54)
JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees\Collection
  Methods:  75.00% ( 3/ 4)   Lines:  94.29% ( 33/ 35)
JosephLeedy\CustomFees\Model\Rule\Condition\Combine
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 47/ 47)
JosephLeedy\CustomFees\Model\Rule\Condition\Product
  Methods:   0.00% ( 0/ 1)   Lines:  66.67% (  2/  3)
JosephLeedy\CustomFees\Model\Rule\Condition\Quote
  Methods:  20.00% ( 1/ 5)   Lines:  27.78% (  5/ 18)
JosephLeedy\CustomFees\Model\Rule\Condition\QuoteAddress
  Methods:  71.43% ( 5/ 7)   Lines:  86.84% ( 33/ 38)
JosephLeedy\CustomFees\Model\Rule\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  86.67% ( 13/ 15)
JosephLeedy\CustomFees\Model\Sales\Pdf\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  94.74% ( 36/ 38)
JosephLeedy\CustomFees\Model\Total\Creditmemo\CustomFees
  Methods:  75.00% ( 3/ 4)   Lines:  78.95% ( 75/ 95)
JosephLeedy\CustomFees\Model\Total\Invoice\CustomFees
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 28/ 28)
JosephLeedy\CustomFees\Model\Total\Quote\CustomFees
  Methods:  50.00% ( 2/ 4)   Lines:  81.67% ( 49/ 60)
JosephLeedy\CustomFees\Observer\AddFieldToProductAttributeEditForm
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
JosephLeedy\CustomFees\Observer\BeforeQuoteSubmitObserver
  Methods:  50.00% ( 1/ 2)   Lines:  91.67% ( 11/ 12)
JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\CollectionFactoryPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 13/ 13)
JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\DataProviderPlugin
  Methods:  50.00% ( 1/ 2)   Lines:  90.62% ( 29/ 32)
JosephLeedy\CustomFees\Plugin\Quote\Api\Data\TotalsInterfacePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 28/ 28)
JosephLeedy\CustomFees\Plugin\Reports\Model\ResourceModel\Refresh\CollectionPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 20/ 20)
JosephLeedy\CustomFees\Plugin\Sales\Api\CreditmemoRepositoryInterfacePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 23/ 23)
JosephLeedy\CustomFees\Plugin\Sales\Api\OrderRepositoryInterfacePlugin
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 21/ 21)
JosephLeedy\CustomFees\Plugin\Sales\Block\Order\TotalsPlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 25/ 25)
JosephLeedy\CustomFees\Plugin\Sales\Model\Convert\OrderPlugin
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  6/  6)
JosephLeedy\CustomFees\Plugin\Sales\Model\Order\InvoicePlugin
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 25/ 25)
JosephLeedy\CustomFees\Plugin\Ui\Component\AbstractComponentPlugin
  Methods:  50.00% ( 1/ 2)   Lines:  93.88% ( 46/ 49)
JosephLeedy\CustomFees\Service\ConditionsApplier
  Methods:  33.33% ( 1/ 3)   Lines:  78.57% ( 11/ 14)
JosephLeedy\CustomFees\Service\ConfigUpdater
  Methods:  42.86% ( 3/ 7)   Lines:  82.76% ( 48/ 58)
JosephLeedy\CustomFees\Service\CustomFeesRetriever
  Methods:  40.00% ( 2/ 5)   Lines:  90.62% ( 29/ 32)
JosephLeedy\CustomFees\Service\InvoicedCustomFeesRecorder
  Methods:  66.67% ( 2/ 3)   Lines:  98.25% ( 56/ 57)
JosephLeedy\CustomFees\Service\RefundedCustomFeesRecorder
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 57/ 57)
JosephLeedy\CustomFees\Setup\Patch\Data\AddFieldsToCustomOrderFeesPatch
  Methods:  25.00% ( 1/ 4)   Lines:  90.32% ( 28/ 31)

@JosephLeedy JosephLeedy merged commit f4a49c9 into main Nov 26, 2025
14 of 70 checks passed
@JosephLeedy JosephLeedy deleted the 95-fix-packing-slip-filters branch November 26, 2025 17:13
@github-project-automation github-project-automation bot moved this from Ready to Merge to Done in Custom Fees for Magento 2 Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Incorrect Orders Included in Printed Sales Order Packing Slips

2 participants