Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c77b39bf1e
@ -77,7 +77,7 @@ if ($action == 'update')
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
|
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup');
|
print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup');
|
||||||
|
|||||||
@ -113,7 +113,7 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
|
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup');
|
print load_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup');
|
||||||
|
|||||||
@ -854,10 +854,12 @@ class Account extends CommonObject
|
|||||||
$sql.= " ba.datec as date_creation, ba.tms as date_update,";
|
$sql.= " ba.datec as date_creation, ba.tms as date_update,";
|
||||||
$sql.= ' c.code as country_code, c.label as country,';
|
$sql.= ' c.code as country_code, c.label as country,';
|
||||||
$sql.= ' d.code_departement as state_code, d.nom as state';
|
$sql.= ' d.code_departement as state_code, d.nom as state';
|
||||||
|
$sql.= ' , aj.code as accountancy_journal';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ba.fk_pays = c.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ba.fk_pays = c.rowid';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid';
|
||||||
$sql.= " WHERE entity IN (".getEntity($this->element).")";
|
$sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_journal as aj ON aj.rowid=ba.fk_accountancy_journal';
|
||||||
|
$sql.= " WHERE ba.entity IN (".getEntity($this->element).")";
|
||||||
if ($id) $sql.= " AND ba.rowid = ".$id;
|
if ($id) $sql.= " AND ba.rowid = ".$id;
|
||||||
if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'";
|
if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'";
|
||||||
|
|
||||||
@ -900,6 +902,7 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
$this->account_number = $obj->account_number;
|
$this->account_number = $obj->account_number;
|
||||||
$this->fk_accountancy_journal = $obj->fk_accountancy_journal;
|
$this->fk_accountancy_journal = $obj->fk_accountancy_journal;
|
||||||
|
$this->accountancy_journal = $obj->accountancy_journal;
|
||||||
|
|
||||||
$this->currency_code = $obj->currency_code;
|
$this->currency_code = $obj->currency_code;
|
||||||
$this->account_currency_code = $obj->currency_code;
|
$this->account_currency_code = $obj->currency_code;
|
||||||
|
|||||||
@ -143,7 +143,7 @@ $title=$langs->trans('BankAccounts');
|
|||||||
// Load array of financial accounts (opened by default)
|
// Load array of financial accounts (opened by default)
|
||||||
$accounts = array();
|
$accounts = array();
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.currency_code, b.datec as date_creation, b.tms as date_update";
|
$sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.currency_code, b.datec as date_creation, b.tms as date_update";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -152,7 +152,7 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N
|
|||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields as ef on (b.rowid = ef.fk_object)";
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||||
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
|
$sql.= " WHERE b.entity IN (".getEntity('bank_account').")";
|
||||||
if ($search_status == 'opened') $sql.= " AND clos = 0";
|
if ($search_status == 'opened') $sql.= " AND clos = 0";
|
||||||
if ($search_status == 'closed') $sql.= " AND clos = 1";
|
if ($search_status == 'closed') $sql.= " AND clos = 1";
|
||||||
if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref);
|
if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref);
|
||||||
@ -509,7 +509,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
$accountingaccount->fetch('',$obj->account_number);
|
$accountingaccount->fetch('',$obj->account_number, 1);
|
||||||
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -80,13 +80,16 @@ class box_comptes extends ModeleBoxes
|
|||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts"));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts"));
|
||||||
|
|
||||||
if ($user->rights->banque->lire) {
|
if ($user->rights->banque->lire) {
|
||||||
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
|
$sql = "SELECT b.rowid, b.ref, b.label, b.bank,b.number, b.courant, b.clos, b.rappro, b.url";
|
||||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
|
$sql.= ", b.code_banque, b.code_guichet, b.cle_rib, b.bic, b.iban_prefix as iban";
|
||||||
$sql.= " domiciliation, proprio, owner_address,";
|
$sql.= ", b.domiciliation, b.proprio, b.owner_address";
|
||||||
$sql.= " account_number, currency_code,";
|
$sql.= ", b.account_number, b.currency_code";
|
||||||
$sql.= " min_allowed, min_desired, comment";
|
$sql.= ", b.min_allowed, b.min_desired, comment";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
$sql.= ', b.fk_accountancy_journal';
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= ', aj.code as accountancy_journal';
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
||||||
|
$sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_journal as aj ON aj.rowid=b.fk_accountancy_journal';
|
||||||
|
$sql.= " WHERE b.entity = ".$conf->entity;
|
||||||
$sql.= " AND clos = 0";
|
$sql.= " AND clos = 0";
|
||||||
//$sql.= " AND courant = 1";
|
//$sql.= " AND courant = 1";
|
||||||
$sql.= " ORDER BY label";
|
$sql.= " ORDER BY label";
|
||||||
@ -108,6 +111,9 @@ class box_comptes extends ModeleBoxes
|
|||||||
$account_static->ref = $objp->ref;
|
$account_static->ref = $objp->ref;
|
||||||
$account_static->label = $objp->label;
|
$account_static->label = $objp->label;
|
||||||
$account_static->number = $objp->number;
|
$account_static->number = $objp->number;
|
||||||
|
$account_static->account_number = $objp->account_number;
|
||||||
|
$account_static->currency_code = $objp->currency_code;
|
||||||
|
$account_static->accountancy_journal = $objp->accountancy_journal;
|
||||||
$solde=$account_static->solde(0);
|
$solde=$account_static->solde(0);
|
||||||
|
|
||||||
$solde_total[$objp->currency_code] += $solde;
|
$solde_total[$objp->currency_code] += $solde;
|
||||||
|
|||||||
@ -133,7 +133,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
$error=0;
|
$error=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
$buffer = '';
|
$buffer = '';
|
||||||
$arraysql = Array();
|
$arraysql = array();
|
||||||
|
|
||||||
// Get version of database
|
// Get version of database
|
||||||
$versionarray=$db->getVersionArray();
|
$versionarray=$db->getVersionArray();
|
||||||
|
|||||||
@ -27,9 +27,9 @@
|
|||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
/* COLORS */
|
/* COLORS */
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
$bar_color=Array(0,0,0);
|
$bar_color=array(0,0,0);
|
||||||
$bg_color=Array(255,255,255);
|
$bg_color=array(255,255,255);
|
||||||
$text_color=Array(0,0,0);
|
$text_color=array(0,0,0);
|
||||||
|
|
||||||
|
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
|
|||||||
@ -356,20 +356,20 @@ function utf82utf16($utf8)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch(strlen($utf8)) {
|
switch(strlen($utf8)) {
|
||||||
case 1:
|
case 1:
|
||||||
// this case should never be reached, because we are in ASCII range
|
// this case should never be reached, because we are in ASCII range
|
||||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
return $utf8;
|
return $utf8;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1})));
|
return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1})));
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2})));
|
return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2})));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignoring UTF-32 for now, sorry
|
// ignoring UTF-32 for now, sorry
|
||||||
|
|||||||
@ -201,7 +201,7 @@ else if ($action == 'setart885') {
|
|||||||
|
|
||||||
$dir = "../../core/modules/dons/";
|
$dir = "../../core/modules/dons/";
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
|
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
|
llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|||||||
@ -848,7 +848,7 @@ llxHeader('', $title, $helpurl);
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
|
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
// Load object modBarCodeProduct
|
// Load object modBarCodeProduct
|
||||||
$res=0;
|
$res=0;
|
||||||
|
|||||||
@ -3585,15 +3585,15 @@ class Product extends CommonObject
|
|||||||
{
|
{
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return $this->LibStatut($this->status,$mode,$type);
|
return $this->LibStatut($this->status,$mode,$type);
|
||||||
case 1:
|
case 1:
|
||||||
return $this->LibStatut($this->status_buy,$mode,$type);
|
return $this->LibStatut($this->status_buy,$mode,$type);
|
||||||
case 2:
|
case 2:
|
||||||
return $this->LibStatut($this->status_batch,$mode,$type);
|
return $this->LibStatut($this->status_batch,$mode,$type);
|
||||||
default:
|
default:
|
||||||
//Simulate previous behavior but should return an error string
|
//Simulate previous behavior but should return an error string
|
||||||
return $this->LibStatut($this->status_buy,$mode,$type);
|
return $this->LibStatut($this->status_buy,$mode,$type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user