<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="point_of_sale.PosConfigLnaChecklist">
        <header>
            <h1>How to configure my printers</h1>
        </header>

        <section>
            <h2> What is it? </h2>
            <p>
                Local Network Access (LNA) is a Chrome feature that allows your browser to communicate 
                directly with your local network. It means you can make your browser communicate with 
                your devices without the need for importing certificates.
            </p>
            <p>
                Be aware that it works only on chromium based browser: <strong> Google chrome, Microsoft Edge, Brave, Opera, Arc and others </strong>
            </p>

            <p class="text-warning">
                <strong> We duly advise you to use Chrome or Brave browser. </strong><br/>
                iOS devices (iPad, iPhones) are not compatible yet.
            </p>

            <h2> How to configure my devices properly: </h2>
            
            <h3> Environment check </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_chromium"
                t-att-checked="checked('lna_chromium')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_chromium"> My browser is chromium based (Chrome, Edge, Brave, etc.) </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_browser_version"
                t-att-checked="checked('lna_browser_version')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_browser_version"> My browser is above version 142 </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_router"
                t-att-checked="checked('lna_router')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_router"> I have access to my router configuration (To fix device IP addresses) </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_epson"
                t-att-checked="checked('lna_epson')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_router"> I use an Epson printer (Check supported printers in Odoo documentation) </label>
            <br />
            <input
                class="form-check-input ms-3"
                type="checkbox"
                id="lna_ethernet"
                t-att-checked="checked('lna_ethernet')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_ethernet"> My printer can be connected through ethernet cables (recommended) </label>
            <br />

            <h3> ePOS printers (Epson) configuration </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_internet"
                t-att-checked="checked('lna_internet')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_internet"> Connect printer to internet (Ethernet cable recommended) </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_ip"
                t-att-checked="checked('lna_ip')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_ip"> Printer's local IP address is printerd </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_printer_config"
                t-att-checked="checked('lna_printer_config')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_printer_config"> Access printer configuration panel by puttin this URL in your search bar: </label>
                <p style="text-indent:1em;">(Replace [printer_ip] with the printer IP address)</p>
                <p><code>http://[printer_ip]/cgi-bin/epos/service.cgi?devid=local_printer</code></p>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_printer_firmware"
                t-att-checked="checked('lna_printer_firmware')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_printer_firmware"> Update the printer firmware </label>
                <p><em> The password is located on the back of the printer (remove covers). </em></p>
                <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image.png" alt="Printer Password Location"/>

            <h3> Check printer reachability: </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_printer_check"
                t-att-checked="checked('lna_printer_check')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_printer_check"> Access the below URL but replace [printer_ip] with your current Pritner IP address </label>
            <p><code>http://[printer_ip]/cgi-bin/epos/service.cgi?devid=local_printer</code></p>
            <p>If this endpoint does not returan a 404 error and displays a blank page, everything is ready.</p>

            <h3> SSL/TLS &gt; Basic </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_tls"
                t-att-checked="checked('lna_tls')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_tls"> <strong> Disable "Redirect HTTP to HTTPS" </strong> </label>
            <p> Keep TLS settings enabled, otherwise the printer will not work with HTTPS. </p>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_1.png" alt="SSL Settings"/>

            <h3> ePoS Printer Service </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_epos_print"
                t-att-checked="checked('lna_epos_print')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_epos_print"> Check if <strong> ePOS-print </strong> is enabled </label>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_2.png" alt="ePOS print enabled"/>

            <h3> Secure printing </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_secure_print"
                t-att-checked="checked('lna_secure_print')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_secure_print"> If you have the secure printing setting, disable it </label>
            <li> If you have the secure printing setting, disable it </li>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_3.png" alt="ePOS print enabled"/>

            <h3 class="text-success"> Now your printer is properly configured to work with LNA </h3>

            <h2> Enable LNA on your database </h2>
            <p> If your database is version <strong> 19.1 or above </strong>, you can skip the system parameter section. </p>
            
            <div>
                <h4> Before 19.1: </h4>
                <p> Add system parameter <code>point_of_sale.use_lna</code> with a value of <code>1</code> . </p>
                <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_4.png" alt="System Parameter Setup"/>

                <h4> After 19.1: </h4>
                <p> Enable the “Use Local Network Access” checkbox directly on the printer configuration. </p>
                <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_5.png" alt="Printer Checkbox"/>
            </div>

            <h2> The printers are properly configured and the LNA is activated. </h2>
            <h3> Point of sale configuration: </h3>
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_pos_link"
                t-att-checked="checked('lna_pos_link')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_pos_link"> Link your printers to your POS (ePOS) </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_print"
                t-att-checked="checked('lna_print')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_print"> Open your POS and try to print a ticket </label>
            <br />
            <input
                class="form-check-input"
                type="checkbox"
                id="lna_prompt"
                t-att-checked="checked('lna_prompt')"
                t-on-click="toggle" />
            <label class="form-check-label ms-2" for="lna_prompt"> The message will appear from the browser. <strong> Allow </strong> access </label>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_6.png" alt="Browser LNA Prompt"/>

            <p> If the permission is denied, refreshing the PoS will show this notification: </p>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_7.png" alt="POS LNA denied message"/>

            <p> If the system parameter is set, but the browser doesn't support LNA, the PoS will show this notification: </p>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_8.png" alt="LNA not supported message"/>

            <p> If everything is correct, the Local Network Access status icon will turn green: </p>
            <img class="img-fluid" src="/point_of_sale/static/img/lna_config/image_9.png" alt="LNA Green Status"/>
        </section>
    </t>
</templates>
