Commit Graph

17697 Commits

Author SHA1 Message Date
Gaetan Craig-Riou
e7a2b7ea48 Remove payment method from customer account transaction 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
bc23423521 Remove the link between enterprise and internal payment method
Enterprise have access to the internal payment method by default.
The access is handled at the application level so we don't have to
manage database links.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
a4ca56c7a5 Refactored internal payment method
We now check on known payment method type, instead of using the internal
collumn.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
9f7655852d Provide helper method to get internal payment method 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
ec106a8f83 Add new payment method ApiCustomerCredit
It was previously modelled by a "Check" payment method
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
2e7237197a Refactor customer credit payment method
Set fixed name and description
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
25c579c478 Per review, small code fixes 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
ed3f928783 Fix diplaying customer transactions when no transaction 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
63a9601812 Add scroll bar to modal component
When content is too big, the bottom is displayed off screen
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
3b068b7125 Add created_by to customer account transactions
It allows tracking of who credited the customer via :
- customer account transaction API
- order payment screen
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
597c0590ed Add the ability to show ID on backoffice customer screen
The customer ID is needed for the customer account transaction api
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
b9b91620ef Make sure to link credit payment method on create and update 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
c67d47a773 Check if internal payment can be voided
Add extra security, we don't want to void a credit payment that is not
completed, otherwise we would be refunding credit that was not used.
A credit payment should not be in a non completed state, but you never
know.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
34c91613f7 Customer account transaction, simplify balance calculation
Lock the customer to ensure the balance calculation is correct. Much
simpler than locking the first transaction.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
219e3ca9c8 Fix typo 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
628810eb33 Fix spec to work with the internal payment method 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
d95aac333b Add internal to payment method
It's used to hide the payment method used for paying with credit. These
payment method are for internal use only.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
3e2e7f1799 Add button to credit customer when order is credit owed state
It will add a negative payment, matching the amount credited in the
customer_account_transaction
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
ee13a3abaf Add Orders::CustomerCreditService.refund
It will be used to credit the customer any fund from an order in
credit_owed state
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
d5bd8fa086 Add ability to "void" a customer credit payment
Voiding the payment will refund the credit used to the customer.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
5e4cd4d51d Remove unused helper 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
41e4fd79a3 Move logic to apply customer credit to it's on service
It's now called as a before transition callback when the order move to
payment. We need to apply the credit at this point to account for
order fees, ie: shippment fees.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
a60afd10e4 Display credit used on the order confirmation page 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
b42b10fcd1 Use the order outstanding balance to create payment
When a customer credit is applied to an order, the balance due is the
order outstanding balance and not the order total.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
c8dbf4c6f0 Add error handling around payment with credit
For now we log error but don't report it to the user, so they can
proceed through the checkout.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
f5a3093e41 Automatically use credit at checkout when available
This only cover the ideal scenario, error handling will be added later
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
5a376c9106 Add customer_credit scope 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
152fd15bd0 Use display_name and display_description for payment method 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
5bdb6e6d69 Clean up spec 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
cb6b1f2dd0 Link producer enterprise to credit payment method 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
130401263a Add CreditPaymentMethod::Linker
It links the given enterprise to credit related payment method. It
will create the methods if missing.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
29a8a6641c Add ability to use payment with credit
Currently it works like any other payment method you can select on
checkout. It will eventually be added automatically to the order, when a
customer has credit available.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
28241756aa Add Customer Credit payment method
It doesn't do anything yet
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
fec5516fce Backoffice customer, Add pop up to list customer payments 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
6aa4bf7a33 Add available credit on the admin customer page 2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
c58a65a52b Add a tab to list customer payment on the account page 2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
e21fadd124 Add CustomerAccountTransactions::DataLoaderService
It's used to load customer transactions related to a user and a specific
enterprise
2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
be7be9bbc6 Add api endpoing to create customer transactions
Plus specs and documentation
2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
6915836a14 Add balance to customer account transaction
It stores the running balance for the customer account, so we don't have
to calulate it on the fly.
2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
7d400e9860 Add CustomerAccountTransaction model
It's used to store payment against a customer, to model customer credit
2026-03-10 16:07:41 +11:00
Gaetan Craig-Riou
d706b3a6c2 Per review, remove customer when no existing customer 2026-03-10 15:20:56 +11:00
Gaetan Craig-Riou
fe00d1f813 reset_other! now reset the customer when present 2026-03-10 14:16:01 +11:00
Maikel
f7f7a5738a Merge pull request #13895 from cillian/remove-angular-from-enterprise-settings-users
Remove Angular from Enterprise > Settings > Users section
2026-03-06 14:05:13 +11:00
Rachel Arnould
57186a74a8 Merge pull request #13958 from arunguleria/13864-remove-variants-dead-features
13864-Remove dead feature to re-arrange variants
2026-03-05 12:44:05 +01:00
Maikel
9fb8bb15e8 Merge pull request #13951 from zilton7/fix/spree-credit-card-brand-deprecation
Fix Spree::CreditCard#brand= deprecation for Rails 7.2 compatibility
2026-03-04 11:01:10 +11:00
Maikel
8aa89c0bf7 Merge pull request #13669 from pacodelaluna/repair-proxy-order-to-support-order-cycle-without-closing-time
Repair ProxyOrder to support order cycle without closing time
2026-03-04 10:59:21 +11:00
Cillian O'Ruanaidh
67853bb976 Use guard 2026-03-04 10:28:39 +11:00
Cillian O'Ruanaidh
d57274fc4c Manager invitation email is only for new users 2026-03-04 10:28:39 +11:00
Cillian O'Ruanaidh
f063e2e8c6 Change to email field 2026-03-04 10:28:39 +11:00
Cillian O'Ruanaidh
d3eb887664 Align button 2026-03-04 10:28:39 +11:00