Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/compta/facture.php htdocs/core/ajax/ajaxdirpreview.php htdocs/core/class/conf.class.php htdocs/core/class/html.formfile.class.php htdocs/core/lib/functions.lib.php htdocs/core/tpl/objectline_create.tpl.php
This commit is contained in:
commit
693b2fe3b4
@ -162,21 +162,13 @@ if ($type == 'directory')
|
|||||||
// Auto area for suppliers invoices
|
// Auto area for suppliers invoices
|
||||||
else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
|
else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
|
||||||
// Auto area for suppliers invoices
|
// Auto area for suppliers invoices
|
||||||
else if ($module == 'invoice_supplier')
|
else if ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
|
||||||
{
|
|
||||||
$relativepath='facture';
|
|
||||||
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
|
|
||||||
}
|
|
||||||
// Auto area for customers orders
|
// Auto area for customers orders
|
||||||
else if ($module == 'propal') $upload_dir = $conf->propal->dir_output;
|
else if ($module == 'propal') $upload_dir = $conf->propal->dir_output;
|
||||||
// Auto area for customers orders
|
// Auto area for customers orders
|
||||||
else if ($module == 'order') $upload_dir = $conf->commande->dir_output;
|
else if ($module == 'order') $upload_dir = $conf->commande->dir_output;
|
||||||
// Auto area for suppliers orders
|
// Auto area for suppliers orders
|
||||||
else if ($module == 'order_supplier')
|
else if ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
|
||||||
{
|
|
||||||
$relativepath='commande';
|
|
||||||
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
|
|
||||||
}
|
|
||||||
// Auto area for suppliers invoices
|
// Auto area for suppliers invoices
|
||||||
else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
|
else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
|
||||||
// Auto area for products
|
// Auto area for products
|
||||||
@ -198,6 +190,8 @@ if ($type == 'directory')
|
|||||||
$param.='&module='.$module;
|
$param.='&module='.$module;
|
||||||
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
|
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
|
||||||
|
|
||||||
|
if ($module == 'company') $excludefiles[]='^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty.
|
||||||
|
|
||||||
$filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1);
|
$filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1);
|
||||||
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
|
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1486,7 +1486,7 @@ abstract class CommonObject
|
|||||||
$fieldname = 'multicurrency_code';
|
$fieldname = 'multicurrency_code';
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql .= ' SET '.$fieldname.' = "'.$this->db->escape($code).'"';
|
$sql .= ' SET '.$fieldname." = '".$this->db->escape($code)."'";
|
||||||
$sql .= ' WHERE rowid='.$this->id;
|
$sql .= ' WHERE rowid='.$this->id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
|
|||||||
@ -488,8 +488,8 @@ class Conf
|
|||||||
// By default, we propagate contacts
|
// By default, we propagate contacts
|
||||||
if (! isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN='*'; // Can be also '*' or '^(BILLING|SHIPPING|CUSTOMER|.*)$' (regex not yet implemented)
|
if (! isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN='*'; // Can be also '*' or '^(BILLING|SHIPPING|CUSTOMER|.*)$' (regex not yet implemented)
|
||||||
|
|
||||||
// By default, we use the zip town autofill
|
// By default, we do not use the zip town table but the table of third parties
|
||||||
if (! isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY=1;
|
if (! isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY=0;
|
||||||
|
|
||||||
// By default, we open card if one found
|
// By default, we open card if one found
|
||||||
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
|
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
|
||||||
|
|||||||
@ -1002,6 +1002,7 @@ class FormFile
|
|||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="modulepart" value="'.$modulepart.'">';
|
print '<input type="hidden" name="modulepart" value="'.$modulepart.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table width="100%" id="tablelines" class="'.($useinecm?'liste noborder':'liste').'">'."\n";
|
print '<table width="100%" id="tablelines" class="'.($useinecm?'liste noborder':'liste').'">'."\n";
|
||||||
|
|
||||||
@ -1106,8 +1107,6 @@ class FormFile
|
|||||||
&& $file['name'] != '..'
|
&& $file['name'] != '..'
|
||||||
&& ! preg_match('/\.meta$/i',$file['name']))
|
&& ! preg_match('/\.meta$/i',$file['name']))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($filearray[$key]['rowid'] > 0) $lastrowid = $filearray[$key]['rowid'];
|
if ($filearray[$key]['rowid'] > 0) $lastrowid = $filearray[$key]['rowid'];
|
||||||
|
|
||||||
$editline=0;
|
$editline=0;
|
||||||
|
|||||||
@ -4159,7 +4159,7 @@ function getTaxesFromId($vatrate, $buyer=null, $seller=null, $firstparamisid=1)
|
|||||||
* @param Societe $buyer Company object
|
* @param Societe $buyer Company object
|
||||||
* @param Societe $seller Company object
|
* @param Societe $seller Company object
|
||||||
* @param int $firstparamisid 1 if first param is id into table (use this if you can)
|
* @param int $firstparamisid 1 if first param is id into table (use this if you can)
|
||||||
* @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...)
|
* @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type1, rate localtax2, accountancycodecust, accountancycodesupp)
|
||||||
* @see getTaxesFromId
|
* @see getTaxesFromId
|
||||||
*/
|
*/
|
||||||
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
|
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
|
||||||
@ -4197,22 +4197,22 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
|||||||
{
|
{
|
||||||
if (! isOnlyOneLocalTax(1))
|
if (! isOnlyOneLocalTax(1))
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, get_localtax($vatrate, $local, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, get_localtax($vatrate, $local, $buyer, $seller), $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($local == 2)
|
elseif ($local == 2)
|
||||||
{
|
{
|
||||||
if (! isOnlyOneLocalTax(2))
|
if (! isOnlyOneLocalTax(2))
|
||||||
{
|
{
|
||||||
return array($obj->localtax2_type, get_localtax($vatrate, $local, $buyer, $seller),$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax2_type, get_localtax($vatrate, $local, $buyer, $seller),$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4221,22 +4221,22 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
|||||||
{
|
{
|
||||||
if(! isOnlyOneLocalTax(2))
|
if(! isOnlyOneLocalTax(2))
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller),$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, $obj->localtax2, $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(! isOnlyOneLocalTax(2))
|
if(! isOnlyOneLocalTax(2))
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type,get_localtax($vatrate, 2, $buyer, $seller) ,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2, $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -738,9 +738,10 @@ function setforfree() {
|
|||||||
function setforpredef() {
|
function setforpredef() {
|
||||||
console.log("Call setforpredef. We hide some fields");
|
console.log("Call setforpredef. We hide some fields");
|
||||||
jQuery("#select_type").val(-1);
|
jQuery("#select_type").val(-1);
|
||||||
|
|
||||||
jQuery("#prod_entry_mode_free").prop('checked',false).change();
|
jQuery("#prod_entry_mode_free").prop('checked',false).change();
|
||||||
jQuery("#prod_entry_mode_predef").prop('checked',true).change();
|
jQuery("#prod_entry_mode_predef").prop('checked',true).change();
|
||||||
jQuery("#price_ht").hide();
|
jQuery("#price_ht").val('').hide();
|
||||||
jQuery("#multicurrency_price_ht").hide();
|
jQuery("#multicurrency_price_ht").hide();
|
||||||
jQuery("#price_ttc").hide(); // May no exists
|
jQuery("#price_ttc").hide(); // May no exists
|
||||||
jQuery("#tva_tx").hide();
|
jQuery("#tva_tx").hide();
|
||||||
|
|||||||
@ -1319,7 +1319,8 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
|
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
|
||||||
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
|
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
|
||||||
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
|
$sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
|
||||||
|
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc";
|
||||||
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
|
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
|
||||||
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
|
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
|
||||||
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
|
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
|
||||||
@ -1392,8 +1393,10 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
$line->pa_ht = $obj->pa_ht;
|
$line->pa_ht = $obj->pa_ht;
|
||||||
|
|
||||||
|
$localtax_array=array(0=>$obj->localtax1_type, 1=>$obj->localtax1_tx, 2=>$obj->localtax2_type, 3=>$obj->localtax2_tx);
|
||||||
|
|
||||||
// For invoicing
|
// For invoicing
|
||||||
$tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc); // We force type to 0
|
$tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc, $localtax_array); // We force type to 0
|
||||||
$line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
|
$line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
|
||||||
$line->qty = $line->qty_shipped;
|
$line->qty = $line->qty_shipped;
|
||||||
$line->total_ht = $tabprice[0];
|
$line->total_ht = $tabprice[0];
|
||||||
@ -1401,6 +1404,7 @@ class Expedition extends CommonObject
|
|||||||
$line->total_localtax2 = $tabprice[10];
|
$line->total_localtax2 = $tabprice[10];
|
||||||
$line->total_ttc = $tabprice[2];
|
$line->total_ttc = $tabprice[2];
|
||||||
$line->total_tva = $tabprice[1];
|
$line->total_tva = $tabprice[1];
|
||||||
|
$line->vat_src_code = $obj->vat_src_code;
|
||||||
$line->tva_tx = $obj->tva_tx;
|
$line->tva_tx = $obj->tva_tx;
|
||||||
$line->localtax1_tx = $obj->localtax1_tx;
|
$line->localtax1_tx = $obj->localtax1_tx;
|
||||||
$line->localtax2_tx = $obj->localtax2_tx;
|
$line->localtax2_tx = $obj->localtax2_tx;
|
||||||
@ -1414,6 +1418,14 @@ class Expedition extends CommonObject
|
|||||||
$this->total_localtax1+= $tabprice[9];
|
$this->total_localtax1+= $tabprice[9];
|
||||||
$this->total_localtax2+= $tabprice[10];
|
$this->total_localtax2+= $tabprice[10];
|
||||||
|
|
||||||
|
// Multicurrency
|
||||||
|
$this->fk_multicurrency = $obj->fk_multicurrency;
|
||||||
|
$this->multicurrency_code = $obj->multicurrency_code;
|
||||||
|
$this->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||||
|
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||||
|
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||||
|
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||||
|
|
||||||
if ($originline != $obj->fk_origin_line)
|
if ($originline != $obj->fk_origin_line)
|
||||||
{
|
{
|
||||||
$line->detail_batch = array();
|
$line->detail_batch = array();
|
||||||
|
|||||||
@ -206,7 +206,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
|
|||||||
$s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n";
|
$s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n";
|
||||||
// $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));";
|
// $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));";
|
||||||
// For JSGanttImproved
|
// For JSGanttImproved
|
||||||
$s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".$task['note']."'));";
|
$s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));";
|
||||||
echo $s;
|
echo $s;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1372,7 +1372,7 @@ if ($action == 'create')
|
|||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user