Several fixes

This commit is contained in:
Laurent Destailleur 2017-12-12 16:11:40 +01:00
parent 2ce3810001
commit 247c380d18
10 changed files with 93 additions and 109 deletions

View File

@ -401,7 +401,7 @@ if ($resql)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
$topicmail="SendProposalRef";
$topicmail="SendPropalRef";
$modelmail="proposal_send";
$objecttmp=new Propal($db);
$trackid='pro'.$object->id;

View File

@ -1210,7 +1210,6 @@ class Contrat extends CommonObject
if (isset($this->entity)) $this->entity=trim($this->entity);
if (isset($this->statut)) $this->statut=(int) $this->statut;
if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc);
if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project);
if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature=trim($this->fk_commercial_signature);
if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi=trim($this->fk_commercial_suivi);
if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service=trim($this->fk_user_mise_en_service);
@ -1235,8 +1234,8 @@ class Contrat extends CommonObject
$sql.= " mise_en_service=".(dol_strlen($this->mise_en_service)!=0 ? "'".$this->db->idate($this->mise_en_service)."'" : 'null').",";
$sql.= " fin_validite=".(dol_strlen($this->fin_validite)!=0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').",";
$sql.= " date_cloture=".(dol_strlen($this->date_cloture)!=0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').",";
$sql.= " fk_soc=".(isset($this->fk_soc)?$this->fk_soc:"null").",";
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
$sql.= " fk_soc=".($this->fk_soc > 0 ? $this->fk_soc:"null").",";
$sql.= " fk_projet=".($this->fk_project > 0 ? $this->fk_project:"null").",";
$sql.= " fk_commercial_signature=".(isset($this->fk_commercial_signature)?$this->fk_commercial_signature:"null").",";
$sql.= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi)?$this->fk_commercial_suivi:"null").",";
$sql.= " fk_user_mise_en_service=".(isset($this->fk_user_mise_en_service)?$this->fk_user_mise_en_service:"null").",";

View File

@ -23,7 +23,7 @@
// $massaction must be defined
// $objectclass and $$objectlabel must be defined
// $objectclass and $objectlabel must be defined
// $parameters, $object, $action must be defined for the hook.
// $permtoread, $permtocreate and $permtodelete may be defined
@ -192,70 +192,70 @@ if (! $error && $massaction == 'confirm_presend')
//var_dump($listofobjectref);exit;
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
$listofqualifiedid=array();
$listofqualifiedobj=array();
$listofqualifiedref=array();
$thirdpartywithoutemail=array();
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
foreach($listofobjectref[$thirdpartyid] as $objectid => $objectobj)
{
//var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut);
if ($objectclass == 'Propal' && $object->statut == Propal::STATUS_DRAFT)
//var_dump($thirdpartyid.' - '.$objectid.' - '.$objectobj->statut);
if ($objectclass == 'Propal' && $objectobj->statut == Propal::STATUS_DRAFT)
{
$langs->load("errors");
$nbignored++;
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$object->ref).'</div><br>';
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue; // Payment done or started or canceled
}
if ($objectclass == 'Commande' && $object->statut == Commande::STATUS_DRAFT)
if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT)
{
$langs->load("errors");
$nbignored++;
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$object->ref).'</div><br>';
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue;
}
if ($objectclass == 'Facture' && $object->statut != Facture::STATUS_VALIDATED)
if ($objectclass == 'Facture' && $objectobj->statut != Facture::STATUS_VALIDATED)
{
$langs->load("errors");
$nbignored++;
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'</div><br>';
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue; // Payment done or started or canceled
}
// Test recipient
if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send)
{
if ($object->element == 'expensereport')
if ($objectobj->element == 'expensereport')
{
$fuser = new User($db);
$fuser->fetch($object->fk_user_author);
$fuser->fetch($objectobj->fk_user_author);
$sendto = $fuser->email;
}
else
{
$object->fetch_thirdparty();
$sendto = $object->thirdparty->email;
$objectobj->fetch_thirdparty();
$sendto = $objectobj->thirdparty->email;
}
}
if (empty($sendto))
{
//print "No recipient for thirdparty ".$object->thirdparty->name;
//print "No recipient for thirdparty ".$objectobj->thirdparty->name;
$nbignored++;
if (empty($thirdpartywithoutemail[$object->thirdparty->id]))
if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id]))
{
$resaction.='<div class="error">'.$langs->trans('NoRecipientEmail',$object->thirdparty->name).'</div><br>';
$resaction.='<div class="error">'.$langs->trans('NoRecipientEmail',$objectobj->thirdparty->name).'</div><br>';
}
dol_syslog('No recipient for thirdparty: '.$object->thirdparty->name, LOG_WARNING);
$thirdpartywithoutemail[$object->thirdparty->id]=1;
dol_syslog('No recipient for thirdparty: '.$objectobj->thirdparty->name, LOG_WARNING);
$thirdpartywithoutemail[$objectobj->thirdparty->id]=1;
continue;
}
if ($_POST['addmaindocfile'])
{
// TODO Use future field $object->fullpathdoc to know where is stored default file
// TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename=dol_sanitizeFileName($object->ref).'.pdf';
$filedir=$uploaddir . '/' . dol_sanitizeFileName($object->ref);
// TODO Use future field $objectobj->fullpathdoc to know where is stored default file
// TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename=dol_sanitizeFileName($objectobj->ref).'.pdf';
$filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref);
$file = $filedir . '/' . $filename;
$mime = dol_mimetype($file);
@ -279,15 +279,15 @@ if (! $error && $massaction == 'confirm_presend')
}
// Object of thirdparty qualified
$listofqualifiedid[$objectid]=$object;
$listofqualifiedref[$objectid]=$object->ref;
$listofqualifiedobj[$objectid]=$objectobj;
$listofqualifiedref[$objectid]=$objectobj->ref;
//var_dump($listofqualifiedref);
}
// Send email if there is at least one qualified record
if (count($listofqualifiedid) > 0)
if (count($listofqualifiedobj) > 0)
{
$langs->load("commercial");
@ -331,12 +331,12 @@ if (! $error && $massaction == 'confirm_presend')
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
// $listofqualifiedid is array with key = object id of qualified objects for the current thirdparty
// $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
$looparray=array();
if (! $oneemailperrecipient)
{
$looparray = $listofqualifiedid;
$looparray = $listofqualifiedobj;
}
else
{
@ -350,7 +350,7 @@ if (! $error && $massaction == 'confirm_presend')
{
// Make substitution in email content
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedid)) : $objecttmp->id);
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedobj)) : $objecttmp->id);
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ',$listofqualifiedref) : $objecttmp->ref);
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
@ -384,7 +384,7 @@ if (! $error && $massaction == 'confirm_presend')
$error=0;
// Insert logs into agenda
foreach($listofqualifiedid as $objid => $object)
foreach($listofqualifiedobj as $objid => $objectobj)
{
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
@ -404,13 +404,13 @@ if (! $error && $massaction == 'confirm_presend')
$actionmsg2='';
// Initialisation donnees
$object->sendtoid = 0;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->fk_element = $objid;
$object->elementtype = $object->element;
$objectobj->sendtoid = 0;
$objectobj->actionmsg = $actionmsg; // Long text
$objectobj->actionmsg2 = $actionmsg2; // Short text
$objectobj->fk_element = $objid;
$objectobj->elementtype = $objectobj->element;
$triggername = strtoupper(get_class($object)) .'_SENTBYMAIL';
$triggername = strtoupper(get_class($objectobj)) .'_SENTBYMAIL';
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
@ -425,7 +425,7 @@ if (! $error && $massaction == 'confirm_presend')
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
$result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
@ -499,15 +499,15 @@ if ($massaction == 'confirm_createbills')
$cmd = new Commande($db);
if ($cmd->fetch($id_order) <= 0) continue;
$object = new Facture($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
$objecttmp = new Facture($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
else {
$object->socid = $cmd->socid;
$object->type = Facture::TYPE_STANDARD;
$object->cond_reglement_id = $cmd->cond_reglement_id;
$object->mode_reglement_id = $cmd->mode_reglement_id;
$object->fk_project = $cmd->fk_project;
$objecttmp->socid = $cmd->socid;
$objecttmp->type = Facture::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->fk_project = $cmd->fk_project;
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
@ -515,16 +515,16 @@ if ($massaction == 'confirm_createbills')
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
}
$object->date = $datefacture;
$object->origin = 'commande';
$object->origin_id = $id_order;
$objecttmp->date = $datefacture;
$objecttmp->origin = 'commande';
$objecttmp->origin_id = $id_order;
$res = $object->create($user);
$res = $objecttmp->create($user);
if($res > 0) $nb_bills_created++;
}
if ($object->id > 0)
if ($objecttmp->id > 0)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
$sql.= "fk_source";
@ -533,9 +533,9 @@ if ($massaction == 'confirm_createbills')
$sql.= ", targettype";
$sql.= ") VALUES (";
$sql.= $id_order;
$sql.= ", '".$object->origin."'";
$sql.= ", ".$object->id;
$sql.= ", '".$object->element."'";
$sql.= ", '".$objecttmp->origin."'";
$sql.= ", ".$objecttmp->id;
$sql.= ", '".$objecttmp->element."'";
$sql.= ")";
if (! $db->query($sql))
@ -562,7 +562,7 @@ if ($massaction == 'confirm_createbills')
{
// Negative line, we create a discount line
$discount = new DiscountAbsolute($db);
$discount->fk_soc=$object->socid;
$discount->fk_soc=$objecttmp->socid;
$discount->amount_ht=abs($lines[$i]->total_ht);
$discount->amount_tva=abs($lines[$i]->total_tva);
$discount->amount_ttc=abs($lines[$i]->total_ttc);
@ -572,7 +572,7 @@ if ($massaction == 'confirm_createbills')
$discountid=$discount->create($user);
if ($discountid > 0)
{
$result=$object->insert_discount($discountid);
$result=$objecttmp->insert_discount($discountid);
//$result=$discount->link_to_invoice($lineid,$id);
}
else
@ -601,7 +601,7 @@ if ($massaction == 'confirm_createbills')
{
$fk_parent_line = 0;
}
$result = $object->addline(
$result = $objecttmp->addline(
$desc,
$lines[$i]->subprice,
$lines[$i]->qty,
@ -620,7 +620,7 @@ if ($massaction == 'confirm_createbills')
$product_type,
$ii,
$lines[$i]->special_code,
$object->origin,
$objecttmp->origin,
$lines[$i]->rowid,
$fk_parent_line,
$lines[$i]->fk_fournprice,
@ -649,8 +649,8 @@ if ($massaction == 'confirm_createbills')
//$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module.
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
else $TFact[$object->id] = $object;
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $objecttmp;
else $TFact[$objecttmp->id] = $objecttmp;
}
// Build doc with all invoices
@ -660,19 +660,19 @@ if ($massaction == 'confirm_createbills')
if (! $error && $validate_invoices)
{
$massaction = $action = 'builddoc';
foreach($TAllFact as &$object)
foreach($TAllFact as &$objecttmp)
{
$result = $object->validate($user);
$result = $objecttmp->validate($user);
if ($result <= 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
break;
}
$id = $object->id; // For builddoc action
$id = $objecttmp->id; // For builddoc action
// Fac builddoc
// Builddoc
$donotredirect = 1;
$upload_dir = $conf->facture->dir_output;
$permissioncreate=$user->rights->facture->creer;
@ -693,7 +693,7 @@ if ($massaction == 'confirm_createbills')
$action='create';
$_GET["origin"]=$_POST["origin"];
$_GET["originid"]=$_POST["originid"];
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages("Error", null, 'errors');
$error++;
}
}
@ -750,7 +750,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
@ -767,7 +767,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$filename=preg_replace('/\s/','_',$filename);
// Save merged file
if (in_array($object->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
@ -839,7 +839,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$filename=preg_replace('/\s/','_',$filename);
// Save merged file
if (in_array($object->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
@ -881,13 +881,15 @@ if ($action == 'remove_file')
// Validate records
if (! $error && $massaction == 'validate' && $permtocreate)
{
if ($object->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
$objecttmp=new $objectclass($db);
if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
$langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
$error++;
}
if ($object->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL))
if ($objecttmp->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL))
{
$langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
@ -897,7 +899,6 @@ if (! $error && $massaction == 'validate' && $permtocreate)
{
$db->begin();
$objecttmp=new $objectclass($db);
$nbok = 0;
foreach($toselect as $toselectid)
{
@ -962,7 +963,7 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
{
$langs->load("errors");
$nbignored++;
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$object->ref).'</div><br>';
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'</div><br>';
continue;
}*/

View File

@ -4167,7 +4167,12 @@ abstract class CommonObject
// Set the public "share" key
$setsharekey = false;
if ($this->element == 'propal' && ! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($this->element == 'propal')
{
$useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok
if ($useonlinesignature) $setsharekey=true;
if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
}
if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($setsharekey)

View File

@ -531,7 +531,8 @@ class Utils
*/
function generateDoc($module)
{
global $conf, $dirins;
global $conf, $langs;
global $dirins;
$error = 0;
@ -549,7 +550,7 @@ class Utils
if (class_exists($class))
{
try {
$moduleobj = new $class($db);
$moduleobj = new $class($this->db);
}
catch(Exception $e)
{

View File

@ -63,7 +63,8 @@ function commande_prepare_head(Commande $object)
{
$nbShipments=$object->getNbOfShipments(); $nbReceiption=0;
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipments");
$text='';
if ($conf->expedition_bon->enabled) $text.=$langs->trans("Shipments");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/';
if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings");
if ($nbShipments > 0 || $nbReceiption > 0) $text.= ' <span class="badge">'.($nbShipments?$nbShipments:0);

View File

@ -2350,7 +2350,7 @@ class CommandeFournisseur extends CommonOrder
* @param string $ref_supplier Supplier ref
* @return int < 0 if error, > 0 if ok
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise=0, $ref_supplier='')
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise=0, $ref_supplier='')
{
global $mysoc, $conf;
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");

View File

@ -173,19 +173,20 @@ class Segment implements IteratorAggregate, Countable
*/
public function macroReplace($text)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
global $langs;
$hoy = dol_getdate(dol_now('tzuser'));
$dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']);
$nextMonth = $dateinonemontharray['month'];
$patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u',
'/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u',
'/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u',
'/__CURRENTYEAR__/u','/__NEXTYEAR__/u' );
$values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']),
$hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']),
$nextMonth, monthArray($langs)[$nextMonth],
$values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']),
$hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']),
$nextMonth, monthArray($langs)[$nextMonth],
$hoy['year'], $hoy['year']+1 );
$text=preg_replace($patterns, $values, $text);

View File

@ -133,30 +133,6 @@ if ($object->id)
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client)
{
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print '</td></tr>';
}
if ($object->fournisseur)
{
print '<tr><td class="titlefield">';
print $langs->trans('SupplierCode').'</td><td colspan="3">';
print $object->code_fournisseur;
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
print '</td></tr>';
}
// Number of files
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';

View File

@ -442,7 +442,7 @@ class Entrepot extends CommonObject
}
/**
* Return number of unique different product into a warehosue
* Return number of unique different product into a warehouse
*
* @return Array Array('nb'=>Nb, 'value'=>Value)
*/