Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Philippe GRAND 2020-02-24 10:28:13 +01:00
commit f00c8ee227
57 changed files with 1585 additions and 398 deletions

View File

@ -9,15 +9,17 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1
- uses: Dolibarr/stale@v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.'
stale-issue-label: 'Issue Stale (automatic label)'
exempt-issue-label: 'Priority High / Blocking'
days-before-stale: 365
days-before-close: 10
days-before-close: 15
operations-per-run: 10
#stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. If this PR is still mergeable (no conflict, nor Continuous Integration errors), please comment to confirm this merge is still expected. Without comment, this issue will be closed automatically by stale bot in 15 days.'
#stale-pr-label: 'PR Stale (automatic label)'
#exempt-pr-label: 'Priority Top Strategic'
stale-pr-label: 'PR Stale (automatic label)'
stale-pr-message:
exempt-pr-label: 'Priority Top Strategic'

View File

@ -75,7 +75,7 @@ if ($id)
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback);
dol_banner_tab($object, 'id', $linkback);
print '<div class="fichecenter">';

View File

@ -65,7 +65,7 @@ function printDropdownBookmarksList()
// Url to list bookmark
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
$listbtn .= '<span class="fa fa-list"></span> '.$langs->trans('Bookmarks').'</a>';
$listbtn .= '<span class="fa fa-list paddingright"></span>'.$langs->trans('Bookmarks').'</a>';
// Url to go on create new bookmark page
$newbtn = '';
@ -74,7 +74,7 @@ function printDropdownBookmarksList()
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$newbtn .= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
$newbtn .= img_picto('', 'bookmark').' '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
$newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
}
$bookmarkList = '<div id="dropdown-bookmarks-list" >';

View File

@ -111,6 +111,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount1->description = $discount->description.' (1)';
$newdiscount2->description = $discount->description.' (2)';
}
$newdiscount1->fk_user = $discount->fk_user;
$newdiscount2->fk_user = $discount->fk_user;
$newdiscount1->fk_soc = $discount->fk_soc;
@ -121,7 +122,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount2->datec = $discount->datec;
$newdiscount1->tva_tx = $discount->tva_tx;
$newdiscount2->tva_tx = $discount->tva_tx;
$newdiscount1->amount_ttc = $_POST["amount_ttc_1"];
$newdiscount1->amount_ttc = $amount_ttc_1;
$newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc);
$newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
$newdiscount2->amount_ht = price2num($newdiscount2->amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT');

View File

@ -453,7 +453,7 @@ print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n
if (!empty($conf->multicompany->enabled) && is_object($mc))
{
$mc->getInfo($conf->entity);
print '<span class="marginleftonly marginrightonly">('.$langs->trans("Entity").' : ';
print '<span class="marginleftonly marginrightonly'.(empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)?' opacitymedium':'').'">('.$langs->trans("Entity").' : ';
print "<td>";
if (!empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) {
print $mc->select_entities(GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $mc->id, 'search_entity', '', false, false, false, false, true);

View File

@ -255,13 +255,14 @@ else
$px1->draw($file, $fileurl);
$show1 = $px1->show();
unset($graph_datas);
unset($px1);
unset($datas);
unset($datamin);
unset($dataall);
unset($labels);
unset($amounts);
$px1 = null;
$graph_datas =null;
$datas = null;
$datamin = null;
$dataall = null;
$labels = null;
$amounts = null;
}
// Graph Balance for the year
@ -392,13 +393,13 @@ else
$show2 = $px2->show();
unset($px2);
unset($graph_datas);
unset($datas);
unset($datamin);
unset($dataall);
unset($labels);
unset($amounts);
$px2 = null;
$graph_datas =null;
$datas = null;
$datamin = null;
$dataall = null;
$labels = null;
$amounts = null;
}
// Graph 3 - Balance for all time line
@ -460,7 +461,7 @@ else
}
else
{
$datas[$i] = '' +$solde + $subtotal;
$datas[$i] = 0 + $solde + $subtotal;
}
$datamin[$i] = $object->min_desired;
$dataall[$i] = $object->min_allowed;
@ -505,13 +506,13 @@ else
$show3 = $px3->show();
unset($px3);
unset($graph_datas);
unset($datas);
unset($datamin);
unset($dataall);
unset($labels);
unset($amounts);
$px3 = null;
$graph_datas =null;
$datas = null;
$datamin = null;
$dataall = null;
$labels = null;
$amounts = null;
}
// Tableau 4a - Credit/Debit
@ -634,10 +635,10 @@ else
$show4 = $px4->show();
unset($graph_datas);
unset($px4);
unset($debits);
unset($credits);
$px4 = null;
$graph_datas = null;
$debits = null;
$credits = null;
}
// Tableau 4b - Credit/Debit
@ -742,10 +743,10 @@ else
$show5 = $px5->show();
unset($graph_datas);
unset($px5);
unset($debits);
unset($credits);
$px5 = null;
$graph_datas = null;
$debits = null;
$credits = null;
}
}

View File

@ -1397,6 +1397,9 @@ class Facture extends CommonInvoice
if (!empty($this->total_ttc))
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($moretitle) $label .= ' - '.$moretitle;
if (isset($this->statut) && isset($this->alreadypaid)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5, $this->alreadypaid);
}
}
$linkclose = ($target ? ' target="'.$target.'"' : '');
@ -2419,12 +2422,23 @@ class Facture extends CommonInvoice
* @param string $force_number Reference to force on invoice
* @param int $idwarehouse Id of warehouse to use for stock decrease if option to decreasenon stock is on (0=no decrease)
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param int $batch_rule [=0] 0 not decrement batch, else batch rule to use
* 1=take in batches ordered by sellby and eatby dates
* @return int <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK
*/
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0)
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$productStatic = null;
$warehouseStatic = null;
if ($batch_rule > 0) {
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/productbatch.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
$productStatic = new Product($this->db);
$warehouseStatic = new Entrepot($this->db);
}
$now = dol_now();
@ -2566,11 +2580,94 @@ class Facture extends CommonInvoice
$mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this;
// We decrease stock for product
if ($this->type == self::TYPE_CREDIT_NOTE) $result = $mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr", $num));
else $result = $mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr", $num));
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
if ($this->type == self::TYPE_CREDIT_NOTE) {
$result = $mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr", $num));
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
}
} else {
$is_batch_line = false;
if ($batch_rule > 0) {
$productStatic->fetch($this->lines[$i]->fk_product);
if ($productStatic->hasbatch()) {
$is_batch_line = true;
$product_qty_remain = $this->lines[$i]->qty;
$sortfield = null;
$sortorder = null;
// find all batch order by sellby (DLC) and eatby dates (DLUO) first
if ($batch_rule == Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST) {
$sortfield = 'pl.sellby,pl.eatby,pb.qty,pl.rowid';
$sortorder = 'ASC,ASC,ASC,ASC';
}
$resBatchList = Productbatch::findAllForProduct($this->db, $productStatic->id, $idwarehouse, (!empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER) ? null : 0), $sortfield, $sortorder);
if (!is_array($resBatchList)) {
$error++;
$this->error = $this->db->lasterror();
}
if (!$error) {
$batchList = $resBatchList;
if (empty($batchList)) {
$error++;
$langs->load('errors');
$warehouseStatic->fetch($idwarehouse);
$this->error = $langs->trans('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref);
dol_syslog(__METHOD__ . ' Error: ' . $langs->transnoentitiesnoconv('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR);
}
foreach ($batchList as $batch) {
if ($batch->qty <= 0) continue; // try to decrement only batches have positive quantity first
// enough quantity in this batch
if ($batch->qty >= $product_qty_remain) {
$product_batch_qty = $product_qty_remain;
} // not enough (take all in batch)
else {
$product_batch_qty = $batch->qty;
}
$result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_batch_qty, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch);
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
break;
}
$product_qty_remain -= $product_batch_qty;
// all product quantity was decremented
if ($product_qty_remain <= 0) break;
}
if (!$error && $product_qty_remain > 0) {
if ($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER) {
// take in the first batch
$batch = $batchList[0];
$result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_qty_remain, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch);
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
}
} else {
$error++;
$langs->load('errors');
$warehouseStatic->fetch($idwarehouse);
$this->error = $langs->trans('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref);
dol_syslog(__METHOD__ . ' Error: ' . $langs->transnoentitiesnoconv('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR);
}
}
}
}
}
if (!$is_batch_line) {
$result = $mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr", $num));
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
}
}
}
}
}

View File

@ -1041,6 +1041,8 @@ if ($resql)
$totalpay = price2num($facturestatic->total_ttc - $remaintopay);
}
$facturestatic->alreadypaid = $paiement;
print '<tr class="oddeven"';
if ($contextpage == 'poslist')
{

View File

@ -183,7 +183,8 @@ if ($action == 'add')
(GETPOST('entitycurrentorall', 'alpha')?0:''),
GETPOST('langfile', 'alpha'),
1,
(GETPOST('totalizable', 'alpha')?1:0)
(GETPOST('totalizable', 'alpha')?1:0),
(GETPOST('printable', 'alpha')?1:0)
);
if ($result > 0)
{
@ -352,7 +353,8 @@ if ($action == 'update')
(GETPOST('entitycurrentorall', 'alpha')?0:''),
GETPOST('langfile'),
1,
(GETPOST('totalizable', 'alpha')?1:0)
(GETPOST('totalizable', 'alpha')?1:0),
(GETPOST('printable', 'alpha')?1:0)
);
if ($result > 0)
{

View File

@ -86,7 +86,7 @@ class box_boms extends ModeleBoxes
if ($user->rights->bom->read)
{
$sql = "SELECT p.ref as product_ref";
$sql = "SELECT p.ref as product_ref, p.tobuy, p.tosell";
$sql.= ", c.rowid";
$sql.= ", c.date_creation";
$sql.= ", c.tms";
@ -109,11 +109,15 @@ class box_boms extends ModeleBoxes
while ($line < $num) {
$objp = $this->db->fetch_object($result);
$datem=$this->db->jdate($objp->tms);
$bomstatic->id = $objp->rowid;
$bomstatic->ref = $objp->ref;
$bomstatic->id = $objp->socid;
$bomstatic->status = $objp->status;
$productstatic->ref = $objp->product_ref;
$productstatic->status = $objp->tobuy;
$productstatic->status_buy = $objp->tosell;
$this->info_box_contents[$line][] = array(
'td' => 'class="nowraponall"',

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -83,6 +84,7 @@ class box_contacts extends ModeleBoxes
if ($user->rights->societe->lire && $user->rights->societe->contact->lire)
{
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
$sql .= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail";
$sql .= ", s.nom as socname, s.name_alias, s.email as semail";
$sql .= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur";

View File

@ -91,7 +91,7 @@ class box_services_contracts extends ModeleBoxes
$sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
$sql.= " c.rowid, c.ref, c.statut as contract_status, c.ref_customer, c.ref_supplier,";
$sql.= " cd.rowid as cdid, cd.label, cd.description, cd.tms as datem, cd.statut, cd.product_type as type,";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as plabel, p.fk_product_type as ptype, p.entity";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as plabel, p.fk_product_type as ptype, p.entity, p.tobuy, p.tosell";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
@ -165,6 +165,9 @@ class box_services_contracts extends ModeleBoxes
$productstatic->ref=$objp->product_ref;
$productstatic->entity=$objp->pentity;
$productstatic->label=$objp->plabel;
$productstatic->status = $objp->tosell;
$productstatic->status_buy = $objp->tobuy;
$text = $productstatic->getNomUrl(1, '', 20);
if ($objp->plabel)
{

View File

@ -49,6 +49,10 @@ abstract class CommonDocGenerator
*/
protected $db;
/**
* @var Extrafields object
*/
public $extrafieldsCache;
/**
* Constructor
@ -1074,7 +1078,7 @@ abstract class CommonDocGenerator
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
* @return int new rank on success and -1 on error
* @return null
*/
public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{
@ -1096,6 +1100,221 @@ abstract class CommonDocGenerator
}
}
/**
* get extrafield content for pdf writeHtmlCell compatibility
* usage for PDF line columns and object note block
*
* @param object $object common object
* @param string $extrafieldKey the extrafield key
* @return string
*/
public function getExtrafieldContent($object, $extrafieldKey)
{
global $hookmanager;
if(empty($object->table_element)){ return; }
$extrafieldsKeyPrefix = "options_";
// Cleanup extrafield key to remove prefix if present
$pos = strpos($extrafieldKey, $extrafieldsKeyPrefix);
if($pos===0){
$extrafieldKey = substr($extrafieldKey, strlen($extrafieldsKeyPrefix));
}
$extrafieldOptionsKey = $extrafieldsKeyPrefix.$extrafieldKey;
// Load extrafiels if not allready does
if(empty($this->extrafieldsCache)){ $this->extrafieldsCache = new ExtraFields($this->db); }
if(empty($this->extrafieldsCache->attributes[$object->table_element])){ $this->extrafieldsCache->fetch_name_optionals_label($object->table_element); }
$extrafields = $this->extrafieldsCache;
$extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
// TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ...
if($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link'){
// for lack of anything better we cleanup all html tags
$extrafieldOutputContent = dol_string_nohtmltag($extrafieldOutputContent);
}
$parameters = array(
'object' => $object,
'extrafields' => $extrafields,
'extrafieldKey' => $extrafieldKey,
'extrafieldOutputContent' =>& $extrafieldOutputContent
);
$reshook = $hookmanager->executeHooks('getPDFExtrafieldContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($reshook)
{
$extrafieldOutputContent = $hookmanager->resPrint;
}
return $extrafieldOutputContent;
}
/**
* display extrafields columns content
*
* @param object $object line of common object
* @param Translate $outputlangs Output language
* @param array $params array of additionals parameters
* @return double max y value
*/
public function getExtrafieldsInHtml($object, $outputlangs, $params = array())
{
global $hookmanager;
if(empty($object->table_element)){
return;
}
// Load extrafiels if not allready does
if(empty($this->extrafieldsCache)){ $this->extrafieldsCache = new ExtraFields($this->db); }
if(empty($this->extrafieldsCache->attributes[$object->table_element])){ $this->extrafieldsCache->fetch_name_optionals_label($object->table_element); }
$extrafields = $this->extrafieldsCache;
$defaultParams = array(
'style' => '',
'display' => 'auto', // auto, table, list
'table' => array(
'maxItemsInRow' => 2,
'cellspacing' => 0,
'cellpadding' => 0,
'border' => 0,
'labelcolwidth' => '25%',
'arrayOfLineBreakType' => array('text', 'html')
),
'list' => array(
'separator' => '<br/>'
),
'auto' => array(
'list' => 0, // 0 for default
'table' => 4 // if there more than x extrafield to display
),
);
$params = $params + $defaultParams;
/**
* @var $extrafields ExtraFields
*/
$html = '';
$fields = array();
if (is_array($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{
// Enable extrafield ?
$enabled = !empty($extrafields->attributes[$object->table_element]['printable'][$key]);
if(empty($enabled)){
continue;
}
$field = new stdClass();
$field->rank = intval($extrafields->attributes[$object->table_element]['pos'][$key]);
$field->content = $this->getExtrafieldContent($object, $key);
$field->label = $outputlangs->transnoentities($label);
$field->type = $extrafields->attributes[$object->table_element]['type'][$key];
$fields[] = $field;
}
}
if(!empty($fields))
{
// Sort extrafields by rank
uasort($fields, function ($a, $b) {
return ($a->rank > $b->rank) ? -1 : 1;
}
);
// define some HTML content with style
$html.= '<style>'.$params['style'].'</style>';
// auto select display format
if($params['display'] == 'auto') {
$lastNnumbItems = 0;
foreach ($params['auto'] as $display => $numbItems){
if($lastNnumbItems <= $numbItems && count($fields) > $numbItems){
$lastNnumbItems = $numbItems;
$params['display'] = $display;
}
}
}
if($params['display'] == 'list') {
// Display in list format
foreach ($fields as $field) {
$html .= !empty($html)?$params['list']['separator']:'';
$html .= '<strong>' . $field->label . ' : </strong>';
$html .= $field->content;
}
}
elseif($params['display'] == 'table') {
// Display in table format
$html .= '<table class="extrafield-table" cellspacing="' . $params['table']['cellspacing'] . '" cellpadding="' . $params['table']['cellpadding'] . '" border="' . $params['table']['border'] . '">';
$html .= "<tr>";
$itemsInRow = 0;
$maxItemsInRow = $params['table']['maxItemsInRow'];
foreach ($fields as $field) {
//$html.= !empty($html)?'<br/>':'';
if ($itemsInRow >= $maxItemsInRow) {
// start a new line
$html .= "</tr><tr>";
$itemsInRow = 0;
}
// for some type we need line break
if (in_array($field->type, $params['table']['arrayOfLineBreakType'])) {
if ($itemsInRow > 0) {
// close table row and empty cols
for ($i = $itemsInRow; $i <= $maxItemsInRow; $i++) {
$html .= "<td ></td><td></td>";
}
$html .= "</tr>";
// start a new line
$html .= "<tr>";
}
$itemsInRow = $maxItemsInRow;
$html .= '<td colspan="' . ($maxItemsInRow * 2 - 1) . '">';
$html .= '<strong>' . $field->label . ' :</strong> ';
$html .= $field->content;
$html .= "</td>";
} else {
$itemsInRow++;
$html .= '<td width="'.$params['table']['labelcolwidth'].'" class="extrafield-label">';
$html .= '<strong>' . $field->label . ' :</strong>';
$html .= "</td>";
$html .= '<td class="extrafield-content">';
$html .= $field->content;
$html .= "</td>";
}
}
$html .= "</tr>";
$html .= '</table>';
}
}
return $html;
}
/**
* get column status from column key
@ -1167,4 +1386,81 @@ abstract class CommonDocGenerator
}
return $this->tabTitleHeight;
}
/**
* Define Array Column Field for extrafields
*
* @param object $object common object det
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @return null
*/
public function defineColumnExtrafield($object, $outputlangs, $hidedetails = 0)
{
global $conf;
if(!empty($hidedetails)){
return;
}
if(empty($object->table_element)){
return;
}
// Load extrafiels if not allready does
if(empty($this->extrafieldsCache)){ $this->extrafieldsCache = new ExtraFields($this->db); }
if(empty($this->extrafieldsCache->attributes[$object->table_element])){ $this->extrafieldsCache->fetch_name_optionals_label($object->table_element); }
$extrafields = $this->extrafieldsCache;
if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{
// Dont display separator yet even is set to be displayed (not compatible yet)
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
{
continue;
}
// Enable extrafield ?
$enabled = !empty($extrafields->attributes[$object->table_element]['printable'][$key]);
// Load language if required
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $outputlangs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
// TODO : add more extrafield customisation capacities for PDF like width, rank...
// set column definition
$def = array(
'rank' => intval($extrafields->attributes[$object->table_element]['pos'][$key]),
'width' => 25, // in mm
'status' => boolval($enabled),
'title' => array(
'label' => $outputlangs->transnoentities($label)
),
'content' => array(
'align' => 'C'
),
'border-left' => true, // add left line separator
);
$alignTypeRight = array('double', 'int', 'price');
if(in_array($extrafields->attributes[$object->table_element]['type'][$key], $alignTypeRight)){
$def['content']['align'] = 'R';
}
$alignTypeLeft = array('text', 'html');
if(in_array($extrafields->attributes[$object->table_element]['type'][$key], $alignTypeLeft)){
$def['content']['align'] = 'L';
}
// for extrafields we use rank of extrafield to place it on PDF
$this->insertNewColumnDef("options_".$key, $def);
}
}
}
}

View File

@ -49,6 +49,8 @@
* <dol_print_object_tax> Print object total tax
* <dol_print_object_local_tax> Print object local tax
* <dol_print_object_total> Print object total
* <dol_print_order_lines_printer1> Print order lines for Printer1
* <dol_print_order_lines_printer2> Print order lines for Printer2
* <dol_print_payment> Print payment method
*
* Code which can be placed everywhere
@ -188,6 +190,8 @@ class dolReceiptPrinter extends Printer
'dol_print_object_local_tax',
'dol_print_object_total',
'dol_print_object_number',
'dol_print_order_lines_printer1',
'dol_print_order_lines_printer2',
'dol_value_customer_firstname',
'dol_value_customer_lastname',
'dol_value_customer_mail',
@ -720,6 +724,28 @@ class dolReceiptPrinter extends Printer
case 'DOL_BEEP':
$this->printer->getPrintConnector() -> write("\x1e");
break;
case 'DOL_PRINT_ORDER_LINES_PRINTER1':
foreach ($object->lines as $line) {
if ($line->special_code==1)
{
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd);
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->desc))."\n");
}
}
break;
case 'DOL_PRINT_ORDER_LINES_PRINTER2':
foreach ($object->lines as $line) {
if ($line->special_code==2)
{
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd);
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->desc))."\n");
}
}
break;
default:
$this->printer->text($vals[$tplline]['tag']);
$this->printer->text($vals[$tplline]['value']);

View File

@ -225,9 +225,10 @@ class ExtraFields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @return int <=0 if KO, >0 if OK
*/
public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0)
public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
{
if (empty($attrname)) return -1;
if (empty($label)) return -1;
@ -245,7 +246,7 @@ class ExtraFields
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
{
// Add declaration of field into table
$result2 = $this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $help, $default_value, $computed, $entity, $langfile, $enabled, $totalizable);
$result2 = $this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $help, $default_value, $computed, $entity, $langfile, $enabled, $totalizable, $printable);
$err2 = $this->errno;
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
{
@ -374,9 +375,11 @@ class ExtraFields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @return int <=0 if KO, >0 if OK
* @throws Exception
*/
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0)
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
{
// phpcs:enable
global $conf, $user;
@ -390,6 +393,7 @@ class ExtraFields
if (empty($required)) $required = 0;
if (empty($unique)) $unique = 0;
if (empty($alwayseditable)) $alwayseditable = 0;
if (empty($totalizable)) $totalizable = 0;
if (!empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/", $attrname) && !is_numeric($attrname))
{
@ -421,6 +425,7 @@ class ExtraFields
$sql .= " perms,";
$sql .= " langs,";
$sql .= " list,";
$sql .= " printable,";
$sql .= " fielddefault,";
$sql .= " fieldcomputed,";
$sql .= " fk_user_author,";
@ -444,6 +449,7 @@ class ExtraFields
$sql .= " ".($perms ? "'".$this->db->escape($perms)."'" : "null").",";
$sql .= " ".($langfile ? "'".$this->db->escape($langfile)."'" : "null").",";
$sql .= " '".$this->db->escape($list)."',";
$sql .= " '".$this->db->escape($printable)."',";
$sql .= " ".($default ? "'".$this->db->escape($default)."'" : "null").",";
$sql .= " ".($computed ? "'".$this->db->escape($computed)."'" : "null").",";
$sql .= " ".(is_object($user) ? $user->id : 0).",";
@ -451,7 +457,7 @@ class ExtraFields
$sql .= "'".$this->db->idate(dol_now())."',";
$sql .= " ".($enabled ? "'".$this->db->escape($enabled)."'" : "1").",";
$sql .= " ".($help ? "'".$this->db->escape($help)."'" : "null").",";
$sql .= " ".($totalizable ? '1' : '0');
$sql .= " ".($totalizable ? 'TRUE' : 'FALSE');
$sql .= ')';
dol_syslog(get_class($this)."::create_label", LOG_DEBUG);
@ -590,9 +596,11 @@ class ExtraFields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
* @param int $totalizable Is extrafield totalizable on list
* @param int $printable Is extrafield displayed on PDF
* @return int >0 if OK, <=0 if KO
* @throws Exception
*/
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0)
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
{
if ($elementtype == 'thirdparty') $elementtype = 'societe';
if ($elementtype == 'contact') $elementtype = 'socpeople';
@ -642,7 +650,7 @@ class ExtraFields
{
if ($label)
{
$result = $this->update_label($attrname, $label, $type, $length, $elementtype, $unique, $required, $pos, $param, $alwayseditable, $perms, $list, $help, $default, $computed, $entity, $langfile, $enabled, $totalizable);
$result = $this->update_label($attrname, $label, $type, $length, $elementtype, $unique, $required, $pos, $param, $alwayseditable, $perms, $list, $help, $default, $computed, $entity, $langfile, $enabled, $totalizable, $printable);
}
if ($result > 0)
{
@ -700,13 +708,15 @@ class ExtraFields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
* @param int $totalizable Is extrafield totalizable on list
* @param int $printable Is extrafield displayed on PDF
* @return int <=0 if KO, >0 if OK
* @throws Exception
*/
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0)
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
{
// phpcs:enable
global $conf, $user;
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable);
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable.", ".$printable);
// Clean parameters
if ($elementtype == 'thirdparty') $elementtype = 'societe';
@ -771,6 +781,7 @@ class ExtraFields
$sql .= " alwayseditable,";
$sql .= " param,";
$sql .= " list,";
$sql .= " printable,";
$sql .= " totalizable,";
$sql .= " fielddefault,";
$sql .= " fieldcomputed,";
@ -794,7 +805,8 @@ class ExtraFields
$sql .= " '".$this->db->escape($alwayseditable)."',";
$sql .= " '".$this->db->escape($params)."',";
$sql .= " '".$this->db->escape($list)."', ";
$sql .= " ".$totalizable.",";
$sql .= " '".$this->db->escape($printable)."', ";
$sql .= " ".($totalizable ? 'TRUE' : 'FALSE').",";
$sql .= " ".(($default != '') ? "'".$this->db->escape($default)."'" : "null").",";
$sql .= " ".($computed ? "'".$this->db->escape($computed)."'" : "null").",";
$sql .= " ".$user->id.",";
@ -871,7 +883,7 @@ class ExtraFields
}*/
// We should not have several time this request. If we have, there is some optimization to do by calling a simple $extrafields->fetch_optionals() in top of code and not into subcode
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,printable,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
$sql .= " FROM ".MAIN_DB_PREFIX."extrafields";
//$sql.= " WHERE entity IN (0,".$conf->entity.")"; // Filter is done later
if ($elementtype) $sql .= " WHERE elementtype = '".$elementtype."'"; // Filed with object->table_element
@ -933,7 +945,8 @@ class ExtraFields
$this->attributes[$tab->elementtype]['perms'][$tab->name] = (strlen($tab->perms) == 0 ? 1 : $tab->perms);
$this->attributes[$tab->elementtype]['langfile'][$tab->name] = $tab->langs;
$this->attributes[$tab->elementtype]['list'][$tab->name] = $tab->list;
$this->attributes[$tab->elementtype]['totalizable'][$tab->name] = $tab->totalizable;
$this->attributes[$tab->elementtype]['printable'][$tab->name] = $tab->printable;
$this->attributes[$tab->elementtype]['totalizable'][$tab->name] = ($tab->totalizable ? 1 : 0);
$this->attributes[$tab->elementtype]['entityid'][$tab->name] = $tab->entity;
$this->attributes[$tab->elementtype]['enabled'][$tab->name] = $tab->enabled;
$this->attributes[$tab->elementtype]['help'][$tab->name] = $tab->help;

View File

@ -6693,8 +6693,10 @@ class Form
<script type="text/javascript">
jQuery(document).ready(function () {
$(\'.multiselectcheckbox'.$htmlname.' input[type="checkbox"]\').on(\'click\', function () {
console.log("A new field was added/removed")
$("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\')
console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
$("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST
var title = $(this).val() + ",";
if ($(this).is(\':checked\')) {
$(\'.'.$htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
@ -6703,8 +6705,10 @@ class Form
$(\'.'.$htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
}
// Now, we submit page
$(this).parents(\'form:first\').submit();
//$(this).parents(\'form:first\').submit();
});
});
</script>
@ -7070,7 +7074,6 @@ class Form
jQuery(".linkto").click(function() {
console.log("We choose to show/hide link for rel="+jQuery(this).attr(\'rel\'));
jQuery("#"+jQuery(this).attr(\'rel\')+"list").toggle();
jQuery(this).toggle();
});
});
</script>

View File

@ -80,7 +80,7 @@ $arrayoftype = array(
'contact' => array('label' => 'Contacts', 'ObjectClassName' => 'Contact', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"),
'contract' => array('label' => 'Contracts', 'ObjectClassName' => 'Contrat', 'enabled' => $conf->contrat->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", 'langs'=>'contract'),
'invoice' => array('label' => 'Invoices', 'ObjectClassName' => 'Facture', 'enabled' => $conf->facture->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"),
'invoice_template'=>array('label' => 'PredefinedInvoices', 'ObjectClassName' => 'FactureRec', 'enabled' => $conf->facture->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/compta/class/facturerec.class.php"),
'invoice_template'=>array('label' => 'PredefinedInvoices', 'ObjectClassName' => 'FactureRec', 'enabled' => $conf->facture->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/compta/class/facturerec.class.php", 'langs'=>'bills'),
'bom' => array('label' => 'BOM', 'ObjectClassName' => 'Bom', 'enabled' => $conf->bom->enabled),
'mo' => array('label' => 'MO', 'ObjectClassName' => 'Mo', 'enabled' => $conf->mo->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/mrp/class/mo.class.php"),
'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Ticket', 'enabled' => $conf->ticket->enabled),
@ -114,9 +114,6 @@ elseif (is_array($hookmanager->resArray)) {
if ($objecttype) {
try {
if ($arrayoftype[$objecttype]['langs']) {
$langs->load($arrayoftype[$objecttype]['langs']);
}
if ($arrayoftype[$objecttype]['ClassPath']) {
include_once $arrayoftype[$objecttype]['ClassPath'];
} else {
@ -211,6 +208,9 @@ foreach ($arrayoftype as $key => $val) {
if (dol_eval($val['enabled'], 1)) {
$newarrayoftype[$key] = $arrayoftype[$key];
}
if ($val['langs']) {
$langs->load($val['langs']);
}
}
print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', '', 1);
if (empty($conf->use_javascript_ajax)) print '<input type="submit" class="button" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';

View File

@ -81,13 +81,31 @@ print "});\n";
// Wrapper to manage dropdown
if (! defined('JS_JQUERY_DISABLE_DROPDOWN'))
{
print "\n/* JS CODE TO ENABLE dropdown */\n";
print "\n/* JS CODE TO ENABLE dropdown (hamburger, linkto, ...) */\n";
print '
jQuery(document).ready(function () {
$(".dropdown dt a").on(\'click\', function () {
console.log("We click on dropdown");
//console.log($(this).parent().parent().find(\'dd ul\'));
$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
jQuery(document).ready(function () {
var lastopendropdown = null;
// Click onto the link "link to" or "hamburger", toggle dropdown
$(".dropdown dt a").on(\'click\', function () {
console.log("toggle dropdown dt a");
//$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
$(this).parent().parent().find(\'dd ul\').toggleClass("open");
if ($(this).parent().parent().find(\'dd ul\').hasClass("open")) {
lastopendropdown = $(this).parent().parent().find(\'dd ul\');
//console.log(lastopendropdown);
} else {
// We closed the dropdown for hamburger selectfields
if ($("input:hidden[name=formfilteraction]").val() == "listafterchangingselectedfields") {
console.log("resubmit the form saved into lastopendropdown after clicking on hamburger");
//$(".dropdown dt a").parents(\'form:first\').submit();
//$(".dropdown dt a").closest("form").submit();
lastopendropdown.closest("form").submit();
}
}
// Note: Did not find a way to get exact height (value is update at exit) so i calculate a generic from nb of lines
heigthofcontent = 21 * $(this).parent().parent().find(\'dd div ul li\').length;
if (heigthofcontent > 300) heigthofcontent = 300; // limited by max-height on css .dropdown dd ul
@ -101,19 +119,32 @@ if (! defined('JS_JQUERY_DISABLE_DROPDOWN'))
console.log("We reposition top by "+pix);
$(this).parent().parent().find(\'dd\').css("top", pix);
}
// $(".dropdown dd ul").slideToggle(\'fast\');
});
$(".dropdowncloseonclick").on(\'click\', function () {
console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul");
$(this).parent().parent().hide();
});
$(document).bind(\'click\', function (e) {
//console.log("We click outside of dropdown, so we close it.");
var $clicked = $(e.target);
if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide();
// Click on a link into the popup "link to" or other dropdown that ask to close drop down on element click, so close dropdown
$(".dropdowncloseonclick").on(\'click\', function () {
console.log("Link has class dropdowncloseonclick, so we close/hide the popup ul");
//$(this).parent().parent().hide(); // $(this).parent().parent() is ul
$(this).parent().parent().removeClass("open"); // $(this).parent().parent() is ul
});
});
// Click outside of any dropdown
$(document).bind(\'click\', function (e) {
var $clicked = $(e.target); // This is element we click on
if (!$clicked.parents().hasClass("dropdown")) {
console.log("close dropdown dd ul - we click outside");
//$(".dropdown dd ul").hide();
$(".dropdown dd ul").removeClass("open");
if ($("input:hidden[name=formfilteraction]").val() == "listafterchangingselectedfields") {
console.log("resubmit form saved into lastopendropdown after clicking outside of dropdown and having change selectlist from selectlist field of hamburger dropdown");
//$(".dropdown dt a").parents(\'form:first\').submit();
//$(".dropdown dt a").closest("form").submit();
lastopendropdown.closest("form").submit();
}
}
});
});
';
}

View File

@ -1298,7 +1298,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$tabsname = str_replace("@", "", $picto);
$out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">'.$langs->trans("More").'... ('.$nbintab.')</a>';
$out .= '<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px">';
$out .= '<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px; z-index:10;">';
$out .= $outmore;
$out .= '</div>';
$out .= '<div></div>';
@ -7618,15 +7618,12 @@ function printCommonFooter($zone = 'private')
$micro_end_time = microtime(true);
print ' - Build time: '.ceil(1000 * ($micro_end_time - $micro_start_time)).' ms';
}
if (function_exists("memory_get_usage"))
{
print ' - Mem: '.memory_get_usage();
if (function_exists("memory_get_usage")) {
print ' - Mem: '.memory_get_usage(); // Do not use true here, it seems it takes the peak amount
}
if (function_exists("xdebug_memory_usage"))
{
print ' - XDebug time: '.ceil(1000 * xdebug_time_index()).' ms';
print ' - XDebug mem: '.xdebug_memory_usage();
print ' - XDebug mem peak: '.xdebug_peak_memory_usage();
if (function_exists("memory_get_peak_usage")) {
print ' - Real mem peak: '.memory_get_peak_usage(true);
}
if (function_exists("zend_loader_file_encoded"))
{

View File

@ -107,7 +107,7 @@ function dol_decode($chain, $key = '1')
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
*
* @param string $chain String to hash
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return string Hash of string
* @see getRandomPassword()
*/
@ -122,7 +122,7 @@ function dol_hash($chain, $type = '0')
}
// Salt value
if (!empty($conf->global->MAIN_SECURITY_SALT)) $chain = $conf->global->MAIN_SECURITY_SALT.$chain;
if (! empty($conf->global->MAIN_SECURITY_SALT) && $type != '4' && $type !== 'md5openldap') $chain = $conf->global->MAIN_SECURITY_SALT.$chain;
if ($type == '1' || $type == 'sha1') return sha1($chain);
elseif ($type == '2' || $type == 'sha1md5') return sha1(md5($chain));

View File

@ -232,13 +232,9 @@ if (!function_exists('dol_loginfunction'))
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 128;
}
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'))
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg'))
{
$urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png';
}
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
{
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png';
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}
// Security graphical code

View File

@ -410,6 +410,13 @@ class pdf_eratosthene extends ModelePDFCommandes
}
}
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote))
{
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
$pagenb = $pdf->getPage();
if ($notetoshow)
{
@ -702,6 +709,17 @@ class pdf_eratosthene extends ModelePDFCommandes
$nexY = max($pdf->GetY(), $nexY);
}
// Extrafields
if(!empty($object->lines[$i]->array_options)){
foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue){
if ($this->getColumnStatus($extrafieldColKey))
{
$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey);
$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
$nexY = max($pdf->GetY(), $nexY);
}
}
}
$parameters = array(
'object' => $object,
@ -1804,7 +1822,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$this->cols['discount']['status'] = true;
}
$rank = $rank + 10;
$rank = $rank + 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
$this->cols['totalexcltax'] = array(
'rank' => $rank,
'width' => 26, // in mm
@ -1815,6 +1833,11 @@ class pdf_eratosthene extends ModelePDFCommandes
'border-left' => true, // add left line separator
);
// Add extrafields cols
if(!empty($object->lines)) {
$line = reset($object->lines);
$this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
}
$parameters = array(
'object' => $object,

View File

@ -313,6 +313,8 @@ class pdf_espadon extends ModelePdfExpedition
$tab_height = 130;
$tab_height_newpage = 150;
$this->posxdesc = $this->marge_gauche + 1;
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
@ -336,7 +338,17 @@ class pdf_espadon extends ModelePdfExpedition
}
}
if (!empty($object->note_public) || !empty($object->tracking_number))
// display note
$notetoshow = empty($object->note_public) ? '' : $object->note_public;
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote))
{
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
if (!empty($notetoshow) || !empty($object->tracking_number))
{
$tab_top = 88 + $height_incoterms;
$tab_top_alt = $tab_top;
@ -375,10 +387,10 @@ class pdf_espadon extends ModelePdfExpedition
}
// Notes
if (!empty($object->note_public))
if (!empty($notetoshow))
{
$pdf->SetFont('', '', $default_font_size - 1); // In loop to manage multi-page
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top_alt, dol_htmlentitiesbr($notetoshow), 0, 1);
}
$nexY = $pdf->GetY();
@ -558,7 +570,17 @@ class pdf_espadon extends ModelePdfExpedition
$nexY = max($pdf->GetY(), $nexY);
}
// Extrafields
if(!empty($object->lines[$i]->array_options)){
foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue){
if ($this->getColumnStatus($extrafieldColKey))
{
$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey);
$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
$nexY = max($pdf->GetY(), $nexY);
}
}
}
$nexY += 3;
if ($weighttxt && $voltxt) $nexY += 2;
@ -1225,6 +1247,11 @@ class pdf_espadon extends ModelePdfExpedition
),
);
// Add extrafields cols
if(!empty($object->lines)) {
$line = reset($object->lines);
$this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
}
$parameters = array(
'object' => $object,

View File

@ -1115,10 +1115,9 @@ class pdf_crabe extends ModelePDFFactures
// If payment mode not forced or forced to VIR, show payment with BAN
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
{
if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER))
{
$bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
if (!empty($object->fk_bank)) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) {
$bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
if ($object->fk_bank > 0) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
$account = new Account($this->db);
$account->fetch($bankid);

View File

@ -126,10 +126,11 @@ class pdf_sponge extends ModelePDFFactures
*/
public $situationinvoice;
/**
* @var float X position for the situation progress column
* @var array of document table collumns
*/
public $posxprogress;
public $cols;
/**
@ -407,6 +408,8 @@ class pdf_sponge extends ModelePDFFactures
$tab_height_newpage = 150;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift;
$nexY = $tab_top - 1;
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
@ -444,6 +447,13 @@ class pdf_sponge extends ModelePDFFactures
}
}
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote))
{
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
$pagenb = $pdf->getPage();
if ($notetoshow)
{
@ -632,8 +642,6 @@ class pdf_sponge extends ModelePDFFactures
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter = $pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
$pageposafter = $pdf->getPage();
@ -735,6 +743,18 @@ class pdf_sponge extends ModelePDFFactures
$nexY = max($pdf->GetY(), $nexY);
}
// Extrafields
if(!empty($object->lines[$i]->array_options)){
foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue){
if ($this->getColumnStatus($extrafieldColKey))
{
$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey);
$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
$nexY = max($pdf->GetY(), $nexY);
}
}
}
$parameters = array(
'object' => $object,
@ -1052,7 +1072,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Show miscellaneous information (payment mode, payment term, ...)
*
* @param PDF $pdf Object PDF
* @param tcpdf $pdf Object PDF
* @param Object $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
@ -1199,10 +1219,9 @@ class pdf_sponge extends ModelePDFFactures
// If payment mode not forced or forced to VIR, show payment with BAN
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
{
if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER))
{
$bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
if (!empty($object->fk_bank)) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) {
$bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
if ($object->fk_bank > 0) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
$account = new Account($this->db);
$account->fetch($bankid);
@ -1223,7 +1242,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Show total to pay
*
* @param PDF $pdf Object PDF
* @param TCPDI $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Amount already paid (in the currency of invoice)
* @param int $posy Position depart
@ -1789,7 +1808,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Show table for lines
*
* @param PDF $pdf Object PDF
* @param tcpdf $pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used)
@ -1849,7 +1868,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Show top header of page.
*
* @param PDF $pdf Object PDF
* @param Tcpdf $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
@ -2345,7 +2364,7 @@ class pdf_sponge extends ModelePDFFactures
$this->cols['discount']['status'] = true;
}
$rank = $rank + 10;
$rank = $rank + 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
$this->cols['totalexcltax'] = array(
'rank' => $rank,
'width' => 26, // in mm
@ -2356,6 +2375,11 @@ class pdf_sponge extends ModelePDFFactures
'border-left' => true, // add left line separator
);
// Add extrafields cols
if(!empty($object->lines)) {
$line = reset($object->lines);
$this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
}
$parameters = array(
'object' => $object,

View File

@ -418,6 +418,14 @@ class pdf_cyan extends ModelePDFPropales
if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote))
{
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0)
{
$tmpuser = new User($this->db);
@ -717,6 +725,17 @@ class pdf_cyan extends ModelePDFPropales
$nexY = max($pdf->GetY(), $nexY);
}
// Extrafields
if(!empty($object->lines[$i]->array_options)){
foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue){
if ($this->getColumnStatus($extrafieldColKey))
{
$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey);
$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
$nexY = max($pdf->GetY(), $nexY);
}
}
}
$parameters = array(
'object' => $object,
@ -1952,7 +1971,7 @@ class pdf_cyan extends ModelePDFPropales
$this->cols['discount']['status'] = true;
}
$rank = $rank + 10;
$rank = $rank + 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
$this->cols['totalexcltax'] = array(
'rank' => $rank,
'width' => 26, // in mm
@ -1963,6 +1982,11 @@ class pdf_cyan extends ModelePDFPropales
'border-left' => true, // add left line separator
);
// Add extrafields cols
if(!empty($object->lines)) {
$line = reset($object->lines);
$this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
}
$parameters = array(
'object' => $object,

View File

@ -369,6 +369,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
// Affiche notes
$notetoshow = empty($object->note_public) ? '' : $object->note_public;
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote))
{
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
$pagenb = $pdf->getPage();
if ($notetoshow)
{
@ -649,6 +656,17 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$nexY = max($pdf->GetY(), $nexY);
}
// Extrafields
if(!empty($object->lines[$i]->array_options)){
foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue){
if ($this->getColumnStatus($extrafieldColKey))
{
$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey);
$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
$nexY = max($pdf->GetY(), $nexY);
}
}
}
$parameters = array(
'object' => $object,
@ -1596,7 +1614,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->cols['discount']['status'] = true;
}
$rank = $rank + 10;
$rank = $rank + 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
$this->cols['totalexcltax'] = array(
'rank' => $rank,
'width' => 26, // in mm
@ -1607,6 +1625,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
'border-left' => true, // add left line separator
);
// Add extrafields cols
if(!empty($object->lines)) {
$line = reset($object->lines);
$this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
}
$parameters = array(
'object' => $object,
@ -1630,230 +1653,4 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->cols = $hookmanager->resArray;
}
}
/*
*
* DEBUT PARTIE NORMALEMENT DANS LA CLASSE CommonDocGenerator
*
*
*/
/**
* uasort callback function to Sort columns fields
*
* @param array $a PDF lines array fields configs
* @param array $b PDF lines array fields configs
* @return int Return compare result
*/
public function columnSort($a, $b)
{
if (empty($a['rank'])) { $a['rank'] = 0; }
if (empty($b['rank'])) { $b['rank'] = 0; }
if ($a['rank'] == $b['rank']) {
return 0;
}
return ($a['rank'] > $b['rank']) ? -1 : 1;
}
/**
* Prepare Array Column Field
*
* @param object $object common object
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @return null
*/
public function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
global $conf;
$this->defineColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
// Sorting
uasort($this->cols, array($this, 'columnSort'));
// Positionning
$curX = $this->page_largeur - $this->marge_droite; // start from right
// Array width
$arrayWidth = $this->page_largeur - $this->marge_droite - $this->marge_gauche;
// Count flexible column
$totalDefinedColWidth = 0;
$countFlexCol = 0;
foreach ($this->cols as $colKey => &$colDef)
{
if (!$this->getColumnStatus($colKey)) continue; // continue if disabled
if (!empty($colDef['scale'])) {
// In case of column widht is defined by percentage
$colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100);
}
if (empty($colDef['width'])) {
$countFlexCol++;
}
else {
$totalDefinedColWidth += $colDef['width'];
}
}
foreach ($this->cols as $colKey => &$colDef)
{
// setting empty conf with default
if (!empty($colDef['title'])) {
$colDef['title'] = array_replace($this->defaultTitlesFieldsStyle, $colDef['title']);
}
else {
$colDef['title'] = $this->defaultTitlesFieldsStyle;
}
// setting empty conf with default
if (!empty($colDef['content'])) {
$colDef['content'] = array_replace($this->defaultContentsFieldsStyle, $colDef['content']);
}
else {
$colDef['content'] = $this->defaultContentsFieldsStyle;
}
if ($this->getColumnStatus($colKey))
{
// In case of flexible column
if (empty($colDef['width'])) {
$colDef['width'] = abs(($arrayWidth - $totalDefinedColWidth)) / $countFlexCol;
}
// Set positions
$lastX = $curX;
$curX = $lastX - $colDef['width'];
$colDef['xStartPos'] = $curX;
$colDef['xEndPos'] = $lastX;
}
}
}
/**
* get column content width from column key
*
* @param string $colKey the column key
* @return float width in mm
*/
public function getColumnContentWidth($colKey)
{
$colDef = $this->cols[$colKey];
return $colDef['width'] - $colDef['content']['padding'][3] - $colDef['content']['padding'][1];
}
/**
* get column content X (abscissa) left position from column key
*
* @param string $colKey the column key
* @return float X position in mm
*/
public function getColumnContentXStart($colKey)
{
$colDef = $this->cols[$colKey];
return $colDef['xStartPos'] + $colDef['content']['padding'][3];
}
/**
* get column position rank from column key
*
* @param string $colKey the column key
* @return int rank on success and -1 on error
*/
public function getColumnRank($colKey)
{
if (!isset($this->cols[$colKey]['rank'])) return -1;
return $this->cols[$colKey]['rank'];
}
/**
* get column position rank from column key
*
* @param string $newColKey the new column key
* @param array $defArray a single column definition array
* @param string $targetCol target column used to place the new column beside
* @param bool $insertAfterTarget insert before or after target column ?
* @return int new rank on success and -1 on error
*/
public function insertNewColumnDef($newColKey, $defArray, $targetCol = false, $insertAfterTarget = false)
{
// prepare wanted rank
$rank = -1;
// try to get rank from target column
if (!empty($targetCol)) {
$rank = $this->getColumnRank($targetCol);
if ($rank >= 0 && $insertAfterTarget) { $rank++; }
}
// get rank from new column definition
if ($rank < 0 && !empty($defArray['rank'])) {
$rank = $defArray['rank'];
}
// error: no rank
if ($rank < 0) { return -1; }
foreach ($this->cols as $colKey =>& $colDef)
{
if ($rank <= $colDef['rank'])
{
$colDef['rank'] = $colDef['rank'] + 1;
}
}
$defArray['rank'] = $rank;
$this->cols[$newColKey] = $defArray; // array_replace is used to preserve keys
return $rank;
}
/**
* print standard column content
*
* @param PDF $pdf pdf object
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
* @return int new rank on success and -1 on error
*/
public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{
global $hookmanager;
$parameters = array(
'curY' =>& $curY,
'columnText' => $columnText,
'colKey' => $colKey
);
$reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (!$reshook)
{
if (empty($columnText)) return;
$pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position
$colDef = $this->cols[$colKey];
$pdf->MultiCell($this->getColumnContentWidth($colKey), 2, $columnText, '', $colDef['content']['align']);
}
}
/**
* get column status from column key
*
* @param string $colKey the column key
* @return float width in mm
*/
public function getColumnStatus($colKey)
{
if (!empty($this->cols[$colKey]['status'])) {
return true;
}
else return false;
}
}

View File

@ -196,6 +196,9 @@ $langs->load("modulebuilder");
<!-- Visibility -->
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int')!='' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
<!-- Visibility for PDF-->
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
</td><td class="valeur"><input id="printable" type="checkbox" name="printable"<?php echo GETPOST('printable', 'alpha')?' checked':''; ?>></td></tr>
<!-- Totalizable -->
<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable', 'alpha') || GETPOST('button', 'alpha'))?' checked':''); ?>></td></tr>
<!-- Help tooltip -->

View File

@ -165,6 +165,7 @@ $list=$extrafields->attributes[$elementtype]['list'][$attrname];
$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
$help=$extrafields->attributes[$elementtype]['help'][$attrname];
$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname];
$printable=$extrafields->attributes[$elementtype]['printable'][$attrname];
if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
{
@ -261,8 +262,12 @@ else
<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required?' checked':''); ?>></td></tr>
<!-- Always editable -->
<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable?' checked':''); ?>></td></tr>
<!-- Visibility -->
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list!=''?$list:'1'); ?>"></td></tr>
<!-- Visibility for PDF-->
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
</td><td class="valeur"><input id="printable" type="checkbox" name="printable"<?php echo !empty($printable)?' checked':''; ?>></td></tr>
<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable?' checked':''); ?>></td></tr>
<!-- Help tooltip -->
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
@ -270,7 +275,6 @@ else
<!-- Multicompany entity -->
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ?' checked':''); ?>></td></tr>
<?php } ?>
<!-- Visibility -->
</table>
<?php dol_fiche_end(); ?>

View File

@ -64,8 +64,9 @@ print '<td class="center">'.$langs->trans("Unique").'</td>';
print '<td class="center">'.$langs->trans("Required").'</td>';
print '<td class="center">'.$langs->trans("AlwaysEditable").'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
if ($conf->multicompany->enabled) {
if ($conf->multicompany->enabled){
print '<td class="center">'.$langs->trans("Entities").'</td>';
}
print '<td width="80">&nbsp;</td>';
@ -92,6 +93,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n";
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n";
print '<td class="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n";
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['printable'][$key])."</td>\n";
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n";
if (! empty($conf->multicompany->enabled)) {
print '<td class="center">';

View File

@ -1094,7 +1094,7 @@ class Cronjob extends CommonObject
$errmsg = '';
if (!is_array($object->errors) || !in_array($object->error, $object->errors)) $errmsg .= $object->error;
if (is_array($object->errors) && count($object->errors)) $errmsg .= ($errmsg ? ', '.$errmsg : '').join(', ', $object->errors);
if (is_array($object->errors) && count($object->errors)) $errmsg .= (($errmsg ? ', ' : '').join(', ', $object->errors));
if (empty($errmsg)) $errmsg = $langs->trans('ErrorUnknown');
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
@ -1320,9 +1320,9 @@ class Cronjob extends CommonObject
if ($processing) $moretext = ' ('.$langs->trans("Running").')';
elseif ($lastresult) $moretext .= ' ('.$langs->trans("Error").')';
$this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Draft').$moretext;
$this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled').$moretext;
$this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled').$moretext;
$this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled');
$this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled');
}

View File

@ -753,8 +753,10 @@ class Fichinter extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("ShowIntervention").'</u>';
if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
$url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id;

View File

@ -204,7 +204,7 @@ foreach ($arrayfields as $tmpkey => $tmpval)
$sql = "SELECT";
$sql .= " f.ref, f.rowid, f.fk_statut, f.description, f.datec as date_creation, f.tms as date_update, f.note_private,";
if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= "fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,";
$sql .= " s.nom as name, s.rowid as socid, s.client";
$sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus";
if (!empty($conf->projet->enabled)) {
$sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title";
}
@ -479,6 +479,13 @@ if ($resql)
$objectstatic->ref = $obj->ref;
$objectstatic->statut = $obj->fk_statut;
$companystatic->name=$obj->name;
$companystatic->id=$obj->socid;
$companystatic->client=$obj->client;
$companystatic->fournisseur=$obj->fournisseur;
$companystatic->email=$obj->email;
$companystatic->status=$obj->thirdpartystatus;
print '<tr class="oddeven">';
if (!empty($arrayfields['f.ref']['checked']))
@ -521,9 +528,6 @@ if ($resql)
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td>';
$companystatic->name=$obj->name;
$companystatic->id=$obj->socid;
$companystatic->client=$obj->client;
print $companystatic->getNomUrl(1, '', 44);
print '</td>';
if (! $i) $totalarray['nbfield']++;

View File

@ -2358,6 +2358,9 @@ class FactureFournisseur extends CommonInvoice
elseif ($this->type == self::TYPE_CREDIT_NOTE) $label = $langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
elseif ($this->type == self::TYPE_DEPOSIT) $label = $langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
if ($moretitle) $label .= ' - '.$moretitle;
if (isset($this->statut) && isset($this->alreadypaid)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5, $this->alreadypaid);
}
$ref = $this->ref;
if (empty($ref)) $ref = $this->id;

View File

@ -849,6 +849,9 @@ if ($resql)
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
$facturestatic->alreadypaid = ($paiement ? $paiement : 0);
//If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice
if ($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) {
if ($facturestatic->isCreditNoteUsed()) {
@ -1081,7 +1084,6 @@ if ($resql)
if (!empty($arrayfields['f.fk_statut']['checked']))
{
print '<td class="right nowrap">';
// TODO $paiement is not yet defined
print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type);
print "</td>";
if (!$i) $totalarray['nbfield']++;

View File

@ -206,7 +206,7 @@ input:-webkit-autofill {
table.listofchoices, table.listofchoices tr, table.listofchoices td {
border-collapse: collapse;
padding: 4px;
padding: 8px;
color: #000000;
border: 1px solid #ccc !important;
line-height: 18px;
@ -275,6 +275,7 @@ div.header {
a:link,a:visited,a:active {
text-decoration:none;
color: #114466;
}
a:hover {
text-decoration:underline;
@ -344,10 +345,21 @@ ul {
padding-bottom: 0;
}
tr.choiceselected td.listofchoicesdesc {
color: #000 !important;
}
.button {
tr.choiceselected td .button {
background: rgb(0,113,121);
color: #fff;
}
a.button:link,a.button:visited,a.button:active {
color: #888;
}
.button {
background: #ddd;
color: #fff;
/* border: 1px solid #e0e0e0; */
padding: 0.3em 0.7em;
margin: 0 0.5em;
@ -363,7 +375,7 @@ a.button:hover {
}
.choiceselected {
background-color: #f4fcf4;
background-color: #f4f6f4;
background-repeat: repeat-x;
background-position: top left;
}

View File

@ -399,7 +399,7 @@ function pHeader($subtitle, $next, $action = 'set', $param = '', $forcejqueryurl
print '<body>'."\n";
print '<div class="divlogoinstall" style="text-align:center">';
print '<img class="imglogoinstall" src="../theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
print '<img class="imglogoinstall" src="../theme/dolibarr_logo.svg" alt="Dolibarr logo" width="300px"><br>';
print DOL_VERSION;
print '</div><br>';

View File

@ -40,6 +40,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
-- For v12
@ -179,4 +181,9 @@ INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, desc
INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL);
INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL);
DELETE FROM llx_const WHERE name = __ENCRYPT('DONATION_ART885')__;
DELETE FROM llx_const WHERE name = __ENCRYPT('DONATION_ART885')__;
ALTER TABLE llx_extrafields MODIFY COLUMN printable integer DEFAULT 0;
ALTER TABLE llx_extrafields ADD COLUMN printable integer DEFAULT 0;

View File

@ -36,7 +36,7 @@ create table llx_extrafields
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
param text, -- extra parameters to define possible values of field
list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing
printable boolean DEFAULT FALSE, -- is the extrafield output on documents
printable integer DEFAULT 0, -- is the extrafield output on documents
totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list
langs varchar(64), -- example: fileofmymodule@mymodule
help text, -- to store help tooltip

View File

@ -1686,6 +1686,8 @@ CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point of Sale disabled
StockDecreaseForPointOfSaleDisabledbyBatch=Stock decrease in POS is not compatible with module Serial/Lot management (currently active) so stock decrease is disabled.
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point of Sale. Hence a warehouse is required.
CashDeskForceDecreaseStockLabel=Stock decrease for batch products was forced.
CashDeskForceDecreaseStockDesc=Decrease first by the oldest eatby and sellby dates.
##### Bookmark #####
BookmarkSetup=Bookmark module setup
BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or external web sites on your left menu.

View File

@ -230,6 +230,8 @@ ErrorAddAtLeastOneLineFirst=Add at least one line first
ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible.
ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother=Error, language is mandatory if you set the page as a translation of another one.
ErrorLanguageOfTranslatedPageIsSameThanThisPage=Error, language of translated page is same than this one.
ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in warehouse "%s".
ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s".
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.

View File

@ -84,6 +84,8 @@ ListOfPermissionsDefined=List of defined permissions
SeeExamples=See examples here
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example:<br>preg_match('/public/', $_SERVER['PHP_SELF'])?0:1<br>($user->rights->holiday->define_holiday ? 1 : 0)
DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.<br/>Currently, known compatibles PDF models are : eratostene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)
DisplayOnPdf=Display on PDF
IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0)
SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0)
SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax.

View File

@ -31,7 +31,7 @@ NextYearOfInvoice=Following year of invoice date
DateNextInvoiceBeforeGen=Date of next invoice (before generation)
DateNextInvoiceAfterGen=Date of next invoice (after generation)
GraphInBarsAreLimitedTo3Measures=Grapics are limited to 3 measures in 'Bars' mode. The mode 'Lines' was automatically selected instead.
OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected.
OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected.
AtLeastOneMeasureIsRequired=At least 1 field for measure is required
AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required
@ -278,3 +278,7 @@ LinesToImport=Lines to import
MemoryUsage=Memory usage
RequestDuration=Duration of request
PopuProp=Products/Services by popularity in Proposals
PopuCom=Products/Services by popularity in Orders
ProductStatistics=Products/Services Statistics
NbOfQtyInOrders=Qty in orders

View File

@ -1683,6 +1683,8 @@ CashDeskIdWareHouse=Forcer et restreindre l'emplacement/entrepôt à utiliser po
StockDecreaseForPointOfSaleDisabled=Réduction de stock lors de l'utilisation du Point de Vente désactivée
StockDecreaseForPointOfSaleDisabledbyBatch=La décrémentation de stock depuis ce module Point de Vente n'est pas encore compatible avec la gestion des numéros de lots/série.
CashDeskYouDidNotDisableStockDecease=Vous n'avez pas désactivé la réduction de stock lors d'une vente depuis le Point de vente. Par conséquent, un entrepôt est nécessaire.
CashDeskForceDecreaseStockLabel=Décrémentation des stocks pour les lots a été forcé.
CashDeskForceDecreaseStockDesc=Décrémentation des lots par DLC et DLUO les plus anciennes.
##### Bookmark #####
BookmarkSetup=Configuration du module Marque-pages
BookmarkDesc=Ce module vous permet de gérer des liens et raccourcis. Il permet aussi d'ajouter n'importe quelle page de Dolibarr ou lien web dans le menu d'accès rapide sur la gauche.

View File

@ -227,6 +227,8 @@ ErrorNoFieldWithAttributeShowoncombobox=Aucun champ n'a la propriété 'showonco
ErrorFieldRequiredForProduct=Le champ '%s' est obligatoire pour le produit %s
ProblemIsInSetupOfTerminal=Le problème est dans la configuration du terminal %s.
ErrorAddAtLeastOneLineFirst=Ajouter d'abord au moins une ligne
ErrorBatchNoFoundForProductInWarehouse=Aucun lot trouvé pour le produit "%s" dans l'entrepôt "%s".
ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=Quantité insuffisante dans les lots pour le produit "%s" dans l'entepôt "%s".
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente.
WarningPasswordSetWithNoAccount=Un mot de passe a été fixé pour cet adhérent. Cependant, aucun compte d'utilisateur n'a été créé. Donc, ce mot de passe est stocké, mais ne peut être utilisé pour accéder à Dolibarr. Il peut être utilisé par un module/interface externe, mais si vous n'avez pas besoin de définir ni login ni mot de passe pour un adhérent, vous pouvez désactiver l'option «Gérer un login pour chaque adhérent" depuis la configuration du module Adhérents. Si vous avez besoin de gérer un login, mais pas de mot de passe, vous pouvez laisser ce champ vide pour éviter cet avertissement. Remarque: L'email peut également être utilisé comme login si l'adhérent est lié à un utilisateur.

View File

@ -1898,13 +1898,15 @@ function top_menu_user()
$( document ).ready(function() {
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
// Hide the menus.
//console.log("close login dropdown");
// Hide the menus.
$("#topmenu-login-dropdown").removeClass("open");
}
});
$("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
event.preventDefault();
console.log("toggle login dropdown");
event.preventDefault();
$("#topmenu-login-dropdown").toggleClass("open");
});
@ -1954,14 +1956,14 @@ function top_menu_bookmark()
$( document ).ready(function() {
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-bookmark-dropdown").length) {
console.log("close");
//console.log("close bookmark dropdown - we click outside");
// Hide the menus.
$("#topmenu-bookmark-dropdown").removeClass("open");
}
});
$("#topmenu-bookmark-dropdown .dropdown-toggle").on("click", function(event) {
console.log("toggle");
console.log("toggle bookmark dropdown");
openBookMarkDropDown();
});
@ -2077,7 +2079,7 @@ function top_menu_search()
// close drop down
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
console.log("click close");
console.log("click close search - we click outside");
// Hide the menus.
$("#topmenu-global-search-dropdown").removeClass("open");
}
@ -2085,7 +2087,7 @@ function top_menu_search()
// Open drop down
$("#topmenu-global-search-dropdown .dropdown-toggle").on("click", function(event) {
console.log("click open");
console.log("toggle search dropdown");
openGlobalSearchDropDown();
});

View File

@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
*/
class Productbatch extends CommonObject
{
/**
* Batches rules
*/
const BATCH_RULE_SELLBY_EATBY_DATES_FIRST = 1;
/**
* @var string ID to identify managed object
*/
@ -540,4 +545,65 @@ class Productbatch extends CommonObject
return -1;
}
}
/**
* Return all batch for a product and a warehouse
*
* @param DoliDB $db Database object
* @param int $fk_product Id of product
* @param int $fk_warehouse Id of warehouse
* @param int $qty_min [=NULL] Minimum quantity
* @param string $sortfield [=NULL] List of sort fields, separated by comma. Example: 't1.fielda,t2.fieldb'
* @param string $sortorder [=NULL] Sort order, separated by comma. Example: 'ASC,DESC';
* @return int|array <0 if KO, array of batch
*
* @throws Exception
*/
public static function findAllForProduct($db, $fk_product, $fk_warehouse = 0, $qty_min = null, $sortfield = null, $sortorder = null)
{
$productBatchList = array();
dol_syslog(__METHOD__ . ' fk_product=' . $fk_product . ', fk_warehouse=' . $fk_warehouse . ', qty_min=' . $qty_min . ', sortfield=' . $sortfield . ', sortorder=' . $sortorder, LOG_DEBUG);
$sql = "SELECT";
$sql .= " pl.rowid";
$sql .= ", pl.fk_product";
$sql .= ", pl.batch";
$sql .= ", pl.sellby";
$sql .= ", pl.eatby";
$sql .= ", pb.qty";
$sql .= " FROM " . MAIN_DB_PREFIX . "product_lot as pl";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = pl.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_batch AS pb ON pl.batch = pb.batch";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_stock AS ps ON ps.rowid = pb.fk_product_stock";
$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
$sql .= " AND pl.fk_product = " . $fk_product;
if ($fk_warehouse > 0) {
$sql .= " AND ps.fk_entrepot = " . $fk_warehouse;
}
if ($qty_min !== null) {
$sql .= " AND pb.qty > " . $qty_min;
}
$sql .= $db->order($sortfield, $sortorder);
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
$productBatch = new self($db);
$productBatch->id = $obj->rowid;
$productBatch->fk_product = $obj->fk_product;
$productBatch->batch = $obj->batch;
$productBatch->eatby = $db->jdate($obj->eatby);
$productBatch->sellby = $db->jdate($obj->sellby);
$productBatch->qty = $obj->qty;
$productBatchList[] = $productBatch;
}
$db->free($resql);
return $productBatchList;
} else {
dol_syslog(__METHOD__ . ' Error: ' . $db->lasterror(), LOG_ERR);
return -1;
}
}
}

217
htdocs/product/popucom.php Normal file
View File

@ -0,0 +1,217 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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 <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/popucom.php
* \ingroup commande, produit
* \brief Liste des produits/services par popularite
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Load translation files required by the page
//Required to translate NbOfCommande
$langs->load('commande');
$type=GETPOST("type", "int");
// Security check
if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service');
$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
if (! $sortfield) $sortfield="c";
if (! $sortorder) $sortorder="DESC";
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$staticproduct=new Product($db);
/*
* View
*/
$helpurl='';
if ($type == '0')
{
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
elseif ($type == '1')
{
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
else
{
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
$title=$langs->trans("Statistics");
llxHeader('', $title, $helpurl);
print load_fiche_titre($title, $mesg, 'products');
$param = '';
$title = $langs->trans("ListProductServiceByPopularity");
if ((string) $type == '1') {
$title = $langs->trans("ListServiceByPopularity");
}
if ((string) $type == '0') {
$title = $langs->trans("ListProductByPopularity");
}
if ($type != '') $param .= '&type='.$type;
$h=0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php?id=all';
$head[$h][1] = $langs->trans("Chart");
$head[$h][2] = 'chart';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php';
$head[$h][1] = $langs->trans("PopuProp");
$head[$h][2] = 'popularityprop';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/popucom.php';
$head[$h][1] = $langs->trans("PopuCom");
$head[$h][2] = 'popularitycommande';
$h++;
dol_fiche_head($head, 'popularitycommande', $langs->trans("Statistics"), -1);
// Array of liens to show
$infoprod=array();
// Add lines for commande
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, SUM(pd.qty) as c";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
$sql.= " AND p.rowid = pd.fk_product";
if ($type !== '') {
$sql.= " AND fk_product_type = ".$type;
}
$sql.= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type";
$result=$db->query($sql);
if ($result)
{
$totalnboflines = $db->num_rows($result);
}
$sql.= $db->order($sortfield, $sortorder);
$sql.= $db->plimit($limit+1, $offset);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label);
$infoprod[$objp->rowid]['nblinecommande']=$objp->c;
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
//var_dump($infoprod);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, '');
print '<table class="noborder centpercent">';
print "<tr class=\"liste_titre\">";
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('NbOfQtyInOrders', $_SERVER["PHP_SELF"], 'c', '', $param, '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
foreach($infoprod as $prodid => $vals)
{
// Multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
{
$sql = "SELECT label";
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql.= " WHERE fk_product=".$prodid;
$sql.= " AND lang='". $langs->getDefaultLang() ."'";
$sql.= " LIMIT 1";
$resultp = $db->query($sql);
if ($resultp)
{
$objtp = $db->fetch_object($resultp);
if (! empty($objtp->label)) $vals['label'] = $objtp->label;
}
}
print "<tr>";
print '<td><a href="'.DOL_URL_ROOT.'/product/stats/card.php?id='.$prodid.'">';
if ($vals['type'] == 1) print img_object($langs->trans("ShowService"), "service");
else print img_object($langs->trans("ShowProduct"), "product");
print " ";
print $vals['ref'].'</a></td>';
print '<td>';
if ($vals['type'] == 1) print $langs->trans("Service");
else print $langs->trans("Product");
print '</td>';
print '<td>'.$vals['label'].'</td>';
print '<td class="right">'.$vals['nblinecommande'].'</td>';
print "</tr>\n";
$i++;
}
print "</table>";
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -99,11 +99,16 @@ $head[$h][1] = $langs->trans("Chart");
$head[$h][2] = 'chart';
$h++;
$head[$h][0] = $_SERVER['PHP_SELF'];
$head[$h][1] = $title;
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php';
$head[$h][1] = $langs->trans("PopuProp");
$head[$h][2] = 'popularityprop';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/popucom.php';
$head[$h][1] = $langs->trans("PopuCom");
$head[$h][2] = 'popularitycommande';
$h++;
dol_fiche_head($head, 'popularityprop', $langs->trans("Statistics"), -1);

View File

@ -161,10 +161,15 @@ if (empty($id) & empty($ref))
}
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != '' ? '?type='.$type : '');
$head[$h][1] = $title;
$head[$h][1] = $langs->trans("PopuProp");
$head[$h][2] = 'popularityprop';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/popucom.php'.($type != '' ? '?type='.$type : '');
$head[$h][1] = $langs->trans("PopuCom");
$head[$h][2] = 'popularitycommande';
$h++;
dol_fiche_head($head, 'chart', $langs->trans("Statistics"), -1);
}

View File

@ -2417,7 +2417,9 @@ class Societe extends CommonObject
$label .= '<br><b>'.$langs->trans('CustomerAccountancyCode').':</b> '.($this->code_compta ? $this->code_compta : $this->code_compta_client);
if (!empty($conf->accounting->enabled) && $this->fournisseur)
$label .= '<br><b>'.$langs->trans('SupplierAccountancyCode').':</b> '.$this->code_compta_fournisseur;
if (isset($this->status)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
$label .= '</div>';
// Add type of canvas

View File

@ -179,7 +179,7 @@ if (!empty($conf->stock->enabled))
{
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td>';
if (empty($conf->productbatch->enabled)) {
if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
}
else
@ -207,6 +207,13 @@ if (!empty($conf->stock->enabled))
print '<span class="opacitymedium">'.$langs->trans("StockDecreaseForPointOfSaleDisabled").'</span>';
}
print '</td></tr>';
if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK) && !$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
print '<tr class="oddeven"><td>' . $langs->trans('CashDeskForceDecreaseStockLabel') . '</td>';
print '<td>';
print '<span class="opacitymedium">' . $langs->trans('CashDeskForceDecreaseStockDesc') . '</span>';
print '</td></tr>';
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {

View File

@ -190,7 +190,12 @@ if ($action == 'valid' && $user->rights->facture->creer)
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey);
$res = $invoice->validate($user, '', $conf->global->$constantforkey);
$batch_rule = 0;
if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
require_once DOL_DOCUMENT_ROOT . '/product/class/productbatch.class.php';
$batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST;
}
$res = $invoice->validate($user, '', $conf->global->$constantforkey, 0, $batch_rule);
$conf->global->STOCK_CALCULATE_ON_BILL = $savconst;
}
@ -441,6 +446,10 @@ if ($action == "updatereduction")
if ($action == "order" and $placeid != 0)
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter"){
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$printer = new dolReceiptPrinter($db);
}
$headerorder = '<html><br><b>'.$langs->trans('Place').' '.$place.'<br><table width="65%"><thead><tr><th class="left">'.$langs->trans("Label").'</th><th class="right">'.$langs->trans("Qty").'</th></tr></thead><tbody>';
$footerorder = '</tbody></table>'.dol_print_date(dol_now(), 'dayhour').'<br></html>';
@ -458,13 +467,20 @@ if ($action == "order" and $placeid != 0)
$result = array_intersect($catsprinter1, $existing);
$count = count($result);
if ($count > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where rowid=".$line->id;
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='1' where rowid=".$line->id; //Set to print on printer 1
$db->query($sql);
$order_receipt_printer1 .= '<tr>'.$line->product_label.'<td class="right">'.$line->qty;
if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1 .= "<br>(".$line->array_options['options_order_notes'].")";
$order_receipt_printer1 .= '</td></tr>';
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter"){
$invoice->fetch($placeid); //Reload object before send to printer
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='1' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);
$invoice->fetch($placeid); //Reload object after set lines as printed
foreach ($invoice->lines as $line)
{
@ -476,15 +492,20 @@ if ($action == "order" and $placeid != 0)
$result = array_intersect($catsprinter2, $existing);
$count = count($result);
if ($count > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where rowid=".$line->id;
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='2' where rowid=".$line->id; //Set to print on printer 2
$db->query($sql);
$order_receipt_printer2 .= '<tr>'.$line->product_label.'<td class="right">'.$line->qty;
if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer2 .= "<br>(".$line->array_options['options_order_notes'].")";
$order_receipt_printer2 .= '</td></tr>';
}
}
$invoice->fetch($placeid);
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter"){
$invoice->fetch($placeid); //Reload object before send to printer
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='2' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);
$invoice->fetch($placeid); //Reload object after set lines as printed
}
$sectionwithinvoicelink = '';

View File

@ -0,0 +1,439 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="720"
height="200"
id="svg3450"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="dolibarr_logo.svg"
inkscape:export-filename="/home/ldestailleur/git/dolibarr-foundation/logo-cliparts/dolibarr_logo.png"
inkscape:export-xdpi="77.362831"
inkscape:export-ydpi="77.362831">
<title
id="title3072">Logo Dolibarr ERP-CRM</title>
<defs
id="defs3452">
<linearGradient
id="linearGradient888">
<stop
style="stop-color:#373d5f;stop-opacity:1"
offset="0"
id="stop884" />
<stop
style="stop-color:#373d5a;stop-opacity:1"
offset="1"
id="stop886" />
</linearGradient>
<linearGradient
id="linearGradient5378">
<stop
id="stop5374"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop5376"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient5372">
<stop
id="stop5368"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop5370"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient5366">
<stop
id="stop5362"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop5364"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient5360">
<stop
id="stop5356"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop5358"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient4730">
<stop
id="stop4726"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop4728"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="5360">
<stop
id="stop4720"
offset="0"
style="stop-color:#373d5f;stop-opacity:1" />
<stop
id="stop4722"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient4718">
<stop
id="stop4714"
offset="0"
style="stop-color:#373d55;stop-opacity:1" />
<stop
id="stop4716"
offset="1"
style="stop-color:#373d5a;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient3734-3-6">
<stop
style="stop-color:#49496f;stop-opacity:1"
offset="0"
id="stop3736" />
<stop
style="stop-color:#45455a;stop-opacity:1"
offset="1"
id="stop3738" />
</linearGradient>
<filter
inkscape:collect="always"
id="filter3775"
style="color-interpolation-filters:sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="11.473048"
id="feGaussianBlur3777" />
</filter>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath922">
<g
style="fill:url(#linearGradient884);fill-opacity:1"
inkscape:label="Clip"
id="use924" />
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3734-3-6"
id="linearGradient4636"
gradientUnits="userSpaceOnUse"
x1="75.697441"
y1="310.53391"
x2="742.98004"
y2="310.53391" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient888"
id="linearGradient4650"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143"
gradientTransform="translate(0,-0.08891)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4718"
id="linearGradient4652"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143"
gradientTransform="translate(0,-1.60543)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4730"
id="linearGradient4654"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5360"
id="linearGradient4658"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143"
gradientTransform="translate(0,-1.0682839)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5366"
id="linearGradient4660"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5372"
id="linearGradient4662"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5378"
id="linearGradient4664"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath880">
<g
inkscape:label="Clip"
id="use882">
<text
transform="matrix(0.35661275,0,0,0.39656343,-125.67134,110.19296)"
id="text889"
y="887.85065"
x="537.1402"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Bitstream Vera Sans';opacity:0.17204303;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter3775)"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:518.16009521px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
y="887.85065"
x="537.1402"
id="tspan887"
sodipodi:role="line">Dolibarr</tspan></text>
</g>
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3734-3-6"
id="linearGradient899"
gradientUnits="userSpaceOnUse"
x1="75.697441"
y1="310.53391"
x2="742.98004"
y2="310.53391" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath923">
<g
inkscape:label="Clip"
id="use925">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Bitstream Vera Sans';opacity:0.17204303;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter3775)"
x="537.1402"
y="887.85065"
id="text932"
transform="matrix(0.35661275,0,0,0.39656343,-121.4287,154.03358)"><tspan
sodipodi:role="line"
id="tspan930"
x="537.1402"
y="887.85065"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:518.16009521px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none">Dolibarr</tspan></text>
</g>
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3734-3-6"
id="linearGradient884"
gradientUnits="userSpaceOnUse"
x1="75.697441"
y1="310.53391"
x2="742.98004"
y2="310.53391" />
<linearGradient
gradientTransform="matrix(1,0,0,0.74259216,53.441098,97.405596)"
inkscape:collect="always"
xlink:href="#linearGradient888"
id="linearGradient4654-3"
gradientUnits="userSpaceOnUse"
x1="385.41022"
y1="210.12474"
x2="386.59824"
y2="386.90143" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568544"
inkscape:cx="318.01609"
inkscape:cy="106.45631"
inkscape:current-layer="g4648"
inkscape:document-units="px"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:showpageshadow="false"
showborder="true"
borderlayer="false"
fit-margin-top="24"
fit-margin-left="24"
fit-margin-right="0"
fit-margin-bottom="0"
showguides="true"
inkscape:guide-bbox="true"
inkscape:measure-start="0,0"
inkscape:measure-end="0,0"
inkscape:pagecheckerboard="true">
<inkscape:grid
type="xygrid"
id="grid1458" />
</sodipodi:namedview>
<metadata
id="metadata3455">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Logo Dolibarr ERP-CRM</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-nd/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Laurent Destailleur</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Laurent Destailleur</dc:title>
</cc:Agent>
</dc:rights>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-nd/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
style="display:inline"
transform="translate(-51.413681,-199.60957)">
<g
id="g4592">
<g
style="fill:url(#linearGradient4636);fill-opacity:1"
id="g4626">
<g
style="fill:url(#linearGradient899)"
id="g4648">
<path
sodipodi:nodetypes="cccccscsssccsssc"
d="m 112.32913,280.29476 v 98.02589 l -36.631688,-0.40123 v 0.40123 -137.35672 h 47.729468 c 20.93239,0 37.32341,5.28424 49.17307,15.85272 14.07523,12.64204 21.11285,29.7991 21.11285,51.47117 0,20.73563 -6.01506,37.65857 -18.04517,50.76884 -12.03011,13.11027 -27.20637,19.35291 -46.1538,19.35291 -2.22557,0 -6.23968,-0.0713 -11.22982,-0.0888 v -40.23379 l 10.08954,-0.0542 c 21.35314,-0.11469 27.8053,-9.87885 27.8053,-29.74492 0,-18.66206 -10.49627,-27.99309 -31.48881,-27.99309 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4650);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8463"
inkscape:connector-curvature="0" />
<path
d="m 251.18669,274.26322 q 19.12787,0 32.75197,15.35106 13.71432,15.25071 13.71432,36.62179 0,21.67206 -13.89478,36.92279 -13.80455,15.25071 -33.38356,15.25071 -19.57899,0 -33.47377,-15.25071 -13.89479,-15.35105 -13.89479,-36.92279 0,-21.97308 13.89479,-36.9228 13.89478,-15.05005 34.28582,-15.05005 z m -0.90227,37.02313 q -5.41355,0 -9.20303,4.41468 -3.78949,4.31435 -3.78949,10.63537 0,6.22068 3.78949,10.63537 3.87971,4.41468 9.20303,4.41468 5.41356,0 9.20304,-4.41468 3.8797,-4.41469 3.8797,-10.63537 0,-6.32102 -3.78947,-10.63537 -3.78949,-4.41468 -9.29327,-4.41468 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4652);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8465"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccccc"
d="M 345.47268,241.05287 V 378.40956 H 311.72822 V 241.05287 Z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4654);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8467"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="csscscsccscsssccscc"
d="m 450.676,239.98458 v 81.97261 c 0,13.31093 4.30076,19.9664 12.90229,19.9664 3.66918,0 6.76693,-1.37123 9.29326,-4.11368 2.58647,-2.80935 3.87971,-6.18725 3.87971,-10.1337 0,-4.08023 -1.20301,-7.49158 -3.60903,-10.23403 -2.40603,-2.80935 -5.3534,-4.21402 -8.84213,-4.21402 -2.46617,0 -8.23123,-0.013 -8.23123,-0.013 l -0.25,-38.08747 c 0,0 6.97747,-0.22701 9.02258,-0.22701 12.69177,0 23.54895,5.08358 32.57153,15.25073 9.08273,10.16714 13.6241,22.40785 13.6241,36.72212 0,14.64872 -5.14562,26.5166 -13.80455,37.02313 -8.57803,10.40836 -22.98621,14.59993 -33.92491,14.51154 -6.73664,-0.0544 -13.32335,-1.10024 -19.75947,-4.37784 -6.37595,-3.27757 -11.63912,-7.69225 -15.78951,-13.24404 -7.21807,-9.63203 -10.8271,-22.10686 -10.8271,-37.42447 v -83.37728 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4658);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8471"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccssscscsccscscscscc"
d="m 575.66649,342.98354 -0.15625,35.42602 c 0,0 -5.0745,0 -7.36022,0 -13.53387,0 -24.8121,-3.24403 -33.83468,-13.14362 -9.02259,-9.89959 -13.53388,-22.30753 -13.53388,-37.2238 0,-14.51494 4.54137,-26.82254 13.6241,-36.92279 9.14289,-10.10026 20.24066,-15.15039 33.29333,-15.15039 14.55643,0 26.01511,4.74913 34.37604,14.24739 8.42108,9.43136 12.63162,22.34096 12.63162,38.72879 l -0.0625,49.46442 h -33.80696 l 0.125,-46.75541 c 0.0141,-5.28421 -1.17293,-9.49824 -3.5188,-12.64203 -2.28573,-3.14379 -5.38348,-4.71569 -9.29327,-4.71569 -3.54889,0 -6.61657,1.43811 -9.20304,4.31434 -2.58647,2.87623 -3.87971,6.28758 -3.87971,10.23405 0,4.14712 1.17294,7.55846 3.51881,10.23403 2.34587,2.67556 5.32333,4.01334 8.93236,4.01334 2.94737,0 8.14805,-0.10867 8.14805,-0.10867 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4660);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8473"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccssccscsc"
d="m 683.66305,275.87667 0.004,38.91662 c 0,0 -4.41872,0.10517 -6.34353,0.10517 -6.13535,0 -9.20303,5.21735 -9.20303,15.65204 v 47.85906 h -33.74447 v -55.08308 c 0,-14.44805 3.54888,-25.95298 10.64665,-34.51479 7.09777,-8.62869 16.57148,-12.94304 28.42114,-12.94304 2.64662,0 10.21945,0.008 10.21945,0.008 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4662);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8475"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccssccscscc"
d="m 742.97999,275.87857 -0.0312,38.94597 c 0,0 -4.51247,0.0739 -6.43728,0.0739 -6.13537,0 -9.20305,5.21735 -9.20305,15.65204 v 47.85906 h -33.74445 v -55.08308 c 0,-14.44805 3.54888,-25.95298 10.64664,-34.51479 7.09777,-8.62869 16.57149,-12.94304 28.42114,-12.94304 2.64663,0 10.34825,0.01 10.34825,0.01 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4664);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7072947;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8477"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccccc"
d="m 398.91378,276.40957 v 102 h -33.74446 v -102 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:194.85823059px;line-height:125%;font-family:'Bauhaus 93';-inkscape-font-specification:'Bauhaus 93';text-align:start;writing-mode:lr-tb;text-anchor:start;display:inline;fill:url(#linearGradient4654-3);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.47124052;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.18431373"
id="path8467-5"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#007179;fill-opacity:1;fill-rule:nonzero;stroke:none"
x="643.31146"
y="229.77211"
id="text5484"
transform="scale(0.88533213,1.1295196)"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42.95219803px;line-height:100%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#007179;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:role="line"
id="tspan5486"
x="643.31146"
y="229.77211">ERP/CRM</tspan></text>
<ellipse
style="fill:#007179;fill-opacity:1;stroke:none;stroke-width:1.02999127;stroke-opacity:1"
id="path957"
cx="381.94193"
cy="247.58162"
rx="17.456699"
ry="18.119612" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -9,7 +9,7 @@ button.dropdown-item.global-search-item {
outline: none;
}
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu{
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open {
display: block;
}

View File

@ -1519,8 +1519,8 @@ div.nopadding {
}
td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto {
color: rgb(<?php print $colortexttitlenotab; ?>);
opacity: 0.5;
color: var(--colortexttitlenotab);
opacity: 0.75;
}
.pictotitle {
margin-<?php echo $right; ?>: 8px;
@ -3597,7 +3597,7 @@ span.dashboardlineko {
.boxtable {
margin-bottom: 25px !important;
border-bottom-width: 1px;
background: var(--colorbackbody);
border-top: <?php echo $borderwidth ?>px solid rgb(<?php echo $colortopbordertitle1 ?>);
/* border-top: 2px solid var(--colorbackhmenu1) !important; */
}
@ -4983,7 +4983,7 @@ input.select2-input {
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: var(--colortext);
background-color: var(--colorbackvmenu1);
/* background-color: var(--colorbackvmenu1); */
}
.select2-default {
color: #999 !important;
@ -5079,8 +5079,8 @@ input.select2-input {
box-shadow: none !important;
}
.select2-dropdown {
background-color: var(--colorbackvmenu1);
border: 1px solid var(--colorbackvmenu1);;
/*background-color: var(--colorbackvmenu1);
border: 1px solid var(--colorbackvmenu1); */
box-shadow: 1px 2px 10px var(--colorbackvmenu1);
}
.select2-dropdown-open {
@ -5405,9 +5405,9 @@ dl.dropdown {
.dropdown dd ul li span {
color: #888;
}
.dropdown dd ul li a:hover {
/*.dropdown dd ul li a:hover {
background-color: var(--inputbackgroundcolor);
}
}*/
dd.dropdowndd ul li {
text-overflow: ellipsis;
overflow: hidden;

View File

@ -32,7 +32,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235, 235, 224);
$theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(191, 75, 57), array(80, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
$theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(80, 166, 90), array(190, 190, 100), array(91, 115, 247), array(140, 140, 220), array(190, 120, 120), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php page, not by the style sheet, if the constant is not defined.
{
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php
@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover
$colorbacklinepairchecked = '230,237,244'; // line checked
$colorbacklinebreak = '233,228,230'; // line break
$colorbackbody = '255,255,255';
$colortexttitlenotab = '0,113,121'; // 140,80,10 or 10,140,80
$colortexttitlenotab = '90,50,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b
$colortexttitle = '0,0,0';
$colortext = '0,0,0';
$colortextlink = '10, 20, 100';