From 66fff10ad34abc27b780fe922354396bf023be36 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Thu, 7 Apr 2016 14:13:35 +0200 Subject: [PATCH 1/1] Support PDF export of past orders as well --- ordersatz_pos.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/ordersatz_pos.php b/ordersatz_pos.php index 0c9cbdd..70a4c1f 100644 --- a/ordersatz_pos.php +++ b/ordersatz_pos.php @@ -13,6 +13,7 @@ include_once($_SESSION['sys']['basedir'].'masks/metro/utils.php'); include_once($_SESSION['sys']['basedir'].'lib/mail.php'); +$done = true; if (substr($_SERVER["SCRIPT_FILENAME"],-10) == '/index.php' && !empty($_GET['id'])) { $_SESSION['ordersatz'] = $_GET['id']; @@ -24,16 +25,23 @@ if (!$done) { 'icon' => 'masks/metro/import.png', 'title' => 'Neue Artikel importieren', 'function' => 'import_articles'))); - Actions::instance()->addLink(new Link(array('id' => 'btn_pdf', - 'icon' => 'masks/metro/pdf_document.png', - 'title' => 'PDF Vorschau', - 'function' => 'build_pdf'))); +} + +Actions::instance()->addLink(new Link(array('id' => 'btn_pdf', + 'icon' => 'masks/metro/pdf_document.png', + 'title' => 'PDF Vorschau', + 'function' => 'build_pdf'))); + +if (!$done) { Actions::instance()->addLink(new Link(array('id' => 'btn_finish', 'icon' => 'masks/metro/hp_folder_finished.png', 'title' => 'Ordersatz Abschließen und Versenden', 'function' => 'confirm_finish'))); +} - $jscode = <<add($jscode); -} + +JavaScript::instance()->add($jscode); function get_title($id) { @@ -136,8 +148,12 @@ $mask = array( 'specs' => array('ClassName' => 'alignrightpad'), ), 'artnr' => array( - 'name' => 'Artnr', + 'name' => 'ArtNr', + 'sqltype' => 'int', 'width' => 60, + 'type' => 'number', + 'filter' => 't=3', + 'specs' => array('decPlaces' => 0, 'thouSep' => ''), 'visible' => false, ), 'menge' => array( @@ -189,7 +205,6 @@ $mask = array( 'specs' => array('ClassName' => 'aligncenter'), 'control' => "new Rico.TableColumn.lookup(".grid_lookup_sql('metro_abteilung','id','name').", 0, '')", 'distinct' => "SELECT DISTINCT abteilung,metro_abteilung.name FROM metro_artikel JOIN metro_abteilung ON abteilung = metro_abteilung.id ORDER BY name", - 'visible' => false, ), 'gang' => array( 'name' => 'Gang', -- 2.20.1