# POS Account Payment Order SEPA

Adds a contextual action **"Collect by SEPA direct debit"** on the POS
sessions list/form (Point of Sale → Sessions).

## Purpose

When a POS order is paid with a *"Customer Account"* payment method
(`split_transactions = True`) and is **not invoiced**, Odoo does not register a
real collection nor a per-order accounting move: the amount lands as an **open
receivable** for the customer inside the **session's** single journal entry
(`pos.session.move_id`). This module lets you collect those receivables in bulk
through a **SEPA direct debit payment order** (debit order), without
re-invoicing the already-issued (simplified) tickets.

> The action runs on **sessions** (not orders) precisely because the receivable
> lives in the session move, not in the order. Selecting the sessions of the
> affected period collects every open "Customer Account" line in them.

## Usage

1. Make sure the affected customers have a **valid SEPA mandate** (see
   `account_banking_mandate_batch`).
2. Go to **Point of Sale → Sessions**, filter the sessions of the period,
   select them and run **Action → Collect by SEPA direct debit**.
3. The action creates the **payment lines** inside a draft inbound SEPA
   payment order, grouped by payment mode. Receivable lines without a partner,
   already queued, or whose partner has no valid mandate are **skipped and
   reported**. Already-collected lines (reconciled) are ignored.
4. Open **Invoicing → Customers → Payment Orders**, confirm it and **generate
   the SEPA file (pain.008)**.

## Payment mode resolution

The inbound SEPA payment mode is taken from the partner's
`customer_payment_mode_id` when it is a valid `sepa_direct_debit` inbound mode;
otherwise the first inbound `sepa_direct_debit` payment mode is used as
fallback.
