Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-06-26 16:46:01 +02:00
commit b5b07f8a14
9 changed files with 99 additions and 62 deletions

View File

@ -327,7 +327,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
// Third party // Product
$fullname=$name[$key]; $fullname=$name[$key];
if ($key >= 0) { if ($key >= 0) {
$linkname='<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.'</a>'; $linkname='<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.'</a>';
@ -339,23 +339,24 @@ if ($modecompta == 'CREANCES-DETTES') {
// Amount w/o VAT // Amount w/o VAT
print '<td align="right">'; print '<td align="right">';
if ($key > 0) { /*if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
} else { } else {
print '<a href="#">'; print '<a href="#">';
} }*/
print price($amount_ht[$key]); print price($amount_ht[$key]);
//print '</a>';
print '</td>'; print '</td>';
// Amount with VAT // Amount with VAT
print '<td align="right">'; print '<td align="right">';
if ($key > 0) { /*if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
} else { } else {
print '<a href="#">'; print '<a href="#">';
} }*/
print price($amount[$key]); print price($amount[$key]);
print '</a>'; //print '</a>';
print '</td>'; print '</td>';
// Percent; // Percent;

View File

@ -207,7 +207,7 @@ class FormFile
return $this->getDocumentsLink($modulepart, $filename, $filedir); return $this->getDocumentsLink($modulepart, $filename, $filedir);
} }
$printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false;
$hookmanager->initHooks(array('formfile'));
$forname='builddoc'; $forname='builddoc';
$out=''; $out='';
$var=true; $var=true;
@ -450,14 +450,18 @@ class FormFile
$langs->load("errors"); $langs->load("errors");
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
} }
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
$out.= $genbutton; $out.= $genbutton;
$out.= '</th>'; $out.= '</th>';
if ($printer) $out.= '<th></th>'; if ($printer) $out.= '<th></th>';
if($hookmanager->hooks['formfile'])
{
foreach($hookmanager->hooks['formfile'] as $module)
{
if(method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>';
}
}
$out.= '</tr>'; $out.= '</tr>';
// Execute hooks // Execute hooks
@ -529,6 +533,7 @@ class FormFile
$out.= ($param?'&'.$param:''); $out.= ($param?'&'.$param:'');
$out.= '">'.img_printer().'</a></td>'; $out.= '">'.img_printer().'</a></td>';
} }
if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
} }
$out.= '</tr>'; $out.= '</tr>';

View File

@ -198,6 +198,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
-- Check deposit -- Check deposit

View File

@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob
DROP table llx_adherent_options; DROP table llx_adherent_options;
DROP table llx_adherent_options_label; DROP table llx_adherent_options_label;
ALTER TABLE `llx_user` ADD `accountancy_code` VARCHAR( 24 ) NULL;

View File

@ -62,5 +62,6 @@ create table llx_user
statut tinyint DEFAULT 1, statut tinyint DEFAULT 1,
photo varchar(255), -- filename or url of photo photo varchar(255), -- filename or url of photo
lang varchar(6), lang varchar(6),
color varchar(6) color varchar(6),
accountancy_code varchar(24) NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -226,6 +226,7 @@ if ($search_all)
$sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.siren LIKE '%".$db->escape($search_all)."%'";
$sql.= ")"; $sql.= ")";
} }
if ($search_nom) if ($search_nom)
@ -235,6 +236,7 @@ if ($search_nom)
$sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.siren LIKE '%".$db->escape($search_nom)."%'";
$sql.= ")"; $sql.= ")";
} }
if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'"; if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'";

View File

@ -97,6 +97,8 @@ class User extends CommonObject
var $users; // To store all tree of users hierarchy var $users; // To store all tree of users hierarchy
var $parentof; // To store an array of all parents for all ids. var $parentof; // To store an array of all parents for all ids.
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
/** /**
* Constructor de la classe * Constructor de la classe
@ -149,6 +151,7 @@ class User extends CommonObject
$sql.= " u.datepreviouslogin as datep,"; $sql.= " u.datepreviouslogin as datep,";
$sql.= " u.photo as photo,"; $sql.= " u.photo as photo,";
$sql.= " u.openid as openid,"; $sql.= " u.openid as openid,";
$sql.= " u.accountancy_code,";
$sql.= " u.ref_int, u.ref_ext"; $sql.= " u.ref_int, u.ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
@ -209,6 +212,7 @@ class User extends CommonObject
$this->openid = $obj->openid; $this->openid = $obj->openid;
$this->lang = $obj->lang; $this->lang = $obj->lang;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->accountancy_code = $obj->accountancy_code;
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
@ -1114,6 +1118,7 @@ class User extends CommonObject
$this->address = empty($this->address)?'':$this->address; $this->address = empty($this->address)?'':$this->address;
$this->zip = empty($this->zip)?'':$this->zip; $this->zip = empty($this->zip)?'':$this->zip;
$this->town = empty($this->town)?'':$this->town; $this->town = empty($this->town)?'':$this->town;
$this->accountancy_code = trim($this->accountancy_code);
// Check parameters // Check parameters
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -1142,6 +1147,7 @@ class User extends CommonObject
$sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", email = '".$this->db->escape($this->email)."'";
$sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
$sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'";
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");

View File

@ -188,6 +188,7 @@ if ($action == 'add' && $canadduser)
$object->email = GETPOST("email"); $object->email = GETPOST("email");
$object->job = GETPOST("job"); $object->job = GETPOST("job");
$object->signature = GETPOST("signature"); $object->signature = GETPOST("signature");
$object->accountancy_code = GETPOST("accountancy_code");
$object->note = GETPOST("note"); $object->note = GETPOST("note");
$object->ldap_sid = GETPOST("ldap_sid"); $object->ldap_sid = GETPOST("ldap_sid");
@ -324,6 +325,7 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->email = GETPOST("email"); $object->email = GETPOST("email");
$object->job = GETPOST("job"); $object->job = GETPOST("job");
$object->signature = GETPOST("signature"); $object->signature = GETPOST("signature");
$object->accountancy_code = GETPOST("accountancy_code");
$object->openid = GETPOST("openid"); $object->openid = GETPOST("openid");
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
@ -1193,6 +1195,10 @@ else
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Accountancy code
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'.$object->accountancy_code.'</td>';
// Status // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';
@ -1822,6 +1828,21 @@ else
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Accountancy code
print "<tr>";
print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
if ($caneditfield)
{
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
}
else
{
print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">';
print $object->accountancy_code;
}
print '</td>';
// Status // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';