Merge remote-tracking branch 'Upstream/develop' into develop-loan

This commit is contained in:
aspangaro 2014-11-09 07:26:14 +01:00
commit 9c3fa5a9eb
37 changed files with 331 additions and 242 deletions

View File

@ -53,12 +53,14 @@ before_script:
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo Mysql version
- mysql --version
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo '<?php ' > htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
@ -88,12 +90,12 @@ before_script:
script:
- cd htdocs/install
- date
- php upgrade.php 3.4.0 3.5.0 > upgrade.log
- php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
# - php upgrade.php 3.4.0 3.5.0 > upgrade.log
# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
- php upgrade.php 3.6.0 3.7.0 >> upgrade360370.log
- cat upgrade360370.log
- php upgrade.php 3.6.0 3.7.0 >> upgrade.log
# - cat upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
# - cat upgrade2.log
- cd ../..

View File

@ -446,6 +446,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;

View File

@ -277,20 +277,14 @@ if ($object->id > 0)
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</table>';
print '</div>';
dol_fiche_end();
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
if ($action != 'edit')
{
print "<br>";
// Link to agenda views
print '<div id="agendaviewbutton">';
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
@ -330,13 +324,23 @@ if ($object->id > 0)
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</div>';
print '<div style="clear: both"></div>';
print "<br><br>";
}
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
print $langs->trans("ErrorUnknown");
}
$db->close();
llxFooter();
$db->close();

View File

@ -99,6 +99,13 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
$filterd=$user->id;
}
// Purge search criteria
if (GETPOST("button_removefilter"))
{
$datestart='';
$dateend='';
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('agendalist'));
@ -278,8 +285,7 @@ if ($resql)
//print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
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 '&nbsp; ';
//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 '<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>';
print "</tr>\n";

View File

@ -323,10 +323,9 @@ if ($result)
$formpropal->selectProposalStatus($viewstatut,1);
print '</td>';
print '<td class="liste_titre" align="right">';
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp;';
print '<input type="image" value="button_removefilter" class="liste_titre" 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>';
print '<input type="image" value="button_search" class="liste_titre" 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" value="button_removefilter" class="liste_titre" 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>';
print "</tr>\n";
$var=true;

View File

@ -43,9 +43,9 @@ $orderyear=GETPOST("orderyear","int");
$ordermonth=GETPOST("ordermonth","int");
$deliveryyear=GETPOST("deliveryyear","int");
$deliverymonth=GETPOST("deliverymonth","int");
$sref=GETPOST('sref','alpha');
$sref_client=GETPOST('sref_client','alpha');
$snom=GETPOST('snom','alpha');
$search_ref=GETPOST('search_ref','alpha');
$search_ref_customer=GETPOST('search_ref_customer','alpha');
$search_company=GETPOST('search_company','alpha');
$sall=GETPOST('sall');
$socid=GETPOST('socid','int');
$search_user=GETPOST('search_user','int');
@ -69,6 +69,20 @@ $limit = $conf->liste_limit;
$viewstatut=GETPOST('viewstatut');
// Purge search criteria
if (GETPOST("button_removefilter"))
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_ref_customer='';
$search_company='';
$orderyear='';
$ordermonth='';
$deliverymonth='';
$deliveryyear='';
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('orderlist'));
@ -81,24 +95,6 @@ $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$orderyear='';
$ordermonth='';
$deliverymonth='';
$deliveryyear='';
}
/*
* View
*/
@ -128,8 +124,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid';
$sql.= ' AND c.entity = '.$conf->entity;
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($sref) {
$sql .= natural_search('c.ref', $sref);
if ($search_ref) {
$sql .= natural_search('c.ref', $search_ref);
}
if ($sall)
{
@ -188,13 +184,13 @@ else if ($deliveryyear > 0)
{
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'";
}
if (!empty($snom))
if (!empty($search_company))
{
$sql .= natural_search('s.nom', $snom);
$sql .= natural_search('s.nom', $search_company);
}
if (!empty($sref_client))
if (!empty($search_ref_customer))
{
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\'';
}
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0)
@ -246,15 +242,15 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
if ($orderyear) $param.='&orderyear='.$orderyear;
if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
if ($sref) $param.='&sref='.$sref;
if ($snom) $param.='&snom='.$snom;
if ($sref_client) $param.='&sref_client='.$sref_client;
if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
if ($orderyear) $param.='&orderyear='.$orderyear;
if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
if ($search_ref) $param.='&search_ref='.$search_ref;
if ($search_company) $param.='&search_company='.$search_company;
if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer;
if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
$num = $db->num_rows($resql);
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
@ -294,33 +290,35 @@ if ($resql)
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
print '</tr>';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="sref" value="'.$sref.'">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
print '</td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="6" name="sref_client" value="'.$sref_client.'">';
print '<input class="flat" type="text" size="6" name="search_ref_customer" value="'.$search_ref_customer.'">';
print '</td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'">';
print '</td>';
print '<td class="liste_titre">';
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="orderday" value="'.$orderday.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="ordermonth" value="'.$ordermonth.'">';
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
print '</td><td class="liste_titre">';
print '</td><td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="deliverymonth" value="'.$deliverymonth.'">';
$formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5);
print '</td><td class="liste_titre">&nbsp;';
print '</td><td align="right" class="liste_titre">';
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")).'">';
print '</td></tr>';
print '</td>';
print '<td class="liste_titre">&nbsp;</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")).'">';
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";
$var=true;
$total=0;
@ -443,12 +441,12 @@ if ($resql)
print '</td>';
// Order date
print '<td align="right">';
print '<td align="center">';
print dol_print_date($db->jdate($objp->date_commande), 'day');
print '</td>';
// Delivery date
print '<td align="right">';
print '<td align="center">';
print dol_print_date($db->jdate($objp->date_livraison), 'day');
print '</td>';

View File

@ -115,7 +115,7 @@ if ($month > 0)
}
else if ($year > 0)
{
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
$sql.= $db->order($sortfield,$sortorder);

View File

@ -560,7 +560,7 @@ print '<tr class="liste_titre"><td class="liste_titre">&nbsp;</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="center" colspan="2">';
print '<td align="center" colspan="2" class="borderrightlight">';
print '<a href="clientfourn.php?year='.$annee.'">';
print $annee;
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
@ -571,7 +571,7 @@ print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right">'.$langs->trans("Outcome").'</td>';
print '<td align="right">'.$langs->trans("Income").'</td>';
print '<td align="right" class="borderrightlight">'.$langs->trans("Income").'</td>';
}
print '</tr>';
@ -601,7 +601,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
print "</td>";
print '<td align="right">&nbsp;';
print '<td align="right" class="borderrightlight">&nbsp;';
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
if (isset($encaiss_ttc[$case]))
{
@ -623,7 +623,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$nbcols+=2;
print '<td align="right">'.(isset($totsorties[$annee])?price(price2num($totsorties[$annee],'MT')):'&nbsp;').'</td>';
print '<td align="right">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):'&nbsp;').'</td>';
print '<td align="right" style="border-right: 1px solid #DDD">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):'&nbsp;').'</td>';
}
print "</tr>\n";
@ -637,7 +637,7 @@ $var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Profit").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right" colspan="2"> ';
print '<td align="right" colspan="2" class="borderrightlight"> ';
if (isset($totentrees[$annee]) || isset($totsorties[$annee]))
{
$in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0);

View File

@ -184,7 +184,7 @@ print '<tr class="liste_titre"><td>&nbsp;</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($modecompta == 'CREANCES-DETTES') print '<td align="center" width="10%" colspan="3">';
else print '<td align="center" width="10%" colspan="2">';
else print '<td align="center" width="10%" colspan="2" class="borderrightlight">';
print '<a href="casoc.php?year='.$annee.'">';
print $annee;
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
@ -198,7 +198,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Delta").'</td>';
print '<td align="right" class="borderrightlight">'.$langs->trans("Delta").'</td>';
if ($annee != $year_end) print '<td width="15">&nbsp;</td>';
}
print '</tr>';
@ -244,7 +244,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
print "</td>";
}
// Valeur CA du mois
print '<td align="right">';
if ($cum[$case])
@ -266,29 +266,29 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
{
$percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100);
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
print '<td align="right">'.($percent>=0?"+$percent":"$percent").'%</td>';
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
}
if ($cum[$caseprev] && ! $cum[$case])
{
print '<td align="right">-100%</td>';
print '<td align="right" class="borderrightlight">-100%</td>';
}
if (! $cum[$caseprev] && $cum[$case])
{
//print '<td align="right">+Inf%</td>';
print '<td align="right">-</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
print '<td align="right">+0%</td>';
print '<td align="right" class="borderrightlight">+0%</td>';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
print '<td align="right">-</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
}
else
{
print '<td align="right">';
print '<td align="right" class="borderrightlight">';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print '&nbsp;'; }
print '</td>';
@ -382,7 +382,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
print '<td>&nbsp;</td>';
}
}
// Montant total
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear)))
{
@ -398,24 +398,24 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($total[$annee-1] && $total[$annee]) {
$percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100);
print '<td align="right" class="nowrap">'.($percent>=0?"+$percent":"$percent").'%</td>';
print '<td align="right" class="nowrap borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
}
if ($total[$annee-1] && ! $total[$annee])
{
print '<td align="right">-100%</td>';
print '<td align="right" class="borderrightlight">-100%</td>';
}
if (! $total[$annee-1] && $total[$annee])
{
print '<td align="right">+Inf%</td>';
print '<td align="right" class="borderrightlight">+Inf%</td>';
}
if (! $total[$annee-1] && ! $total[$annee])
{
print '<td align="right">+0%</td>';
print '<td align="right" class="borderrightlight">+0%</td>';
}
}
else
{
print '<td align="right">';
print '<td align="right" class="borderrightlight">';
if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear,$maxyear))) { print '-'; }
else { print '&nbsp;'; }
print '</td>';

View File

@ -357,7 +357,6 @@ if ($result)
print '</td>';
print '<td class="liste_titre" align="right">';
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp;';
print '<input type="image" value="button_removefilter" class="liste_titre" 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>';
print '</tr>';

View File

@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++)
$sessionkey='dol_antispam_value';
$_SESSION[$sessionkey]=$string;
header("Content-type: image/png");
$img = imagecreate(80,32);
if (empty($img))
{
@ -60,6 +58,8 @@ if (empty($img))
exit;
}
header("Content-type: image/png");
$background_color = imagecolorallocate($img, 250, 250, 250);
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
imagestring($img, 4, 24, 8, $string, $ecriture_color);

View File

@ -1825,7 +1825,7 @@ abstract class CommonObject
if (empty($sourceid) && empty($targetid))
{
dol_print_error('','Bad usage of function. No parameter defined and no id defined');
dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
return -1;
}
@ -2525,14 +2525,14 @@ abstract class CommonObject
if (! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
print '<td align="right" class="margininfos" width="80">'.$langs->trans('BuyingPrice').'</td>';
else
print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>';
print '<td align="right" class="margininfos" width="80">'.$langs->trans('CostPrice').'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>';
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>';
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarkRate').'</td>';
}
// Total HT
@ -3012,11 +3012,16 @@ abstract class CommonObject
$marginInfo = $this->getMarginInfos($force_price);
if (! empty($conf->global->MARGININFO_HIDE_SHOW))
{
print "<img onclick=\"$('.margininfos').toggle();\" src='".img_picto($langs->trans("Hide")."/".$langs->trans("Show"),'object_margin.png','','',1)."'>";
if ($conf->global->MARGININFO_HIDE_SHOW == 2) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>'; // hide by default
}
print $langs->trans('ShowMarginInfos').' : ';
$hidemargininfos = $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW'];
print '<span id="showMarginInfos" class="linkobject '.(!empty($hidemargininfos)?'':'hideobject').'">'.img_picto($langs->trans("Disabled"),'switch_off').'</span>';
print '<span id="hideMarginInfos" class="linkobject '.(!empty($hidemargininfos)?'hideobject':'').'">'.img_picto($langs->trans("Enabled"),'switch_on').'</span>';
print '<script>$(document).ready(function() {
$("span#showMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 0); $(".margininfos").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject");})});
$("span#hideMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 1); $(".margininfos").hide(); $("span#hideMarginInfos").addClass("hideobject"); $("span#showMarginInfos").removeClass("hideobject");})});
});</script>';
if (!empty($hidemargininfos)) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
print '<table class="nobordernopadding margintable" width="100%">';
print '<tr class="liste_titre">';

View File

@ -631,7 +631,7 @@ function hideMessage(fieldId,message) {
/*
* TODO Used by admin page only ?
* Used by button to set on/off
*/
function setConstant(url, code, input, entity, strict) {
$.get( url, {
@ -689,7 +689,7 @@ function setConstant(url, code, input, entity, strict) {
}
/*
* TODO Used by admin page only ?
* Used by button to set on/off
*/
function delConstant(url, code, input, entity, strict) {
$.get( url, {
@ -743,7 +743,7 @@ function delConstant(url, code, input, entity, strict) {
}
/*
* TODO Used by admin page only ?
* Used by button to set on/off
*/
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
var boxConfirm = box;

View File

@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';
* @param string $class Class name
* @param string $member Name of property
* @return mixed Return value of static property
* @deprecated PHP 5.3 is now the minimum requirement, this is no longer necessary
*/
function getStaticMember($class, $member)
{
if (isset($class::$member)) {
return $class::$member;
}
// This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
/*if (version_compare(phpversion(), '5.3.0', '<'))
{
if (is_object($class)) $class = get_class($class);
$classObj = new ReflectionClass($class);
$result = null;
$found=0;
foreach($classObj->getStaticProperties() as $prop => $value)
{
if ($prop == $member)
{
$result = $value;
$found++;
break;
}
}
if ($found) return $result;
}*/
if (isset($class::$member)) return $class::$member;
dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
return null;
}
@ -2862,7 +2879,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
$listofcurrenciesbefore=array('USD');
if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code);
else
else
{
$tmpcur=$outlangs->getCurrencySymbol($currency_code);
$cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur);

View File

@ -770,15 +770,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&amp;viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
}
// Supplier Orders
if (! empty($conf->fournisseur->enabled))
{
$langs->load("supplier");
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&amp;search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
if (! empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE))
{
$langs->load("supplier");
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&amp;search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
}
}
// Donations
if (! empty($conf->don->enabled))

View File

@ -87,8 +87,8 @@
</td>
<td>
<table class="nobordernopadding">
<tr><td width="30%">
<textarea name="param" id="param"><?php echo GETPOST('param'); ?></textarea>
<tr><td>
<textarea name="param" id="param" cols="80" rwos="<?php echo ROWS_4 ?>"><?php echo GETPOST('param'); ?></textarea>
</td><td id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?></td>
<td id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?></td></tr>
</table>

View File

@ -98,8 +98,8 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ
</td>
<td>
<table class="nobordernopadding">
<tr><td width="30%">
<textarea name="param" id="param"><?php echo $param_chain; ?></textarea>
<tr><td>
<textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo $param_chain; ?></textarea>
</td><td><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?></td></tr>
</table>
</td>

View File

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Need to have following variables defined:
* $object (invoice, order, ...)
* $conf
@ -49,21 +49,30 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<table width="100%" class="nobordernopadding"><tr><td';
if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
print '>' . $label . '</td>';
//TODO Improve element and rights detection
if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && ($action != 'edit_extras' || GETPOST('attribute') != $key))
//var_dump($user->rights);
$permok=false;
$keyforperm=$object->element;
if ($object->element == 'fichinter') $keyforperm='ficheinter';
if (isset($user->rights->$keyforperm)) $permok=$user->rights->$keyforperm->creer||$user->rights->$keyforperm->create||$user->rights->$keyforperm->write;
if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer;
if ($object->element=='invoice_supplier') $permok=$user->rights->fournisseur->facture->creer;
if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key])
&& $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key))
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
print '</tr></table>';
print '<td colspan="5">';
// Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
}
//TODO Improve element and rights detection
if ($action == 'edit_extras' && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && GETPOST('attribute') == $key)
if ($action == 'edit_extras' && $permok && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
print '<input type="hidden" name="action" value="update_extras">';

View File

@ -61,7 +61,7 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord
if (! empty($usemargins))
{
?>
<td align="right">
<td align="right" class="margininfos">
<?php
echo '<label for="buying_price">';
if ($conf->global->MARGIN_TYPE == "1")
@ -72,8 +72,8 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord
?>
</td>
<?php
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
}
?>
<td colspan="<?php echo $colspan; ?>">&nbsp;</td>
@ -217,7 +217,7 @@ else {
if (! empty($usemargins))
{
?>
<td align="right">
<td align="right" class="margininfos">
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
@ -232,12 +232,12 @@ else {
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{
echo '<td align="right" class="nowrap"><input type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
$coldisplay++;
}
if (! empty($conf->global->DISPLAY_MARK_RATES))
{
echo '<td align="right" class="nowrap"><input type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'"><span class="np_markRate hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'"><span class="np_markRate hideonsmartphone">%</span></td>';
$coldisplay++;
}
}

View File

@ -125,7 +125,7 @@ $coldisplay=-1; // We remove first td
if (! empty($usemargins))
{
?>
<td align="right"><?php $coldisplay++; ?>
<td align="right" class="margininfos"><?php $coldisplay++; ?>
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
@ -139,9 +139,9 @@ $coldisplay=-1; // We remove first td
$margin_rate = (isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:(($line->pa_ht == 0)?'':price($line->marge_tx)));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td align="right" class="nowrap">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td align="right" class="nowrap"><input type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
elseif (! empty($conf->global->DISPLAY_MARK_RATES))
@ -149,9 +149,9 @@ $coldisplay=-1; // We remove first td
$mark_rate = (isset($_POST["np_markRate"])?$_POST["np_markRate"]:price($line->marque_tx));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td align="right" class="nowrap">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td align="right" class="nowrap"><input type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
echo '<td align="right" class="nowrap margininfos"><input type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
}

View File

@ -141,13 +141,13 @@ if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><div class="margininfos"><?php echo price($line->pa_ht); ?></div></td>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<?php } } ?>
<?php if ($line->special_code == 3) { ?>

View File

@ -92,6 +92,7 @@ print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td align="center">'.$langs->trans("AlwaysEditable").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
@ -107,6 +108,7 @@ foreach($extrafields->attribute_type as $key => $value)
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n"; // TODO This must be generalised into all page to admin extrafield. Mutualize code here is easy and will save a lot of code
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
print "</tr>";

View File

@ -146,7 +146,7 @@ class FactureFournisseur extends CommonInvoice
*/
function create($user)
{
global $langs,$conf;
global $langs,$conf,$hookmanager;
$error=0;
$now=dol_now();

View File

@ -39,12 +39,11 @@ $langs->load("sendings");
$search_ref=GETPOST('search_ref');
$search_refsupp=GETPOST('search_refsupp');
$search_nom=GETPOST('search_nom');
$search_company=GETPOST('search_company');
$search_user=GETPOST('search_user');
$search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all');
$search_status=GETPOST('search_status','int');
if ($search_status == '') $search_status=-1;
$page = GETPOST('page','int');
$socid = GETPOST('socid','int');
@ -58,6 +57,18 @@ $orderid = GETPOST('orderid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
// Purge search criteria
if (GETPOST("button_removefilter"))
{
$search_ref='';
$search_refsupp='';
$search_company='';
$search_user='';
$search_ttc='';
$search_status='';
}
if ($search_status == '') $search_status=-1;
/*
* View
@ -102,9 +113,9 @@ if ($search_ref)
{
$sql .= natural_search('cf.ref', $search_ref);
}
if ($search_nom)
if ($search_company)
{
$sql .= natural_search('s.nom', $search_nom);
$sql .= natural_search('s.nom', $search_company);
}
if ($search_user)
{
@ -154,13 +165,14 @@ if ($resql)
$i = 0;
$param="";
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_nom) $param.="&search_nom=".$search_nom;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
if ($socid) $param.="&socid=".$socid;
if ($search_status >= 0) $param.="&search_status=".$search_status;
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_company) $param.="&search_company=".$search_company;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
if ($socid) $param.="&socid=".$socid;
if ($search_status >= 0) $param.="&search_status=".$search_status;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<table class="noborder" width="100%">';
@ -180,7 +192,7 @@ if ($resql)
print '<td class="liste_titre"><input type="text" class="flat" name="search_ref" value="'.$search_ref.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_refsupp" value="'.$search_refsupp.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$search_nom.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.$search_company.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_user" value="'.$search_user.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_ttc" value="'.$search_ttc.'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
@ -188,10 +200,9 @@ if ($resql)
print '<td class="liste_titre" align="right">';
$formorder->selectSupplierOrderStatus($search_status,1,'search_status');
print '</td>';
print '<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")).'">';
print '</td>';
print '</tr>';
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";
$var=true;

View File

@ -56,7 +56,7 @@ ALTER TABLE llx_user ADD COLUMN fk_user_creat integer AFTER tms;
ALTER TABLE llx_user ADD COLUMN fk_user_modif integer AFTER fk_user_creat;
-- Add module accounting Expert
ALTER TABLE llx_bookkeeping RENAME TO llx_accounting_bookkeeping; -- To update old user of module Accounting Expert
--ALTER TABLE llx_bookkeeping RENAME TO llx_accounting_bookkeeping; -- To update old user of module Accounting Expert -> Line should be added into file sql/x.y.z-a.b.c.sql of module.
CREATE TABLE llx_accounting_bookkeeping
@ -182,7 +182,7 @@ ALTER TABLE llx_product MODIFY COLUMN fk_barcode_type INTEGER NULL DEFAULT NULL;
UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0;
ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type);
UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELECT rowid from llx_c_barcode_type);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
--ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
-- Added missing relations of llx_product_price

View File

@ -41,3 +41,4 @@ AgentContactType=Commercial agent contact type
AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per sale representative
rateMustBeNumeric=Rate must be a numeric value
markRateShouldBeLesserThan100=Mark rate should be lower than 100
ShowMarginInfos=Show margin infos

View File

@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is do
RelatedShippings=Related shippings
ShipmentLine=Shipment line
CarrierList=List of transporters
SendingRunning=Product from customer order already sent
SuppliersReceiptRunning=Product from supplier order already received
# Sending methods
SendingMethodCATCH=Catch by customer

View File

@ -24,3 +24,5 @@ Deliverer=Livreur(s) :
Sender=Expéditeur
Recipient=Destinataire
ErrorStockIsNotEnough=Le stock est insuffisant
Shippable=Expédiable
NonShippable=Non Expédiable

View File

@ -48,3 +48,5 @@ Charges=Charges
AgentContactType=Type de contact agent commercial
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera utilisé pour le rapport de marges par agent commercial
ShowMarginInfos=Afficher les infos liées aux marges

View File

@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle exp
RelatedShippings=Expédition(s) associée(s)
ShipmentLine=Ligne d'expédition
CarrierList=Liste des transporteurs
SendingRunning=Produits de commandes clients déjà expédiés
SuppliersReceiptRunning=Produits de commandes fournisseurs déjà réceptionnés
# Sending methods
SendingMethodCATCH=Enlèvement par le client

View File

@ -3032,42 +3032,56 @@ class Product extends CommonObject
*
* @return int < 0 if KO, > 0 if OK
*/
function load_virtual_stock()
{
global $conf;
function load_virtual_stock()
{
global $conf;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
{
$stock_commande_client=$stock_commande_fournisseur=0;
$stock_sending_client=$stock_reception_fournisseur=0;
$stock_commande_client=0;
$stock_commande_fournisseur=0;
$stock_sending_client=0;
$stock_reception_fournisseur=0;
if (! empty($conf->commande->enabled))
{
$result=$this->load_stats_commande(0,'1,2');
if ($result < 0) dol_print_error($db,$this->error);
$stock_commande_client=$this->stats_commande['qty'];
}
if (! empty($conf->expedition->enabled))
{
$result=$this->load_stats_sending(0,'1,2');
if ($result < 0) dol_print_error($db,$this->error);
$stock_sending_client=$this->stats_expedition['qty'];
}
if (! empty($conf->fournisseur->enabled))
{
$result=$this->load_stats_commande_fournisseur(0,'3');
if ($result < 0) dol_print_error($db,$this->error);
$stock_commande_fournisseur=$this->stats_commande_fournisseur['qty'];
if (! empty($conf->commande->enabled)) {
$result=$this->load_stats_commande(0,'1,2');
if ($result < 0) dol_print_error($db,$this->error);
$stock_commande_client=$this->stats_commande['qty'];
}
if (! empty($conf->expedition->enabled)) {
$result=$this->load_stats_sending(0,'1,2');
if ($result < 0) dol_print_error($db,$this->error);
$stock_sending_client=$this->stats_expedition['qty'];
}
if (! empty($conf->fournisseur->enabled)) {
$result=$this->load_stats_commande_fournisseur(0,'3,4');
if ($result < 0) dol_print_error($db,$this->error);
$stock_commande_fournisseur=$this->stats_commande_fournisseur['qty'];
$result=$this->load_stats_reception(0,'3');
if ($result < 0) dol_print_error($db,$this->error);
$stock_reception_fournisseur=$this->stats_reception['qty'];
}
$result=$this->load_stats_reception(0,'4');
if ($result < 0) dol_print_error($db,$this->error);
$stock_reception_fournisseur=$this->stats_reception['qty'];
}
$this->stock_theorique=$this->stock_reel-($stock_commande_client-$stock_sending_client)+($stock_commande_fournisseur-$stock_reception_fournisseur);
//echo $this->stock_theorique.' = '.$this->stock_reel.' - ('.$stock_commande_client.' - '.$stock_sending_client.') + ('.$stock_commande_fournisseur.' - '.$stock_reception_fournisseur.')';
}
}
// Stock decrease mode
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
$this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client;
}
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) {
$this->stock_theorique=$this->stock_reel;
}
if (! empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
$this->stock_theorique=$this->stock_reel-$stock_commande_client;
}
// Stock Increase mode
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
}
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
$this->stock_theorique-=$stock_reception_fournisseur;
}
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
}
}
/**
* Move an uploaded file described into $file array into target directory $sdir.

View File

@ -510,7 +510,7 @@ else
$product_static->status_buy = $objp->tobuy;
$product_static->status = $objp->tosell;
// Status (to sell)
print '<td align="right" nowrap="nowrap">';
print '<td align="center" nowrap="nowrap">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else {
@ -519,7 +519,7 @@ else
print '</td>';
// Status (to buy)
print '<td align="right" nowrap="nowrap">';
print '<td align="center" nowrap="nowrap">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
} else {

View File

@ -461,7 +461,6 @@ if ($resql)
print '</td>';
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp; ';
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";

View File

@ -39,6 +39,7 @@ $langs->load("products");
$langs->load("orders");
$langs->load("bills");
$langs->load("stocks");
$langs->load("sendings");
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
@ -331,58 +332,62 @@ if ($id > 0 || $ref)
print '</td>';
print '</tr>';
// Calculating a theorical value
// Calculating a theorical value
print '<tr><td>'.$langs->trans("VirtualStock").'</td>';
print "<td>".$product->stock_theorique;
if ($product->stock_theorique < $product->seuil_stock_alerte) {
print ' '.img_warning($langs->trans("StockLowerThanLimit"));
}
print '</td>';
print '</tr>';
// If stock if stock increment is done on real sending
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
{
// Stock theorique
print '<tr><td>'.$langs->trans("VirtualStock").'</td>';
print "<td>".$product->stock_theorique;
if ($product->stock_theorique < $product->seuil_stock_alerte)
{
print ' '.img_warning($langs->trans("StockLowerThanLimit"));
}
print '</td>';
print '</tr>';
print '<tr><td>';
$text_stock_options = (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);;
print '</td>';
print '<td>';
print '<tr><td>';
if ($product->stock_theorique != $product->stock_reel) print $langs->trans("StockDiffPhysicTeoric");
else print $langs->trans("RunningOrders");
print '</td>';
print '<td>';
$found=0;
$found=0;
// Number of customer orders running
if (! empty($conf->commande->enabled))
{
if ($found) print '<br>'; else $found=1;
print $langs->trans("CustomersOrdersRunning").': '.$product->stats_commande['qty'];
$result=$product->load_stats_commande(0,'0');
if ($result < 0) dol_print_error($db,$product->error);
print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')';
}
// Nbre de commande clients en cours
if (! empty($conf->commande->enabled))
{
if ($found) print '<br>'; else $found=1;
print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_sendings['qty']);
$result=$product->load_stats_commande(0,'0');
if ($result < 0) dol_print_error($db,$product->error);
print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')';
//print '<br>';
//print $langs->trans("CustomersSendingRunning").': '.$stock_sending_client;
}
// Number of product from customer order already sent (partial shipping)
if (! empty($conf->expedition->enabled)) {
if ($found) print '<br>'; else $found=1;
$result=$product->load_stats_sending(0,'2');
print $langs->trans("SendingRunning").': '.$product->stats_expedition['qty'];
}
// Nbre de commande fournisseurs en cours
if (! empty($conf->fournisseur->enabled))
{
if ($found) print '<br>'; else $found=1;
print $langs->trans("SuppliersOrdersRunning").': '.($product->stats_commande_fournisseur['qty']-$product->stats_reception['qty']);
$result=$product->load_stats_commande_fournisseur(0,'0,1,2');
if ($result < 0) dol_print_error($db,$product->error);
print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')';
}
print '</td></tr>';
}
// Number of supplier order running
if (! empty($conf->fournisseur->enabled)) {
if ($found) print '<br>'; else $found=1;
$result=$product->load_stats_commande_fournisseur(0,'3,4');
print $langs->trans("SuppliersOrdersRunning").': '.$product->stats_commande_fournisseur['qty'];
$result=$product->load_stats_commande_fournisseur(0,'0,1,2');
if ($result < 0) dol_print_error($db,$product->error);
print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')';
}
// If stock if stock increment is done on
// TODO Add information when stock increment is done on other option
// TODO Add also information on possible decrease stock accroding to stock decrease option
// Number of product from supplier order already received (partial receipt)
if (! empty($conf->fournisseur->enabled)) {
if ($found) print '<br>'; else $found=1;
print $langs->trans("SuppliersReceiptRunning").': '.$product->stats_reception['qty'];
}
print '</td></tr>';
// Last movement
$sql = "SELECT max(m.datem) as datem";

View File

@ -1 +1,2 @@
/bootstrap
/oblyon

1
htdocs/theme/eldy/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.new

View File

@ -424,6 +424,10 @@ th .button {
border-radius: 10px;
}
.borderrightlight
{
border-right: 1px solid #DDD;
}
/* ============================================================================== */
/* Styles to hide objects */
@ -862,7 +866,7 @@ form#login {
max-width: 540px;
background-color: #FFFFFF;
-moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
-webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
@ -872,7 +876,7 @@ form#login {
border-radius: 8px;
border:solid 1px rgba(80,80,80,.4);
border-top:solid 1px f8f8f8;
/*
background-color: #f8f8f8;