From 5e4f1678157be213dc165cf0a2daa734c104dc71 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 16 Jun 2025 23:49:56 +0200 Subject: [PATCH] Debug v22 - missing module_source in view mode of card --- htdocs/commande/card.php | 44 ++++++++++++++++++++---- htdocs/commande/class/commande.class.php | 5 +-- htdocs/commande/list.php | 4 +-- htdocs/compta/facture/card.php | 1 + 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2248ea4de08..cb9a9c7fd8f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -676,6 +676,14 @@ if (empty($reshook)) { if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } + } elseif ($action == 'setposinfo' && $usercancreate) { + $object->fetch($id); + $object->module_source = GETPOST('posmodule'); + $object->pos_source = GETPOST('posterminal'); + $result = $object->update($user); + if ($result < 0) { + dol_print_error($db, $object->error); + } } elseif ($action == 'setmulticurrencycode' && $usercancreate) { // Multicurrency Code $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); @@ -2823,16 +2831,12 @@ if ($action == 'create' && $usercancreate) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); } - /* - * Confirmation de la cloture - */ + // Confirmation of closing if ($action == 'shipped') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1); } - /* - * Confirmation de l'annulation - */ + // Confirmation of cancellation if ($action == 'cancel') { $qualified_for_stock_change = 0; if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { @@ -2967,6 +2971,34 @@ if ($action == 'create' && $usercancreate) { print ''; + // POS + if (isModEnabled('takepos') || $object->module_source || getDolGlobalString('ORDER_ALLOW_POS_SOURCE_EDIT')) { + $langs->trans("cashdesk"); + print ''; + } + if ($soc->outstanding_limit) { // Outstanding Bill print '
'; + print ''; + if ($action != 'editposinfo' && $object->status == $object::STATUS_DRAFT && $usercancreate) { + print ''; + } + print '
'; + print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo')); + print 'id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'
'; + print '
'; + print '
'; + print ''; + print ''; + if ($action == 'editposinfo') { + print ' '; + print ''; + print ''; + } else { + if ($object->module_source) { + print ''.dolPrintHTML(ucfirst($object->module_source).' - '.$langs->transnoentitiesnoconv("Terminal").' '.$object->pos_source).''; + } + } + print '
'; + print '
'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 877f6607f88..b91dbe00811 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3423,8 +3423,9 @@ class Commande extends CommonOrder $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").","; - $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); - + $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").","; + $sql .= " module_source = ".(isset($this->module_source) ? "'".$this->db->escape($this->module_source)."'" : "null").","; + $sql .= " pos_source = ".(isset($this->pos_source) ? "'".$this->db->escape($this->pos_source)."'" : "null"); $sql .= " WHERE rowid=".((int) $this->id); $this->db->begin(); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 77a6707f5e6..8e3c4e86e14 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2216,11 +2216,11 @@ if (!empty($arrayfields['c.date_cloture']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['c.note_public']['checked'])) { - print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, ''); $totalarray['nbfield']++; } if (!empty($arrayfields['c.note_private']['checked'])) { - print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, ''); $totalarray['nbfield']++; } if (!empty($arrayfields['shippable']['checked'])) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 33470a48d17..0f6fdbe2a7f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5230,6 +5230,7 @@ if ($action == 'create') { // POS if (isModEnabled('takepos') || $object->module_source || getDolGlobalString('INVOICE_ALLOW_POS_SOURCE_EDIT')) { + $langs->trans("cashdesk"); print '
'; print '
'; print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));