Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Smarty is gone, as in Thelia 3: the Smarty plugin `credit_note_format_address`, the Smarty back-office and PDF templates, the Smarty fallback of the back-office hooks. The loops no Twig template calls are removed too: `credit-note-comment`, `credit-note-status`, `credit-note-type`, `order-credit-note` and `credit-note-version` (its table has not existed since 2.3.4). The loops `credit-note`, `credit-note-address` and `credit-note-detail` stay: the credit note document of the PDF template reads them.
- The languages a credit note is printed in are a setting of the module (`document_locales`, locales separated by commas): a customer whose language is in the list gets the document in that language, the others the default language of the shop. Empty, as before: English and French. A shop whose PDF template is translated in German adds `de_DE`. The field refuses anything that is not a list of locales such as `fr_FR`.
- Credit notes numbered like the invoices (`invoice_ref_with_thelia_order`) draw their number from `InvoiceRefSequence::next()` (InvoiceRef 3.1 or later): the counter is read under a lock shared with the orders, and a number an order already carries is skipped. The previous read and increment, without a lock, could hand the same number to an invoice and a credit note.
- The ceiling of an order is a setting of the module (`order_ceiling`, on by default, added to an existing installation by the update): a shop that grants credit notes beyond the total of the order turns it off.
Expand Down
5 changes: 0 additions & 5 deletions Config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

<loops>
<loop name="credit-note" class="CreditNote\Loop\CreditNote" />
<loop name="credit-note-type" class="CreditNote\Loop\CreditNoteType" />
<loop name="credit-note-status" class="CreditNote\Loop\CreditNoteStatus" />
<loop name="credit-note-comment" class="CreditNote\Loop\CreditNoteComment" />
<loop name="credit-note-version" class="CreditNote\Loop\CreditNoteVersion" />
<loop name="credit-note-address" class="CreditNote\Loop\CreditNoteAddress" />
<loop name="credit-note-detail" class="CreditNote\Loop\CreditNoteDetail" />
<loop name="order-credit-note" class="CreditNote\Loop\OrderCreditNote" />
</loops>

</config>
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>4.1.0</version>
<version>4.2.0</version>
<author>
<name>Gilles Bourgeat</name>
<email>gbourgeat@openstudio.fr</email>
Expand Down
8 changes: 1 addition & 7 deletions Controller/CreditNoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,7 @@ protected function performCustomer(Form $formValidate, CreditNote $creditNote)
/** @var int $customerId */
$customerId = $formValidate->get('customer_id')->getData();

// check if order
if (!empty($orderId) && null !== $order = OrderQuery::create()->findPk($orderId)) {
$creditNote
->setOrder($order)
->setCurrency($order->getCurrency())
->setCustomer($order->getCustomer());
} elseif (!empty($customerId) && null !== $customer = CustomerQuery::create()->findPk($customerId)) {
if (!empty($customerId) && null !== $customer = CustomerQuery::create()->findPk($customerId)) {
$creditNote->setCustomer($customer);
}

Expand Down
2 changes: 0 additions & 2 deletions Hook/Back/ConfigHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

class ConfigHook extends BaseHook
{
use TemplateFallbackTrait;

public function __construct(
private readonly TheliaFormFactory $formFactory,
?EventDispatcherInterface $dispatcher = null,
Expand Down
2 changes: 0 additions & 2 deletions Hook/Back/CustomerEditHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
class CustomerEditHook extends BaseHook
{
use TemplateFallbackTrait;

public function __construct(
private readonly CreditNoteHookPresenter $presenter,
?EventDispatcherInterface $dispatcher = null,
Expand Down
2 changes: 0 additions & 2 deletions Hook/Back/MainHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
class MainHook extends BaseHook
{
use TemplateFallbackTrait;

public function __construct(
private readonly CreditNoteHookPresenter $presenter,
?EventDispatcherInterface $dispatcher = null,
Expand Down
2 changes: 0 additions & 2 deletions Hook/Back/OrderEditHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
*/
class OrderEditHook extends BaseHook
{
use TemplateFallbackTrait;

public function __construct(
private readonly CreditNoteHookPresenter $presenter,
?EventDispatcherInterface $dispatcher = null,
Expand Down
77 changes: 0 additions & 77 deletions Hook/Back/TemplateFallbackTrait.php

This file was deleted.

127 changes: 0 additions & 127 deletions Loop/CreditNoteComment.php

This file was deleted.

Loading
Loading