Files
odoo-addons/addons/laundry_management/views/laundry_payment_wizard_views.xml

145 lines
7.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ═══════════════════════════════════════════════════════════════
LAUNDRY PAYMENT WIZARD — POS-like payment screen (PART 2)
Model: laundry.payment.wizard
═══════════════════════════════════════════════════════════════ -->
<record id="view_laundry_payment_wizard_form" model="ir.ui.view">
<field name="name">laundry.payment.wizard.form</field>
<field name="model">laundry.payment.wizard</field>
<field name="arch" type="xml">
<form string="Register Payment / تسجيل الدفع">
<sheet>
<!-- ── Order / Customer Header ── -->
<div class="row mb-3 p-3"
style="background:linear-gradient(135deg,#1a73e8,#0d5cb6);
border-radius:8px;color:white;">
<div class="col-6">
<div style="font-size:0.8em;opacity:0.8;">Order / الطلب</div>
<div class="fw-bold fs-5">
<field name="order_name" readonly="1" class="text-white"/>
</div>
<div style="font-size:0.85em;opacity:0.9;" class="mt-1">
<field name="partner_id" readonly="1" class="text-white"/>
</div>
<div style="font-size:0.8em;opacity:0.8;" class="mt-1">
<field name="mobile" readonly="1" class="text-white"/>
</div>
</div>
<div class="col-6 text-end">
<div style="font-size:0.8em;opacity:0.8;">Processing Status</div>
<div class="fw-bold">
<field name="laundry_state" readonly="1" class="text-white"/>
</div>
<div style="font-size:0.8em;opacity:0.8;" class="mt-2">Order Total</div>
<div class="fw-bold fs-4">
<field name="order_total" readonly="1"
widget="monetary"
options="{'currency_field': 'currency_id'}"
class="text-white"/>
</div>
</div>
</div>
<!-- ── Balance Due Banner ── -->
<div class="alert mb-3"
t-attf-class="alert #{amount_due > 0 ? 'alert-danger' : 'alert-success'}"
role="alert">
<div class="d-flex justify-content-between align-items-center">
<span class="fw-bold">
<span invisible="amount_due == 0">
💰 Balance Due / المبلغ المتبقي:
</span>
<span invisible="amount_due != 0">
✅ Order is fully paid!
</span>
</span>
<span class="fs-4 fw-bold">
<field name="amount_due" readonly="1"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
</span>
</div>
</div>
<!-- ── Payment Entry ── -->
<group string="Payment Details / تفاصيل الدفع">
<group>
<field name="journal_id"
string="Journal / الدفتر"
options="{'no_create': True, 'no_create_edit': True}"
required="1"/>
<field name="payment_method_line_id"
string="Payment Method / طريقة الدفع"
options="{'no_create': True, 'no_create_edit': True}"
required="1"/>
<field name="amount"
string="Amount Received / المبلغ المستلم"
required="1"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
</group>
<group>
<field name="payment_date"
string="Payment Date / تاريخ الدفع"
required="1"/>
<field name="memo"
string="Reference / المرجع"
placeholder="e.g. Cash payment for order…"/>
</group>
</group>
<!-- ── Change Display (cash overpayment) ── -->
<div class="alert alert-warning mt-2"
invisible="not is_overpayment"
role="alert">
<div class="d-flex justify-content-between align-items-center">
<span class="fw-bold">💵 Change to Return / الباقي:</span>
<span class="fs-5 fw-bold">
<field name="change_amount" readonly="1"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
</span>
</div>
<div class="small text-muted mt-1">
Payment recorded for balance due. Return change to customer.
</div>
</div>
<!-- Hidden fields -->
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="is_overpayment" invisible="1"/>
</sheet>
<footer>
<button name="action_confirm_payment"
string="✓ Confirm Payment / تأكيد الدفع"
type="object"
class="btn-primary btn-lg"/>
<button name="action_view_invoice"
string="View Invoice"
type="object"
class="btn-secondary"
groups="laundry_management.group_laundry_manager"/>
<button string="Cancel"
class="btn-secondary"
special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- Action to open the payment wizard (also used by button on order) -->
<record id="action_laundry_payment_wizard" model="ir.actions.act_window">
<field name="name">Register Payment</field>
<field name="res_model">laundry.payment.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'default_order_id': active_id}</field>
</record>
</odoo>