{"en_US": "<t t-name=\"stock.report_package_barcode\">\n    <t t-call=\"web.basic_layout\">\n        <!-- quantity patterns are always 3 digit codes + 1 digit for number of digits (excluding units) -->\n        <t t-set=\"uom_unit_id\" t-value=\"env.ref('uom.product_uom_unit').id\"/>\n        <t t-set=\"gs1_uom_patterns\" t-value=\"{rule.associated_uom_id.id: rule.pattern[1:4] + str(len(str('{:.10f}'.format(rule.associated_uom_id.rounding).rstrip('0')).split('.')[1])) for rule in env['barcode.rule'].search([('associated_uom_id', '!=', False), ('associated_uom_id.id', '!=', uom_unit_id), ('is_gs1_nomenclature', '=', True)])}\"/>\n        <t t-foreach=\"docs\" t-as=\"o\">\n            <t>\n                <div class=\"page\">\n                    <div class=\"oe_structure\"/>\n                    <table class=\"table table-condensed\" style=\"border-bottom: 0px solid white !important;\">\n                        <tr>\n                            <th>\n                              <h1 t-field=\"o.name\" class=\"mt0 float-start\"/>\n                            </th>\n                            <th name=\"td_pk_barcode\" style=\"text-align: center\">\n                                <t t-if=\"o.valid_sscc\">\n                                    <div class=\"row text-start\">\n                                        <t t-set=\"barcode\" t-value=\"'00' + o.name\"/>\n                                        <t t-if=\"o.pack_date\" t-set=\"barcode\" t-value=\"barcode + '13' + o.pack_date.strftime('%y%m%d')\"/>\n                                        <div class=\"col-3\" name=\"datamatrix_barcode\" style=\"margin: 0px 20px 40px 60px\" t-out=\"barcode\" t-options=\"{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'width': 100, 'height': 100}\"/>\n                                    </div>\n                                </t>\n                                <t t-else=\"\">\n                                    <div t-field=\"o.name\" t-options=\"{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}\"/>\n                                    <p t-field=\"o.name\"/>\n                                </t>\n                            </th>\n                        </tr>\n                    </table>\n                    <div class=\"row mt32 mb32\">\n                        <div t-if=\"o.pack_date\" class=\"col-auto\">\n                            <strong>Pack Date:</strong>\n                            <p t-field=\"o.pack_date\"/>\n                        </div>\n                        <div t-if=\"o.package_type_id\" class=\"o_packaging_type col-auto\">\n                            <strong>Package Type:</strong>\n                            <p t-field=\"o.package_type_id.name\"/>\n                        </div>\n                    </div>\n                    <table class=\"table table-sm table-striped\" style=\"border-bottom: 0px solid white !important;\">\n                        <t t-set=\"has_serial_number\" t-value=\"o.quant_ids.mapped('lot_id')\"/>\n                        <t t-set=\"has_ean_barcode\" t-value=\"any(valid_ean for valid_ean in o.quant_ids.product_id.mapped('valid_ean'))\"/>\n                        <thead>\n                            <tr>\n                                <th>Product</th>\n                                <th name=\"th_quantity\" class=\"text-end\">Quantity</th>\n                                <th name=\"th_uom\" groups=\"uom.group_uom\"/>\n                                <th name=\"th_serial\" class=\"text-end\" t-if=\"has_serial_number\">Lot/Serial Number</th>\n                                <th name=\"th_barcode\" class=\"text-end\" t-if=\"has_ean_barcode\"/>\n                            </tr>\n                        </thead>\n                        <tbody>\n                            <tr t-foreach=\"o.quant_ids\" t-as=\"l\">\n                                <td>\n                                   <span t-field=\"l.product_id.name\"/>\n                                </td>\n                                <td class=\"text-end\">\n                                    <span t-field=\"l.quantity\"/>\n                                </td>\n                                <td groups=\"uom.group_uom\">\n                                    <span t-field=\"l.product_id.uom_id.name\"/>\n                                </td>\n                                <td class=\"text-end\" t-if=\"has_serial_number\">\n                                    <t t-if=\"l.lot_id\"><span t-field=\"l.lot_id.name\"/></t>\n                                </td>\n                                <td class=\"text-end\" t-if=\"has_ean_barcode\">\n                                    <t t-if=\"l.product_id.valid_ean\">\n                                        <t t-set=\"product_barcode\" t-value=\"'01' + '0' * (14 - len(l.product_id.barcode)) + l.product_id.barcode\"/>\n                                        <t t-set=\"gs1_pattern\" t-value=\"gs1_uom_patterns.get(l.product_uom_id.id, False)\"/>\n                                        <t t-if=\"(gs1_pattern or l.product_uom_id.id == uom_unit_id) and l.quantity &gt;= 0\">\n                                            <t t-if=\"gs1_pattern\">\n                                                <t t-set=\"qty_str\" t-value=\"str(int(l.quantity/l.product_uom_id.rounding))\"/>\n                                                <t t-if=\"len(qty_str) &lt;= 6\" t-set=\"product_barcode\" t-value=\"product_barcode + gs1_pattern +  '0' * (6 - len(qty_str)) + qty_str\"/>\n                                            </t>\n                                            <t t-else=\"\">\n                                                <!-- GS1 have no decimal indicator for unit uom => round for now.. -->\n                                                <t t-set=\"qty_str\" t-value=\"str(int(round(l.quantity)))\"/>\n                                                <t t-if=\"len(qty_str) &lt;=8\" t-set=\"product_barcode\" t-value=\"product_barcode + '30' +  '0' * (8 - len(qty_str)) + qty_str\"/>\n                                            </t>\n                                        </t>\n                                        <!-- TODO: lot/sn ALWAYS has to be last part of barcode since left padding '0's = different sn/lot name match when scanning => fix when FNC1 can be used,  -->\n                                        <t name=\"product_barcode_lot_datamatrix\" t-if=\"l.product_id.tracking == 'lot' and l.lot_id\" t-set=\"product_barcode\" t-value=\"product_barcode + '10' + l.lot_id.name\"/>\n                                        <t t-elif=\"l.product_id.tracking == 'serial' and l.lot_id\" t-set=\"product_barcode\" t-value=\"product_barcode + '21' +  l.lot_id.name\"/>\n                                        <span t-out=\"product_barcode\" t-options=\"{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'img_style': 'width:17mm;height:17mm'}\"/>\n                                    </t>\n                                </td>\n                            </tr>\n                        </tbody>\n                    </table>\n                </div>\n            </t>\n        </t>\n    </t>\n</t>", "vi_VN": "<t t-name=\"stock.report_package_barcode\">\n    <t t-call=\"web.basic_layout\">\n        <!-- quantity patterns are always 3 digit codes + 1 digit for number of digits (excluding units) -->\n        <t t-set=\"uom_unit_id\" t-value=\"env.ref('uom.product_uom_unit').id\"/>\n        <t t-set=\"gs1_uom_patterns\" t-value=\"{rule.associated_uom_id.id: rule.pattern[1:4] + str(len(str('{:.10f}'.format(rule.associated_uom_id.rounding).rstrip('0')).split('.')[1])) for rule in env['barcode.rule'].search([('associated_uom_id', '!=', False), ('associated_uom_id.id', '!=', uom_unit_id), ('is_gs1_nomenclature', '=', True)])}\"/>\n        <t t-foreach=\"docs\" t-as=\"o\">\n            <t>\n                <div class=\"page\">\n                    <div class=\"oe_structure\"/>\n                    <table class=\"table table-condensed\" style=\"border-bottom: 0px solid white !important;\">\n                        <tr>\n                            <th>\n                              <h1 t-field=\"o.name\" class=\"mt0 float-start\"/>\n                            </th>\n                            <th name=\"td_pk_barcode\" style=\"text-align: center\">\n                                <t t-if=\"o.valid_sscc\">\n                                    <div class=\"row text-start\">\n                                        <t t-set=\"barcode\" t-value=\"'00' + o.name\"/>\n                                        <t t-if=\"o.pack_date\" t-set=\"barcode\" t-value=\"barcode + '13' + o.pack_date.strftime('%y%m%d')\"/>\n                                        <div class=\"col-3\" name=\"datamatrix_barcode\" style=\"margin: 0px 20px 40px 60px\" t-out=\"barcode\" t-options=\"{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'width': 100, 'height': 100}\"/>\n                                    </div>\n                                </t>\n                                <t t-else=\"\">\n                                    <div t-field=\"o.name\" t-options=\"{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:300px;height:50px;'}\"/>\n                                    <p t-field=\"o.name\"/>\n                                </t>\n                            </th>\n                        </tr>\n                    </table>\n                    <div class=\"row mt32 mb32\">\n                        <div t-if=\"o.pack_date\" class=\"col-auto\">\n                            <strong>Ngày đóng gói:</strong>\n                            <p t-field=\"o.pack_date\"/>\n                        </div>\n                        <div t-if=\"o.package_type_id\" class=\"o_packaging_type col-auto\">\n                            <strong>Loại kiện hàng:</strong>\n                            <p t-field=\"o.package_type_id.name\"/>\n                        </div>\n                    </div>\n                    <table class=\"table table-sm table-striped\" style=\"border-bottom: 0px solid white !important;\">\n                        <t t-set=\"has_serial_number\" t-value=\"o.quant_ids.mapped('lot_id')\"/>\n                        <t t-set=\"has_ean_barcode\" t-value=\"any(valid_ean for valid_ean in o.quant_ids.product_id.mapped('valid_ean'))\"/>\n                        <thead>\n                            <tr>\n                                <th>Sản phẩm</th>\n                                <th name=\"th_quantity\" class=\"text-end\">Số lượng</th>\n                                <th name=\"th_uom\" groups=\"uom.group_uom\"/>\n                                <th name=\"th_serial\" class=\"text-end\" t-if=\"has_serial_number\">Số lô/sê-ri</th>\n                                <th name=\"th_barcode\" class=\"text-end\" t-if=\"has_ean_barcode\"/>\n                            </tr>\n                        </thead>\n                        <tbody>\n                            <tr t-foreach=\"o.quant_ids\" t-as=\"l\">\n                                <td>\n                                   <span t-field=\"l.product_id.name\"/>\n                                </td>\n                                <td class=\"text-end\">\n                                    <span t-field=\"l.quantity\"/>\n                                </td>\n                                <td groups=\"uom.group_uom\">\n                                    <span t-field=\"l.product_id.uom_id.name\"/>\n                                </td>\n                                <td class=\"text-end\" t-if=\"has_serial_number\">\n                                    <t t-if=\"l.lot_id\"><span t-field=\"l.lot_id.name\"/></t>\n                                </td>\n                                <td class=\"text-end\" t-if=\"has_ean_barcode\">\n                                    <t t-if=\"l.product_id.valid_ean\">\n                                        <t t-set=\"product_barcode\" t-value=\"'01' + '0' * (14 - len(l.product_id.barcode)) + l.product_id.barcode\"/>\n                                        <t t-set=\"gs1_pattern\" t-value=\"gs1_uom_patterns.get(l.product_uom_id.id, False)\"/>\n                                        <t t-if=\"(gs1_pattern or l.product_uom_id.id == uom_unit_id) and l.quantity &gt;= 0\">\n                                            <t t-if=\"gs1_pattern\">\n                                                <t t-set=\"qty_str\" t-value=\"str(int(l.quantity/l.product_uom_id.rounding))\"/>\n                                                <t t-if=\"len(qty_str) &lt;= 6\" t-set=\"product_barcode\" t-value=\"product_barcode + gs1_pattern +  '0' * (6 - len(qty_str)) + qty_str\"/>\n                                            </t>\n                                            <t t-else=\"\">\n                                                <!-- GS1 have no decimal indicator for unit uom => round for now.. -->\n                                                <t t-set=\"qty_str\" t-value=\"str(int(round(l.quantity)))\"/>\n                                                <t t-if=\"len(qty_str) &lt;=8\" t-set=\"product_barcode\" t-value=\"product_barcode + '30' +  '0' * (8 - len(qty_str)) + qty_str\"/>\n                                            </t>\n                                        </t>\n                                        <!-- TODO: lot/sn ALWAYS has to be last part of barcode since left padding '0's = different sn/lot name match when scanning => fix when FNC1 can be used,  -->\n                                        <t name=\"product_barcode_lot_datamatrix\" t-if=\"l.product_id.tracking == 'lot' and l.lot_id\" t-set=\"product_barcode\" t-value=\"product_barcode + '10' + l.lot_id.name\"/>\n                                        <t t-elif=\"l.product_id.tracking == 'serial' and l.lot_id\" t-set=\"product_barcode\" t-value=\"product_barcode + '21' +  l.lot_id.name\"/>\n                                        <span t-out=\"product_barcode\" t-options=\"{'widget': 'barcode', 'symbology': 'ECC200DataMatrix', 'img_style': 'width:17mm;height:17mm'}\"/>\n                                    </t>\n                                </td>\n                            </tr>\n                        </tbody>\n                    </table>\n                </div>\n            </t>\n        </t>\n    </t>\n</t>"}