mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
fc5dc0865d
commit
6df4954b20
|
|
@ -632,19 +632,19 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
|
|||
if (empty($reshook)) {
|
||||
// Button re-export
|
||||
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=0' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Activated"), 'switch_on') . '</a> ';
|
||||
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
||||
} else {
|
||||
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=1' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a> ';
|
||||
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
|
||||
}
|
||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">' . $langs->trans("IncludeDocsAlreadyExported") . '</span>';
|
||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList") . ' (' . $listofformat[$formatexportset] . ')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"] . '?action=export_file' . ($param ? '&' . $param : ''), $user->rights->accounting->mouvements->export);
|
||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
|
||||
$url = './card.php?action=create';
|
||||
if (!empty($socid)) $url .= '&socid=' . $socid;
|
||||
if (!empty($socid)) $url .= '&socid='.$socid;
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -379,12 +379,12 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
|
||||
$newcardbutton .= ' ';
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||
}
|
||||
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -380,8 +380,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||
}
|
||||
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class AccountancyExport
|
|||
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
||||
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
||||
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||
public static $EXPORT_TYPE_GESTINUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTINUMV5 = 135;
|
||||
public static $EXPORT_TYPE_GESTINUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTINUMV5 = 135;
|
||||
public static $EXPORT_TYPE_FEC = 1000;
|
||||
|
||||
|
||||
|
|
@ -115,11 +115,11 @@ class AccountancyExport
|
|||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
||||
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
);
|
||||
|
||||
|
|
@ -148,12 +148,12 @@ class AccountancyExport
|
|||
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
||||
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
||||
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
||||
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
|
||||
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
|
||||
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
|
||||
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
);
|
||||
|
||||
|
|
@ -208,9 +208,9 @@ class AccountancyExport
|
|||
self::$EXPORT_TYPE_AGIRIS => array(
|
||||
'label' => $langs->trans('Modelcsv_agiris'),
|
||||
),
|
||||
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
||||
'label' => $langs->trans('Modelcsv_openconcerto'),
|
||||
),
|
||||
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
||||
'label' => $langs->trans('Modelcsv_openconcerto'),
|
||||
),
|
||||
self::$EXPORT_TYPE_SAGE50_SWISS => array(
|
||||
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
|
||||
),
|
||||
|
|
@ -218,18 +218,18 @@ class AccountancyExport
|
|||
'label' => $langs->trans('Modelcsv_charlemagne'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => array(
|
||||
'label' => $langs->trans('Modelcsv_LDCompta'),
|
||||
),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => array(
|
||||
'label' => $langs->trans('Modelcsv_LDCompta'),
|
||||
),
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => array(
|
||||
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
),
|
||||
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV3 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
),
|
||||
self::$EXPORT_TYPE_GESTINUMV5 => array(
|
||||
'label' => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
),
|
||||
self::$EXPORT_TYPE_FEC => array(
|
||||
'label' => $langs->trans('Modelcsv_FEC'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
|
|
@ -307,21 +307,21 @@ class AccountancyExport
|
|||
case self::$EXPORT_TYPE_CHARLEMAGNE :
|
||||
$this->exportCharlemagne($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_LDCOMPTA :
|
||||
$this->exportLDCompta($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
||||
$this->exportLDCompta10($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV3 :
|
||||
$this->exportGestimumV3($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV5 :
|
||||
$this->exportGestimumV5($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_FEC :
|
||||
$this->exportFEC($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_LDCOMPTA :
|
||||
$this->exportLDCompta($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
||||
$this->exportLDCompta10($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV3 :
|
||||
$this->exportGestimumV3($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_GESTINUMV5 :
|
||||
$this->exportGestimumV5($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_FEC :
|
||||
$this->exportFEC($TData);
|
||||
break;
|
||||
default:
|
||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||
break;
|
||||
|
|
@ -1484,136 +1484,136 @@ class AccountancyExport
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : Gestimum V3
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportGestimumV3($objectLines)
|
||||
/**
|
||||
* Export format : Gestimum V3
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportGestimumV3($objectLines)
|
||||
{
|
||||
global $langs;
|
||||
global $langs;
|
||||
|
||||
$this->separator = ',';
|
||||
$this->separator = ',';
|
||||
|
||||
$invoices_infos = array();
|
||||
$supplier_invoices_infos = array();
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
$invoices_infos = array();
|
||||
$supplier_invoices_infos = array();
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
$invoice_ref = $line->doc_ref;
|
||||
$company_name = "";
|
||||
$invoice_ref = $line->doc_ref;
|
||||
$company_name = "";
|
||||
|
||||
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
|
||||
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
|
||||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Get new customer invoice ref and company name
|
||||
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->facnumber;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Get new supplier invoice ref and company name
|
||||
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->ref;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($line->doc_type == 'customer_invoice') {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
|
||||
} else {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
|
||||
}
|
||||
}
|
||||
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
|
||||
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
|
||||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Get new customer invoice ref and company name
|
||||
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->facnumber;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Get new supplier invoice ref and company name
|
||||
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
|
||||
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($obj = $this->db->fetch_object($resql)) {
|
||||
// Save invoice infos
|
||||
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||
$invoice_ref = $obj->ref;
|
||||
$company_name = $obj->nom;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($line->doc_type == 'customer_invoice') {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
|
||||
} else {
|
||||
// Retrieve invoice infos
|
||||
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
|
||||
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
|
||||
}
|
||||
}
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
//Libellé Auto
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
//Libellé manuel
|
||||
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Numéro de pièce
|
||||
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Devise
|
||||
print 'EUR' . $this->separator;
|
||||
//Montant
|
||||
print price2num(abs($line->montant)) . $this->separator;
|
||||
//Sens
|
||||
print $line->sens . $this->separator;
|
||||
//Code lettrage
|
||||
print $this->separator;
|
||||
//Date Echéance
|
||||
print $date;
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
//Libellé Auto
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
//Libellé manuel
|
||||
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Numéro de pièce
|
||||
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
|
||||
//Devise
|
||||
print 'EUR' . $this->separator;
|
||||
//Montant
|
||||
print price2num(abs($line->montant)) . $this->separator;
|
||||
//Sens
|
||||
print $line->sens . $this->separator;
|
||||
//Code lettrage
|
||||
print $this->separator;
|
||||
//Date Echéance
|
||||
print $date;
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : Gestimum V5
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportGestimumV5($objectLines)
|
||||
/**
|
||||
* Export format : Gestimum V5
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportGestimumV5($objectLines)
|
||||
{
|
||||
|
||||
$this->separator = ',';
|
||||
$this->separator = ',';
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
|
||||
print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
|
||||
print price2num($line->montant).$this->separator;
|
||||
print $line->sens.$this->separator;
|
||||
print $date . $this->separator;
|
||||
print $this->separator;
|
||||
print $this->separator;
|
||||
print 'EUR';
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
print $line->id . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||
print length_accountg($line->subledger_account) . $this->separator;
|
||||
} else {
|
||||
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||
}
|
||||
print $this->separator;
|
||||
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||
print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
|
||||
print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
|
||||
print price2num($line->montant).$this->separator;
|
||||
print $line->sens.$this->separator;
|
||||
print $date . $this->separator;
|
||||
print $this->separator;
|
||||
print $this->separator;
|
||||
print 'EUR';
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* trunc
|
||||
|
|
|
|||
|
|
@ -621,18 +621,18 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
print '"' . $key . '"' . $sep;
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '""' . $sep;
|
||||
print '"' . $langs->trans("VAT") . ' - ' . join(', ', $def_tva[$key][$k]) . ' %"' . $sep;
|
||||
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) . ' %' . ($numtax ? ' - Localtax ' . $numtax : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . $journal . '"';
|
||||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '""'.$sep;
|
||||
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.$journal.'"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ class Adherent extends CommonObject
|
|||
public $pass;
|
||||
|
||||
/**
|
||||
* @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
|
||||
*/
|
||||
* @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
|
||||
*/
|
||||
public $pass_indatabase;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -250,10 +250,10 @@ class Subscription extends CommonObject
|
|||
|
||||
$this->db->begin();
|
||||
|
||||
if (!is_numeric($this->amount)) {
|
||||
$this->error = 'BadValueForParameterAmount';
|
||||
return -1;
|
||||
}
|
||||
if (!is_numeric($this->amount)) {
|
||||
$this->error = 'BadValueForParameterAmount';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".$this->fk_type.",";
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
// Create the autoloader for Luracast
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
|
||||
call_user_func(function () {
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
});
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/iAuthenticate.php';
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ class Documents extends DolibarrApi
|
|||
|
||||
$upload_dir = $conf->categorie->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'category').$object->id."/photos/".dol_sanitizeFileName($object->ref);
|
||||
} elseif ($modulepart == 'ecm') {
|
||||
throw new RestException(500, 'Modulepart Ecm not implemented yet.');
|
||||
throw new RestException(500, 'Modulepart Ecm not implemented yet.');
|
||||
// // require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
|
||||
// if (!DolibarrApiAccess::$user->rights->ecm->read) {
|
||||
|
|
@ -634,7 +634,7 @@ class Documents extends DolibarrApi
|
|||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$object = new Propal($this->db);
|
||||
} else {
|
||||
// TODO Implement additional moduleparts
|
||||
// TODO Implement additional moduleparts
|
||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ if (!$res) die("Include of main fails");
|
|||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
|
||||
|
||||
call_user_func(function () {
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
});
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ if ($user->rights->categorie->creer)
|
|||
|
||||
if ($user->rights->categorie->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
|
|
|||
|
|
@ -524,7 +524,7 @@ class ActionComm extends CommonObject
|
|||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->ref =$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
|
||||
$this->ref = $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
|
||||
|
||||
// Now insert assigned users
|
||||
if (!$error)
|
||||
|
|
@ -2186,7 +2186,7 @@ class ActionComm extends CommonObject
|
|||
$this->db->commit();
|
||||
return 0;
|
||||
} else {
|
||||
$this->db->commit(); // We commit also on error, to have the error message recorded.
|
||||
$this->db->commit(); // We commit also on error, to have the error message recorded.
|
||||
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
|
||||
return $error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||
$supplierproposalstatic->total_ht = $obj->total_ht;
|
||||
$supplierproposalstatic->total_tva = $obj->total_tva;
|
||||
$supplierproposalstatic->total_ttc = $obj->total_ttc;
|
||||
$supplierproposalstatic->statut = $obj->status;
|
||||
$supplierproposalstatic->statut = $obj->status;
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ if (empty($reshook))
|
|||
$object->ref = GETPOST('ref');
|
||||
$object->datep = $datep;
|
||||
$object->date = $datep;
|
||||
$object->date_livraison = $date_delivery; // deprecated
|
||||
$object->date_livraison = $date_delivery; // deprecated
|
||||
$object->delivery_date = $date_delivery;
|
||||
$object->availability_id = GETPOST('availability_id');
|
||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class Propal extends CommonObject
|
|||
* @var int Date expected for delivery
|
||||
* @deprecated
|
||||
*/
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
|
||||
/**
|
||||
* @var integer|string $delivery_date;
|
||||
|
|
@ -1503,7 +1503,7 @@ class Propal extends CommonObject
|
|||
$this->date = $this->db->jdate($obj->dp); // Proposal date
|
||||
$this->datep = $this->db->jdate($obj->dp); // deprecated
|
||||
$this->fin_validite = $this->db->jdate($obj->dfv);
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->delivery_date = $this->db->jdate($obj->delivery_date);
|
||||
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
|
||||
$this->availability_id = $obj->fk_availability;
|
||||
|
|
@ -2922,7 +2922,7 @@ class Propal extends CommonObject
|
|||
$tabletodelete = $this->table_element_line;
|
||||
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
|
||||
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) {
|
||||
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -2955,7 +2955,7 @@ class Propal extends CommonObject
|
|||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
|
||||
$res = $this->db->query($sql);
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -2966,7 +2966,7 @@ class Propal extends CommonObject
|
|||
// Delete record into ECM index and physically
|
||||
if (!$error) {
|
||||
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ $arrayfields = array(
|
|||
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ if (empty($reshook))
|
|||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->availability_id = GETPOST('availability_id');
|
||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||
$object->date_livraison = $datelivraison; // deprecated
|
||||
$object->date_livraison = $datelivraison; // deprecated
|
||||
$object->delivery_date = $datelivraison;
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
|
||||
$object->warehouse_id = GETPOST('warehouse_id', 'int');
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ class Commande extends CommonOrder
|
|||
* @var int Date expected for delivery
|
||||
* @deprecated
|
||||
*/
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
|
||||
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
|
||||
|
||||
|
|
@ -1359,7 +1359,7 @@ class Commande extends CommonOrder
|
|||
$this->fk_account = $object->fk_account;
|
||||
$this->availability_id = $object->availability_id;
|
||||
$this->demand_reason_id = $object->demand_reason_id;
|
||||
$this->date_livraison = $object->date_livraison; // deprecated
|
||||
$this->date_livraison = $object->date_livraison; // deprecated
|
||||
$this->delivery_date = $object->date_livraison;
|
||||
$this->shipping_method_id = $object->shipping_method_id;
|
||||
$this->warehouse_id = $object->warehouse_id;
|
||||
|
|
@ -1867,7 +1867,7 @@ class Commande extends CommonOrder
|
|||
$this->availability = $obj->availability_label;
|
||||
$this->demand_reason_id = $obj->fk_input_reason;
|
||||
$this->demand_reason_code = $obj->demand_reason_code;
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->delivery_date = $this->db->jdate($obj->delivery_date);
|
||||
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
|
||||
$this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
|
||||
|
|
@ -3358,7 +3358,7 @@ class Commande extends CommonOrder
|
|||
$tabletodelete = $this->table_element_line;
|
||||
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
|
||||
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) {
|
||||
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -3391,7 +3391,7 @@ class Commande extends CommonOrder
|
|||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
|
||||
$res = $this->db->query($sql);
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -3402,7 +3402,7 @@ class Commande extends CommonOrder
|
|||
// Delete record into ECM index and physically
|
||||
if (!$error) {
|
||||
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,37 +143,37 @@ if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
|
|||
$checkedtypetiers = 0;
|
||||
$arrayfields = array(
|
||||
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
||||
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
|
||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
|
||||
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
|
||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
||||
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
|
||||
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
|
||||
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
|
||||
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
|
||||
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
|
||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
|
||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
|
||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
|
||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
|
||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
|
||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
|
||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
|
||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
|
||||
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
|
||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
|
||||
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
|
||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
||||
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
|
||||
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
|
||||
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
|
||||
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
|
||||
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
|
||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
|
||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
|
||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
|
||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
|
||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
|
||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
|
||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
|
||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
@ -448,10 +448,10 @@ if ($resql)
|
|||
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
|
||||
if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
|
||||
if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
|
||||
if ($search_dateorder_start) $param .= '&search_dateorder_start_day=' . dol_print_date($search_dateorder_start, '%d') . '&search_dateorder_start_month=' . dol_print_date($search_dateorder_start, '%m') . '&search_dateorder_start_year=' . dol_print_date($search_dateorder_start, '%Y');
|
||||
if ($search_dateorder_end) $param .= '&search_dateorder_end_day=' . dol_print_date($search_dateorder_end, '%d') . '&search_dateorder_end_month=' . dol_print_date($search_dateorder_end, '%m') . '&search_dateorder_end_year=' . dol_print_date($search_dateorder_end, '%Y');
|
||||
if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day=' . dol_print_date($search_datedelivery_start, '%d') . '&search_datedelivery_start_month=' . dol_print_date($search_datedelivery_start, '%m') . '&search_datedelivery_start_year=' . dol_print_date($search_datedelivery_start, '%Y');
|
||||
if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day=' . dol_print_date($search_datedelivery_end, '%d') . '&search_datedelivery_end_month=' . dol_print_date($search_datedelivery_end, '%m') . '&search_datedelivery_end_year=' . dol_print_date($search_datedelivery_end, '%Y');
|
||||
if ($search_dateorder_start) $param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
|
||||
if ($search_dateorder_end) $param .= '&search_dateorder_end_day='.dol_print_date($search_dateorder_end, '%d').'&search_dateorder_end_month='.dol_print_date($search_dateorder_end, '%m').'&search_dateorder_end_year='.dol_print_date($search_dateorder_end, '%Y');
|
||||
if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day='.dol_print_date($search_datedelivery_start, '%d').'&search_datedelivery_start_month='.dol_print_date($search_datedelivery_start, '%m').'&search_datedelivery_start_year='.dol_print_date($search_datedelivery_start, '%Y');
|
||||
if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day='.dol_print_date($search_datedelivery_end, '%d').'&search_datedelivery_end_month='.dol_print_date($search_datedelivery_end, '%m').'&search_datedelivery_end_year='.dol_print_date($search_datedelivery_end, '%Y');
|
||||
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
|
||||
if ($search_company) $param .= '&search_company='.urlencode($search_company);
|
||||
if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
|
||||
|
|
@ -836,7 +836,7 @@ if ($resql)
|
|||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
//print $form->selectyesno('search_shippable', $search_shippable, 1, 0, 1, 1);
|
||||
if (! empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) {
|
||||
if (!empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) {
|
||||
print '<input type="checkbox" name="show_shippable_command" value="1"'.($show_shippable_command ? ' checked' : '').'>';
|
||||
print $langs->trans('ShowShippableStatus');
|
||||
} else {
|
||||
|
|
@ -854,17 +854,17 @@ if ($resql)
|
|||
// Status
|
||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
$liststatus = array(
|
||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
$liststatus = array(
|
||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
|
|
@ -950,7 +950,7 @@ if ($resql)
|
|||
$generic_commande->statut = $obj->fk_statut;
|
||||
$generic_commande->billed = $obj->billed;
|
||||
$generic_commande->date = $db->jdate($obj->date_commande);
|
||||
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
|
||||
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
|
||||
$generic_commande->delivery_date = $db->jdate($obj->date_delivery);
|
||||
$generic_commande->ref_client = $obj->ref_client;
|
||||
$generic_commande->total_ht = $obj->total_ht;
|
||||
|
|
@ -1235,7 +1235,7 @@ if ($resql)
|
|||
|
||||
// Get local and virtual stock and store it into cache
|
||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
|
||||
$generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock()
|
||||
$generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock()
|
||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
|
||||
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
} else {
|
||||
|
|
@ -1245,9 +1245,9 @@ if ($resql)
|
|||
|
||||
if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default should be this case.
|
||||
{
|
||||
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->product_ref . ' ' . dol_trunc($generic_commande->lines[$lig]->product_label, 25);
|
||||
$text_info .= ' - ' . $langs->trans("Stock") . ': <span class="' . ($generic_product->stock_reel > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_reel . '</span>';
|
||||
$text_info .= ' - ' . $langs->trans("VirtualStock") . ': <span class="' . ($generic_product->stock_theorique > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_theorique . '</span>';
|
||||
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->product_ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
|
||||
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
|
||||
$text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
|
||||
$text_info .= '<br>';
|
||||
|
||||
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel) {
|
||||
|
|
@ -1281,20 +1281,20 @@ if ($resql)
|
|||
$stock_order_supplier = $generic_product->stats_commande_fournisseur['qty'];
|
||||
}
|
||||
}
|
||||
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->ref . ' ' . dol_trunc($generic_commande->lines[$lig]->product_label, 25);
|
||||
$text_stock_reel = $generic_product->stock_reel . '/' . $stock_order;
|
||||
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
|
||||
$text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
|
||||
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
|
||||
$warning++;
|
||||
$text_warning .= '<span class="warning">' . $langs->trans('Available') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_warning .= '<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
|
||||
$notshippable++;
|
||||
$text_info .= '<span class="warning">' . $langs->trans('Available') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_info .= '<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
} else {
|
||||
$text_info .= '<span class="ok">' . $langs->trans('Available') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_info .= '<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$text_info .= ' ' . $langs->trans('SupplierOrder') . ' : ' . $stock_order_supplier . '<br>';
|
||||
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
||||
} else {
|
||||
$text_info .= '<br>';
|
||||
}
|
||||
|
|
@ -1303,10 +1303,10 @@ if ($resql)
|
|||
}
|
||||
if ($notshippable == 0) {
|
||||
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft');
|
||||
$text_info = $langs->trans('Shippable') . '<br>' . $text_info;
|
||||
$text_info = $langs->trans('Shippable').'<br>'.$text_info;
|
||||
} else {
|
||||
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'error paddingleft');
|
||||
$text_info = $langs->trans('NonShippable') . '<br>' . $text_info;
|
||||
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1314,7 +1314,7 @@ if ($resql)
|
|||
print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2);
|
||||
}
|
||||
if ($warning) { // Always false in default mode
|
||||
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders') . '<br>' . $text_warning, 2, 1, img_picto('', 'error'), '', 2);
|
||||
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'<br>'.$text_warning, 2, 1, img_picto('', 'error'), '', 2);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1330,8 +1330,8 @@ if ($resql)
|
|||
// Status
|
||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ if ($mode == 'customer')
|
|||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
|
||||
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class Facture extends CommonInvoice
|
|||
* @var int Date expected for delivery
|
||||
* @deprecated
|
||||
*/
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
public $date_livraison; // deprecated; Use delivery_date instead.
|
||||
|
||||
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
|
||||
|
||||
|
|
@ -1331,7 +1331,7 @@ class Facture extends CommonInvoice
|
|||
$this->availability_id = $object->availability_id;
|
||||
$this->demand_reason_id = $object->demand_reason_id;
|
||||
$this->delivery_date = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
|
||||
$this->date_livraison = $object->delivery_date; // deprecated
|
||||
$this->date_livraison = $object->delivery_date; // deprecated
|
||||
$this->fk_delivery_address = $object->fk_delivery_address; // deprecated
|
||||
$this->contact_id = $object->contact_id;
|
||||
$this->ref_client = $object->ref_client;
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_
|
|||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
|
|||
|
|
@ -632,10 +632,10 @@ if ($object->id > 0)
|
|||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
$buttonlabel = $langs->trans("MakeWithdrawRequest");
|
||||
$user_perms=$user->rights->prelevement->bons->creer;
|
||||
$user_perms = $user->rights->prelevement->bons->creer;
|
||||
if ($type == 'bank-transfer') {
|
||||
$buttonlabel = $langs->trans("MakeBankTransferOrder");
|
||||
$user_perms=$user->rights->paymentbybanktransfer->create;
|
||||
$user_perms = $user->rights->paymentbybanktransfer->create;
|
||||
}
|
||||
|
||||
// Add a transfer request
|
||||
|
|
|
|||
|
|
@ -164,12 +164,12 @@ class BonPrelevement extends CommonObject
|
|||
$result = 0;
|
||||
} else {
|
||||
$result = -1;
|
||||
$this->errors[] = get_class($this)."::AddFacture " . $this->db->lasterror;
|
||||
$this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror;
|
||||
dol_syslog(get_class($this)."::AddFacture Error $result");
|
||||
}
|
||||
} else {
|
||||
$result = -2;
|
||||
$this->errors[]=get_class($this)."::AddFacture linedid Empty";
|
||||
$this->errors[] = get_class($this)."::AddFacture linedid Empty";
|
||||
dol_syslog(get_class($this)."::AddFacture Error $result");
|
||||
}
|
||||
} else {
|
||||
|
|
@ -247,7 +247,7 @@ class BonPrelevement extends CommonObject
|
|||
$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes");
|
||||
$result = 0;
|
||||
} else {
|
||||
$this->errors[]=get_class($this)."::addline Error -2 " .$this->db->lasterror;
|
||||
$this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror;
|
||||
dol_syslog(get_class($this)."::addline Error -2");
|
||||
$result = -2;
|
||||
}
|
||||
|
|
@ -1124,7 +1124,7 @@ class BonPrelevement extends CommonObject
|
|||
if (!$resql)
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
dol_syslog(__METHOD__."::Update Error=".$this->db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ if (!empty($conf->socialnetworks->enabled)) {
|
|||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ if ($action == 'add' && !empty($permissiontoadd))
|
|||
// Ignore special fields
|
||||
if (in_array($key, array('rowid', 'entity', 'import_key'))) continue;
|
||||
if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) {
|
||||
if (!in_array(abs($val['visible']), array(1, 3))) continue; // Only 1 and 3 that are case to create
|
||||
if (!in_array(abs($val['visible']), array(1, 3))) continue; // Only 1 and 3 that are case to create
|
||||
}
|
||||
|
||||
// Set value to insert
|
||||
|
|
@ -146,7 +146,7 @@ if ($action == 'update' && !empty($permissiontoadd))
|
|||
// Ignore special fields
|
||||
if (in_array($key, array('rowid', 'entity', 'import_key'))) continue;
|
||||
if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) {
|
||||
if (!in_array(abs($val['visible']), array(1, 3, 4))) continue; // Only 1 and 3 and 4 that are case to update
|
||||
if (!in_array(abs($val['visible']), array(1, 3, 4))) continue; // Only 1 and 3 and 4 that are case to update
|
||||
}
|
||||
|
||||
// Set value to update
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ if ($action == 'update')
|
|||
GETPOST('computed_value', 'alpha'),
|
||||
(GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
|
||||
GETPOST('langfile'),
|
||||
GETPOST('enabled', 'alpha'),
|
||||
GETPOST('enabled', 'alpha'),
|
||||
(GETPOST('totalizable', 'alpha') ? 1 : 0),
|
||||
GETPOST('printable', 'alpha')
|
||||
);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes
|
|||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql.= " AND u.statut = 1";
|
||||
$sql .= " AND u.statut = 1";
|
||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||
$sql .= " ORDER BY u.birth ASC";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ abstract class CommonDocGenerator
|
|||
if ($member->photo) {
|
||||
$logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo;
|
||||
} else {
|
||||
$logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png';
|
||||
$logotouse = DOL_DOCUMENT_ROOT.'/public/theme/common/nophoto.png';
|
||||
}
|
||||
|
||||
$array_member = array(
|
||||
|
|
@ -585,7 +585,7 @@ abstract class CommonDocGenerator
|
|||
|
||||
'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref),
|
||||
'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines
|
||||
'line_product_label'=>(empty($line->product_label) ? '' :$line->product_label),
|
||||
'line_product_label'=>(empty($line->product_label) ? '' : $line->product_label),
|
||||
'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type),
|
||||
'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode),
|
||||
|
||||
|
|
@ -1342,7 +1342,7 @@ abstract class CommonDocGenerator
|
|||
if (!empty($fields))
|
||||
{
|
||||
// Sort extrafields by rank
|
||||
uasort($fields, function ($a, $b) {
|
||||
uasort($fields, function($a, $b) {
|
||||
return ($a->rank > $b->rank) ? 1 : -1;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -5092,7 +5092,7 @@ abstract class CommonObject
|
|||
global $conf, $extrafields;
|
||||
|
||||
if (empty($rowid)) $rowid = $this->id;
|
||||
if (empty($rowid) && isset($this->rowid)) $rowid = $this->rowid; // deprecated
|
||||
if (empty($rowid) && isset($this->rowid)) $rowid = $this->rowid; // deprecated
|
||||
|
||||
// To avoid SQL errors. Probably not the better solution though
|
||||
if (!$this->table_element) {
|
||||
|
|
@ -5939,7 +5939,7 @@ abstract class CommonObject
|
|||
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
|
||||
} elseif (in_array($type, array('duration'))) {
|
||||
$out = $form->select_duration($keyprefix.$key.$keysuffix, $value, 0, 'text', 0, 1);
|
||||
} elseif (in_array($type, array('int', 'integer'))) {
|
||||
} elseif (in_array($type, array('int', 'integer'))) {
|
||||
$tmp = explode(',', $size);
|
||||
$newsize = $tmp[0];
|
||||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
|
|
@ -5949,7 +5949,7 @@ abstract class CommonObject
|
|||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
} elseif (in_array($type, array('mail', 'phone', 'url'))) {
|
||||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
} elseif (preg_match('/^text/', $type)) {
|
||||
} elseif (preg_match('/^text/', $type)) {
|
||||
if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
|
@ -8060,7 +8060,7 @@ abstract class CommonObject
|
|||
// Delete llx_ecm_files
|
||||
if (!$error) {
|
||||
$res = $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
@ -8492,7 +8492,7 @@ abstract class CommonObject
|
|||
// Delete ecm_files extrafields
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files_extrafields WHERE fk_object IN (";
|
||||
$sql .= " SELECT rowid FROM ".MAIN_DB_PREFIX."ecm_files WHERE filename LIKE '".$this->db->escape($this->ref)."%'";
|
||||
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
|
||||
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
|
||||
$sql .= ")";
|
||||
|
||||
if (!$this->db->query($sql)) {
|
||||
|
|
@ -8504,7 +8504,7 @@ abstract class CommonObject
|
|||
// Delete ecm_files
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%'";
|
||||
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
|
||||
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
|
||||
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->lasterror();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class DolGeoIP
|
|||
//print 'function_exists(geoip_country_code_by_name))='.function_exists('geoip_country_code_by_name');
|
||||
//print geoip_database_info();
|
||||
} else {
|
||||
$this->gi = ''; // For avoid error
|
||||
$this->gi = ''; // For avoid error
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class Events // extends CommonObject
|
|||
|
||||
// Clean parameters
|
||||
$this->description = trim($this->description);
|
||||
if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT'])?'':$_SERVER['HTTP_USER_AGENT']);
|
||||
if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->description)) { $this->error = 'ErrorBadValueForParameterCreateEventDesc'; return -1; }
|
||||
|
|
|
|||
|
|
@ -1490,7 +1490,7 @@ class Form
|
|||
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
|
||||
}
|
||||
|
||||
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num?'':' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
|
||||
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num ? '' : ' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
|
||||
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>';
|
||||
if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
|
||||
|
||||
|
|
@ -1523,7 +1523,7 @@ class Form
|
|||
if (!empty($contact_town)) $extendedInfos[] = $contact_town;
|
||||
elseif (!empty($company_town)) $extendedInfos[] = $company_town;
|
||||
$extendedInfos = implode(' - ', $extendedInfos);
|
||||
if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos;
|
||||
if (!empty($extendedInfos)) $extendedInfos = ' - '.$extendedInfos;
|
||||
}
|
||||
|
||||
$contactstatic->id = $obj->rowid;
|
||||
|
|
@ -1540,7 +1540,7 @@ class Form
|
|||
$out .= '<option value="'.$obj->rowid.'"';
|
||||
if ($disabled) $out .= ' disabled';
|
||||
$out .= ' selected>';
|
||||
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
|
||||
$out .= $contactstatic->getFullName($langs).$extendedInfos;
|
||||
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
|
||||
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
|
||||
$out .= '</option>';
|
||||
|
|
@ -1548,7 +1548,7 @@ class Form
|
|||
$out .= '<option value="'.$obj->rowid.'"';
|
||||
if ($disabled) $out .= ' disabled';
|
||||
$out .= '>';
|
||||
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
|
||||
$out .= $contactstatic->getFullName($langs).$extendedInfos;
|
||||
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
|
||||
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
|
||||
$out .= '</option>';
|
||||
|
|
@ -1556,7 +1556,7 @@ class Form
|
|||
} else {
|
||||
if (in_array($obj->rowid, $selected))
|
||||
{
|
||||
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
|
||||
$out .= $contactstatic->getFullName($langs).$extendedInfos;
|
||||
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
|
||||
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ class FormOrder extends Form
|
|||
$options[$value] = $tmpsupplierorder->getLibStatut($short);
|
||||
}
|
||||
|
||||
if (is_array($selected)) $selectedarray = $selected;
|
||||
else $selectedarray = explode(',', $selected);
|
||||
if (is_array($selected)) $selectedarray = $selected;
|
||||
else $selectedarray = explode(',', $selected);
|
||||
|
||||
print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
|
||||
}
|
||||
print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of input method (mode used to receive order, like order received by email, fax, online)
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ class Translate
|
|||
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because
|
||||
// we want to keep '"' '<b>' '</b>' '<strong' '</strong>' '<a ' '</a>' '<br>' '< ' '<span' '</span>' that are reliable HTML tags inside translation strings.
|
||||
$str = str_replace(
|
||||
array('"', '<b>', '</b>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
|
||||
array('"', '<b>', '</b>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
|
||||
array('__quot__', '__tagbold__', '__tagboldend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
|
||||
$str
|
||||
);
|
||||
|
|
@ -745,7 +745,7 @@ class Translate
|
|||
*/
|
||||
public function transcountrynoentities($str, $countrycode)
|
||||
{
|
||||
if (! empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode");
|
||||
if (!empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode");
|
||||
else return $this->transnoentities($str);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ function GETPOSTISSET($paramname)
|
|||
$isset = true;
|
||||
}
|
||||
} else {
|
||||
$isset = (isset($_POST[$paramname]) || isset($_GET[$paramname])); // We must keep $_POST and $_GET here
|
||||
$isset = (isset($_POST[$paramname]) || isset($_GET[$paramname])); // We must keep $_POST and $_GET here
|
||||
}
|
||||
|
||||
return $isset;
|
||||
|
|
@ -1289,11 +1289,11 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
*/
|
||||
function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled = '')
|
||||
{
|
||||
if (strpos($url, '?') > 0) {
|
||||
$url .= '&dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup=1';
|
||||
} else {
|
||||
$url .= '?dol_hide_menuinpopup=1&dol_hide_leftmenu=1&dol_openinpopup=1';
|
||||
}
|
||||
if (strpos($url, '?') > 0) {
|
||||
$url .= '&dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup=1';
|
||||
} else {
|
||||
$url .= '?dol_hide_menuinpopup=1&dol_hide_leftmenu=1&dol_openinpopup=1';
|
||||
}
|
||||
|
||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
|
||||
$out = '<a class="button bordertransp button_'.$name.'"'.$disabled.' title="'.dol_escape_htmltag($label).'">'.$buttonstring.'</a>';
|
||||
|
|
@ -4139,7 +4139,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
|||
print $out;
|
||||
} else {
|
||||
if (empty($langs->defaultlang)) $langs->setDefaultLang();
|
||||
$langs->loadLangs(array("main", "errors")); // Reload main because language may have been set only on previous line so we have to reload files we need.
|
||||
$langs->loadLangs(array("main", "errors")); // Reload main because language may have been set only on previous line so we have to reload files we need.
|
||||
// This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
|
||||
print 'This website or feature is currently temporarly not available or failed after a technical error.<br><br>This may be due to a maintenance operation. Current status of operation are on next line...<br><br>'."\n";
|
||||
print $langs->trans("DolibarrHasDetectedError").'. ';
|
||||
|
|
@ -5592,7 +5592,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
|||
// In a future, we may distribut directories on several levels depending on setup and object.
|
||||
// Here, $object->id, $object->ref and $modulepart are required.
|
||||
//var_dump($modulepart);
|
||||
if (! in_array($modulepart, array('product'))) { // Test to remove
|
||||
if (!in_array($modulepart, array('product'))) { // Test to remove
|
||||
$path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref);
|
||||
}
|
||||
}
|
||||
|
|
@ -6294,7 +6294,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||
|
||||
if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0)
|
||||
{
|
||||
$birthday = (empty($object->birth) ? '': dol_print_date($object->birth, 'day'));
|
||||
$birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day'));
|
||||
|
||||
$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
|
||||
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
|
||||
|
|
@ -6694,7 +6694,7 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object
|
|||
// to list all tags in odt template
|
||||
$tags = '';
|
||||
foreach ($substitutionarray as $key => $value) {
|
||||
$tags .= '{' . $key . '} => ' . $value ."\n";
|
||||
$tags .= '{'.$key.'} => '.$value."\n";
|
||||
}
|
||||
$substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ function dolSessionGC($max_lifetime)
|
|||
|
||||
$time_stamp = dol_now();
|
||||
|
||||
$delete_query = "DELETE FROM ".MAIN_DB_PREFIX."session";
|
||||
$delete_query = "DELETE FROM ".MAIN_DB_PREFIX."session";
|
||||
$delete_query .= " WHERE last_accessed < '".$dbsession->idate($time_stamp - $max_lifetime)."'";
|
||||
|
||||
$resql = $dbsession->query($delete_query);
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||
$taskstatic->fk_statut = $lines[$i]->status;
|
||||
$taskstatic->date_start = $lines[$i]->date_start;
|
||||
$taskstatic->date_end = $lines[$i]->date_end;
|
||||
$taskstatic->datee = $lines[$i]->date_end; // deprecated
|
||||
$taskstatic->datee = $lines[$i]->date_end; // deprecated
|
||||
$taskstatic->planned_workload = $lines[$i]->planned_workload;
|
||||
$taskstatic->duration_effective = $lines[$i]->duration;
|
||||
|
||||
|
|
@ -1319,7 +1319,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||
global $daytoparse;
|
||||
$tmparray = dol_getdate($daytoparse, true); // detail of current day
|
||||
|
||||
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK)?0:1));
|
||||
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
|
||||
global $numstartworkingday, $numendworkingday;
|
||||
$cssweekend = '';
|
||||
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
|
||||
|
||||
// Incoterm
|
||||
if (! empty($conf->incoterm->enabled))
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
$desc_incoterms = $object->getIncotermsForPDF();
|
||||
if ($desc_incoterms)
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ class ImportCsv extends ModeleImports
|
|||
$errorforthistable++;
|
||||
$error++;
|
||||
} else {
|
||||
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
|
||||
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
|
||||
}
|
||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
||||
$newval = price2num($newval);
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ class ImportXlsx extends ModeleImports
|
|||
$errorforthistable++;
|
||||
$error++;
|
||||
} else {
|
||||
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
|
||||
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
|
||||
}
|
||||
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
|
||||
$newval = price2num($newval);
|
||||
|
|
|
|||
|
|
@ -258,10 +258,10 @@ class modUser extends DolibarrModules
|
|||
$keyforselect = 'user'; $keyforelement = 'user'; $keyforaliasextra = 'extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
if (empty($conf->adherent->enabled))
|
||||
{
|
||||
unset($this->export_fields_array[$r]['u.fk_member']);
|
||||
unset($this->export_entities_array[$r]['u.fk_member']);
|
||||
}
|
||||
{
|
||||
unset($this->export_fields_array[$r]['u.fk_member']);
|
||||
unset($this->export_entities_array[$r]['u.fk_member']);
|
||||
}
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'user as u';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extra ON u.rowid = extra.fk_object';
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ if (empty($conf) || !is_object($conf))
|
|||
exit;
|
||||
}
|
||||
|
||||
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
|
||||
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element;
|
||||
|
||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||
if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
||||
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
||||
{
|
||||
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) {
|
||||
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class InterfaceLogevents extends DolibarrTriggers
|
|||
$event->dateevent = $date;
|
||||
$event->label = $text;
|
||||
$event->description = $desc;
|
||||
$event->user_agent = (empty($_SERVER["HTTP_USER_AGENT"])?'':$_SERVER["HTTP_USER_AGENT"]);
|
||||
$event->user_agent = (empty($_SERVER["HTTP_USER_AGENT"]) ? '' : $_SERVER["HTTP_USER_AGENT"]);
|
||||
|
||||
$result = $event->create($user);
|
||||
if ($result > 0) {
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ if (!file_exists($fullpath_original_file_osencoded))
|
|||
|
||||
// Hooks
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('document'));
|
||||
|
|
@ -254,9 +254,9 @@ $parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'origina
|
|||
'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded);
|
||||
$reshook = $hookmanager->executeHooks('downloadDocument', $parameters); // Note that $action and $object may have been
|
||||
if ($reshook < 0) {
|
||||
$errors = $hookmanager->error . (is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '') . join($separator, $hookmanager->errors) : '');
|
||||
dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : " . $errors);
|
||||
print "ErrorDownloadDocumentHooks: " . $errors;
|
||||
$errors = $hookmanager->error.(is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '').join($separator, $hookmanager->errors) : '');
|
||||
dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : ".$errors);
|
||||
print "ErrorDownloadDocumentHooks: ".$errors;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -620,7 +620,7 @@ class Expedition extends CommonObject
|
|||
$this->getUrlTrackingStatus($obj->tracking_number);
|
||||
|
||||
// Thirdparty
|
||||
$result = $this->fetch_thirdparty(); // TODO Remove this
|
||||
$result = $this->fetch_thirdparty(); // TODO Remove this
|
||||
|
||||
// Retrieve extrafields
|
||||
$this->fetch_optionals();
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ $arrayfields = array(
|
|||
);
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
|
|||
|
|
@ -1101,7 +1101,7 @@ class ExpenseReport extends CommonObject
|
|||
$tabletodelete = $this->table_element_line;
|
||||
//$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
|
||||
if (! $this->db->query($sql)) {
|
||||
if (!$this->db->query($sql)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -1134,7 +1134,7 @@ class ExpenseReport extends CommonObject
|
|||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
|
||||
$res = $this->db->query($sql);
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
|
|
@ -1145,7 +1145,7 @@ class ExpenseReport extends CommonObject
|
|||
// Delete record into ECM index and physically
|
||||
if (!$error) {
|
||||
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
|
||||
if (! $res) {
|
||||
if (!$res) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1186,7 +1186,7 @@ class ExpenseReport extends CommonObject
|
|||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to status validate
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
$this->date_approve = $this->db->jdate($obj->date_approve);
|
||||
$this->date_approve2 = $this->db->jdate($obj->date_approve2);
|
||||
$this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->delivery_date = $this->db->jdate($obj->delivery_date);
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->methode_commande_id = $obj->fk_input_method;
|
||||
|
|
|
|||
|
|
@ -1143,9 +1143,9 @@ if (empty($reshook))
|
|||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->note_private = GETPOST('note_private', 'restricthtml');
|
||||
$object->note_private = GETPOST('note_private', 'restricthtml');
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->date_livraison = $datelivraison; // deprecated
|
||||
$object->date_livraison = $datelivraison; // deprecated
|
||||
$object->delivery_date = $datelivraison;
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||
$valid_dashboardlines = array();
|
||||
foreach ($dashboardlines as $workboardid => $tmp) {
|
||||
if ($tmp instanceof WorkboardResponse) {
|
||||
$tmp->id = $workboardid; // Complete the object to add its id into its name
|
||||
$tmp->id = $workboardid; // Complete the object to add its id into its name
|
||||
$valid_dashboardlines[$workboardid] = $tmp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ if (!defined('NOLOGIN'))
|
|||
$user->getrights();
|
||||
}
|
||||
|
||||
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL')?constant('NOTOKENRENEWAL'):''));
|
||||
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL') ?constant('NOTOKENRENEWAL') : ''));
|
||||
//Another call for easy debugg
|
||||
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
|
||||
|
||||
|
|
@ -1702,8 +1702,8 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
$title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').'...';
|
||||
if ($mode == 'wiki') {
|
||||
$title .= '<br>'.$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"');
|
||||
if ($helppresent) $title.= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>';
|
||||
else $title.= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
|
||||
if ($helppresent) $title .= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>';
|
||||
else $title .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
|
||||
}
|
||||
$text .= '<a class="help" target="_blank" rel="noopener" href="';
|
||||
if ($mode == 'wiki') $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage)));
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ foreach ($object->fields as $key => $val)
|
|||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
|
|||
|
|
@ -148,15 +148,15 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testMyObjectCreate()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
global $conf, $user, $langs, $db;
|
||||
$conf = $this->savconf;
|
||||
$user = $this->savuser;
|
||||
$langs = $this->savlangs;
|
||||
$db = $this->savdb;
|
||||
|
||||
$localobject=new MyObject($this->savdb);
|
||||
$localobject = new MyObject($this->savdb);
|
||||
$localobject->initAsSpecimen();
|
||||
$result=$localobject->create($user);
|
||||
$result = $localobject->create($user);
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
|
@ -175,15 +175,15 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testMyObjectDelete($id)
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
global $conf, $user, $langs, $db;
|
||||
$conf = $this->savconf;
|
||||
$user = $this->savuser;
|
||||
$langs = $this->savlangs;
|
||||
$db = $this->savdb;
|
||||
|
||||
$localobject=new MyObject($this->savdb);
|
||||
$result=$localobject->fetch($id);
|
||||
$result=$localobject->delete($user);
|
||||
$localobject = new MyObject($this->savdb);
|
||||
$result = $localobject->fetch($id);
|
||||
$result = $localobject->delete($user);
|
||||
|
||||
print __METHOD__." id=".$id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
|
|
|||
|
|
@ -4238,15 +4238,15 @@ class Product extends CommonObject
|
|||
if ($mode == 0) {
|
||||
$sql .= " WHERE pa.fk_product_fils = ".$this->id." OR pa.fk_product_pere = ".$this->id;
|
||||
} elseif ($mode == -1) {
|
||||
$sql .= " WHERE pa.fk_product_fils = ".$this->id; // We are a child, so we found lines that link to parents (can have several parents)
|
||||
$sql .= " WHERE pa.fk_product_fils = ".$this->id; // We are a child, so we found lines that link to parents (can have several parents)
|
||||
} elseif ($mode == 1) {
|
||||
$sql .= " WHERE pa.fk_product_pere = ".$this->id; // We are a parent, so we found lines that link to children (can have several children)
|
||||
$sql .= " WHERE pa.fk_product_pere = ".$this->id; // We are a parent, so we found lines that link to children (can have several children)
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) { $nb = $obj->nb; }
|
||||
if ($obj) { $nb = $obj->nb; }
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -610,17 +610,17 @@ if ($id > 0 || $ref)
|
|||
</script>';
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
// Currency
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td>';
|
||||
$currencycodetouse = GETPOST('multicurrency_code') ?GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
|
||||
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse = $conf->currency;
|
||||
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
|
||||
print ' '.$langs->trans("CurrencyRate").' ';
|
||||
print '<input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx') ? GETPOST('multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx : '')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
// Currency
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td>';
|
||||
$currencycodetouse = GETPOST('multicurrency_code') ?GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
|
||||
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse = $conf->currency;
|
||||
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
|
||||
print ' '.$langs->trans("CurrencyRate").' ';
|
||||
print '<input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx') ? GETPOST('multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx : '')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Currency price qty min
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMinCurrency").'</td>';
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) {
|
|||
|
||||
//var_dump($arraypricelevel);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
@ -1283,58 +1283,58 @@ if ($resql)
|
|||
|
||||
// Multiprices
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
if (! isset($productpricescache)) {
|
||||
$productpricescache=array();
|
||||
}
|
||||
if (! isset($productpricescache[$obj->rowid])) {
|
||||
$productpricescache[$obj->rowid] = array();
|
||||
}
|
||||
if (! isset($productpricescache)) {
|
||||
$productpricescache=array();
|
||||
}
|
||||
if (! isset($productpricescache[$obj->rowid])) {
|
||||
$productpricescache[$obj->rowid] = array();
|
||||
}
|
||||
|
||||
if ($obj->tosell)
|
||||
{
|
||||
// Make 1 request for all price levels (without filter on price_level) and saved result into an cache array
|
||||
// then reuse the cache array if we need prices for other price levels
|
||||
$sqlp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type";
|
||||
$sqlp .= " FROM ".MAIN_DB_PREFIX."product_price as p";
|
||||
$sqlp .= " WHERE fk_product = ".$obj->rowid;
|
||||
$sqlp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
|
||||
$resultp = $db->query($sqlp);
|
||||
if ($resultp)
|
||||
{
|
||||
$nump = $db->num_rows($resultp);
|
||||
$j = 0;
|
||||
while ($j < $nump)
|
||||
{
|
||||
$objp = $db->fetch_object($resultp);
|
||||
if ($obj->tosell)
|
||||
{
|
||||
// Make 1 request for all price levels (without filter on price_level) and saved result into an cache array
|
||||
// then reuse the cache array if we need prices for other price levels
|
||||
$sqlp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type";
|
||||
$sqlp .= " FROM ".MAIN_DB_PREFIX."product_price as p";
|
||||
$sqlp .= " WHERE fk_product = ".$obj->rowid;
|
||||
$sqlp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
|
||||
$resultp = $db->query($sqlp);
|
||||
if ($resultp)
|
||||
{
|
||||
$nump = $db->num_rows($resultp);
|
||||
$j = 0;
|
||||
while ($j < $nump)
|
||||
{
|
||||
$objp = $db->fetch_object($resultp);
|
||||
|
||||
if (empty($productpricescache[$obj->rowid][$objp->price_level]))
|
||||
{
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price'] = $objp->price;
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price_ttc'] = $objp->price_ttc;
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price_base_type'] = $objp->price_base_type;
|
||||
}
|
||||
if (empty($productpricescache[$obj->rowid][$objp->price_level]))
|
||||
{
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price'] = $objp->price;
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price_ttc'] = $objp->price_ttc;
|
||||
$productpricescache[$obj->rowid][$objp->price_level]['price_base_type'] = $objp->price_base_type;
|
||||
}
|
||||
|
||||
$j++;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
|
||||
$db->free($resultp);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$db->free($resultp);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($arraypricelevel as $key => $value)
|
||||
{
|
||||
if (!empty($arrayfields['p.sellprice'.$key]['checked']))
|
||||
{
|
||||
print '<td class="right nowraponall">';
|
||||
if (! empty($productpricescache[$obj->rowid]))
|
||||
if (!empty($productpricescache[$obj->rowid]))
|
||||
{
|
||||
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
|
||||
print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC");
|
||||
} else {
|
||||
print price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT");
|
||||
}
|
||||
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
|
||||
print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC");
|
||||
} else {
|
||||
print price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT");
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ if (empty($reshook))
|
|||
|
||||
// We must define tva_tx, npr and local taxes
|
||||
$tva_tx = $tva_tx_txt;
|
||||
$reg = array();
|
||||
$reg = array();
|
||||
$vatratecode = '';
|
||||
if (preg_match('/\((.*)\)/', $tva_tx_txt, $reg))
|
||||
{
|
||||
|
|
@ -330,7 +330,7 @@ if (empty($reshook))
|
|||
'price' => $newprice,
|
||||
'price_min' => $newprice_min,
|
||||
'price_base_type' => $newpricebase,
|
||||
'default_vat_code' => $vatratecode,
|
||||
'default_vat_code' => $vatratecode,
|
||||
'vat_tx' => $tva_tx, // default_vat_code should be used in priority in a future
|
||||
'npr' => $npr, // default_vat_code should be used in priority in a future
|
||||
'localtaxes_array' => array('0'=>$localtax1_type, '1'=>$localtax1, '2'=>$localtax2_type, '3'=>$localtax2) // default_vat_code should be used in priority in a future
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ if (empty($reshook))
|
|||
$object->address = (string) GETPOST("address", "alpha");
|
||||
$object->zip = (string) GETPOST("zipcode", "alpha");
|
||||
$object->town = (string) GETPOST("town", "alpha");
|
||||
$object->country_id = GETPOST("country_id");
|
||||
$object->country_id = GETPOST("country_id");
|
||||
$object->phone = (string) GETPOST("phone", "alpha");
|
||||
$object->fax = (string) GETPOST("fax", "alpha");
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class MouvementStock extends CommonObject
|
|||
dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch);
|
||||
|
||||
// Clean parameters
|
||||
$price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value.
|
||||
$price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value.
|
||||
if (empty($price)) $price = 0;
|
||||
$now = (!empty($datem) ? $datem : dol_now());
|
||||
|
||||
|
|
|
|||
|
|
@ -620,7 +620,7 @@ if ($test) $isavailable[$daytoparse] = array('morning'=>false, 'afternoon'=>fals
|
|||
|
||||
$tmparray = dol_getdate($daytoparse, true); // detail of current day
|
||||
// For monday, must be 0 for monday if MAIN_START_WEEK = 1, must be 1 for monday if MAIN_START_WEEK = 0
|
||||
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK)?0:1));
|
||||
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
|
||||
// numstartworkingday and numendworkingday are default start and end date of working days (1 means sunday if MAIN_START_WEEK is 0, 1 means monday if MAIN_START_WEEK is 1)
|
||||
$cssweekend = '';
|
||||
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.
|
||||
|
|
|
|||
|
|
@ -922,7 +922,7 @@ class Task extends CommonObject
|
|||
$tasks[$i]->planned_workload = $obj->planned_workload;
|
||||
|
||||
if ($includebilltime) {
|
||||
$tasks[$i]->tobill = $obj->tobill;
|
||||
$tasks[$i]->tobill = $obj->tobill;
|
||||
$tasks[$i]->billed = $obj->billed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -963,7 +963,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||
print $langs->trans('InvoiceToUse');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all');
|
||||
$form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
/*print '<tr>';
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ class Reception extends CommonObject
|
|||
$this->ref = $obj->ref;
|
||||
$this->socid = $obj->socid;
|
||||
$this->ref_supplier = $obj->ref_supplier;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ if (empty($reshook))
|
|||
$nuser->personal_mobile = $object->phone;
|
||||
$nuser->birth = $object->date_birth;
|
||||
$nuser->salary = $object->remuneration_proposed;
|
||||
$nuser->fk_user = $jobposition->fk_user_supervisor; // Supervisor
|
||||
$nuser->fk_user = $jobposition->fk_user_supervisor; // Supervisor
|
||||
|
||||
$result = $nuser->create($user);
|
||||
|
||||
|
|
|
|||
|
|
@ -269,20 +269,20 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec
|
|||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required */
|
||||
$sql.= " GROUP BY ";
|
||||
$sql .= " GROUP BY ";
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
$sql.='t.'.$key.', ';
|
||||
$sql .= 't.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql=preg_replace('/,\s*$/', '', $sql);
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
|
|
|
|||
|
|
@ -813,14 +813,14 @@ print '</a></td>';
|
|||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="80%">' . $langs->trans("AddEmailPhoneTownInContactList") . '</td>';
|
||||
print '<td width="80%">'.$langs->trans("AddEmailPhoneTownInContactList").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="center">';
|
||||
if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
|
||||
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">';
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
}
|
||||
print '</a></td>';
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ $arrayfields = array(
|
|||
's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ if (empty($reshook))
|
|||
{
|
||||
if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) {
|
||||
$object->ref = GETPOST('ref');
|
||||
$object->date_livraison = $date_delivery; // deprecated
|
||||
$object->date_livraison = $date_delivery; // deprecated
|
||||
$object->delivery_date = $date_delivery;
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
|
|
|
|||
|
|
@ -1240,7 +1240,7 @@ class SupplierProposal extends CommonObject
|
|||
$this->datev = $this->db->jdate($obj->datev); // TODO deprecated
|
||||
$this->date_creation = $this->db->jdate($obj->datec); //Creation date
|
||||
$this->date_validation = $this->db->jdate($obj->datev); //Validation date
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
|
||||
$this->delivery_date = $this->db->jdate($obj->delivery_date);
|
||||
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ if ($action == "getTables")
|
|||
$rows = array();
|
||||
while ($row = $db->fetch_array($resql)) {
|
||||
$invoice = new Facture($db);
|
||||
$result=$invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')');
|
||||
if ($result>0) $row['occupied']="red";
|
||||
$result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')');
|
||||
if ($result > 0) $row['occupied'] = "red";
|
||||
$rows[] = $row;
|
||||
}
|
||||
echo json_encode($rows);
|
||||
|
|
|
|||
|
|
@ -420,9 +420,9 @@ if ($action == 'creditnote')
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'history' || $action=='creditnote')
|
||||
if ($action == 'history' || $action == 'creditnote')
|
||||
{
|
||||
if ($action=='creditnote') $placeid = $creditnote->id;
|
||||
if ($action == 'creditnote') $placeid = $creditnote->id;
|
||||
else $placeid = (int) GETPOST('placeid', 'int');
|
||||
$invoice = new Facture($db);
|
||||
$invoice->fetch($placeid);
|
||||
|
|
@ -679,8 +679,8 @@ if ($action == "order" and $placeid != 0)
|
|||
}
|
||||
|
||||
$sql = "SELECT label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place);
|
||||
$resql = $db->query($sql);
|
||||
$row = $db->fetch_object($resql);
|
||||
$resql = $db->query($sql);
|
||||
$row = $db->fetch_object($resql);
|
||||
$headerorder = '<html><br><b>'.$langs->trans('Place').' '.$row->label.'<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>';
|
||||
$order_receipt_printer1 = "";
|
||||
|
|
@ -858,7 +858,7 @@ $(document).ready(function() {
|
|||
<?php
|
||||
|
||||
if ($action == "order" and $order_receipt_printer1 != "") {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
@ -880,7 +880,7 @@ if ($action == "order" and $order_receipt_printer1 != "") {
|
|||
}
|
||||
|
||||
if ($action == "order" and $order_receipt_printer2 != "") {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
@ -902,7 +902,7 @@ if ($action == "order" and $order_receipt_printer2 != "") {
|
|||
}
|
||||
|
||||
if ($action == "order" and $order_receipt_printer3 != "") {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val)
|
|||
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
|
@ -316,7 +316,7 @@ if ($socid > 0)
|
|||
|
||||
foreach ($search as $key => $val)
|
||||
{
|
||||
if ($key == 'fk_statut' && !empty($search['fk_statut']))
|
||||
if ($key == 'fk_statut' && !empty($search['fk_statut']))
|
||||
{
|
||||
$newarrayofstatus = array();
|
||||
foreach ($search['fk_statut'] as $key2 => $val2) {
|
||||
|
|
@ -636,9 +636,9 @@ foreach ($object->fields as $key => $val)
|
|||
$formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150'));
|
||||
print '</td>';
|
||||
} elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print $form->select_dolusers($search[$key], 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth150'));
|
||||
print '</td>';
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print $form->select_dolusers($search[$key], 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth150'));
|
||||
print '</td>';
|
||||
} elseif ($key == 'fk_statut') {
|
||||
$arrayofstatus = array();
|
||||
$arrayofstatus['openall'] = '-- '.$langs->trans('OpenAll').' --';
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ if ($search_thirdparty != '') $sql .= natural_search(array('s.nom'), $search_thi
|
|||
if ($search_login != '') $sql .= natural_search("u.login", $search_login);
|
||||
if ($search_lastname != '') $sql .= natural_search("u.lastname", $search_lastname);
|
||||
if ($search_firstname != '') $sql .= natural_search("u.firstname", $search_firstname);
|
||||
if ($search_gender != '' && $search_gender != '-1') $sql .= " AND u.gender = '".$db->escape($search_gender)."'"; // Cannot use natural_search as looking for %man% also includes woman
|
||||
if ($search_gender != '' && $search_gender != '-1') $sql .= " AND u.gender = '".$db->escape($search_gender)."'"; // Cannot use natural_search as looking for %man% also includes woman
|
||||
if (is_numeric($search_employee) && $search_employee >= 0) {
|
||||
$sql .= ' AND u.employee = '.(int) $search_employee;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -882,7 +882,7 @@ class Website extends CommonObject
|
|||
global $user;
|
||||
|
||||
$this->id = 0;
|
||||
$this->specimen =1;
|
||||
$this->specimen = 1;
|
||||
$this->entity = 1;
|
||||
$this->ref = 'myspecimenwebsite';
|
||||
$this->description = 'A specimen website';
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ class ZapierApi extends DolibarrApi
|
|||
$fields = array(
|
||||
'url',
|
||||
);
|
||||
dol_syslog("API Zapier create hook receive : " . print_r($request_data, true), LOG_DEBUG);
|
||||
dol_syslog("API Zapier create hook receive : ".print_r($request_data, true), LOG_DEBUG);
|
||||
$result = $this->validate($request_data, $fields);
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
|
|
|
|||
|
|
@ -77,12 +77,12 @@ if (!$myfile)
|
|||
}
|
||||
|
||||
$tmp = 1;
|
||||
while ($tmp!=null)
|
||||
while ($tmp != null)
|
||||
{
|
||||
$groupofemails=array();
|
||||
for ($i=0; $i < MAXEMAILS; $i++)
|
||||
$groupofemails = array();
|
||||
for ($i = 0; $i < MAXEMAILS; $i++)
|
||||
{
|
||||
$tmp =fgets($myfile);
|
||||
$tmp = fgets($myfile);
|
||||
if ($tmp == null)
|
||||
{
|
||||
break;
|
||||
|
|
@ -99,7 +99,7 @@ while ($tmp!=null)
|
|||
{
|
||||
// Loop on each record and update the email to null if email into $groupofemails
|
||||
|
||||
$sql=$sql_base."societe as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
|
||||
$sql = $sql_base."societe as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ while ($tmp!=null)
|
|||
{
|
||||
// Loop on each record and update the email to null if email into $groupofemails
|
||||
|
||||
$sql=$sql_base."socpeople as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
|
||||
$sql = $sql_base."socpeople as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ while ($tmp!=null)
|
|||
{
|
||||
// Loop on each record and update the email to null if email into $groupofemails
|
||||
|
||||
$sql=$sql_base."user as u SET u.email = NULL WHERE u.email = '".$db->escape($email)."';";
|
||||
$sql = $sql_base."user as u SET u.email = NULL WHERE u.email = '".$db->escape($email)."';";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
|
@ -123,8 +123,8 @@ while ($tmp!=null)
|
|||
{
|
||||
// Loop on each record and update the email to null if email into $groupofemails
|
||||
|
||||
$sql=$sql_base."adherent as a SET a.email = NULL WHERE a.email = '".$db->escape($email)."';";
|
||||
$resql=$db->query($sql);
|
||||
$sql = $sql_base."adherent as a SET a.email = NULL WHERE a.email = '".$db->escape($email)."';";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
echo $email;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user