From 4678373480056d5ebbc13622990d307d2ed5316a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 16:41:51 +0200 Subject: [PATCH 01/10] NEW print / send email form in takepos --- htdocs/takepos/invoice.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 17805a6b060..fab81c5f3c2 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -399,10 +399,12 @@ if ($action=="valid" || $action=="history") else $sectionwithinvoicelink.=$langs->trans('BillShortStatusValidated'); } $sectionwithinvoicelink.=''; + if ($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) { if ($conf->global->TAKEPOSCONNECTOR) $sectionwithinvoicelink.=' '; else $sectionwithinvoicelink.=' '; - if ($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) $sectionwithinvoicelink.=''; -} + $sectionwithinvoicelink.=' '; + $sectionwithinvoicelink.=''; + } else $sectionwithinvoicelink.=' ';} /* From cf1a029b436b4489884b51ac8f2dfc9a1d0c9029 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 16:46:04 +0200 Subject: [PATCH 02/10] Update invoice.php --- htdocs/takepos/invoice.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index fab81c5f3c2..5ab6ee4bfd4 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -404,8 +404,9 @@ if ($action=="valid" || $action=="history") else $sectionwithinvoicelink.=' '; $sectionwithinvoicelink.=' '; $sectionwithinvoicelink.=''; - } else $sectionwithinvoicelink.=' ';} - + } else { $sectionwithinvoicelink.=' '; + $sectionwithinvoicelink.=''; + } /* * View @@ -488,6 +489,12 @@ if ($action == "search") { ?> }); + +function PrintSend(id) +{ + console.log("Open box to select the Print/Send form"); + $.colorbox({href:"printsend.php?facid="+id, width:"90%", height:"80%", transition:"none", iframe:"true", title:"trans("PrintSend");?>"}); +} function Print(id){ $.colorbox({href:"receipt.php?facid="+id, width:"40%", height:"90%", transition:"none", iframe:"true", title:" Date: Sat, 24 Aug 2019 16:58:39 +0200 Subject: [PATCH 03/10] Update invoice.php --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 5ab6ee4bfd4..3f97f45d40c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -493,7 +493,7 @@ if ($action == "search") { function PrintSend(id) { console.log("Open box to select the Print/Send form"); - $.colorbox({href:"printsend.php?facid="+id, width:"90%", height:"80%", transition:"none", iframe:"true", title:"trans("PrintSend");?>"}); + $.colorbox({href:"printsend.php?facid="+id, width:"90%", height:"50%", transition:"none", iframe:"true", title:"trans("PrintSend");?>"}); } function Print(id){ From bc93a8b4b1c2ccbe65e85872735a4b8ae8af6c55 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 17:18:43 +0200 Subject: [PATCH 04/10] Create printsend.php --- htdocs/takepos/printsend.php | 152 +++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 htdocs/takepos/printsend.php diff --git a/htdocs/takepos/printsend.php b/htdocs/takepos/printsend.php new file mode 100644 index 00000000000..3208721c95a --- /dev/null +++ b/htdocs/takepos/printsend.php @@ -0,0 +1,152 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/printsend.php + * \ingroup takepos + * \brief Page with the content of the popup to enter payments + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +require '../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + +$invoiceid = GETPOST('facid', 'int'); + +/* + * View + */ + +$invoice = new Facture($db); +if ($invoiceid > 0) +{ + $invoice->fetch($invoiceid); +} +else +{ + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) + { + $invoiceid = $obj->rowid; + } + if (! $invoiceid) + { + $invoiceid=0; // Invoice does not exist yet + } + else + { + $invoice->fetch($invoiceid); + } +} + +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + +$langs->loadLangs(array("main", "bills", "cashdesk")); + +?> + + + + + + +
+
+
+
+
+ +
+ + + + + +
+ + + From 3a4ba0c4018f2230967969d77a399faa6bdb09a5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 17:29:48 +0200 Subject: [PATCH 05/10] Update printsend.php --- htdocs/takepos/printsend.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/printsend.php b/htdocs/takepos/printsend.php index 3208721c95a..ff97c1cc51c 100644 --- a/htdocs/takepos/printsend.php +++ b/htdocs/takepos/printsend.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2019 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -131,6 +131,12 @@ else print "var received=0;"; } } } + +function Print(id){ + $.colorbox.close(); + $.colorbox({href:"receipt.php?facid="+id, width:"40%", height:"90%", transition:"none", iframe:"true", title:"trans("PrintTicket"); ?>"}); +} @@ -140,11 +146,11 @@ else print "var received=0;"; -
+
- - + +
From add28f10db02fc7065482839039180fdc2159b8a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 24 Aug 2019 17:37:50 +0200 Subject: [PATCH 06/10] Update invoice.php --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3f97f45d40c..a1882b1964b 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -403,9 +403,9 @@ if ($action=="valid" || $action=="history") if ($conf->global->TAKEPOSCONNECTOR) $sectionwithinvoicelink.=' '; else $sectionwithinvoicelink.=' '; $sectionwithinvoicelink.=' '; - $sectionwithinvoicelink.=''; + if ($invoice->paye) $sectionwithinvoicelink.=''; } else { $sectionwithinvoicelink.=' '; - $sectionwithinvoicelink.=''; + if ($invoice->paye) $sectionwithinvoicelink.=''; } /* From ca5a3da04c287e5bc4801e6237e1869bec46569a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 11 Sep 2019 15:04:13 +0200 Subject: [PATCH 07/10] Update printsend.php --- htdocs/takepos/printsend.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/takepos/printsend.php b/htdocs/takepos/printsend.php index ff97c1cc51c..6a2b672cf60 100644 --- a/htdocs/takepos/printsend.php +++ b/htdocs/takepos/printsend.php @@ -65,8 +65,6 @@ else } } -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - $langs->loadLangs(array("main", "bills", "cashdesk")); ?> From 21c51eb3d22f128a43da1afd609d3965073a191a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 15 Sep 2019 21:01:29 +0200 Subject: [PATCH 08/10] Update invoice.php --- htdocs/takepos/invoice.php | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a1882b1964b..8512beee2ee 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -698,9 +698,52 @@ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takep $soc = new Societe($db); if ($invoice->socid > 0) $soc->fetch($invoice->socid); else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}); - print '

'; + print '

'; print $langs->trans("Customer").': '.$soc->name; + + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; + if (! empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") + { + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; + $warehouse = new Entrepot($db); + $warehouse->fetch($conf->global->$constantforkey); + print '
'.$langs->trans("Warehouse").': '.$warehouse->ref; + } print '

'; + + // Module Adherent + if (! empty($conf->adherent->enabled)) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $langs->load("members"); + print '

'; + print $langs->trans("Member").': '; + $adh=new Adherent($db); + $result=$adh->fetch('', '', $invoice->socid); + if ($result > 0) + { + $adh->ref=$adh->getFullName($langs); + print $adh->getFullName($langs); + print '
'.$langs->trans("Type").': '.$adh->type; + if ($adh->datefin) + { + print '
'.$langs->trans("SubscriptionEndDate").': '.dol_print_date($adh->datefin, 'day'); + if ($adh->hasDelay()) { + print " ".img_warning($langs->trans("Late")); + } + } + else + { + print $langs->trans("SubscriptionNotReceived"); + if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated + } + } + else + { + print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; + } + print '

'; + } } if ($action == "search") From 6ff13ab7e1679cfa6996cf12687503791c4e8c5f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 23 Oct 2019 22:03:43 +0200 Subject: [PATCH 09/10] Update invoice.php --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ca119b85791..7ea78438bfe 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -439,7 +439,7 @@ if ($action=="valid" || $action=="history") else $sectionwithinvoicelink.=$langs->trans('BillShortStatusValidated'); } $sectionwithinvoicelink.=''; - if ($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) { + if ($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) $sectionwithinvoicelink.=''; if ($conf->global->TAKEPOSCONNECTOR) $sectionwithinvoicelink.=' '; else $sectionwithinvoicelink.=' '; $sectionwithinvoicelink.=' '; From 0e7f3c307eb3899b2db5094102caa563bb236882 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 23 Oct 2019 20:05:37 +0000 Subject: [PATCH 10/10] Fixing style errors. --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 7ea78438bfe..9ed6529c222 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -444,9 +444,9 @@ if ($action=="valid" || $action=="history") else $sectionwithinvoicelink.=' '; $sectionwithinvoicelink.=' '; if ($invoice->paye) $sectionwithinvoicelink.=''; - } else { $sectionwithinvoicelink.=' '; +} else { $sectionwithinvoicelink.=' '; if ($invoice->paye) $sectionwithinvoicelink.=''; - } +} /* * View