Merge remote-tracking branch 'origin/3.9' into develop
Conflicts: htdocs/fourn/class/fournisseur.commande.class.php
This commit is contained in:
commit
f6d1913bb7
@ -200,9 +200,12 @@ if ($what == 'mysql')
|
||||
$ok=0;
|
||||
dol_syslog("Run command ".$fullcommandcrypted);
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
$i=0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
|
||||
fwrite($handle,$read);
|
||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
|
||||
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
|
||||
|
||||
@ -447,7 +447,7 @@ abstract class CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR');
|
||||
$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); // See also option MAIN_FORCE_STATE_INTO_ADDRESS
|
||||
|
||||
$contactid=0;
|
||||
$thirdpartyid=0;
|
||||
@ -483,11 +483,11 @@ abstract class CommonObject
|
||||
$out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++;
|
||||
$outdone++;
|
||||
}
|
||||
|
||||
if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)
|
||||
&& ! empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state)
|
||||
|
||||
if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) // If MAIN_FORCE_STATE_INTO_ADDRESS is on, state is already returned previously with getFullAddress
|
||||
&& empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state)
|
||||
{
|
||||
$out.=($outdone?'<br>':'').$this->state;
|
||||
$out.=($outdone?' - ':'').$this->state;
|
||||
$outdone++;
|
||||
}
|
||||
|
||||
|
||||
@ -1001,7 +1001,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
|
||||
global $conf,$langs;
|
||||
|
||||
$ret='';
|
||||
$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR');
|
||||
$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
||||
|
||||
// Address
|
||||
$ret .= $object->address;
|
||||
@ -1009,7 +1009,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
|
||||
if (in_array($object->country_code,array('US','AU')) || ! empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) // US: title firstname name \n address lines \n town, state, zip \n country
|
||||
{
|
||||
$ret .= ($ret ? $sep : '' ).$object->town;
|
||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||
if ($object->state)
|
||||
{
|
||||
$ret.=", ".$object->state;
|
||||
}
|
||||
@ -1018,7 +1018,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
|
||||
else if (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country
|
||||
{
|
||||
$ret .= ($ret ? $sep : '' ).$object->town;
|
||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||
if ($object->state)
|
||||
{
|
||||
$ret.=", ".$object->state;
|
||||
}
|
||||
@ -1028,12 +1028,11 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
|
||||
{
|
||||
$ret .= ($ret ? $sep : '' ).$object->zip;
|
||||
$ret .= ($object->town?(($object->zip?' ':'').$object->town):'');
|
||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||
if ($object->state)
|
||||
{
|
||||
$ret.="\n".$object->state;
|
||||
}
|
||||
}
|
||||
|
||||
else // Other: title firstname name \n address lines \n zip town \n country
|
||||
{
|
||||
$ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : '';
|
||||
|
||||
@ -883,8 +883,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
|
||||
}
|
||||
// Avoid having any valid PDF with setup that is not complete
|
||||
elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||
|| ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER)))
|
||||
elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
|
||||
|| ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)))
|
||||
{
|
||||
$outputlangs->load("errors");
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->statuts[5] = 'StatusOrderReceivedAll';
|
||||
$this->statuts[6] = 'StatusOrderCanceled'; // Approved->Canceled
|
||||
$this->statuts[7] = 'StatusOrderCanceled'; // Process running->canceled
|
||||
//$this->statuts[8] = 'StatusOrderBilled'; // Everything is finish, order received totally and bill received
|
||||
//$this->statuts[8] = 'StatusOrderBilled'; // Everything is finished, order received totally and bill received
|
||||
$this->statuts[9] = 'StatusOrderRefused';
|
||||
}
|
||||
|
||||
@ -611,8 +611,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
* @param string $option On what the link points
|
||||
* @return string Chain with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
@ -647,8 +647,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
* Returns the following order reference not used depending on the numbering model activated
|
||||
* defined within COMMANDE_SUPPLIER_ADDON_NUMBER
|
||||
*
|
||||
* @param Societe $soc objet societe
|
||||
* @return string reference libre pour la facture
|
||||
* @param Societe $soc company object
|
||||
* @return string free reference for the invoice
|
||||
*/
|
||||
function getNextNumRef($soc)
|
||||
{
|
||||
@ -742,7 +742,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Definition du nom de modele de numerotation de commande
|
||||
// Definition of order numbering model name
|
||||
$soc = new Societe($this->db);
|
||||
$soc->fetch($this->fourn_id);
|
||||
|
||||
@ -930,7 +930,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
/**
|
||||
* Cancel an approved order.
|
||||
* L'annulation se fait apres l'approbation
|
||||
* The cancellation is done after approval
|
||||
*
|
||||
* @param User $user User making action
|
||||
* @param int $idwarehouse Id warehouse to use for stock change (not used for supplier orders).
|
||||
@ -1064,7 +1064,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->multicurrency_tx = 1;
|
||||
}
|
||||
|
||||
/* On positionne en mode brouillon la commande */
|
||||
// We set order into draft status
|
||||
$this->brouillon = 1;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur (";
|
||||
@ -1119,9 +1119,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
if ($this->id) {
|
||||
$num=count($this->lines);
|
||||
|
||||
/*
|
||||
* Insertion du detail des produits dans la base
|
||||
*/
|
||||
// insert products details into database
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$result = $this->addline(
|
||||
|
||||
@ -2859,6 +2859,18 @@ elseif (! empty($object->id))
|
||||
}
|
||||
}
|
||||
|
||||
// Ship
|
||||
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
|
||||
{
|
||||
if (in_array($object->statut, array(3,4))) {
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id . '">' . $langs->trans('OrderDispatch') . '</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('OrderDispatch') . '</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create bill
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
|
||||
@ -193,16 +193,19 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
|
||||
//print '<table width="100%">';
|
||||
|
||||
// Generation des graphs
|
||||
$dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
|
||||
if (! file_exists($dir.'/'.$object->id))
|
||||
if ($object->id > 0) // We are on statistics for a dedicated product
|
||||
{
|
||||
if (dol_mkdir($dir.'/'.$object->id) < 0)
|
||||
{
|
||||
$mesg = $langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$error++;
|
||||
}
|
||||
$dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
|
||||
if (! file_exists($dir.'/'.$object->id))
|
||||
{
|
||||
if (dol_mkdir($dir.'/'.$object->id) < 0)
|
||||
{
|
||||
$mesg = $langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$graphfiles=array(
|
||||
'propal' =>array('modulepart'=>'productstats_proposals',
|
||||
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
|
||||
|
||||
@ -766,7 +766,7 @@ if ($resql)
|
||||
$arraystcomm=array();
|
||||
foreach($prospectstatic->cacheprospectstatus as $key => $val)
|
||||
{
|
||||
$arraystcomm[$val['id']]=$val['label'];
|
||||
$arraystcomm[$val['id']]=($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']);
|
||||
}
|
||||
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user