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

This commit is contained in:
Laurent Destailleur
2015-08-26 11:25:05 +02:00
50 changed files with 375 additions and 232 deletions

View File

@@ -224,7 +224,7 @@ Dolibarr better:
hook afterLogin or afterLoginFailed instead.
- The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled
to make difference between creation from contact or not.
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page
@@ -238,6 +238,7 @@ FIX: Not showing delivery date on rouget pdf
FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
NEW: Created new ContratLigne::insert function

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Script build for hudson CI -->
<project name="dolibarr" default="hudson" basedir=".">
fdfds
<!-- Exclude/ignore paths -->
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*" />

View File

@@ -117,7 +117,7 @@ http://bugs.debian.org/package
severity 123 xxx
##### Update but tracker system
##### Update bug tracker system
To set status of a bug to "pending"
> bts --smtp-host=yoursmtpserver tag 999999 +pending
@@ -249,7 +249,7 @@ from git clone dir and make link to git.
* If local branch upstream and pristine-tar does not exists, create it
from origin/upstream and origin/pristine.
* If new upstream is available onto sourceforge, launch:
* When new upstream is available onto sourceforge, launch:
> debian/get-orig-source.sh
If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
@@ -273,8 +273,8 @@ Note: If there was errors solved manually after get-orig-sources.sh, you may nee
* Fix debian/* files used to build package.
Add an entry into debian/changelog
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import)
Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
Then check/modify also the user/date signature:
- Date must have format reported by "date -R"
- Name and email must match value into debian/control file (Entry added here is used by next step).
@@ -299,7 +299,7 @@ Note: Package is built into directory ../build-area
* If package .deb is ok:
Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
> git push --all ou git push origin --all
> git push --all
* If ok, you can tag.
> Edit debian/changelog to replace "UNRELEASED" into "unstable", then push

View File

@@ -24,7 +24,7 @@ fi
# To convert
if [ "x$1" = "xfix" ]
then
for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml"\) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
do
echo "Fix file $fic"
dos2unix $fic

File diff suppressed because one or more lines are too long

View File

@@ -53,6 +53,7 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$btn_ventil = GETPOST('ventil', 'alpha');
// Getpost Order and column and limit page
$sortfield = GETPOST('sortfield', 'alpha');
@@ -129,7 +130,7 @@ print '<script type="text/javascript">
* Action
*/
if ($action == 'ventil') {
if ($action == 'ventil' && !empty($btn_ventil)) {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
if (! empty($codeventil) && ! empty($mesCasesCochees)) {
print '<div><font color="red">' . count($mesCasesCochees) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
@@ -337,7 +338,7 @@ if ($result) {
}
print '</table>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil"></div>';
print '</form>';
} else {
print $db->error();

View File

@@ -89,8 +89,8 @@ $idpays = $p[0];
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte, ";
$sql .= " ct.accountancy_code_sell as account_tva";
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
$sql .= " fd.situation_percent,ct.accountancy_code_sell as account_tva";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
@@ -102,16 +102,18 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
$sql .= " AND f.type IN (0,1,2,5)";
else
$sql .= " AND f.type IN (0,1,2,3,5)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
}
else {
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
}
$sql .= " AND fd.product_type IN (0,1)";
if ($date_start && $date_end)
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
$sql .= " ORDER BY f.datef";
dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql);
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$tabfac = array ();
@@ -143,10 +145,15 @@ if ($result) {
$line = new FactureLigne($db);
$line->fetch($obj->rowid);
$prev_progress = $line->get_prev_progress();
if ($obj->situation_percent == 0) { // Avoid divide by 0
$situation_ratio = 0;
if ($obj->type==Facture::TYPE_SITUATION) {
// Avoid divide by 0
if ($obj->situation_percent == 0) {
$situation_ratio = 0;
} else {
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
}
} else {
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
$situation_ratio = 1;
}
// Invoice lines

View File

@@ -182,7 +182,8 @@ if ($result)
$formquestion=array();
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
}
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
@@ -195,7 +196,6 @@ if ($result)
// Lignes des champs de filtres
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
@@ -222,7 +222,6 @@ if ($result)
print '</td>';
print "</tr>\n";
print '</form>';
$var=True;
@@ -283,7 +282,7 @@ if ($result)
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
}
print "</table>";
print "</table></form>";
$db->free($result);
if ($num)

View File

@@ -61,15 +61,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
* Search form
*/
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/askpricesupplier/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchRequest").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
/*

View File

@@ -96,7 +96,8 @@ if ($result)
$param = "&amp;sall=".$sall;
if ($filteremail) $param.='&amp;filteremail='.urlencode($filteremail);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="liste">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
@@ -108,7 +109,6 @@ if ($result)
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
print "</tr>\n";
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="sref" value="'.$sref.'" size="6">';
@@ -123,7 +123,6 @@ if ($result)
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print "</td>";
print "</tr>\n";
print '</form>';
$var=True;
@@ -177,7 +176,7 @@ if ($result)
print "</tr>\n";
$i++;
}
print "</table>";
print '</table></form>';
$db->free($result);
}
else

View File

@@ -63,15 +63,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
* Search form
*/
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
/*

View File

@@ -54,15 +54,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
if (! empty($conf->propal->enabled))
{
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProposal").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
}
/*

View File

@@ -150,7 +150,7 @@ $search_categ = GETPOST('search_categ','int');
// If the internal user must only see his prospect, force searching by him
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
// List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
// List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
$sts = array(-1,0,1,2,3);
@@ -158,6 +158,10 @@ $sts = array(-1,0,1,2,3);
$hookmanager->initHooks(array('prospectlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('thirdparty');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
@@ -171,6 +175,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_datec="";
$search_categ="";
$search_status="";
$search_array_options=array();
}
if ($search_status=='') $search_status=1; // always display active customer first
@@ -216,13 +221,14 @@ $sql.= " st.libelle as stcomm_label,";
$sql.= " d.nom as departement";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$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."c_stcomm as st";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
@@ -231,7 +237,7 @@ $sql.= " AND s.client IN (2, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = " .$socid;
if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
@@ -252,6 +258,19 @@ if ($socname)
$sortfield = "s.nom";
$sortorder = "ASC";
}
// Extra fields
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
if (in_array($typ, array('int'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
}
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
@@ -265,6 +284,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
}
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
dol_syslog('comm/prospect/list.php', LOG_DEBUG);
$resql = $db->query($sql);
@@ -298,9 +318,15 @@ if ($resql)
}
if ($search_level_from != '') $param.='&search_level_from='.$search_level_from;
if ($search_level_to != '') $param.='&search_level_to='.$search_level_to;
if ($search_categ != '') $param.='&search_categ='.$search_categ;
if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ);
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($search_status != '') $param.='&search_status='.$search_status;
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
$param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
// $param and $urladd should have the same value
$urladd = $param;
@@ -346,7 +372,19 @@ if ($resql)
print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
// Extrafields
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
{
foreach($extrafields->attribute_list as $key => $val)
{
if ($val)
{
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder);
}
}
}
// Hook fields
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
@@ -360,13 +398,13 @@ if ($resql)
print '<input type="text" class="flat" name="search_nom" size="10" value="'.$search_nom.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_zipcode" size="10" value="'.$search_zipcode.'">';
print '<input type="text" class="flat" name="search_zipcode" size="6" value="'.$search_zipcode.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_town" size="10" value="'.$search_town.'">';
print '<input type="text" class="flat" name="search_town" size="8" value="'.$search_town.'">';
print '</td>';
print '<td class="liste_titre" align="center">';
print '<input type="text" class="flat" name="search_state" size="10" value="'.$search_state.'">';
print '<input type="text" class="flat" name="search_state" size="8" value="'.$search_state.'">';
print '</td>';
print '<td align="center" class="liste_titre">';
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
@@ -404,14 +442,29 @@ if ($resql)
{
$arraystcomm[$val['id']]=$val['label'];
}
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, 1);
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
print '</td>';
print '<td class="liste_titre" align="center">';
print '&nbsp;';
print '</td>';
$parameters=array();
// Extrafields
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
{
foreach($extrafields->attribute_list as $key => $val)
{
if ($val)
{
$crit=$search_array_options['search_options_'.$key];
print '<td class="liste_titre">';
print $extrafields->showInputField($key, $crit, '', '', 'search_', 4);
print '</td>';
}
}
}
// Hook fields
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
@@ -460,7 +513,7 @@ if ($resql)
print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']);
print "</td>";
print '<td align="right" class="nowrap">';
print '<td align="center" class="nowrap">';
foreach($prospectstatic->cacheprospectstatus as $key => $val)
{
$titlealt='default';
@@ -469,6 +522,21 @@ if ($resql)
}
print '</td>';
// Extrafields
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
{
foreach($extrafields->attribute_list as $key => $val)
{
if ($val)
{
print '<td>';
$paramkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$paramkey);
print '</td>';
}
}
}
// Hook fields
$parameters=array('obj' => $obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@@ -62,15 +62,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
// Search customer orders
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
/*

View File

@@ -158,7 +158,6 @@ if ($result)
$db->free($result);
}
print "</form>";
/*
* Line to add category
@@ -172,9 +171,7 @@ if ($action != 'edit')
print '</tr>';
}
print "</table>";
print "</form>";
print '</table></form>';
llxFooter();

View File

@@ -596,8 +596,7 @@ if ($result)
}
print '</tr>';
print "</table>";
print '</form>';
print '</table></form>';
}
}
@@ -610,22 +609,21 @@ print '</div>';
// List of bank categories
print '<br>';
print '<table class="noborder" width="100%">';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'&amp;id='.$id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="class">';
print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Rubriques").'</td><td colspan="2">';
if ($user->rights->banque->modifier)
{
print '<select class="flat" name="cat1">'.$options.'</select>&nbsp;';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
}
print "</tr>";
print "</form>";
print '</tr>';
$sql = "SELECT c.label, c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
@@ -650,13 +648,13 @@ if ($result)
{
print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=delete_categ&amp;rowid='.$rowid.'&amp;fk_categ='.$objp->rowid.'">'.img_delete($langs->trans("Remove")).'</a></td>';
}
print "</tr>";
print '</tr>';
$i++;
}
$db->free($result);
}
print "</table>";
print '</table></form>';
llxFooter();

View File

@@ -129,6 +129,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_montant_ht='';
$search_montant_ttc='';
$search_status='';
$day='';
$year='';
$month='';
}
@@ -350,7 +351,7 @@ if ($resql)
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="right">';
$liststatus=array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"), '3'=>$langs->trans("Cancel"));
$liststatus=array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled"));
print $form->selectarray('search_status', $liststatus, $search_status, 1);
print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';

View File

@@ -114,8 +114,13 @@ $sql.= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
else $sql.= " AND f.type IN (0,1,2,3,5)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
}
else {
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
}
$sql.= " AND fd.product_type IN (0,1)";
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
$sql.= " ORDER BY f.rowid";
@@ -163,10 +168,15 @@ if ($result)
$line = new FactureLigne($db);
$line->fetch($obj->id);
$prev_progress = $line->get_prev_progress();
if ($obj->situation_percent == 0) { // Avoid divide by 0
$situation_ratio = 0;
if ($obj->type==Facture::TYPE_SITUATION) {
// Avoid divide by 0
if ($obj->situation_percent == 0) {
$situation_ratio = 0;
} else {
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
}
} else {
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
$situation_ratio = 1;
}
//la ligne facture

View File

@@ -28,6 +28,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("bills");
$langs->load("compta");
@@ -36,6 +38,10 @@ $langs->load("compta");
$facid =GETPOST('facid','int');
$socid =GETPOST('socid','int');
$userid=GETPOST('userid','int');
$day = GETPOST('day','int');
$month = GETPOST('month','int');
$year = GETPOST('year','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture',$facid,'');
@@ -66,6 +72,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_amount="";
$search_paymenttype="";
$search_company="";
$day='';
$year='';
$month='';
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@@ -81,6 +90,7 @@ $extrafields = new ExtraFields($db);
llxHeader('', $langs->trans('ListPayment'));
$form=new Form($db);
$formother=new FormOther($db);
if (GETPOST("orphelins"))
{
@@ -141,6 +151,19 @@ else
else $sql.= " AND f.fk_user_author = ".$userid;
}
// Search criteria
if ($month > 0)
{
if ($year > 0 && empty($day))
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
else if ($year > 0 && ! empty($day))
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
$sql.= " AND date_format(p.datep, '%m') = '".$month."'";
}
else if ($year > 0)
{
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref;
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
@@ -194,7 +217,11 @@ if ($resql)
print '<td align="left">';
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
print '</td>';
print '<td>&nbsp;</td>';
print '<td align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
$formother->select_year($year?$year:-1,'year',1, 20, 5);
print '</td>';
print '<td align="left">';
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
print '</td>';

View File

@@ -269,7 +269,7 @@ if ($result)
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="view" value="'.htmlspecialchars($view).'">';
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';

View File

@@ -153,7 +153,9 @@ if ($resql)
if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices");
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png');
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
@@ -169,9 +171,6 @@ if ($resql)
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder);
print "</tr>\n";
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="hidden" name="filter" value="'.$filter.'">';
@@ -203,7 +202,6 @@ if ($resql)
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
print '</form>';
$contractstatic=new Contrat($db);
$productstatic=new Product($db);
@@ -278,7 +276,7 @@ if ($resql)
}
$db->free($resql);
print "</table>";
print '</table></form>';
}
else

View File

@@ -105,7 +105,7 @@ class box_contacts extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $societestatic->getNomUrl(1),
'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''),
'asis' => 1,
);

View File

@@ -375,19 +375,19 @@ class CMailFile
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
{
dol_include_once('/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('maildao'));
$reshook=$hookmanager->executeHooks('doactions',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (!empty($reshook))
{
dol_include_once('/core/class/hookmanager.class.php');
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array(
'maildao'
));
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (! empty($reshook))
{
$this->error = "Error in hook maildao doactions " . $reshook;
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
$this->error="Error in hook maildao doactions ".$reshook;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return $reshook;
}
return $reshook;
}
// Action according to choosed sending method
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')

View File

@@ -567,7 +567,7 @@ class ExtraFields
/**
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
*
* @param string $elementtype Type of element ('adherent', 'commande', thirdparty', 'facture', 'propal', 'product', ...)
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
* @return array Array of attributes for all extra fields
*/
@@ -631,13 +631,15 @@ class ExtraFields
/**
* Return HTML string to put an input field into a page
*
* @param string $key Key of attribute
* @param string $value Value to show (for date type it must be in timestamp format)
* @param string $moreparam To add more parametes on html input tag
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @return string
* @param string $key Key of attribute
* @param string $value Value to show (for date type it must be in timestamp format)
* @param string $moreparam To add more parametes on html input tag
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @param int $showsize Value for size attribute
* @return string
*/
function showInputField($key,$value,$moreparam='',$keyprefix='')
function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$showsize=0)
{
global $conf,$langs;
@@ -651,24 +653,27 @@ class ExtraFields
$perms=$this->attribute_perms[$key];
$list=$this->attribute_list[$key];
if ($type == 'date')
if (empty($showsize))
{
$showsize=10;
if ($type == 'date')
{
$showsize=10;
}
elseif ($type == 'datetime')
{
$showsize=19;
}
elseif (in_array($type,array('int','double')))
{
$showsize=10;
}
else
{
$showsize=round($size);
if ($showsize > 48) $showsize=48;
}
}
elseif ($type == 'datetime')
{
$showsize=19;
}
elseif (in_array($type,array('int','double')))
{
$showsize=10;
}
else
{
$showsize=round($size);
if ($showsize > 48) $showsize=48;
}
if (in_array($type,array('date','datetime')))
{
$tmp=explode(',',$size);
@@ -684,22 +689,22 @@ class ExtraFields
if (! is_object($form)) $form=new Form($this->db);
// TODO Must also support $moreparam
$out = $form->select_date($value, 'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
$out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
}
elseif (in_array($type,array('int')))
{
$tmp=explode(',',$size);
$newsize=$tmp[0];
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'varchar')
{
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'text')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
$doleditor=new DolEditor($keysuffix.'options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
$out=$doleditor->Create(1);
}
elseif ($type == 'boolean')
@@ -710,26 +715,26 @@ class ExtraFields
} else {
$checked=' value="1" ';
}
$out='<input type="checkbox" class="flat" name="options_'.$key.$keyprefix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
$out='<input type="checkbox" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'mail')
{
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="32" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="32" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'phone')
{
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="20" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'price')
{
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
}
elseif ($type == 'double')
{
if (!empty($value)) {
$value=price($value);
}
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
}
elseif ($type == 'select')
{
@@ -737,10 +742,10 @@ class ExtraFields
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
}
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
$out.='<option value="0">&nbsp;</option>';
foreach ($param['options'] as $key=>$val )
{
@@ -758,10 +763,10 @@ class ExtraFields
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
}
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
if (is_array($param['options']))
{
$param_list=array_keys($param['options']);
@@ -907,7 +912,7 @@ class ExtraFields
foreach ($param['options'] as $keyopt=>$val )
{
$out.='<input class="flat" type="checkbox" name="options_'.$key.$keyprefix.'[]" '.($moreparam?$moreparam:'');
$out.='<input class="flat" type="checkbox" name="'.$keysuffix.'options_'.$key.$keyprefix.'[]" '.($moreparam?$moreparam:'');
$out.=' value="'.$keyopt.'"';
if ((is_array($value_arr)) && in_array($keyopt,$value_arr)) {
@@ -924,7 +929,7 @@ class ExtraFields
$out='';
foreach ($param['options'] as $keyopt=>$val )
{
$out.='<input class="flat" type="radio" name="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'');
$out.='<input class="flat" type="radio" name="'.$keysuffix.'options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'');
$out.=' value="'.$keyopt.'"';
$out.= ($value==$keyopt?'checked':'');
$out.='/>'.$val.'<br>';
@@ -1018,7 +1023,7 @@ class ExtraFields
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
}
}
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= ' value="' . $obj->rowid . '"';
$out .= 'checked';
@@ -1037,7 +1042,7 @@ class ExtraFields
$labeltoshow = '(not defined)';
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= ' value="' . $obj->rowid . '"';
$out .= 'checked';
@@ -1050,7 +1055,7 @@ class ExtraFields
$parent = $parentName . ':' . $obj->{$parentField};
}
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
$out .= ' value="' . $obj->rowid . '"';
$out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked ' : '');
@@ -1080,7 +1085,7 @@ class ExtraFields
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
}
/* Add comments
@@ -1417,14 +1422,16 @@ class ExtraFields
return 0;
}
}
/**
* return array_options array for object by extrafields value (using for data send by forms)
*
* @param array $extralabels $array of extrafields
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @return int 1 if array_options set / 0 if no value
* @param array $extralabels $array of extrafields
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @return int 1 if array_options set / 0 if no value
*/
function getOptionalsFromPost($extralabels,$keyprefix='')
function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='')
{
global $_POST;
@@ -1439,24 +1446,24 @@ class ExtraFields
if (in_array($key_type,array('date','datetime')))
{
// Clean parameters
$value_key=dol_mktime($_POST["options_".$key.$keyprefix."hour"], $_POST["options_".$key.$keyprefix."min"], 0, $_POST["options_".$key.$keyprefix."month"], $_POST["options_".$key.$keyprefix."day"], $_POST["options_".$key.$keyprefix."year"]);
$value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]);
}
else if (in_array($key_type,array('checkbox')))
{
$value_arr=GETPOST("options_".$key.$keyprefix);
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
$value_key=implode($value_arr,',');
}
else if (in_array($key_type,array('price','double')))
{
$value_arr=GETPOST("options_".$key.$keyprefix);
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
$value_key=price2num($value_arr);
}
else
{
$value_key=GETPOST("options_".$key.$keyprefix);
$value_key=GETPOST($keysuffix."options_".$key.$keyprefix);
}
$array_options["options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read.
$array_options[$keysuffix."options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read.
}
return $array_options;

View File

@@ -4406,7 +4406,7 @@ class Form
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array with key+value
* @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;').
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or '&nbsp;'), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag
@@ -4455,7 +4455,7 @@ class Form
{
$textforempty=' ';
if (! empty($conf->use_javascript_ajax)) $textforempty='&nbsp;'; // If we use ajaxcombo, we need &nbsp; here to avoid to have an empty element that is too small.
$out.='<option value="-1"'.($id==-1?' selected':'').'>'.$textforempty.'</option>'."\n";
$out.='<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id==-2?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
}
if (is_array($array))

View File

@@ -303,13 +303,14 @@ class FormOther
* Return select list for categories (to use in form search selectors)
*
* @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
* @param integer $selected Preselected value
* @param string $htmlname Name of combo list
* @param integer $selected Preselected value
* @param string $htmlname Name of combo list
* @param int $nocateg Show also an entry "Not categorized"
* @param int $showempty Add also an empty line
* @return string Html combo list code
* @see select_all_categories
*/
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0)
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1)
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -331,7 +332,7 @@ class FormOther
// Print a select with each of them
$moreforfilter.='<select class="flat minwidth100" id="select_categ_'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
$moreforfilter.='<option value="">&nbsp;</option>'; // Should use -1 to say nothing
if ($showempty) $moreforfilter.='<option value="0">&nbsp;</option>'; // Should use -1 to say nothing
if (is_array($tab_categs))
{

View File

@@ -522,7 +522,7 @@ class SMTPs
* @param mixed $_strConfigPath path to config file or VOID
* @return void
*/
function setConfig ( $_strConfigPath = null )
function setConfig($_strConfigPath = null)
{
/**
* Returns constructed SELECT Object string or boolean upon failure
@@ -736,7 +736,7 @@ class SMTPs
* @param string $_strTransEncode Content-Transfer-Encoding
* @return void
*/
function setTransEncode ( $_strTransEncode )
function setTransEncode($_strTransEncode)
{
if (array_search($_strTransEncode, $this->_smtpsTransEncodeTypes))
$this->_smtpsTransEncode = $_strTransEncode;
@@ -830,7 +830,7 @@ class SMTPs
* @return void
*
*/
function _buildAddrList( $_type, $_addrList )
function _buildAddrList($_type, $_addrList)
{
// Pull existing list
$aryHost = $this->_msgRecipients;

View File

@@ -144,7 +144,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
/** Return, in clear text, value of a number of seconds in days, hours and minutes
*
* @param int $iSecond Number of seconds
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30"", 'allhourmin': total delay hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part);
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30", 'allwithouthour': total delay days without hour part like "2 days", 'allhourmin': total delay with format hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part);
* @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour)
* @param int $lengthOfWeek Length of week (default 7)
* @return string Formated text of duration
@@ -157,7 +157,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours
if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days
if ($format == 'all' || $format == 'allhour' || $format == 'allhourmin')
if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin')
{
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US

View File

@@ -3743,7 +3743,7 @@ function yn($yesno, $case=1, $color=0)
*
* @param string $num Id of object
* @param int $level Level of subdirs to return (1, 2 or 3 levels)
* @param int $alpha Use alpha ref
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0).
* @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '')
* @param Object $object Object
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')

View File

@@ -1692,64 +1692,61 @@ function pdf_getLinkedObjects($object,$outputlangs)
if ($objecttype == 'propal')
{
$outputlangs->load('propal');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
else if ($objecttype == 'commande')
{
$outputlangs->load('orders');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
else if ($objecttype == 'contrat')
{
$outputlangs->load('contracts');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs);
}
}
else if ($objecttype == 'shipping')
{
$outputlangs->load('orders');
$outputlangs->load('sendings');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$objects[$i]->fetchObjectLinked();
$order = $objects[$i]->linkedObjects['commande'][0];
$elementobject->fetchObjectLinked();
$order = $elementobject->linkedObjects['commande'][0];
if (! empty($object->linkedObjects['commande'])) // There is already a link to order so we show only info of shipment
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
$linkedobjects[$objecttype]['date_value'].= dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
}
else // We show both info of order and shipment
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
}
}
}

View File

@@ -1023,14 +1023,13 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE))
{
//Add the year filter input
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<table width="100%">';
print '<tr>';
print '<td>'.$langs->trans("Year").'</td>';
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="'.$project_year_filter.'"/>';
print '</form>';
print "</tr>\n";
print '</table>';
print '</table></form>';
}
}

View File

@@ -789,7 +789,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (empty($leftmenu) || ($leftmenu == 'suppliers_bills')) {
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
}

View File

@@ -269,18 +269,32 @@ class pdf_strato extends ModelePDFContract
// Description of product line
if ($objectligne->datei) {
$datei = dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
if ($objectligne->date_ouverture_prevue) {
$datei = dol_print_date($objectligne->date_ouverture_prevue,'day',false,$outputlangs,true);
} else {
$datei = $langs->trans("Unknown");
}
if ($objectligne->duration) {
$durationi = convertSecondToTime($objectligne->duration);
if ($objectligne->date_fin_validite) {
$durationi = convertSecondToTime($objectligne->date_fin_validite - $objectligne->date_ouverture_prevue, 'allwithouthour');
$datee = dol_print_date($objectligne->date_fin_validite,'day',false,$outputlangs,true);
} else {
$durationi = $langs->trans("Unknown");
$datee = $langs->trans("Unknown");
}
if ($objectligne->date_ouverture) {
$daters = dol_print_date($objectligne->date_ouverture,'day',false,$outputlangs,true);
} else {
$daters = $langs->trans("Unknown");
}
if ($objectligne->date_cloture) {
$datere = dol_print_date($objectligne->date_cloture,'day',false,$outputlangs,true);
} else {
$datere = $langs->trans("Unknown");
}
$txtpredefinedservice='';
$txtpredefinedservice = $objectligne->product_ref;
if ($objectligne->product_label)
@@ -289,7 +303,10 @@ class pdf_strato extends ModelePDFContract
$txtpredefinedservice .= $objectligne->product_label;
}
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".$datei." - ".$outputlangs->transnoentities("Duration")." : ".$durationi,1,$outputlangs->charset_output).'</strong>';
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("DateStartPlannedShort")." : ".$datei." - ".$outputlangs->transnoentities("DateEndPlanned")." : ".$datee,1,$outputlangs->charset_output).'</strong>';
$txt.='<br>';
$txt.='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("DateStartRealShort")." : ".$daters,1,$outputlangs->charset_output);
if ($objectligne->date_cloture) $txt.=dol_htmlentitiesbr(" - ".$outputlangs->transnoentities("DateEndRealShort")." : ".$datere,1,$outputlangs->charset_output).'</strong>';
$desc=dol_htmlentitiesbr($objectligne->desc,1);
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,dol_concatdesc($txtpredefinedservice,$desc)), 0, 1, 0);

View File

@@ -141,7 +141,7 @@ class modContrat extends DolibarrModules
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
's.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra',
'co.rowid'=>"contractId",'co.ref'=>"contactRef",'co.datec'=>"contractDateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"DateMiseService",
'co.rowid'=>"contractId",'co.ref'=>"contractRef",'co.datec'=>"contractDateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"DateMiseService",
'co.fin_validite'=>"EndValidity",'co.date_cloture'=>"Cloture",'co.note_private'=>"NotePrivate",'co.note_public'=>"NotePublic",
'cod.rowid'=>'LineId','cod.label'=>"LineLabel",'cod.description'=>"LineDescription",'cod.price_ht'=>"LineUnitPrice",'cod.tva_tx'=>"LineVATRate",
'cod.qty'=>"LineQty",'cod.total_ht'=>"LineTotalHT",'cod.total_tva'=>"LineTotalVAT",'cod.total_ttc'=>"LineTotalTTC",
@@ -151,8 +151,8 @@ class modContrat extends DolibarrModules
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company',
's.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company',
's.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',
'co.rowid'=>"Contract",'co.ref'=>"Contract",'co.datec'=>"Contract",'co.date_contrat'=>"Contract",'co.mise_en_service'=>"Contract",
'co.fin_validite'=>"Contract",'co.date_cloture'=>"Contract",'co.note_private'=>"Contract",'co.note_public'=>"Contract",
'co.rowid'=>"contract",'co.ref'=>"contract",'co.datec'=>"contract",'co.date_contrat'=>"contract",'co.mise_en_service'=>"contract",
'co.fin_validite'=>"contract",'co.date_cloture'=>"contract",'co.note_private'=>"contract",'co.note_public'=>"contract",
'cod.rowid'=>'contract_line','cod.label'=>"contract_line",'cod.description'=>"contract_line",'cod.price_ht'=>"contract_line",'cod.tva_tx'=>"contract_line",
'cod.qty'=>"contract_line",'cod.total_ht'=>"contract_line",'cod.total_tva'=>"contract_line",'cod.total_ttc'=>"contract_line",
'cod.date_ouverture'=>"contract_line",'cod.date_ouverture_prevue'=>"contract_line",'cod.date_fin_validite'=>"contract_line",'cod.date_cloture'=>"contract_line",

View File

@@ -322,7 +322,7 @@ if (! empty($conf->margin->enabled))
var remise = $("input[name='remise_percent']:first");
var rate = $("input[name='"+npRate+"']:first");
if (rate.val() == '') return true;
if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true;
if (! $.isNumeric(rate.val().replace(',','.')))
{
@@ -331,7 +331,7 @@ if (! empty($conf->margin->enabled))
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "markRate" && rate.val() >= 100)
if (npRate == "np_markRate" && rate.val() >= 100)
{
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
e.stopPropagation();
@@ -347,9 +347,11 @@ if (! empty($conf->margin->enabled))
bpjs=price2numjs(buying_price.val());
ratejs=price2numjs(rate.val());
if (npRate == "marginRate")
/* console.log(npRate+" - "+bpjs+" - "+ratejs); */
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
else if (npRate == "markRate")
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value

View File

@@ -888,11 +888,11 @@ if ($action == 'create')
}
else
{
print '<tr><td colspan="3" ></td><td align="center">';
print '<tr><td colspan="3" ></td><td align="center">';
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
print '</td>';
print '<td align="left">';
print '</td>';
print '<td align="left">';
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle);
}
}

View File

@@ -628,7 +628,7 @@ class Expedition extends CommonObject
// TODO possibilite d'expedier a partir d'une propale ou autre origine
$sql = "SELECT cd.fk_product, cd.subprice,";
$sql.= " ed.rowid, ed.qty, ed.fk_entrepot,";
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty, edb.fk_origin_stock";
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
$sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
@@ -639,8 +639,8 @@ class Expedition extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$cpt = $this->db->num_rows($resql);
for ($i = 0; $i < $cpt; $i++)
$cpt = $this->db->num_rows($resql);
for ($i = 0; $i < $cpt; $i++)
{
$obj = $this->db->fetch_object($resql);
if ($obj->qty <= 0) continue;
@@ -654,18 +654,18 @@ class Expedition extends CommonObject
{
// line without batch detail
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
if ($result < 0) {
$error++; break;
}
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
if ($result < 0) {
$error++; break;
}
}
else
{
// line with batch detail
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->edbqty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
if ($result < 0) {
$error++; break;
}
@@ -859,9 +859,9 @@ class Expedition extends CommonObject
{
// $value['q']=qty to move
// $value['id_batch']=id into llx_product_batch of record to move
//var_dump($value);
$linebatch = new ExpeditionLineBatch($this->db);
//var_dump($value);
$linebatch = new ExpeditionLineBatch($this->db);
$ret=$linebatch->fetchFromStock($value['id_batch']); // load serial, sellby, eatby
if ($ret<0)
{

View File

@@ -48,13 +48,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchASending").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
/*
* Shipments to validate

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -63,7 +64,8 @@ $entitytoicon = array(
'shipment' => 'sending',
'shipment_line'=> 'sending',
'expensereport'=> 'trip',
'expensereport_line'=> 'trip'
'expensereport_line'=> 'trip',
'contract_line' => 'contract'
);
// Translation code

View File

@@ -1151,7 +1151,7 @@ class FactureFournisseur extends CommonInvoice
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu=price2num($pu);
@@ -1197,7 +1197,7 @@ class FactureFournisseur extends CommonInvoice
}
else
{
dol_syslog("Error error=".$this->error, LOG_ERR);
dol_syslog("Error after updateline error=".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
@@ -2096,16 +2096,17 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->db->begin();
if ($this->fk_product) {
if (empty($this->fk_product))
{
$fk_product = "null";
} else {
$fk_product = $this->fk_product;
}
if ($this->fk_unit) {
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
} else {
if (empty($this->fk_unit)) {
$fk_unit = "null";
} else {
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";

View File

@@ -58,15 +58,15 @@ print '<tr valign="top"><td class="notopnoleft" width="30%">';
* Search form
*/
$var=false;
print '<table class="noborder nohover" width="100%">';
print '<form method="post" action="list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="search_all" size="18"></td>';
print '</tr>';
print "</form></table><br>\n";
print "</table></form><br>\n";
/*

View File

@@ -453,7 +453,9 @@ if (($action != 'create' && $action != 'add') && !$error) {
$companystatic->nom = $soc->nom;
print '<h3>' . $companystatic->getNomUrl(1, 'customer') . '</h3>';
}
print '<form method="get" action="orderstoinvoice.php">';
print '<input type="hidden" name="socid" value="' . $socid . '">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'), 'orderstoinvoice.php', 'c.ref', '', '&amp;socid=' . $socid, '', $sortfield, $sortorder);
@@ -465,8 +467,6 @@ if (($action != 'create' && $action != 'add') && !$error) {
print "</tr>\n";
// Lignes des champs de filtre
print '<form method="get" action="orderstoinvoice.php">';
print '<input type="hidden" name="socid" value="' . $socid . '">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
// REF
@@ -497,7 +497,6 @@ if (($action != 'create' && $action != 'add') && !$error) {
print '</td>';
print '</td></tr>';
print '</form>';
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
$var = True;

View File

@@ -305,7 +305,7 @@ if ($resql)
print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="6" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
print '</td><td class="liste_titre" align="right">';
$liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
$liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
print $form->selectarray('filtre', $liststatus, $filter, 1);
print '</td><td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';

View File

@@ -790,3 +790,5 @@ DELETE FROM llx_c_departements WHERE ncc='OTROS' AND fk_region=420;
DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4;
ALTER TABLE llx_c_paiement MODIFY COLUMN libelle varchar(62);
ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL;

View File

@@ -32,5 +32,5 @@ create table llx_societe_remise_except
fk_facture_line integer,
fk_facture integer,
fk_facture_source integer,
description varchar(255) NOT NULL
description text NOT NULL
)ENGINE=innodb;

View File

@@ -63,7 +63,7 @@ MenuSpecialExpenses=Special expenses
MenuTaxAndDividends=Taxes and dividends
MenuSalaries=Salaries
MenuSocialContributions=Social/fiscal taxes
MenuNewSocialContribution=New tax payment
MenuNewSocialContribution=New social/fiscal tax
NewSocialContribution=New social/fiscal tax
ContributionsToPay=Social/fiscal taxes to pay
AccountancyTreasuryArea=Accountancy/Treasury area

View File

@@ -498,7 +498,6 @@ if ($resql)
print "</tr>\n";
// Lignes des champs de filtre
print '<tr class="liste_titre">';
print '<td class="liste_titre" valign="right">';
print '<input class="flat" type="text" size="2" maxlength="2" placeholder="'.dol_escape_htmltag($langs->trans("Month")).'" name="month" value="'.$month.'">';
@@ -549,7 +548,6 @@ if ($resql)
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print "</tr>\n";
print '</form>';
$arrayofuniqueproduct=array();
@@ -621,7 +619,7 @@ if ($resql)
}
$db->free($resql);
print "</table><br>";
print "</table></form><br>";
// Add number of product when there is a filter on period
if (count($arrayofuniqueproduct) == 1 && is_numeric($year))

View File

@@ -709,7 +709,7 @@ class Societe extends CommonObject
$this->localtax2_value=trim($this->localtax2_value);
$this->capital=price2num(trim($this->capital),'MT');
if (empty($this->capital)) $this->capital = 0;
if (empty($this->capital) || ! is_numeric($this->capital)) $this->capital = 0;
$this->effectif_id=trim($this->effectif_id);
$this->forme_juridique_code=trim($this->forme_juridique_code);

View File

@@ -725,7 +725,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="createuser">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
if (! empty($ldap_sid)) print '<input type="hidden" name="ldap_sid" value="'.$ldap_sid.'">';
if (! empty($ldap_sid)) print '<input type="hidden" name="ldap_sid" value="'.dol_escape_htmltag($ldap_sid).'">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
dol_fiche_head('', '', '', 0, '');

View File

@@ -807,9 +807,9 @@ class User extends CommonObject
/**
* Create a user into database
*
* @param User $user Objet user qui demande la creation
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
* @return int <0 si KO, id compte cree si OK
* @param User $user Objet user doing creation
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int <0 if KO, id of created user if OK
*/
function create($user,$notrigger=0)
{
@@ -829,6 +829,12 @@ class User extends CommonObject
$this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1;
}
if (empty($this->login))
{
$langs->load("errors");
$this->error = $langs->trans("ErrorFieldRequired",$this->login);
return -1;
}
$this->datec = dol_now();
@@ -1171,7 +1177,13 @@ class User extends CommonObject
$this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1;
}
if (empty($this->login))
{
$langs->load("errors");
$this->error = $langs->trans("ErrorFieldRequired",$this->login);
return -1;
}
$this->db->begin();
// Update datas