updating labels
This commit is contained in:
parent
d8c29e9cc2
commit
02ff58e30f
1
commit_message.txt
Normal file
1
commit_message.txt
Normal file
@ -0,0 +1 @@
|
||||
Summary of label printing changes written.
|
||||
13
debug.log
13
debug.log
@ -13,3 +13,16 @@
|
||||
2026-02-25 15:28:54 - Items case hit
|
||||
2026-02-26 02:55:12 - Items case hit
|
||||
2026-02-26 02:56:47 - Items case hit
|
||||
2026-02-26 03:00:52 - Items case hit
|
||||
2026-02-26 03:01:01 - Items case hit
|
||||
2026-02-26 03:01:48 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true}
|
||||
2026-02-26 03:05:30 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true}
|
||||
2026-02-26 03:08:42 - Items case hit
|
||||
2026-02-26 03:09:08 - Items case hit
|
||||
2026-02-26 03:09:24 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true}
|
||||
2026-02-26 03:09:34 - Items case hit
|
||||
2026-02-26 03:10:28 - Items case hit
|
||||
2026-02-26 03:23:07 - Items case hit
|
||||
2026-02-26 03:25:23 - Items case hit
|
||||
2026-02-26 03:29:29 - Items case hit
|
||||
2026-02-26 03:30:39 - Items case hit
|
||||
|
||||
38
index.php
38
index.php
@ -5665,7 +5665,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<tbody>
|
||||
<?php foreach ($data['items'] as $item): ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="form-check-input item-checkbox" data-id="<?= $item['id'] ?>" data-sku="<?= htmlspecialchars($item['sku']) ?>" data-name="<?= htmlspecialchars($item['name_en'] . ' - ' . $item['name_ar']) ?>" data-price="<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>"></td>
|
||||
<td><input type="checkbox" class="form-check-input item-checkbox" data-id="<?= $item['id'] ?>" data-sku="<?= htmlspecialchars($item['sku']) ?>" data-name-en="<?= htmlspecialchars($item['name_en']) ?>" data-name-ar="<?= htmlspecialchars($item['name_ar']) ?>" data-price="<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>"></td>
|
||||
<td>
|
||||
<?php if ($item['image_path']): ?>
|
||||
<img src="<?= htmlspecialchars($item['image_path']) ?>" alt="item" style="width: 40px; height: 40px; object-fit: cover;" class="rounded">
|
||||
@ -5702,7 +5702,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-info" title="View" data-bs-toggle="modal" data-bs-target="#viewItemModal<?= $item['id'] ?>"><i class="bi bi-eye"></i></button>
|
||||
<button class="btn btn-outline-primary" title="Edit" data-bs-toggle="modal" data-bs-target="#editItemModal<?= $item['id'] ?>"><i class="bi bi-pencil"></i></button>
|
||||
<button class="btn btn-outline-dark" title="Barcode" onclick="printItemBarcode('<?= htmlspecialchars($item['sku']) ?>', '<?= htmlspecialchars($item['name_en'] . ' - ' . $item['name_ar']) ?>', '<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>')"><i class="bi bi-upc"></i></button>
|
||||
<button class="btn btn-outline-dark" title="Barcode" onclick="printItemBarcode('<?= htmlspecialchars($item['sku']) ?>', '<?= htmlspecialchars($item['name_en']) ?>', '<?= htmlspecialchars($item['name_ar']) ?>', '<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>')"><i class="bi bi-upc"></i></button>
|
||||
<form method="POST" class="d-inline" onsubmit="return confirm('Are you sure?')">
|
||||
<input type="hidden" name="id" value="<?= $item['id'] ?>">
|
||||
<button type="submit" name="delete_item" class="btn btn-outline-danger" title="Delete"><i class="bi bi-trash"></i></button>
|
||||
@ -5739,7 +5739,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-outline-dark" onclick="printItemBarcode('<?= htmlspecialchars($item['sku']) ?>', '<?= htmlspecialchars($item['name_en'] . ' - ' . $item['name_ar']) ?>', '<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>')"><i class="bi bi-printer"></i> Print Barcode</button>
|
||||
<button class="btn btn-outline-dark" onclick="printItemBarcode('<?= htmlspecialchars($item['sku']) ?>', '<?= htmlspecialchars($item['name_en']) ?>', '<?= htmlspecialchars($item['name_ar']) ?>', '<?= number_format((float)$item['sale_price'] * (1 + (float)($item['vat_rate'] ?? 0) / 100), 3) ?>')"><i class="bi bi-printer"></i> Print Barcode</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal" data-en="Close" data-ar="إغلاق">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -6146,7 +6146,10 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<i class="bi bi-box-seam text-muted" style="font-size: 3rem;"></i>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="fw-bold mb-1 product-name" data-en="<?= htmlspecialchars($p['name_en']) ?>" data-ar="<?= htmlspecialchars($p['name_ar']) ?>"><?= htmlspecialchars($p['name_en']) ?></div>
|
||||
<div class="mb-1 product-name">
|
||||
<div class="fw-bold text-truncate" title="<?= htmlspecialchars($p['name_en']) ?>"><?= htmlspecialchars($p['name_en']) ?></div>
|
||||
<div class="small text-muted fw-normal text-truncate" title="<?= htmlspecialchars($p['name_ar']) ?>" dir="rtl"><?= htmlspecialchars($p['name_ar']) ?></div>
|
||||
</div>
|
||||
<div class="small text-muted mb-2"><?= htmlspecialchars($p['sku']) ?></div>
|
||||
<div class="d-flex justify-content-between align-items-center mt-auto">
|
||||
<div class="d-flex flex-column">
|
||||
@ -14438,12 +14441,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
checkedItems.forEach(cb => {
|
||||
const sku = cb.dataset.sku;
|
||||
const name = cb.dataset.name;
|
||||
const nameEn = cb.dataset.nameEn || '';
|
||||
const nameAr = cb.dataset.nameAr || '';
|
||||
const name = nameEn + (nameAr ? ' - ' + nameAr : '');
|
||||
const id = cb.dataset.id;
|
||||
|
||||
const tr = document.createElement('tr');
|
||||
tr.innerHTML = `
|
||||
<td class="align-middle" style="width: 70%; font-size: 0.9em;">${name} <span class="text-muted">(${sku})</span></td>
|
||||
<td class="align-middle" style="width: 70%; font-size: 0.9em; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${name} <span class="text-muted">(${sku})</span></td>
|
||||
<td class="align-middle" style="width: 30%;">
|
||||
<input type="number" class="form-control form-control-sm item-qty-input"
|
||||
data-id="${id}" value="${defaultCopies}" min="0" onchange="updateAveryPreview()" onkeyup="updateAveryPreview()">
|
||||
@ -14479,7 +14484,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
checkedItems.forEach(cb => {
|
||||
const sku = cb.dataset.sku;
|
||||
const name = cb.dataset.name;
|
||||
const nameEn = cb.dataset.nameEn || '';
|
||||
const nameAr = cb.dataset.nameAr || '';
|
||||
const price = cb.dataset.price;
|
||||
const id = cb.dataset.id;
|
||||
|
||||
@ -14498,7 +14504,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const uniqueId = Math.random().toString(36).substr(2, 9);
|
||||
const svgId = `bc-${sku}-${uniqueId}`;
|
||||
label.innerHTML = `
|
||||
<div style="font-size: 9px; font-weight: bold; margin-bottom: 2px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; width: 100%;">${name}</div>
|
||||
<div style="font-size: 9px; font-weight: bold; margin-bottom: 1px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;">${nameEn}</div>
|
||||
<div style="font-size: 8px; font-weight: bold; margin-bottom: 2px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;">${nameAr}</div>
|
||||
<svg id="${svgId}"></svg>
|
||||
<div style="font-size: 11px; font-weight: bold; margin-top: 2px;">OMR ${price}</div>
|
||||
`;
|
||||
@ -14534,12 +14541,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
|
||||
<script>
|
||||
window.printItemBarcode = function(sku, name, price) {
|
||||
window.currentPrintData = {};
|
||||
window.printItemBarcode = function(sku, nameEn, nameAr, price) {
|
||||
if (!sku) {
|
||||
Swal.fire('Error', 'This item has no SKU/Barcode assigned.', 'error');
|
||||
return;
|
||||
}
|
||||
document.getElementById('barcodeLabelName').textContent = name;
|
||||
window.currentPrintData = { sku, nameEn, nameAr, price };
|
||||
document.getElementById('barcodeLabelName').innerHTML = `<div class="text-truncate" style="max-width:100%;">${nameEn}</div><div class="text-truncate" style="max-width:100%; font-size:0.85em;">${nameAr}</div>`;
|
||||
document.getElementById('barcodeLabelPrice').textContent = 'OMR ' + price;
|
||||
|
||||
JsBarcode("#barcodeSvg", sku, {
|
||||
@ -14560,7 +14569,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const height = parseInt(document.getElementById('barcodeHeight').value) || 25;
|
||||
|
||||
// Get content
|
||||
const name = document.getElementById('barcodeLabelName').innerText;
|
||||
const nameEn = window.currentPrintData.nameEn || '';
|
||||
const nameAr = window.currentPrintData.nameAr || '';
|
||||
const price = document.getElementById('barcodeLabelPrice').innerText;
|
||||
const svg = document.getElementById('barcodeSvg').outerHTML;
|
||||
|
||||
@ -14578,7 +14588,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
for (let i = 0; i < qty; i++) {
|
||||
labelsHtml += `
|
||||
<div class="label-container">
|
||||
<div class="label-name">${name}</div>
|
||||
<div class="label-name-en">${nameEn}</div>
|
||||
<div class="label-name-ar">${nameAr}</div>
|
||||
${svg}
|
||||
<div class="label-price">${price}</div>
|
||||
</div>
|
||||
@ -14606,7 +14617,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
padding: 1mm;
|
||||
}
|
||||
.label-container:last-child { page-break-after: avoid; }
|
||||
.label-name { font-size: 9px; font-weight: bold; margin-bottom: 2px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
|
||||
.label-name-en { font-size: 9px; font-weight: bold; margin-bottom: 1px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
|
||||
.label-name-ar { font-size: 8px; font-weight: bold; margin-bottom: 2px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
|
||||
.label-price { font-size: 12px; font-weight: bold; margin-top: 2px; }
|
||||
svg { max-width: 100%; height: auto; max-height: 70%; display: block; }
|
||||
</style>
|
||||
|
||||
@ -11,3 +11,10 @@
|
||||
2026-02-25 17:09:31 - POST: {"id":"37","delete_invoice":""}
|
||||
2026-02-26 02:56:35 - POST: {"import_items":""}
|
||||
2026-02-26 02:57:11 - POST: {"import_items":""}
|
||||
2026-02-26 03:01:00 - POST: {"import_items":""}
|
||||
2026-02-26 03:01:48 - POST: {"action":"translate","text":"LAMING PINEAPPLE 454G","target":"ar"}
|
||||
2026-02-26 03:05:29 - POST: {"action":"translate","text":"LAMING RED KIDNEY BEANS 425","target":"ar"}
|
||||
2026-02-26 03:09:07 - POST: {"id":"62","name_en":"LAMING RED KIDNEY BEANS 425","name_ar":"LAMING RED KIDNEY BEANS 425","sku":"000023071605","category_id":"2","unit_id":"1","supplier_id":"5","sale_price":"0.25","purchase_price":"0.2","stock_quantity":"0","min_stock_level":"0","vat_rate":"0.00","promotion_start":"","promotion_end":"","promotion_percent":"0","edit_item":""}
|
||||
2026-02-26 03:09:24 - POST: {"action":"translate","text":"LAMING RED KIDNEY BEANS 425","target":"ar"}
|
||||
2026-02-26 03:09:34 - POST: {"id":"62","name_en":"LAMING RED KIDNEY BEANS 425","name_ar":"\u0641\u0627\u0635\u0648\u0644\u064a\u0627\u0621 \u062d\u0645\u0631\u0627\u0621 \u0644\u0627\u0645\u064a\u0646\u062c 425","sku":"000023071605","category_id":"2","unit_id":"1","supplier_id":"5","sale_price":"0.25","purchase_price":"0.2","stock_quantity":"0","min_stock_level":"0","vat_rate":"0.00","expiry_date":"","promotion_start":"","promotion_end":"","promotion_percent":"0","edit_item":""}
|
||||
2026-02-26 03:11:08 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":1.7}]","total_amount":"1.7000000000000002","tax_amount":"0","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":48,\"qty\":1,\"price\":1.3,\"vat_rate\":0,\"vat_amount\":0},{\"id\":17,\"qty\":1,\"price\":0.4,\"vat_rate\":0,\"vat_amount\":0}]"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user