Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
8ced29cb00
@ -4597,6 +4597,9 @@ class OrderLine extends CommonOrderLine
|
|||||||
if (empty($this->remise_percent)) {
|
if (empty($this->remise_percent)) {
|
||||||
$this->remise_percent = 0;
|
$this->remise_percent = 0;
|
||||||
}
|
}
|
||||||
|
if (empty($this->remise)) {
|
||||||
|
$this->remise = 0;
|
||||||
|
}
|
||||||
if (empty($this->info_bits)) {
|
if (empty($this->info_bits)) {
|
||||||
$this->info_bits = 0;
|
$this->info_bits = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1288,7 +1288,8 @@ abstract class CommonDocGenerator
|
|||||||
}
|
}
|
||||||
$extrafields = $this->extrafieldsCache;
|
$extrafields = $this->extrafieldsCache;
|
||||||
|
|
||||||
$extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
|
$extrafieldOutputContent = '';
|
||||||
|
if (isset($object->array_options[$extrafieldOptionsKey])) $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
|
||||||
|
|
||||||
// TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ...
|
// TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ...
|
||||||
if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') {
|
if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') {
|
||||||
|
|||||||
@ -8047,7 +8047,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__AMOUNT_TEXT__'] = is_object($object) ? dol_convertToWord($object->total_ttc, $outputlangs, '', true) : '';
|
$substitutionarray['__AMOUNT_TEXT__'] = is_object($object) ? dol_convertToWord($object->total_ttc, $outputlangs, '', true) : '';
|
||||||
$substitutionarray['__AMOUNT_TEXTCURRENCY__'] = is_object($object) ? dol_convertToWord($object->total_ttc, $outputlangs, $conf->currency, true) : '';
|
$substitutionarray['__AMOUNT_TEXTCURRENCY__'] = is_object($object) ? dol_convertToWord($object->total_ttc, $outputlangs, $conf->currency, true) : '';
|
||||||
|
|
||||||
$substitutionarray['__AMOUNT_REMAIN__'] = is_object($object) ? $object->total_ttc - $already_payed_all : '';
|
$substitutionarray['__AMOUNT_REMAIN__'] = is_object($object) ? price2num($object->total_ttc - $already_payed_all, 'MT') : '';
|
||||||
|
|
||||||
$substitutionarray['__AMOUNT_VAT__'] = is_object($object) ? (isset($object->total_vat) ? $object->total_vat : $object->total_tva) : '';
|
$substitutionarray['__AMOUNT_VAT__'] = is_object($object) ? (isset($object->total_vat) ? $object->total_vat : $object->total_tva) : '';
|
||||||
$substitutionarray['__AMOUNT_VAT_TEXT__'] = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, '', true) : dol_convertToWord($object->total_tva, $outputlangs, '', true)) : '';
|
$substitutionarray['__AMOUNT_VAT_TEXT__'] = is_object($object) ? (isset($object->total_vat) ? dol_convertToWord($object->total_vat, $outputlangs, '', true) : dol_convertToWord($object->total_tva, $outputlangs, '', true)) : '';
|
||||||
|
|||||||
@ -832,7 +832,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$totalToShip = $tmparray['toship'];
|
$totalToShip = $tmparray['toship'];
|
||||||
// Set trueVolume and volume_units not currently stored into database
|
// Set trueVolume and volume_units not currently stored into database
|
||||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) {
|
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) {
|
||||||
$object->trueVolume = price(($object->trueWidth * $object->trueHeight * $object->trueDepth), 0, $outputlangs, 0, 0);
|
$object->trueVolume = $object->trueWidth * $object->trueHeight * $object->trueDepth;
|
||||||
$object->volume_units = $object->size_units * 3;
|
$object->volume_units = $object->size_units * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -567,7 +567,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Total HT line
|
// Total HT line
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN)) {
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN)) {
|
||||||
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs);
|
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->postotalht, $curY);
|
$pdf->SetXY($this->postotalht, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ if ($action == 'presend') {
|
|||||||
$titreform = 'SendMail';
|
$titreform = 'SendMail';
|
||||||
|
|
||||||
$object->fetch_projet();
|
$object->fetch_projet();
|
||||||
|
if (!isset($file)) $file = null;
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
if (!in_array($object->element, array('user', 'member'))) {
|
if (!in_array($object->element, array('user', 'member'))) {
|
||||||
//$fileparams['fullname'] can be filled from the card
|
//$fileparams['fullname'] can be filled from the card
|
||||||
@ -57,7 +57,7 @@ if ($action == 'presend') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = $fileparams['fullname'];
|
$file = isset($fileparams['fullname'])?$fileparams['fullname']:null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
|
|||||||
@ -52,7 +52,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
$amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT');
|
$amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT');
|
||||||
$donation_date = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
$donation_date = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||||
@ -63,6 +63,13 @@ if ($id > 0 || $ref) {
|
|||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($socid) && $socid > 0) {
|
||||||
|
$soc = new Societe($db);
|
||||||
|
if ($socid > 0) {
|
||||||
|
$soc->fetch($socid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -60,6 +60,7 @@ $search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_
|
|||||||
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_company = GETPOST('search_company', 'alpha');
|
$search_company = GETPOST('search_company', 'alpha');
|
||||||
|
$search_thirdparty = GETPOST('search_thirdparty', 'alpha');
|
||||||
$search_name = GETPOST('search_name', 'alpha');
|
$search_name = GETPOST('search_name', 'alpha');
|
||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
@ -72,6 +73,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_all = "";
|
$search_all = "";
|
||||||
$search_ref = "";
|
$search_ref = "";
|
||||||
$search_company = "";
|
$search_company = "";
|
||||||
|
$search_thirdparty = "";
|
||||||
$search_name = "";
|
$search_name = "";
|
||||||
$search_amount = "";
|
$search_amount = "";
|
||||||
$search_status = '';
|
$search_status = '';
|
||||||
|
|||||||
@ -240,12 +240,9 @@ class EcmFiles extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If ref not defined
|
// If ref not defined
|
||||||
$ref = '';
|
if (empty($this->ref)) {
|
||||||
if (!empty($this->ref)) {
|
|
||||||
$ref = $this->ref;
|
|
||||||
} else {
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||||
$ref = dol_hash($this->filepath.'/'.$this->filename, 3);
|
$this->ref = dol_hash($this->filepath.'/'.$this->filename, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxposition = 0;
|
$maxposition = 0;
|
||||||
@ -300,7 +297,7 @@ class EcmFiles extends CommonObject
|
|||||||
$sql .= 'src_object_type,';
|
$sql .= 'src_object_type,';
|
||||||
$sql .= 'src_object_id';
|
$sql .= 'src_object_id';
|
||||||
$sql .= ') VALUES (';
|
$sql .= ') VALUES (';
|
||||||
$sql .= " '".$this->db->escape($ref)."', ";
|
$sql .= " '".$this->db->escape($this->ref)."', ";
|
||||||
$sql .= ' '.(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").',';
|
$sql .= ' '.(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").',';
|
||||||
$sql .= ' '.(!isset($this->share) ? 'NULL' : "'".$this->db->escape($this->share)."'").',';
|
$sql .= ' '.(!isset($this->share) ? 'NULL' : "'".$this->db->escape($this->share)."'").',';
|
||||||
$sql .= ' '.((int) $this->entity).',';
|
$sql .= ' '.((int) $this->entity).',';
|
||||||
|
|||||||
@ -1331,7 +1331,7 @@ class FactureFournisseurRec extends CommonInvoice
|
|||||||
// We refresh the object in order to have all necessary data (like date_lim_reglement)
|
// We refresh the object in order to have all necessary data (like date_lim_reglement)
|
||||||
$new_fac_fourn->fetch($new_fac_fourn->id);
|
$new_fac_fourn->fetch($new_fac_fourn->id);
|
||||||
$result = $new_fac_fourn->generateDocument($facturerec->model_pdf, $langs);
|
$result = $new_fac_fourn->generateDocument($facturerec->model_pdf, $langs);
|
||||||
if ($result <= 0) {
|
if ($result < 0) {
|
||||||
$this->errors = $new_fac_fourn->errors;
|
$this->errors = $new_fac_fourn->errors;
|
||||||
$this->error = $new_fac_fourn->error;
|
$this->error = $new_fac_fourn->error;
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||||||
?>
|
?>
|
||||||
<tr class="<?php echo $trclass; ?>">
|
<tr class="<?php echo $trclass; ?>">
|
||||||
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
||||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/commande/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowOrder"), "order").' '.$objectlink->ref; ?></a></td>
|
<td><?php print $objectlink->getNomUrl(1); ?></td>
|
||||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||||
<td class="right"><?php
|
<td class="right"><?php
|
||||||
|
|||||||
@ -49,6 +49,11 @@ $pagenext = $page + 1;
|
|||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
|
if ($user->rights->margins->read->all) {
|
||||||
|
$agentid = GETPOST('agentid', 'int');
|
||||||
|
} else {
|
||||||
|
$agentid = $user->id;
|
||||||
|
}
|
||||||
if (!$sortfield) {
|
if (!$sortfield) {
|
||||||
if ($agentid > 0) {
|
if ($agentid > 0) {
|
||||||
$sortfield = "s.nom";
|
$sortfield = "s.nom";
|
||||||
@ -74,11 +79,6 @@ if (!empty($enddatemonth)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->rights->margins->read->all) {
|
|
||||||
$agentid = GETPOST('agentid', 'int');
|
|
||||||
} else {
|
|
||||||
$agentid = $user->id;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'margins');
|
$result = restrictedArea($user, 'margins');
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
@ -317,7 +317,8 @@ if ($result) {
|
|||||||
$sortfield = 'name';
|
$sortfield = 'name';
|
||||||
}
|
}
|
||||||
$group_list = dol_sort_array($group_list, $sortfield, $sortorder);
|
$group_list = dol_sort_array($group_list, $sortfield, $sortorder);
|
||||||
|
$cumul_achat = 0;
|
||||||
|
$cumul_vente = 0;
|
||||||
foreach ($group_list as $group_id => $group_array) {
|
foreach ($group_list as $group_id => $group_array) {
|
||||||
$pa = $group_array['buying_price'];
|
$pa = $group_array['buying_price'];
|
||||||
$pv = $group_array['selling_price'];
|
$pv = $group_array['selling_price'];
|
||||||
|
|||||||
@ -1033,6 +1033,7 @@ if ($source == 'order') {
|
|||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tag = '';
|
||||||
if (GETPOST('fulltag', 'alpha')) {
|
if (GETPOST('fulltag', 'alpha')) {
|
||||||
$fulltag = GETPOST('fulltag', 'alpha');
|
$fulltag = GETPOST('fulltag', 'alpha');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -174,7 +174,7 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice
|
|||||||
$companylangs->setDefaultLang($mysoc->default_lang);
|
$companylangs->setDefaultLang($mysoc->default_lang);
|
||||||
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
||||||
|
|
||||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
$from = !empty($conf->global->MAILING_EMAIL_FROM) ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
|
||||||
$sendto = $sendemail;
|
$sendto = $sendemail;
|
||||||
|
|
||||||
$urlback = $_SERVER["REQUEST_URI"];
|
$urlback = $_SERVER["REQUEST_URI"];
|
||||||
|
|||||||
@ -1327,7 +1327,9 @@ if ($ispaymentok) {
|
|||||||
if ($attendeetovalidate->email_company && $attendeetovalidate->email_company != $thirdparty->email) {
|
if ($attendeetovalidate->email_company && $attendeetovalidate->email_company != $thirdparty->email) {
|
||||||
$cc = ($cc ? ', ' : '').$attendeetovalidate->email_company;
|
$cc = ($cc ? ', ' : '').$attendeetovalidate->email_company;
|
||||||
}
|
}
|
||||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
|
||||||
|
$from = !empty($conf->global->MAILING_EMAIL_FROM) ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
|
||||||
|
|
||||||
$urlback = $_SERVER["REQUEST_URI"];
|
$urlback = $_SERVER["REQUEST_URI"];
|
||||||
|
|
||||||
$ishtml = dol_textishtml($texttosend); // May contain urls
|
$ishtml = dol_textishtml($texttosend); // May contain urls
|
||||||
@ -1628,7 +1630,7 @@ if ($ispaymentok) {
|
|||||||
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
||||||
|
|
||||||
$sendto = $sendemail;
|
$sendto = $sendemail;
|
||||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
$from = !empty($conf->global->MAILING_EMAIL_FROM) ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
@ -1756,7 +1758,7 @@ if ($ispaymentok) {
|
|||||||
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
$companylangs->loadLangs(array('main', 'members', 'bills', 'paypal', 'paybox'));
|
||||||
|
|
||||||
$sendto = $sendemail;
|
$sendto = $sendemail;
|
||||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
$from = !empty($conf->global->MAILING_EMAIL_FROM) ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user