<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="res_config_settings_view_form_inherit_fusion_rental" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.inherit.fusion.rental</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="sale_renting.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//app[@name='sale_renting']" position="inside">
                <block title="Fusion Rental" name="rental_enhancement_settings">
                    <setting string="Google Review URL"
                             help="Google Review link shown in thank-you emails after rental close.">
                        <div class="content-group">
                            <div class="mt-2">
                                <field name="rental_google_review_url"
                                       placeholder="https://g.page/r/YOUR_REVIEW_LINK/review"/>
                            </div>
                            <div class="text-muted mt-1">
                                For multiple locations, set the URL per warehouse in
                                Inventory &gt; Configuration &gt; Warehouses.
                            </div>
                        </div>
                    </setting>
                    <setting string="Security Deposit Hold Period"
                             help="How many days to hold the security deposit after product pickup before processing the refund.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-3 o_light_label" for="rental_deposit_hold_days"/>
                                <field name="rental_deposit_hold_days" class="col-lg-2"/>
                                <span class="col-lg-4 text-muted">days after pickup</span>
                            </div>
                        </div>
                    </setting>
                    <setting string="Google Maps API Key"
                             help="API key for address autocomplete on the rental agreement form. If Fusion Claims is installed, its key is used automatically.">
                        <div class="content-group">
                            <div class="mt-2">
                                <field name="rental_google_maps_api_key"
                                       placeholder="Enter Google Maps API Key"
                                       password="True"/>
                            </div>
                            <div class="text-muted mt-1">
                                Only needed if Fusion Claims is not installed. Enable the
                                Places API and Geocoding API in Google Cloud Console.
                            </div>
                        </div>
                    </setting>
                </block>
                <block title="Timing &amp; Short-Term Rentals" name="rental_timing_settings">
                    <setting string="Marketing Email Timing"
                             help="Percentage of rental period after start date to send the purchase offer email.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-4 o_light_label" for="rental_marketing_email_pct"/>
                                <field name="rental_marketing_email_pct" class="col-lg-2"/>
                                <span class="col-lg-5 text-muted">% of rental period (default 23% = day 7 of 30)</span>
                            </div>
                        </div>
                    </setting>
                    <setting string="Renewal Reminder Timing"
                             help="Percentage of rental period before renewal date to send the reminder.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-4 o_light_label" for="rental_renewal_reminder_pct"/>
                                <field name="rental_renewal_reminder_pct" class="col-lg-2"/>
                                <span class="col-lg-5 text-muted">% of rental period (default 10% = 3 days before on 30-day)</span>
                            </div>
                        </div>
                    </setting>
                    <setting string="Short-Term Rental Threshold"
                             help="Rentals shorter than this are considered short-term. Auto-renewal waits for the grace period.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-4 o_light_label" for="rental_short_term_threshold_days"/>
                                <field name="rental_short_term_threshold_days" class="col-lg-2"/>
                                <span class="col-lg-5 text-muted">days (rentals below this get grace period protection)</span>
                            </div>
                        </div>
                    </setting>
                    <setting string="Short-Term Grace Period"
                             help="Time after scheduled return before auto-renewal charges a short-term rental.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-4 o_light_label" for="rental_short_term_grace_hours"/>
                                <field name="rental_short_term_grace_hours" class="col-lg-2"/>
                                <span class="col-lg-5 text-muted">hours after return time (default 1 hour)</span>
                            </div>
                        </div>
                    </setting>
                    <setting string="Short-Term Renewal Reminder"
                             help="How many hours before the return time to send the renewal reminder for short-term rentals.">
                        <div class="content-group">
                            <div class="row mt-2">
                                <label class="col-lg-4 o_light_label" for="rental_short_term_reminder_hours"/>
                                <field name="rental_short_term_reminder_hours" class="col-lg-2"/>
                                <span class="col-lg-5 text-muted">hours before return time (default 2 hours)</span>
                            </div>
                        </div>
                    </setting>
                </block>
            </xpath>
        </field>
    </record>

</odoo>
