Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: build/exe/doliwamp/doliwamp.iss htdocs/accountancy/customer/list.php htdocs/accountancy/supplier/list.php
This commit is contained in:
commit
a329f7dc75
@ -352,9 +352,7 @@ begin
|
|||||||
if not FileExists ('c:/windows/system32/msvcr110.dll') and not FileExists ('c:/windows/sysWOW64/msvcr110.dll') and not FileExists ('c:/winnt/system32/msvcr110.dll') and not FileExists ('c:/winnt/sysWOW64/msvcr110.dll') then
|
if not FileExists ('c:/windows/system32/msvcr110.dll') and not FileExists ('c:/windows/sysWOW64/msvcr110.dll') and not FileExists ('c:/winnt/system32/msvcr110.dll') and not FileExists ('c:/winnt/sysWOW64/msvcr110.dll') then
|
||||||
begin
|
begin
|
||||||
// TODO - offer to install the component by opening the URL in the default browser, abort installation if user doesn't accept
|
// TODO - offer to install the component by opening the URL in the default browser, abort installation if user doesn't accept
|
||||||
|
|
||||||
MsgBox('The "Visual C++ Redistributable for Visual Studio 2012" component is missing. Please install the 32-bit version (vcredit_x86.exe) first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 and restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
MsgBox('The "Visual C++ Redistributable for Visual Studio 2012" component is missing. Please install the 32-bit version (vcredit_x86.exe) first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 and restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
// Pb seems similar with msvcp110.dll
|
// Pb seems similar with msvcp110.dll
|
||||||
//vcredist_x64.exe
|
//vcredist_x64.exe
|
||||||
|
|||||||
@ -91,6 +91,9 @@ if ($user->societe_id > 0)
|
|||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('accountancycustomerlist'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
||||||
@ -104,6 +107,12 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOU
|
|||||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||||
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -121,12 +130,13 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass='Skeleton';
|
$objectclass='AccountingAccount';
|
||||||
$objectlabel='Skeleton';
|
|
||||||
$permtoread = $user->rights->accounting->read;
|
$permtoread = $user->rights->accounting->read;
|
||||||
$permtodelete = $user->rights->accounting->delete;
|
$permtodelete = $user->rights->accounting->delete;
|
||||||
$uploaddir = $conf->accounting->dir_output;
|
$uploaddir = $conf->accounting->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil') {
|
||||||
$msg='';
|
$msg='';
|
||||||
@ -192,6 +202,9 @@ $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
|
|||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||||
$sql .= " aa.rowid as aarowid";
|
$sql .= " aa.rowid as aarowid";
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
@ -246,6 +259,11 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
|
|||||||
@ -91,6 +91,9 @@ if ($user->societe_id > 0)
|
|||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('accountancysupplierlist'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
||||||
@ -105,6 +108,12 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
|
|||||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||||
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -122,12 +131,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass='Skeleton';
|
$objectclass='AccountingAccount';
|
||||||
$objectlabel='Skeleton';
|
|
||||||
$permtoread = $user->rights->accounting->read;
|
$permtoread = $user->rights->accounting->read;
|
||||||
$permtodelete = $user->rights->accounting->delete;
|
$permtodelete = $user->rights->accounting->delete;
|
||||||
$uploaddir = $conf->accounting->dir_output;
|
$uploaddir = $conf->accounting->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil') {
|
||||||
$msg='';
|
$msg='';
|
||||||
@ -194,6 +203,9 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
|
|||||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||||
$sql.= " aa.rowid as aarowid";
|
$sql.= " aa.rowid as aarowid";
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
@ -243,6 +255,11 @@ else if ($search_year > 0)
|
|||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class Login
|
|||||||
*
|
*
|
||||||
* Request the API token for a couple username / password.
|
* Request the API token for a couple username / password.
|
||||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: Tha API key (DOLAPIKEY) can be found/set on the user page.
|
||||||
*
|
*
|
||||||
* @param string $login User login
|
* @param string $login User login
|
||||||
* @param string $password User password
|
* @param string $password User password
|
||||||
|
|||||||
@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@ -481,11 +485,18 @@ if (! empty($actioncode))
|
|||||||
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'";
|
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'";
|
||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
||||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||||
|
|||||||
@ -169,7 +169,11 @@ $listofextcals=array();
|
|||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
if ($actioncode != '') {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status != '' && $status > -1) $param.="&status=".$status;
|
if ($status != '' && $status > -1) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@ -226,11 +230,18 @@ if (! empty($actioncode))
|
|||||||
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'";
|
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'";
|
||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
|
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
||||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||||
|
|||||||
@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@ -393,11 +397,18 @@ if (! empty($actioncode))
|
|||||||
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'";
|
if ($actioncode == 'AC_NON_AUTO') $sql.= " AND ca.type != 'systemauto'";
|
||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
|
||||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||||
|
|||||||
@ -836,8 +836,9 @@ class Propal extends CommonObject
|
|||||||
if (empty($this->availability_id)) $this->availability_id=0;
|
if (empty($this->availability_id)) $this->availability_id=0;
|
||||||
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
|
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||||
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
{
|
{
|
||||||
$this->multicurrency_code = $conf->currency;
|
$this->multicurrency_code = $conf->currency;
|
||||||
|
|||||||
@ -712,7 +712,7 @@ class Commande extends CommonOrder
|
|||||||
// $date_commande is deprecated
|
// $date_commande is deprecated
|
||||||
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
|
|||||||
@ -246,7 +246,7 @@ class Facture extends CommonInvoice
|
|||||||
$this->brouillon = 1;
|
$this->brouillon = 1;
|
||||||
if (empty($this->entity)) $this->entity = $conf->entity;
|
if (empty($this->entity)) $this->entity = $conf->entity;
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
|
|||||||
@ -1130,7 +1130,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (empty($this->source)) $this->source = 0;
|
if (empty($this->source)) $this->source = 0;
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
|
|||||||
@ -229,7 +229,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$amount = $this->amount;
|
$amount = $this->amount;
|
||||||
$remise = $this->remise;
|
$remise = $this->remise;
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user