From 2177834b39a136fde6873f8e216262251537d75b Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Tue, 7 Jul 2026 11:23:16 +0200 Subject: [PATCH] Settings page finished, filter gui improved --- webgui/box.php | 29 ++++++++---- webgui/company.php | 19 +++++--- webgui/documents.php | 24 ++++++++-- webgui/equipment.php | 66 ++++++++++++++++++++------ webgui/globals.inc | 105 +++++++++++++++++++++++++++++++++++++++-- webgui/inventory.php | 6 +-- webgui/lib/gpc.inc | 12 +++++ webgui/maintenance.php | 4 +- webgui/manual.php | 2 +- webgui/measurement.php | 19 ++++++-- webgui/projects.php | 4 +- webgui/provisions.php | 2 +- 12 files changed, 241 insertions(+), 51 deletions(-) diff --git a/webgui/box.php b/webgui/box.php index f2ab367..23ff10a 100644 --- a/webgui/box.php +++ b/webgui/box.php @@ -185,7 +185,7 @@ form_view_buttons($g_scriptname, $id); // Inventory in box // WIP -$sql = "SELECT invid, invname, weight FROM inventory WHERE conttype='box' AND boxid=?"; +$sql = "SELECT invid, invname, weight, number FROM inventory WHERE conttype='box' AND boxid=?"; $sth = $pdo->prepare($sql); $sth->execute([$id]); $res = $sth->fetchAll(); @@ -195,21 +195,34 @@ $weight_total = 0.0; if ($res) { echo '', "\n"; echo "\n"; - echo ""; + echo ''; + echo ''; echo '"; + echo '"; echo '"; - echo ""; + echo "\n"; echo "\n"; + $i = 1; foreach ($res as $row) { echo "\n"; - echo "\n"; - echo "\n"; - form_action_buttons('inventory.php', $row['invid']); + echo '\n"; + echo '\n"; + echo '\n"; + echo '\n"; echo "\n"; - $weight_total += $row['weight']; } echo ""; - echo '', "\n"; + echo '', "\n"; echo "\n"; echo "
#', _('Inventory'), "', _('Number'), "', _('Weight'), "
", $row['invname'], "", format_float($row['weight'], 2, 'kg'), "', $i++, ' '; + echo ''; + echo "', $row['invname'], "', $row['number'], "'; + $weight_item = $row['weight'] * $row['number']; + if ($weight_item > 0) { + $weight_total += $weight_item; + echo format_float($weight_item, 2, 'kg'); + } else { + echo '-'; + } + echo "
', format_float($weight_total, 2, 'kg'), '
', format_float($weight_total, 2, 'kg'), '
\n"; } else { diff --git a/webgui/company.php b/webgui/company.php index 5b4e7c8..bbcbf49 100644 --- a/webgui/company.php +++ b/webgui/company.php @@ -264,9 +264,17 @@ echo '', _('Street'),"", $company->street, "', _('Zip, City'),"", $company->zip, ' ', $company->city, "\n"; echo '', _('Country'),"", $company->country, "\n"; echo '', _('Contact'),"", $company->contact, "\n"; -echo '', _('Phone'),"", $company->phone, "\n"; -echo '', _('Email'),"", $company->email, "\n"; -echo '', _('Web'),"", $company->web, "\n"; + +echo '', _('Phone'),""; +echo make_phonelink($company->phone),' ', $company->phone, "\n"; + +echo '', _('Email'),""; +echo make_maillink($company->email),' ', $company->email, "\n"; + +echo '', _('Web'),""; +// echo '\n"; + echo '', _('Customer no.'),"", $company->customerno, "\n"; echo '', _('Contract no.'),"", $company->contractno, "\n"; echo '', _('Remarks'),"", $company->remarks, "\n"; @@ -292,14 +300,13 @@ if ($sth->rowCount() > 0) { } // show referenced invoices - $sql = "SELECT docid, refid, filename, title " . "FROM docref AS r JOIN document AS d USING (docid) " - . "WHERE reftype='company' AND refid=?"; + . "WHERE r.reftype='company' AND r.refid=? AND d.doctype='invoice'"; $sth = $pdo->prepare($sql); $sth->execute([$id]); if ($sth->rowCount() > 0) { - echo "

Invoices:

\n"; + echo "

", _('Invoices'), ":

\n"; echo "