diff --git a/ChangeLog b/ChangeLog index 4adf6192acd..ceb1d847ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,173 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 8.0.0 compared to 7.0.3 ***** +***** ChangeLog for 8.0.0 compared to 7.0.0 ***** + +For Users: +NEW: Experimental module: Ticket +NEW: Experimental module: WebDAV +NEW: Accept anonmymous events (no user assigned) +NEW: Accountancy - Add import on general ledger +NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin) +NEW: Can create event from record card of a company and member +NEW: Add a button to create Stripe customer from the Payment mode tab +NEW: Add accounting account number on product tooltip +NEW: add any predefined mail content +NEW: Add arrows to navigate into containers in website module +NEW: Add a tab to specify accountant/auditor of the company +NEW: Add Date delivery and Availability on Propals List +NEW: Add date in goods reception supplier order table +NEW: Add delivery_time_days of suppliers in export profile +NEW: Add Docments'tab to expedition module +NEW: Use dol_print_phone in thirdparty list page to format phone +NEW: Add entry for the GDPR contact +NEW: Add extrafield type "html" +NEW: Add file number in accountant card and update export filename +NEW: Add files management on products lot +NEW: add filter on project task list +NEW: Add hidden option COMPANY_AQUARIUM_CLEAN_REGEX to clean generated +NEW: add internal stripe payment page for invoice +NEW: Add key __USER_REMOTE_IP__ into available substitution variables +NEW: Add link between credit note invoice and origin +NEW: Add linked file tab to vat +NEW: add link to stripe's info in bank menu +NEW: Add margin filters +NEW: Add mass action enable/disable on cron job list +NEW: Add mass action on project's list to close projects +NEW: Add method to register distributed payments on invoices +NEW: Add multicurrency support for product buy price for supplier propales, orders and invoices +NEW: Add name of day in the timesheet input page per day. +NEW: add new parameters for tcpf encryption +NEW: add optional esign field in pdf propal +NEW: Add option BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD +NEW: Add option CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES +NEW: Add param $dolibarr_main_restrict_ip in config file to limit ips +NEW: add pdf function to check if pdf file is protected/encrypted +NEW: Add pdf template for stock/warehouse module +NEW: Add phone format for a lot of countries +NEW: Add product and product categories filters on customer margins +NEW: Add product categories filter on product margin +NEW: Add romanian chart of accounts +NEW: Add stats in salaries module +NEW: add stripe transaction +NEW: Add tab contact on supplier proposals +NEW: Add total of time spent in timespent page at top of page too. +NEW: Add trigger CONTRACT_MODIFY +NEW: Add triggers on ECM object and add fill src_object_type/id fields +NEW: Add type of website container/page into dictionary +NEW: advance target filtering can be used everywhere with tpl and fk_element +NEW: Allow negative quantity for dispatch (supplier order) +NEW: bank reconcile: checkbox to select all bank operations +NEW: Better performance with openldap +NEW: Can add filter actiontype and notactiontype on event ical export +NEW: Can add product in supplier order/invoice even w/o predefined price +NEW: cancel orders on massaction +NEW: Can crop image files attached in "document" tabs of a member +NEW: Can delete dir content in media and ECM module recursively +NEW: Can dispatch if more than ordered (if hidden option set) +NEW: Can edit the text color for title line of tables +NEW: Can enter time spent from the list of time spent of project +NEW: Can export leave requests +NEW: Can filter on account range in general ledger grouped by account +NEW: Can filter on country and taxid into the binding page +NEW: Can filter on progression in timesheet +NEW: Can fix the bank account of a payment if payment not conciliated +NEW: Can force usage of shared link for photo of products +NEW: Can get template of email from its label +NEW: Can see Unit Purchase Value of product in stock movement +NEW: Can select from the user list into send form email (For field to and CC) +NEW: Can select sample to use when creating a new page +NEW: can send mail from project card +NEW: Can set position of images in module tickets +NEW: Can set the reply-to into email sent +NEW: Can set the start/end date of service line in invoice templates +NEW: Can share any file from the "Document" tab. +NEW: Can sort on priority in task scheduler list +NEW: Can sort order of files in attach tab for leave and expensereport +NEW: Can use setValueFrom without user modification field +NEW: Cat set the encryption algorithm for extrafields of type password +NEW: check idprof1 for country pt +NEW: default add action: new param $backurlforcard to redirect to card +NEW: default warehouse field for products + prefill warehouses when dispatching supplier orders +NEW: Display price HT on all commercial area boards +NEW: display total on contract service list +NEW: display weight volume in proposal +NEW: Edit of extrafields position page on the edit form +NEW: Experimental DAV module provides a public and private directory +NEW: export filter models can be share or not by user +NEW: Externalsite module can accept iframe content. +NEW: Filter export model is now by user +NEW: Finish implementation of option PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES +NEW: generalize use of button to create new element from list +NEW: hidden conf AGENDA_NB_WEEKS_IN_VIEW_PER_USER to set nb weeks to show into per user view +NEW: hidden conf to assign category to thirparty that are not customer nor prospect nor supplier +NEW: hidden conf to set nb weeks to show into user view +NEW: hidden option MAIN_DISABLE_FREE_LINES +NEW: improve way of adding users/sales representative to thirdparty +NEW: Introduce option THIRDPARTY_QUICKSEARCH_ON_FIELDS to personalize fields use to search on quick search. +NEW: Introduce permission "approve" for "leave request" like for "expense report" +NEW: Load product data optional fields to the line -> enables to use "line_options_{extrafield}" +NEW: Look and feel v8 - Show Picto "+" on all links "Add record" +NEW: Look and feel v8: Use a different picto for delete and unlink +NEW: mail templates for projects +NEW: Module variant supported on services +NEW: monthly VAT report show "Claimed for the period" + "Paid during this +NEW: Mutualize code for action="update_extras" +NEW: On invoice card, show accounting account linked +NEW: Online payment of invoice and subscription record the payment +NEW: OnSearchAndListGoOnCustomerOrSupplierCard conf +NEW: Optimize load of hooks classes (save 1-5Kb of memory) +NEW: Option MAIN_SHOW_REGION_IN_STATE renamed into MAIN_SHOW_REGION_IN_STATE_SELECT are more complete +NEW: Option to force all emails recipient +NEW: Hidden option to send to salaries into emails forms +NEW: order minimum amount +NEW: add price in burger menu on mouvement list +NEW: Report a list of leave requests for a month +NEW: Section of files generated by mass action not visible if empty +NEW: send mails from project card +NEW: Show also size in bytes in tooltip if visible unit is not bytes +NEW: Show keyboard shortcut of nav arrow into tooltip +NEW: Show last result code of cron jobs in error in red +NEW: Show region in company info & Global option to show state code MAIN_SHOW_STATE_CODE +NEW: Show total number of records by category +NEW: Show total of time consumed in week in time spent entry page +NEW: Stripe online payments reuse the same stripe customer account +NEW: Suggest link to pay online for customer orders +NEW: supplier credit notes is now supported like for customer credit notes +NEW: supplier order/order lines export: add supplier product ref +NEW: supplier relative discounts +NEW: Support alternative aliases of page name in website +NEW: syslog file autoclean +NEW: thirdparty categ filter on lists +NEW: Use a css style for weekend in time spent +NEW: Use common substitution rule for language to get translation in ODT +NEW: Variable __ONLINE_PAYMENT_URL__ available in email templates + +For developers: +NEW: class reposition can also work on POST (not only GET) +NEW: add a hook in dol_print_phone +NEW: The field "visible" on extrafield can accept expression as condition +NEW: Upgrade of Stripe lib to 6.4.1 +NEW: work on CommonObject 'array' field typeNew common object array +NEW: method Form::selectArrayFilter() + use in left menu search +NEW: [REST API] Add the possibility to remove a category from a thirdparty +NEW: doActions on categorycard +NEW: add "moreHtmlRef" hook +NEW: add hook for more permissions control +NEW: add hook moreHtmlStatus to complete to status on banners +NEW: Add hook printEmail +NEW: Add hook setContentSecurityPolicy +NEW: Add password_hash as a hash algorithm +NEW: Add dol_is_link function +NEW: Adds a contact to an invoice with REST API +NEW: Adds a payment for the list of invoices given as parameter +NEW: adds billing contacts ids to REST API returns +NEW: Add showempty parameter in country selection +NEW: add printUserListWhere hook +NEW: add "printUserPasswordField" hooks +NEW: Call to trigger on payment social contribution creation +NEW: Call to trigger on social contribution creation +NEW: hook getnomurltooltip is replaced with hook getNomUrl more powerfull WARNING: @@ -24,6 +190,8 @@ Following changes may create regressions for some external modules, but were nec * Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip are now replaced with hook getNomUrl. + + ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters FIX: #8722 diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 457f03c6afc..d5835f96781 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1290,7 +1290,7 @@ if (empty($reshook)) { $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); $descline = $langs->trans('Deposit'); - $descline.= ' - '.$langs->trans($arraylist[$typeamount]); + //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount=='amount') { $descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; } elseif ($typeamount=='variable') { @@ -2873,7 +2873,7 @@ if ($action == 'create') if (($origin == 'propal') || ($origin == 'commande')) { print ''; - $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); + $arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount'), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit'))); print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); print ''; print '' . $langs->trans('Value') . ':'; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 3b59e46219a..7a260e6dbc6 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -394,6 +394,7 @@ PaymentConditionShort14DENDMONTH=14 days of month-end PaymentCondition14DENDMONTH=Within 14 days following the end of the month FixAmount=Fix amount VarAmount=Variable amount (%% tot.) +VarAmountOneLine=Variable amount (%% tot.) - 1 line with label '%s' # PaymentType PaymentTypeVIR=Bank transfer PaymentTypeShortVIR=Bank transfer diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 58ec2ac4079..77941d940df 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -48,11 +48,13 @@ $hookmanager->initHooks(array('productstatsorder')); $mesg = ''; +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; @@ -111,7 +113,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - show_stats_for_company($product,$socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -141,24 +143,21 @@ if ($id > 0 || ! empty($ref)) $sql.= ' AND YEAR(c.date_commande) IN (' . $search_year . ')'; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND c.fk_soc = ".$socid; - $sql.= " ORDER BY $sortfield $sortorder "; + $sql.= $db->order($sortfield, $sortorder); //Calcul total qty and amount for global if full scan list $total_ht=0; $total_qty=0; - $totalrecords=0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { - $totalrecords = $db->num_rows($result); - while ($objp = $db->fetch_object($result)) { - $total_ht+=$objp->total_ht; - $total_qty+=$objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql.= $db->plimit($conf->liste_limit +1, $offset); + $sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -171,6 +170,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month='.$search_month; if (! empty($search_year)) $option .= '&search_year='.$search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '
' . "\n"; if (! empty($sortfield)) @@ -182,7 +182,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("CustomersOrders"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,$totalrecords,''); + print_barre_liste($langs->trans("CustomersOrders"), $page, $_SERVER["PHP_SELF"], "&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period').' ('.$langs->trans("OrderDate") .') - '; @@ -210,18 +210,22 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); + $total_ht+=$objp->total_ht; + $total_qty+=$objp->qty; + + $orderstatic->id=$objp->commandeid; + $orderstatic->ref=$objp->ref; + $orderstatic->ref_client=$objp->ref_client; + $societestatic->fetch($objp->socid); + print ''; print ''; - $orderstatic->id=$objp->commandeid; - $orderstatic->ref=$objp->ref; - $orderstatic->ref_client=$objp->ref_client; print $orderstatic->getNomUrl(1); print "\n"; - $societestatic->fetch($objp->socid); print ''.$societestatic->getNomUrl(1).''; print "".$objp->code_client."\n"; print ''; @@ -231,15 +235,11 @@ if ($id > 0 || ! empty($ref)) print ''.$orderstatic->LibStatut($objp->statut,$objp->facture,5).''; print "\n"; $i++; - - if (!empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht+=$objp->total_ht; - $total_qty+=$objp->qty; - } } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print ''.$total_qty.''; print ''.price($total_ht).''; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 61f44371f0c..da5c8f24911 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -118,7 +118,7 @@ if ($id > 0 || ! empty($ref)) { print '
'; print ''; - show_stats_for_company($product, $socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -152,24 +152,21 @@ if ($id > 0 || ! empty($ref)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id; if ($socid) $sql .= " AND c.fk_soc = " . $socid; - $sql .= " ORDER BY $sortfield $sortorder "; + $sql.= $db->order($sortfield, $sortorder); // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; - $totalrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { - $totalrecords = $db->num_rows($result); - while ( $objp = $db->fetch_object($result) ) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql .= $db->plimit($conf->liste_limit + 1, $offset); + $sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) { @@ -181,6 +178,7 @@ if ($id > 0 || ! empty($ref)) { $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -192,7 +190,7 @@ if ($id > 0 || ! empty($ref)) { $option .= '&page=' . $page; } - print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); + print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], "&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period') . ' (' . $langs->trans("OrderDate") . ') - '; @@ -218,19 +216,24 @@ if ($id > 0 || ! empty($ref)) { print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "c.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; - if ($num > 0) { - - while ( $i < $num && $i < $conf->liste_limit ) { + if ($num > 0) + { + while ($i < min($num, $limit)) + { $objp = $db->fetch_object($result); - print ''; - print ''; + $total_ht+=$objp->total_ht; + $total_qty+=$objp->qty; + $supplierorderstatic->id = $objp->commandeid; $supplierorderstatic->ref = $objp->ref; $supplierorderstatic->statut = $objp->statut; + $societestatic->fetch($objp->socid); + + print ''; + print ''; print $supplierorderstatic->getNomUrl(1); print "\n"; - $societestatic->fetch($objp->socid); print '' . $societestatic->getNomUrl(1) . ''; print "" . $objp->code_client . "\n"; print ''; @@ -239,16 +242,12 @@ if ($id > 0 || ! empty($ref)) { print '' . price($objp->total_ht) . "\n"; print '' . $supplierorderstatic->getLibStatut(4) . ''; print "\n"; - $i ++; - - if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } + $i++; } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print '' . $total_qty . ''; print '' . price($total_ht) . ''; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 6459856c0af..c01cbd40530 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -45,11 +45,13 @@ $hookmanager->initHooks(array('productstatscontract')); $mesg = ''; +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; @@ -101,7 +103,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - show_stats_for_company($product,$socid); + $nboflines = show_stats_for_company($product,$socid); print "
"; @@ -132,7 +134,20 @@ if ($id > 0 || ! empty($ref)) if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " GROUP BY c.rowid, c.ref, c.ref_customer, c.ref_supplier, c.date_contrat, c.statut, s.nom, s.rowid, s.code_client"; $sql.= $db->order($sortfield, $sortorder); - $sql.= $db->plimit($conf->liste_limit +1, $offset); + + //Calcul total qty and amount for global if full scan list + $total_ht=0; + $total_qty=0; + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $totalofrecords = $db->num_rows($result); + } + + $sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -144,6 +159,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -155,7 +171,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("Contrats"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("Contrats"), $page, $_SERVER["PHP_SELF"], "&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); $i = 0; print '
'; @@ -176,7 +192,7 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index a1eb69c0611..d0c75ac90b4 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -49,15 +49,18 @@ $hookmanager->initHooks(array('productstatsinvoice')); $showmessage=GETPOST('showmessage'); +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.datef"; + $search_month = GETPOST('search_month', 'aplha'); $search_year = GETPOST('search_year', 'int'); @@ -128,7 +131,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - $nboflines = show_stats_for_company($product,$socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -163,25 +166,19 @@ if ($id > 0 || ! empty($ref)) if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= $db->order($sortfield, $sortorder); - //Calcul total qty and amount for global if full scan list + // Calcul total qty and amount for global if full scan list $total_ht=0; $total_qty=0; - $totalrecords=0; + + // Count total nb of records + $totalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); - if ($result) - { - $totalrecords = $db->num_rows($result); - while ($objp = $db->fetch_object($result)) - { - $total_ht+=$objp->total_ht; - $total_qty+=$objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql.= $db->plimit($conf->liste_limit + 1, $offset); + $sql.= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -193,7 +190,8 @@ if ($id > 0 || ! empty($ref)) if (! empty($search_month)) $option .= '&search_month='.$search_month; if (! empty($search_year)) - $option .= '&search_year='.$search_year; + $option .= '&search_year='.$search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -205,7 +203,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=".$product->id,$sortfield,$sortorder,'',$num,$totalrecords,''); + print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"],"&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period').' ('.$langs->trans("DateInvoice") .') - '; @@ -233,10 +231,13 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); + $total_ht+=$objp->total_ht; + $total_qty+=$objp->qty; + $invoicestatic->id=$objp->facid; $invoicestatic->ref=$objp->facnumber; $societestatic->fetch($objp->socid); @@ -255,15 +256,11 @@ if ($id > 0 || ! empty($ref)) print ''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).''; print "\n"; $i++; - - if (!empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht+=$objp->total_ht; - $total_qty+=$objp->qty; - } } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print ''.$total_qty.''; print ''.price($total_ht).''; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index ea67553e632..fbf75377694 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -49,11 +49,13 @@ $hookmanager->initHooks(array('productstatssupplyinvoice')); $mesg = ''; +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder = "DESC"; @@ -112,7 +114,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - show_stats_for_company($product, $socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -147,19 +149,16 @@ if ($id > 0 || ! empty($ref)) // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; - $totalrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { - $totalrecords = $db->num_rows($result); - while ( $objp = $db->fetch_object($result) ) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql .= $db->plimit($conf->liste_limit + 1, $offset); + $sql.= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -172,6 +171,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -183,7 +183,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); + print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period') . ' (' . $langs->trans("DateInvoice") . ') - '; @@ -211,10 +211,13 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); + $total_ht+=$objp->total_ht; + $total_qty+=$objp->qty; + $supplierinvoicestatic->id = $objp->facid; $supplierinvoicestatic->ref = $objp->ref; $supplierinvoicestatic->ref_supplier = $objp->ref_supplier; @@ -222,12 +225,13 @@ if ($id > 0 || ! empty($ref)) $supplierinvoicestatic->total_ht = $objp->total_ht; $supplierinvoicestatic->total_ttc = $objp->total_ttc; $supplierinvoicestatic->total_tva = $objp->total_tva; + $supplierinvoicestatic->ref = $objp->facnumber; + $societestatic->fetch($objp->socid); print ''; print ''; print $supplierinvoicestatic->getNomUrl(1); print "\n"; - $societestatic->fetch($objp->socid); print '' . $societestatic->getNomUrl(1) . ''; print "" . $objp->code_client . "\n"; print ''; @@ -236,16 +240,12 @@ if ($id > 0 || ! empty($ref)) print '' . price($objp->total_ht) . "\n"; print '' . $supplierinvoicestatic->LibStatut($objp->paye, $objp->statut, 5) . ''; print "\n"; - $i ++; - - if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } + $i++; } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print '' . $total_qty . ''; print '' . price($total_ht) . ''; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 69c567508f3..80256037dfe 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -114,7 +114,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - show_stats_for_company($product, $socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -148,24 +148,21 @@ if ($id > 0 || ! empty($ref)) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id; if ($socid) $sql .= " AND p.fk_soc = " . $socid; - $sql .= " ORDER BY $sortfield $sortorder "; + $sql.= $db->order($sortfield, $sortorder); // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; - $totalrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { - $totalrecords = $db->num_rows($result); - while ( $objp = $db->fetch_object($result) ) { - $total_ht += $objp->amount; - $total_qty += $objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql .= $db->plimit($conf->liste_limit + 1, $offset); + $sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -178,6 +175,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -189,7 +187,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); + print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - '; @@ -216,18 +214,22 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - print ''; - print ''; + $total_ht+=$objp->amount; + $total_qty+=$objp->qty; + $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; $propalstatic->ref_client=$objp->ref_client; - print $propalstatic->getNomUrl(1); - print "\n"; $societestatic->fetch($objp->socid); + + print ''; + print ''; + print $propalstatic->getNomUrl(1); + print "\n"; print ''.$societestatic->getNomUrl(1).''; print ''; print dol_print_date($db->jdate($objp->datep), 'dayhour') . ""; @@ -235,17 +237,13 @@ if ($id > 0 || ! empty($ref)) print '' . price($objp->amount) . '' . "\n"; print '' . $propalstatic->LibStatut($objp->statut, 5) . ''; print "\n"; - $i ++; - - if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } + $i++; } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print '' . $total_qty . ''; print '' . price($total_ht) . ''; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index c040e3ae3a5..cac015171cf 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -114,7 +114,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - show_stats_for_company($product, $socid); + $nboflines = show_stats_for_company($product, $socid); print "
"; @@ -148,24 +148,21 @@ if ($id > 0 || ! empty($ref)) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id; if ($socid) $sql .= " AND p.fk_soc = " . $socid; - $sql .= " ORDER BY $sortfield $sortorder "; + $sql.= $db->order($sortfield, $sortorder); // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; - $totalrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { $result = $db->query($sql); - if ($result) { - $totalrecords = $db->num_rows($result); - while ( $objp = $db->fetch_object($result) ) { - $total_ht += $objp->amount; - $total_qty += $objp->qty; - } - } + $totalofrecords = $db->num_rows($result); } - $sql .= $db->plimit($conf->liste_limit + 1, $offset); + $sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -178,6 +175,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; + if ($limit > 0 && $limit != $conf->liste_limit) $option.='&limit='.urlencode($limit); print '' . "\n"; if (! empty($sortfield)) @@ -189,7 +187,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&page=' . $page; } - print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); + print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit); print '
'; print '
'; print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - '; @@ -216,17 +214,21 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - while ($i < $num && $i < $conf->liste_limit) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - print ''; - print ''; + $total_ht+=$objp->amount; + $total_qty+=$objp->qty; + $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; - print $propalstatic->getNomUrl(1); - print "\n"; $societestatic->fetch($objp->socid); + + print ''; + print ''; + print $propalstatic->getNomUrl(1); + print "\n"; print ''.$societestatic->getNomUrl(1).''; print ''; print dol_print_date($db->jdate($objp->date_valid), 'dayhour') . ""; @@ -234,17 +236,13 @@ if ($id > 0 || ! empty($ref)) print '' . price($objp->amount) . '' . "\n"; print '' . $propalstatic->LibStatut($objp->statut, 5) . ''; print "\n"; - $i ++; - - if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $total_ht += $objp->total_ht; - $total_qty += $objp->qty; - } + $i++; } } print ''; - print '' . $langs->trans('Total') . ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; print ''; print '' . $total_qty . ''; print '' . price($total_ht) . ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 33004faf5a0..e60d948aa48 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1058,22 +1058,23 @@ if ($action == 'create' || $action == 'adduserldap') } // Multicompany - // This is now done with hook formObjectOptions - /* - if (! empty($conf->multicompany->enabled) && is_object($mc)) - { - if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) // condition must be same for create and edit mode - { - print "".''.$langs->trans("Entity").''; - print "".$mc->select_entities($conf->entity); - print "\n"; - } - else - { - print ''; - } - } - */ + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + // This is now done with hook formObjectOptions. Keep this code for backward compatibility with old multicompany module + if (! method_exists($mc, 'formObjectOptions')) + { + if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) // condition must be same for create and edit mode + { + print "".''.$langs->trans("Entity").''; + print "".$mc->select_entities($conf->entity); + print "\n"; + } + else + { + print ''; + } + } + } // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); @@ -1577,23 +1578,25 @@ else print ''.dol_print_date($object->datepreviouslogin,"dayhour").''; print "\n"; - // Multicompany - // This is now done with hook formObjectOptions (included into /core/tpl/extrafields_view.tpl.php) - /* - if (! empty($conf->multicompany->enabled) && is_object($mc)) - { - if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print '' . $langs->trans("Entity") . ''; - if (empty($object->entity)) { - print $langs->trans("AllEntities"); - } else { - $mc->getInfo($object->entity); - print $mc->label; - } - print "\n"; - } - }*/ + // Multicompany + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + // This is now done with hook formObjectOptions. Keep this code for backward compatibility with old multicompany module + if (! method_exists($mc, 'formObjectOptions')) + { + if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print '' . $langs->trans("Entity") . ''; + if (empty($object->entity)) { + print $langs->trans("AllEntities"); + } else { + $mc->getInfo($object->entity); + print $mc->label; + } + print "\n"; + } + } + } // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -1750,7 +1753,7 @@ else } } } - + print "
\n"; @@ -2341,24 +2344,25 @@ else print "\n"; } - // Multicompany - // This is now done with hook formObjectOptions - /* + // Multicompany // TODO check if user not linked with the current entity before change entity (thirdparty, invoice, etc.) !! if (! empty($conf->multicompany->enabled) && is_object($mc)) { - if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + // This is now done with hook formObjectOptions. Keep this code for backward compatibility with old multicompany module + if (! method_exists($mc, 'formObjectOptions')) { - print "".''.$langs->trans("Entity").''; - print "".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities' - print "\n"; - } - else - { - print ''; - } - } - */ + if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print "".''.$langs->trans("Entity").''; + print "".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities' + print "\n"; + } + else + { + print ''; + } + } + } // Other attributes $parameters=array('colspan' => ' colspan="2"');