<div id="poststuff">
    <div id="post-body" class="metabox-holder columns-2">
        <form class="form-horizontal" method="POST" action="">
            <div id="post-body-content">
                <div id="postexcerpt" class="postbox ">
                    <h2 class="hndle ui-sortable-handle">
                        <?php
                            if(isset($data_template["id"])){
                                ?>
                                    <span class="nb_title_page"><?php echo esc_html__('Edit Template','netbase-smart-invoice');?></span>
                                <?php
                            }
                            if(!isset($data_template["id"])){
                                ?>
                                    <span class="nb_title_page"><?php echo esc_html__('Create New Template','netbase-smart-invoice');?></span>
                                <?php
                            }
                        ?>
                        <input type="submit" name="save" id="save-template" class="button button-primary pull-right" value="<?php echo esc_html__("Save Template",'netbase-smart-invoice');?>">
                        <?php
                            if($id_order == 0 || !isset( $_GET['edit'] )){
                                ?>
                                    <button id="preview-template" onclick="NBInvoiceCheckPreview()" type="button" class="button btn-default pull-right"><?php echo esc_html__("Preview",'netbase-smart-invoice');?></button>
                                <?php
                            } else {
                                ?>
                                    <a target="_blank" href="<?php echo admin_url( 'admin.php?page=nb-smart-invoice-create-pages&preview=true&type=invoice&order_ids=' . $id_order . '&id_template='.$_GET['edit'].'' );?>" id="preview-template" class="button btn-default pull-right"><?php echo esc_html__("Preview",'netbase-smart-invoice');?></a>
                                <?php
                            }
                        ?>
                        
                    </h2>
                    <?php
                        echo esc_html($_invoice_displayMessages);
                    ?>
                    <div class="inside">
                        <div class="container-fluid">
                            <div class="row">
                                <input type="hidden" name="id" value="<?php if(isset($data_template["id"])){ echo esc_attr($data_template["id"],'netbase-smart-invoice'); } else { echo esc_attr(0,'netbase-smart-invoice','netbase-smart-invoice');}?>">
                                <input type="hidden" name="columns_number" id="columns_number" value="<?php if(isset($data_template["columns_number"])){ echo esc_attr($data_template["columns_number"],'netbase-smart-invoice'); } else { echo esc_attr(0,'netbase-smart-invoice');}?>">
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="name"><?php echo esc_html__('Name','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <input type="text" value="<?php if(isset($data_template["name_template"])){ echo esc_html($data_template["name_template"]); }?>" class="form-control" name="name_template" id="name_template" placeholder="<?php echo esc_html__("Invoice Name",'netbase-smart-invoice');?>">
                                            <p class="description">(*) This is the display name of the invoice.</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="type template"><?php echo esc_html__('Type Template','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <select class="column-short valid" name="type_template">
                                                <option <?php if(isset($data_template["type"]) && $data_template["type"] == "invoice" ){ echo esc_html("selected"); }?> value="invoice"><?php echo esc_html__("Invoive",'netbase-smart-invoice');?></option>
                                                <option <?php if(isset($data_template["type"]) && $data_template["type"] == "delivery" ){ echo esc_html("selected"); }?> value="delivery"><?php echo esc_html__("Delivery",'netbase-smart-invoice');?></option>
                                            </select>
                                            <p class="description">(*) Select type export invoice or delivery.</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="public"><?php echo esc_html__('Public','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <div class="form-element">
                                                <input <?php if(isset($data_template["public"]) && (int)$data_template["public"] == 1 ){ echo esc_html("checked"); }?> type="checkbox" id="public_invoice" class="field-checkbox" name="public"><br>
                                                <p class="description">(*) Enable or disable invoice or delivery.</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="pwd"><?php echo esc_html__('Enable Landscape PDF','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <div class="form-element">
                                                <input <?php if(isset($data_template["template_landscape"]) && (int)$data_template["template_landscape"] == 1 ){ echo esc_html("checked"); }?> type="checkbox" id="template_landscape_invoice" class="field-checkbox" name="template_landscape" >
                                                <p class="description">(*) Display template horizontal or vertical.</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="invoice header"><?php echo esc_html__('Invoice Header','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <div class="form-element form-element-with">
                                                <?php
                                                    $template_invoice_header = '';
                                                    if(isset($data_template['template_invoice_header'])){
                                                        $template_invoice_header = $data_template['template_invoice_header'];
                                                    }
                                                ?>
                                                <?php wp_editor(stripslashes(html_entity_decode(esc_html($template_invoice_header))),'template_invoice_header', array('editor_height'=>200));?>
                                                <p class="description">(*) The header interface of the invoice template.</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="invoice content"><?php echo esc_html__('Invoice Content','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <div class="form-element form-element-with">
                                                <?php
                                                    $template_invoice_content = '';
                                                    if(isset($data_template['template_invoice_content'])){
                                                        $template_invoice_content = $data_template['template_invoice_content'];
                                                    }
                                                ?>
                                                <?php wp_editor(stripslashes(html_entity_decode(esc_html($template_invoice_content))),'template_invoice_content', array('editor_height'=>500));?>
                                                <p class="description">(*) The content interface of the invoice template.</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="invoice footer"><?php echo esc_html__('Invoice Footer','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <div class="form-element form-element-with">
                                                <?php
                                                    $template_invoice_footer = '';
                                                    if(isset($data_template['template_invoice_footer'])){
                                                        $template_invoice_footer = $data_template['template_invoice_footer'];
                                                    }
                                                ?>
                                                <?php wp_editor(stripslashes(html_entity_decode(esc_html($template_invoice_footer))),'template_invoice_footer', array('editor_height'=>200));?>
                                                <p class="description">(*) The footer interface of the invoice template.</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2" for="pwd"><?php echo esc_html__('Custom Css','netbase-smart-invoice');?>:</label>
                                        <div class="col-sm-10">
                                            <textarea name="template_custom_css" id="template_custom_css"><?php if(isset($data_template["template_custom_css"])){ echo esc_html($data_template["template_custom_css"]); }?></textarea>
                                            <p class="description">(*) This is the style input (css) for the invoice template.</p>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="postexcerpt" class="postbox ">
                    <h2 class="hndle ui-sortable-handle">
                        <span class="nb_title_page"><?php echo esc_html__('Products Table','netbase-smart-invoice');?></span>
                        <input type="button" id="add_new_item_product" onclick="addColumnTableProduct()" class="button button-primary pull-right" value="<?php echo esc_html__("Add New Item",'netbase-smart-invoice');?>">
                        <p class="description">(*) This is the place to add columns in the product table of the order.</p>
                    </h2>
                    <div class="inside">
                        <div class="container-fluid">
                            <div id="main-content-table">
                                <!-- Add colums Table Products -->
                                <?php
                                    if(isset($data_template["columns_number"])){
                                        if((int)$data_template["columns_number"] > 0){
                                            for($i = 0; $i < $data_template["columns_number"]; $i++){
                                                $product_title = json_decode($data_template["item_title_json"]);
                                                $product_value = json_decode($data_template["item_key_value_json"]);
                                                $product_color = json_decode($data_template["item_title_color_json"]);
                                                $product_background = json_decode($data_template["item_title_background_Json"]);
                                                $_time = time();
                                                ?>
                                                    <div id="main-content-columns-<?php echo esc_attr($_time);?>" class="form-group main-content-columns">
                                                    <h2 class="title-columns"><?php echo esc_html__("Columns",'netbase-smart-invoice'); ?> <span>####</span><input onclick="removeColumnTableProduct(this)" type="button" class="button button-default remove-content-columns" removeId="main-content-columns-<?php echo esc_attr($_time);?>" value="Remove"></h2>
                                                    <div class="row">
                                                        <div class="col-md-12">
                                                            <div class="invoice-table-colum">
                                                                <label> <?php echo esc_html__("Title",'netbase-smart-invoice');?> : </label>
                                                                <div class="invoice-col-input">
                                                                    <input name="item_title[]" type="text" value="<?php echo esc_attr($product_title[$i],'netbase-smart-invoice');?>">
                                                                </div>
                                                            </div>
                                                            <div class="invoice-table-colum">
                                                                <label> <?php echo esc_html__("Content",'netbase-smart-invoice');?> : </label>
                                                                <div class="invoice-col-input">
                                                                    <select class="column-short valid" name="item_key_value[]" aria-invalid="false">
                                                                        <?php
                                                                            if(isset($_getOptionDataProduct)){
                                                                                foreach ($_getOptionDataProduct as $key => $value) {
                                                                                    ?>
                                                                                        <option <?php if($product_value[$i] == $key ){echo esc_html("selected='selected'",'netbase-smart-invoice');}?> value="<?php echo esc_attr($key,'netbase-smart-invoice');?>"><?php echo esc_attr($value,'netbase-smart-invoice');?></option>
                                                                                    <?php
                                                                                }
                                                                            }
                                                                        ?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="invoice-table-colum">
                                                                <label> <?php echo esc_html__("Color of Title",'netbase-smart-invoice'); ?> : </label>
                                                                <div class="invoice-col-input">
                                                                    <input name="item_title_color[]" class="jscolor" value="<?php echo esc_attr($product_color[$i],'netbase-smart-invoice');?>" type="text" autocomplete="off">
                                                                </div>
                                                            </div>
                                                            <div class="invoice-table-colum">
                                                                <label> <?php echo esc_html__("Background of Title",'netbase-smart-invoice'); ?> : </label>
                                                                <div class="invoice-col-input">
                                                                    <input name="item_title_background[]" class="jscolor" value="<?php echo esc_attr($product_background[$i],'netbase-smart-invoice');?>" type="text" autocomplete="off">
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <?php
                                            }
                                        }
                                    }
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <!-- /post-body-content -->
        <div id="postbox-container-1" class="postbox-container">
            <div id="side-sortables" class="meta-box-sortables ui-sortable">

                <?php do_action('nb_smart_invoice_admin_shortcode');?>
                
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Invoice Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of invoice copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("the date for create Invoice",'netbase-smart-invoice');?>">
                                [invoice_date]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("the date for create Delivery",'netbase-smart-invoice');?>">
                                [delivery_date]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Invoice Number, ex: #IN000001",'netbase-smart-invoice');?>">
                                [invoice_number]
                            </span>
                            <!--  -->
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("invoice number barcode",'netbase-smart-invoice');?>">
                                [barcode_invoice_number]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Delivery Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of delivery copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Number, ex: #DE000001",'netbase-smart-invoice');?>">
                                [delivery_number]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery First Name",'netbase-smart-invoice');?>">
                                [delivery_firstname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Last Name",'netbase-smart-invoice');?>">
                                [delivery_lastname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Company",'netbase-smart-invoice');?>">
                                [delivery_company]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Address",'netbase-smart-invoice');?>">
                                [delivery_address]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Address Line 2",'netbase-smart-invoice');?>">
                                [delivery_address_line_2]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Zipcode",'netbase-smart-invoice');?>">
                                [delivery_zipcode]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery City",'netbase-smart-invoice');?>">
                                [delivery_city]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery State",'netbase-smart-invoice');?>">
                                [delivery_state]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Country",'netbase-smart-invoice');?>">
                                [delivery_country]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Delivery Notes",'netbase-smart-invoice');?>">
                                [delivery_notes]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Billing Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of billing copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing First Name",'netbase-smart-invoice');?>">
                                [billing_firstname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Last Name",'netbase-smart-invoice');?>">
                                [billing_lastname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Address",'netbase-smart-invoice');?>">
                                [billing_address]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Address 2",'netbase-smart-invoice');?>">
                                [billing_address_line_2]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Zipcode",'netbase-smart-invoice');?>">
                                [billing_zipcode]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing City",'netbase-smart-invoice');?>">
                                [billing_city]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing State",'netbase-smart-invoice');?>">
                                [billing_state]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Country",'netbase-smart-invoice');?>">
                                [billing_country]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Mobile Phone",'netbase-smart-invoice');?>">
                                [billing_mobile_phone]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Billing Email",'netbase-smart-invoice');?>">
                                [billing_email]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Shipping Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of shipping copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Shipping Cost exclude Tax",'netbase-smart-invoice');?>">
                                [shipping_cost_excl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Tax Rate of Shipping Cost",'netbase-smart-invoice');?>">
                                [shipping_cost_tax_rate]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Tax Amount of Shipping Cost",'netbase-smart-invoice');?>">
                                [shipping_cost_tax_amount]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Shipping Cost include Tax",'netbase-smart-invoice');?>">
                                [shipping_cost_incl_tax]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Customer Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of customer copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer Email",'netbase-smart-invoice');?>">
                                [customer_email]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer Username",'netbase-smart-invoice');?>">
                                [customer_username]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer First Name",'netbase-smart-invoice');?>">
                                [customer_firstname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer Last Name",'netbase-smart-invoice');?>">
                                [customer_lastname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer's Nickname field",'netbase-smart-invoice');?>">
                                [customer_nickname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer's Display Name field.",'netbase-smart-invoice');?>">
                                [customer_displayname]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Customer Website",'netbase-smart-invoice');?>">
                                [customer_website]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Order Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of order copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                        <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The number of Order, ex: #OHSATSERP",'netbase-smart-invoice');?>">
                                [order_number]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The date for checkout",'netbase-smart-invoice');?>">
                                [order_date]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Name of Payment method for this Order",'netbase-smart-invoice');?>">
                                [order_payment_method]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Name of Shipping Method",'netbase-smart-invoice');?>">
                                [order_shipping_method]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Subtotal of Order include currency, ex: $73.90",'netbase-smart-invoice');?>">
                                [order_subtotal]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Shipping Cost of Order, ex: $2.00",'netbase-smart-invoice');?>">
                                [order_shipping_cost]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Tax of Order, ex: $1.50",'netbase-smart-invoice');?>">
                                [order_tax]
                            </span>
                            <!--  -->
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The number of discounted Price",'netbase-smart-invoice');?>">
                                [order_discounted]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Order total (include Tax, Shipping Cost, Discounted)",'netbase-smart-invoice');?>">
                                [order_total]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Order total exclude Tax",'netbase-smart-invoice');?>">
                                [order_total_excl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Order total (exclude Tax, Shipping Cost, No Discounted)",'netbase-smart-invoice');?>">
                                [order_total_not_discount_excl]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Order total (include Tax, Shipping Cost, No Discounted)",'netbase-smart-invoice');?>">
                                [order_total_not_discount_incl]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The notes of Order, ex: Lorem ipsum",'netbase-smart-invoice');?>">
                                [order_notes]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The Total of Fees of Order exclude Tax",'netbase-smart-invoice');?>">
                                [order_fee_excl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Tax of Order's Fee",'netbase-smart-invoice');?>">
                                [order_fee_tax_amount]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Rate of Fee",'netbase-smart-invoice');?>">
                                [order_fee_tax_rate]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("The Total of Fees of Order include Tax",'netbase-smart-invoice');?>">
                                [order_fee_incl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Order Refunded",'netbase-smart-invoice');?>">
                                [order_total_refunded]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Order Excl Tax",'netbase-smart-invoice');?>">
                                [total_order_excl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Order Tax Amount",'netbase-smart-invoice');?>">
                                [total_order_tax_amount]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total of Order",'netbase-smart-invoice');?>">
                                [total_order_incl_tax]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Product Short Code','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of product copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("This token will be automatic replaced with products table which you can change columns, title,color... in Product Template section of our module.",'netbase-smart-invoice');?>">
                                [products_list]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Product Excl Tax",'netbase-smart-invoice');?>">
                                [total_product_excl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Product Tax Amount",'netbase-smart-invoice');?>">
                                [total_product_tax_amount]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Product Incl Tax",'netbase-smart-invoice');?>">
                                [total_product_incl_tax]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total Products",'netbase-smart-invoice');?>">
                                [total_product_tax_rate]
                            </span>
                        </div>
                    </div>
                </div>
                <div id="submitdiv" class="postbox">
                    <h2 class="hndle ui-sortable-handle"><span class="nb_title_page"><?php echo esc_html__('Especially','netbase-smart-invoice');?></span></h2>
                    <p class="description">(*)Short code of tax copy to the editor for use</p>
                    <div class="inside inside-main">
                        <div class="inside invoice-buttons">
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Show Tax Table",'netbase-smart-invoice');?>">
                                [tax_table]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Show Individual Tax Table",'netbase-smart-invoice');?>">
                                [individual_tax_table]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Display Table all Discount in order",'netbase-smart-invoice');?>">
                                [discount_table]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total all amount of Coupon include TAX",'netbase-smart-invoice');?>">
                                [total_voucher_amount_tax_incl]
                            </span>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Total all amount of Coupon exclude TAX",'netbase-smart-invoice');?>">
                                [total_voucher_amount_tax_excl]
                            </span>
                            <br/><span><i><?php echo esc_html__("(*) - Compatible WooCommerce Local Pickup Plus plugin",'netbase-smart-invoice');?></i></span><br/>
                            <span class=" btn-short-code" data-toggle="tooltip" data-placement="left" title="<?php echo esc_html__("Shipping Location of Order in WooCommerce Local Pickup Plus plugin",'netbase-smart-invoice');?>">
                                [pickup_locations]
                            </span>
                            <!--  -->
                            <div class="clear"></div>
                        </div>
                        <script>
                            jQuery(function () {
                                jQuery('[data-toggle="tooltip"]').tooltip()
                            })
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /post-body -->
    <br class="clear">
</div>

<script>
    jQuery(document).ready(function(){
        setTimeout(function(){ jscolor.NBCreateColorInput(); }, 500);
        // Remove column
    });
    function addColumnTableProduct(){
            var _col_number = jQuery("#columns_number").val();
            var _col_number_add = parseInt(_col_number) + 1;
            var _date = new Date();
            var _time = _date.getTime();
            $_temp = NBTemplateProduct(_col_number_add, _time);
            jQuery("#main-content-table").append($_temp);
            setTimeout(function(){ jscolor.NBCreateColorInput(); }, 500);
            jQuery("#columns_number").val(_col_number_add);
    }
    function removeColumnTableProduct(_itemTag){
        var _col_number_rm = jQuery("#columns_number").val();
        var id_remove = "#"+jQuery(_itemTag).attr("removeId");
        jQuery(id_remove).remove();
        var _col_number_new = parseInt(_col_number_rm) - 1;
        jQuery("#columns_number").val(_col_number_new);
    }
    function NBTemplateProduct(_col_number, _time){
        var _template = '<div class="form-group main-content-columns" id="main-content-columns-' + _time + '">';
        _template += '<h2 class="title-columns">';
        _template += '<?php echo esc_html__(" Columns ",'netbase-smart-invoice'); ?> <span class="title-columns">####</span>';
        _template += '<input onclick="removeColumnTableProduct(this)" type="button" class="button button-default remove-content-columns" removeId="main-content-columns-'+_time+'" value="Remove">';
        _template += '</h2>';
        _template += '<div class="row">';
        _template += '<div class="col-md-12">';
        _template += '<div class="invoice-table-colum">';
        _template += '<label> <?php echo esc_html__(" Title ",'netbase-smart-invoice'); ?> : </label>';
        _template += '<div class="invoice-col-input">';
        _template += '<input name="item_title[]" type="text" value="title ###">';
        _template += '</div>';
        _template += '</div>';
        _template += '<div class="invoice-table-colum">';
        _template += '<label> <?php echo esc_html__(" Content ",'netbase-smart-invoice'); ?> : </label>';
        _template += '<div class="invoice-col-input">';
        _template += '<select class="column-short valid" name="item_key_value[]" aria-invalid="false">';
        _template += '<option value="p_name"><?php echo esc_html__("Product Name",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_name_custom"><?php echo esc_html__("Product Name with Customization",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_desc"><?php echo esc_html__("Product Full Description",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_shor_desc"><?php echo esc_html__("Product Short Description",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_image"><?php echo esc_html__("Product Image",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_sku"><?php echo esc_html__("SKU",'netbase-smart-invoice');?></option>';
        _template += '<option value="qty"><?php echo esc_html__("Quantity",'netbase-smart-invoice');?></option>';
        _template += '<option value="unit_price_ex_tax"><?php echo esc_html__("Unit Price(Tax Excl)",'netbase-smart-invoice');?></option>';
        _template += '<option value="unit_price_in_tax_no_old_price"><?php echo esc_html__("Unit Price(Tax Incl) - Without Old Price",'netbase-smart-invoice');?></option>';
        _template += '<option value="unit_price_in_tax_in_old_price"><?php echo esc_html__("Unit Price(Tax Incl) - With Old Price",'netbase-smart-invoice');?></option>';
        _template += '<option value="unit_price_ex_tax_has_discount"><?php echo esc_html__("Unit Price(Tax Excl) has Discount",'netbase-smart-invoice');?></option>';
        _template += '<option value="unit_price_in_tax_has_discount"><?php echo esc_html__("Unit Price(Tax Incl) has Discount",'netbase-smart-invoice');?></option>';
        _template += '<option value="p_tax"><?php echo esc_html__("Tax Amount",'netbase-smart-invoice');?></option>';
        _template += '<option value="tax_name"><?php echo esc_html__("Tax Name",'netbase-smart-invoice');?></option>'; 
        _template += '<option value="tax_rate"><?php echo esc_html__("Tax Rate(%)",'netbase-smart-invoice');?></option>';
        _template += '<option value="discounted"><?php echo esc_html__("Unit Discounted Amount",'netbase-smart-invoice');?></option>';
        _template += '<option value="total_ex_tax"><?php echo esc_html__("Total(Tax excl)",'netbase-smart-invoice');?></option>';
        _template += '<option value="total_in_tax"><?php echo esc_html__("Total(Tax Incl)",'netbase-smart-invoice');?></option>';
        _template += '<option value="total_ex_tax_has_discount"><?php echo esc_html__("Total(Tax Excl) has Discount",'netbase-smart-invoice');?></option>';
        _template += '<option value="total_incl_tax_has_discount"><?php echo esc_html__(" Total(Tax Incl) has Discount ",'netbase-smart-invoice'); ?></option>';
        _template += '</select>';
        _template += '</div>';
        _template += '</div>';
        _template += '<div class="invoice-table-colum">';
        _template += '<label> <?php echo esc_html__(" Color of Title ",'netbase-smart-invoice'); ?> : </label>';
        _template += '<div class="invoice-col-input">';
        _template += '<input name="item_title_color[]" class="jscolor" type="text">';
        _template += '</div>';
        _template += '</div>';
        _template += '<div class="invoice-table-colum">';
        _template += '<label> <?php echo esc_html__(" Background of Title ",'netbase-smart-invoice'); ?> : </label>';
        _template += '<div class="invoice-col-input">';
        _template += '<input name="item_title_background[]" class="jscolor" type="text">';
        _template += '</div>';
        _template += '</div>';
        _template += '</div>';
        _template += '</div>';
        _template += '</div>';
        return _template;
    }
</script>
<script>
    function NBInvoiceCheckPreview(){
        alert('You need to have an order and save the template before using the preview');
    }
</script>