From 9e26f5a98e7ef01bfd9026d2782f5aceeea64437 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 11 Jun 2025 12:45:15 +0200 Subject: [PATCH] Debug v22 --- htdocs/commande/class/commande.class.php | 1 + htdocs/commande/list.php | 126 +++++++++++++----- htdocs/compta/facture/class/facture.class.php | 28 +--- htdocs/compta/facture/list.php | 50 +++---- htdocs/core/class/commoninvoice.class.php | 20 +++ 5 files changed, 144 insertions(+), 81 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index cbf6dc69a65..877f6607f88 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -292,6 +292,7 @@ class Commande extends CommonOrder * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. + * 'langfile' the key of the language file for translation. * 'enabled' is a condition when the field must be managed. * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e9cb4a09ac2..34f3c89256e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -74,7 +74,7 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'orderlist'; $optioncss = GETPOST('optioncss', 'alpha'); -$mode = GETPOST('mode', 'alpha'); +$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) if (getDolGlobalInt('MAIN_SEE_SUBORDINATES')) { $userschilds = $user->getAllChildIds(); @@ -200,14 +200,14 @@ if (empty($user->socid)) { $fieldstosearchall["c.note_private"] = "NotePrivate"; } -$checkedtypetiers = 0; +$checkedtypetiers = '0'; $arrayfields = array( 'c.rowid' => array('label' => "ID", 'checked' => '1', 'enabled' => (string) getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID'), 'position' => 1), 'c.ref' => array('label' => "Ref", 'checked' => '1', 'position' => 5, 'searchall' => 1), 'c.ref_ext' => array('label' => "RefExt", 'checked' => '1', 'position' => 5, 'visible' => 0, 'searchall' => 1), 'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => '-1', 'position' => 10, 'searchall' => 1), - 'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 20), - 'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 25), + 'p.ref' => array('label' => "ProjectRef", 'langfile' => 'projects', 'checked' => '-1', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 20), + 'p.title' => array('label' => "ProjectLabel", 'langfile' => 'projects', 'checked' => '0', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 25), 's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30, 'searchall' => 1), 's.name_alias' => array('label' => "AliasNameShort", 'checked' => '-1', 'position' => 31, 'searchall' => 1), 's2.nom' => array('label' => 'ParentCompany', 'position' => 32, 'checked' => '0'), @@ -222,10 +222,12 @@ $arrayfields = array( 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '-1', 'position' => 67), 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '-1', 'position' => 68), 'c.fk_input_reason' => array('label' => "Origin", 'checked' => '-1', 'position' => 69), + 'c.module_source' => array('label' => "POSModule", 'langfile' => 'cashdesk', 'checked' => ($contextpage == 'poslist' ? '1' : '0'), 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('ORDER_SHOW_POS'))", 'position' => 90), + 'c.pos_source' => array('label' => "POSTerminal", 'langfile' => 'cashdesk', 'checked' => ($contextpage == 'poslist' ? '1' : '0'), 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('ORDER_SHOW_POS'))", 'position' => 91), 'c.total_ht' => array('label' => "AmountHT", 'checked' => '1', 'position' => 75), 'c.total_vat' => array('label' => "AmountVAT", 'checked' => '0', 'position' => 80), 'c.total_ttc' => array('label' => "AmountTTC", 'checked' => '0', 'position' => 85), - 'c.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 90), + 'c.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 92), 'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 95), 'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 100), 'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 105), @@ -317,6 +319,8 @@ if (empty($reshook)) { $search_company = ''; $search_company_alias = ''; $search_parent_name = ''; + $search_module_source = ''; + $search_pos_source = ''; $search_town = ''; $search_zip = ""; $search_state = ""; @@ -915,10 +919,11 @@ $sql .= ' c.rowid, c.ref, c.ref_ext, c.total_ht, c.total_tva, c.total_ttc, c.ref $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,'; $sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as delivery_date, c.fk_statut, c.facture as billed,'; $sql .= ' c.date_creation as date_creation, c.tms as date_modification, c.date_cloture as date_cloture,'; -$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,'; -$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,'; $sql .= ' c.fk_cond_reglement,c.deposit_percent,c.fk_mode_reglement,c.fk_shipping_method,'; -$sql .= ' c.fk_input_reason, c.import_key'; +$sql .= ' c.fk_input_reason, c.import_key,'; +$sql .= " c.module_source, c.pos_source,"; +$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,'; +$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -980,9 +985,6 @@ if ($search_ref_ext) { if ($search_ref_customer) { $sql .= natural_search('c.ref_client', $search_ref_customer); } -if ($search_all) { - $sql .= natural_search(array_keys($fieldstosearchall), $search_all); -} if ($search_billed != '' && $search_billed >= 0) { $sql .= ' AND c.facture = '.((int) $search_billed); } @@ -1107,6 +1109,12 @@ if ($search_fk_mode_reglement > 0) { if ($search_fk_input_reason > 0) { $sql .= " AND c.fk_input_reason = ".((int) $search_fk_input_reason); } +if ($search_module_source) { + $sql .= natural_search("c.module_source", $search_module_source); +} +if ($search_pos_source) { + $sql .= natural_search("c.pos_source", $search_pos_source); +} if ($search_import_key) { $sql .= natural_search("s.import_key", $search_import_key); } @@ -1116,7 +1124,7 @@ if ($search_user > 0) { $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; - $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal'"; + $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element = 'commande' AND tc.source = 'internal'"; $sql .= " WHERE ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } // Search on sale representative @@ -1194,6 +1202,10 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} + // Add HAVING from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1214,13 +1226,14 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } $db->free($resql); } +// Complete request and execute it with limit $sql .= $db->order($sortfield, $sortorder); if ($limit) { $sql .= $db->plimit($limit + 1, $offset); @@ -1428,6 +1441,12 @@ if ($search_fk_mode_reglement > 0) { if ($search_fk_input_reason > 0) { $param .= '&search_fk_input_reason='.urlencode((string) ($search_fk_input_reason)); } +if ($search_module_source) { + $param .= '&search_module_source='.urlencode($search_module_source); +} +if ($search_pos_source) { + $param .= '&search_pos_source='.urlencode($search_pos_source); +} if ($search_import_key != '') { $param .= '&search_import_key='.urlencode($search_import_key); } @@ -1482,7 +1501,7 @@ $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', (int) (($contextpage == 'orderlist' || $contextpage == 'billableorders') && $permissiontoadd)); // Lines of title fields -print '
'."\n"; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -1653,7 +1672,7 @@ print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; @@ -1669,13 +1688,13 @@ if (!empty($arrayfields['c.rowid']['checked'])) { // Ref if (!empty($arrayfields['c.ref']['checked'])) { print ''; } // Ref ext if (!empty($arrayfields['c.ref_ext']['checked'])) { print ''; } // Ref customer @@ -1688,20 +1707,20 @@ if (!empty($arrayfields['c.ref_client']['checked'])) { if (!empty($arrayfields['p.ref']['checked'])) { print ''; } -// Project title +// Project label if (!empty($arrayfields['p.title']['checked'])) { print ''; } -// Thirpdarty +// Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { - print ''; } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; } // Parent company @@ -1712,16 +1731,16 @@ if (!empty($arrayfields['s2.nom']['checked'])) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; + print ''; } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; + print ''; } // State if (!empty($arrayfields['state.nom']['checked'])) { print ''; } // Country @@ -1781,6 +1800,18 @@ if (!empty($arrayfields['c.fk_input_reason']['checked'])) { $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1); print ''; } +// Module source +if (!empty($arrayfields['c.module_source']['checked'])) { + print ''; +} +// POS Terminal +if (!empty($arrayfields['c.pos_source']['checked'])) { + print ''; +} // Amount HT / net if (!empty($arrayfields['c.total_ht']['checked'])) { print ''; } -// Date cloture +// Date closing if (!empty($arrayfields['c.date_cloture']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2537,9 +2578,28 @@ while ($i < $imaxinloop) { } } + // Module Source + if (!empty($arrayfields['c.module_source']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // POS Terminal + if (!empty($arrayfields['c.pos_source']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount HT/net if (!empty($arrayfields['c.total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 28af6c49164..df1f66636a1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -147,31 +147,6 @@ class Facture extends CommonInvoice */ public $ref_customer; - /** - * @var float - */ - public $total_ht; - /** - * @var float - */ - public $total_tva; - /** - * @var float - */ - public $total_localtax1; - /** - * @var float - */ - public $total_localtax2; - /** - * @var float - */ - public $total_ttc; - /** - * @var float - */ - public $revenuestamp; - /** * @var float|string */ @@ -191,6 +166,7 @@ class Facture extends CommonInvoice * @var ?string key of POS terminal ('0', '1', ...) */ public $pos_source; + /** * @var int id of template invoice when generated from a template invoice */ @@ -466,6 +442,8 @@ class Facture extends CommonInvoice $this->ismultientitymanaged = 1; $this->isextrafieldmanaged = 1; + + $this->fields['ref_ext']['visible'] = getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT'); } /** diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index e073a084dcf..288cb02876e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -77,10 +77,7 @@ $langs->loadLangs(array('bills', 'companies', 'products', 'categories')); $search_all = trim(GETPOST('search_all', 'alphanohtml')); -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility -$ref = GETPOST('ref', 'alpha'); -$socid = GETPOSTINT('socid'); - +// Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOSTINT('show_files'); @@ -94,6 +91,10 @@ if ($contextpage == 'poslist') { $optioncss = 'print'; } +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$socid = GETPOSTINT('socid'); + $userid = GETPOSTINT('userid'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); @@ -178,8 +179,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; if (!$sortorder && getDolGlobalString('INVOICE_DEFAULT_UNPAYED_SORT_ORDER') && $search_status == '1') { $sortorder = getDolGlobalString('INVOICE_DEFAULT_UNPAYED_SORT_ORDER'); @@ -786,7 +788,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; // Add table from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' WHERE f.fk_soc = s.rowid'; @@ -986,7 +988,7 @@ if ($search_user > 0) { $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; - $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal'"; + $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element = 'facture' AND tc.source = 'internal'"; $sql .= " WHERE ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } // Search on sale representative @@ -1089,7 +1091,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -1134,8 +1136,7 @@ if ($search_fk_fac_rec_source) { print dol_get_fiche_head($head, 'generated', $langs->trans('InvoicesGeneratedFromRec'), -1, 'bill'); // Add a div } - -$param = '&socid='.urlencode((string) ($socid)); +$param = ''; if (!empty($mode)) { $param .= '&mode='.urlencode($mode); } @@ -1154,6 +1155,9 @@ if ($show_files) { if ($search_all) { $param .= '&search_all='.urlencode($search_all); } +if ($socid > 0) { + $param .= '&socid='.((int) $socid); +} if ($search_date_startday) { $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } @@ -1376,6 +1380,7 @@ if ($contextpage != 'poslist') { $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->hasRight("facture", "creer")); } +// Lines of title fields $i = 0; print ''."\n"; if ($optioncss != '') { @@ -1432,7 +1437,7 @@ if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200'); $moreforfilter .= ''; } -// If the user can view prospects other than his' +// If the user can view other users if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); @@ -1729,7 +1734,7 @@ if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { // Amount print '
'; } if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { @@ -2023,7 +2028,7 @@ if (!empty($arrayfields['total_mark_rate']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => $totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { @@ -2061,7 +2066,7 @@ if (!empty($arrayfields['f.fk_statut']['checked'])) { $totalarray['nbfield']++; } if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch center '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center '); $totalarray['nbfield']++; } @@ -2376,7 +2381,7 @@ if ($num > 0) { } } - // Project title + // Project label if (!empty($arrayfields['p.title']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2451,7 +2456,7 @@ if ($num > 0) { // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2468,7 +2473,7 @@ if ($num > 0) { if (!empty($arrayfields['country.code_iso']['checked'])) { $tmparray = getCountry($obj->fk_pays, 'all'); print ''; if (!$i) { $totalarray['nbfield']++; @@ -2479,7 +2484,7 @@ if ($num > 0) { if (!is_array($typenArray) || count($typenArray) == 0) { $typenArray = $formcompany->typent_array(1); } - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -2928,7 +2932,7 @@ if ($num > 0) { } } - print ''."\n"; + print "\n"; } $i++; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 35fbcdd8d80..8355f1c2f29 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -111,6 +111,26 @@ abstract class CommonInvoice extends CommonObject */ public $mode_reglement; + /** + * @var float + */ + public $total_ht; + /** + * @var float + */ + public $total_tva; + /** + * @var float + */ + public $total_localtax1; + /** + * @var float + */ + public $total_localtax2; + /** + * @var float + */ + public $total_ttc; /** * @var float */
'; + print ''; $searchpicto = $form->showFilterButtons('left'); print $searchpicto; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print 'socid) ? " disabled" : "").'>'; + print ''; + print 'socid) ? " disabled" : "").'>'; print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; + print ''; + print ''; + print ''; + print ''; @@ -1866,7 +1897,7 @@ if (!empty($arrayfields['c.tms']['checked'])) { print ''; print ''; print '
'; @@ -2050,6 +2081,14 @@ if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print_liste_field_titre($arrayfields['c.fk_input_reason']['label'], $_SERVER["PHP_SELF"], "c.fk_input_reason", "", $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; } +if (!empty($arrayfields['c.module_source']['checked'])) { + print_liste_field_titre($arrayfields['c.module_source']['label'], $_SERVER["PHP_SELF"], "f.module_source", "", $param, "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['c.pos_source']['checked'])) { + print_liste_field_titre($arrayfields['c.pos_source']['label'], $_SERVER["PHP_SELF"], "f.pos_source", "", $param, "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} if (!empty($arrayfields['c.total_ht']['checked'])) { print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; @@ -2344,7 +2383,7 @@ while ($i < $imaxinloop) { // Project ref if (!empty($arrayfields['p.ref']['checked'])) { - print '
'; + print ''; if ($obj->project_id > 0) { print $projectstatic->getNomUrl(1); } @@ -2356,7 +2395,7 @@ while ($i < $imaxinloop) { // Project label if (!empty($arrayfields['p.title']['checked'])) { - print ''; + print ''; if ($obj->project_id > 0) { print $projectstatic->title; } @@ -2462,11 +2501,13 @@ while ($i < $imaxinloop) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - if (empty($typenArray)) { + if (!is_array($typenArray) || count($typenArray) == 0) { $typenArray = $formcompany->typent_array(1); } - print $typenArray[$obj->typent_code] ?? ''; + print ''; + if (!empty($obj->typent_code)) { + print $typenArray[$obj->typent_code]; + } print ''; + print dol_escape_htmltag($obj->module_source); + print ''; + print dol_escape_htmltag($obj->pos_source); + print ''.price($obj->total_ht)."'.price($obj->total_ht)."'; - print ''; + print ''; print ''; if ($obj->project_id > 0) { @@ -2401,7 +2406,7 @@ if ($num > 0) { $totalarray['nbfield']++; } } - // Alias + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; print dol_escape_htmltag($companystatic->name_alias); @@ -2442,7 +2447,7 @@ if ($num > 0) { // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; - print dol_escape_htmltag($obj->town); + print dolPrintLabel($obj->town); print ''; - print dol_escape_htmltag($obj->zip); + print dolPrintLabel($obj->zip); print ''; - print dol_escape_htmltag($tmparray['label']); + print dolPrintLabel($tmparray['label']); print ''; + print ''; if (!empty($obj->typent_code)) { print $typenArray[$obj->typent_code]; } @@ -2542,7 +2547,6 @@ if ($num > 0) { $totalarray['nbfield']++; } } - // POS Terminal if (!empty($arrayfields['f.pos_source']['checked'])) { print ''; @@ -2555,7 +2559,7 @@ if ($num > 0) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."'.price($obj->total_ht)."