2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'origin/3.4' into 3.5

Conflicts:
	htdocs/core/lib/agenda.lib.php
	htdocs/product/stats/commande_fournisseur.php
This commit is contained in:
Laurent Destailleur
2013-11-28 15:54:12 +01:00
9 changed files with 143 additions and 146 deletions

View File

@@ -136,7 +136,9 @@ Fix: Bad rounding on margin calculations and display.
Fix: Option drop table into backup was broken. Fix: Option drop table into backup was broken.
Fix: [ bug #1105 ] Searching Boxes other search option Fix: [ bug #1105 ] Searching Boxes other search option
Fix: wrong buy price update Fix: wrong buy price update
Fix :[ bug #1142 ] Set paiement on invoice (PGSql) Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1145 ] Agenda button list type do not display
Fix: [ bug #1148 ] Product consomation : supplier order bad status
***** ChangeLog for 3.4.1 compared to 3.4.0 ***** ***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined Fix: Display buying price on line edit when no supplier price is defined

View File

@@ -495,11 +495,12 @@ if ($nboftargetok) {
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
$newbuild =~ s/beta/0.2.beta1/gi; # beta $newbuild =~ s/beta/0.2.beta1/gi; # beta
$newbuild =~ s/rc./0.3.rc1/gi; # rc $newbuild =~ s/rc./0.3.rc1/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale
#$newbuild =~ s/(dev|alpha)/0/gi; # dev #$newbuild =~ s/(dev|alpha)/0/gi; # dev
#$newbuild =~ s/beta/1/gi; # beta #$newbuild =~ s/beta/1/gi; # beta
#$newbuild =~ s/rc./2/gi; # rc #$newbuild =~ s/rc./2/gi; # rc
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale #if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
#print "newbuild=".$newbuild."\n";exit;
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi; $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";

View File

@@ -195,7 +195,7 @@ class Form
} }
else else
{ {
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs) : ''); elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs) : '');
elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');

View File

@@ -43,129 +43,125 @@
* @param string $actioncode Preselected value of actioncode for filter on type * @param string $actioncode Preselected value of actioncode for filter on type
* @return void * @return void
*/ */
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$showextcals=array(),$actioncode='') function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') {
{
global $conf,$user,$langs,$db;
global $conf, $user, $langs, $db;
// Filters // Filters
if ($canedit || ! empty($conf->projet->enabled)) print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER ["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="status" value="' . $status . '">';
print '<input type="hidden" name="year" value="' . $year . '">';
print '<input type="hidden" name="month" value="' . $month . '">';
print '<input type="hidden" name="day" value="' . $day . '">';
print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
print '<table class="nobordernopadding" width="100%">';
print '<tr><td class="nowrap">';
print '<table class="nobordernopadding">';
if ($canedit)
{ {
print '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<tr>';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<td class="nowrap">';
print '<input type="hidden" name="status" value="'.$status.'">'; print $langs->trans("ActionsAskedBy");
print '<input type="hidden" name="year" value="'.$year.'">'; print ' &nbsp;</td><td class="nowrap">';
print '<input type="hidden" name="month" value="'.$month.'">'; print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit);
print '<input type="hidden" name="day" value="'.$day.'">'; print '</td>';
print '<input type="hidden" name="showbirthday" value="'.$showbirthday.'">'; print '</tr>';
print '<table class="nobordernopadding" width="100%">';
if ($canedit || ! empty($conf->projet->enabled)) print '<tr>';
{ print '<td class="nowrap">';
print '<tr><td class="nowrap">'; print $langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy");
print ' &nbsp;</td><td class="nowrap">';
print '<table class="nobordernopadding">'; print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
print '</td></tr>';
if ($canedit)
{ print '<tr>';
print '<tr>'; print '<td class="nowrap">';
print '<td class="nowrap">'; print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy");
print $langs->trans("ActionsAskedBy"); print ' &nbsp;</td><td class="nowrap">';
print ' &nbsp;</td><td class="nowrap">'; print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit);
print $form->select_dolusers($filtera,'userasked',1,'',!$canedit); print '</td></tr>';
print '</td>';
print '</tr>'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions ( $db );
print '<tr>'; print '<tr>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy"); print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap">'; print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit);
print '</td></tr>'; print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0));
print '<tr>'; print '</td></tr>';
print '<td class="nowrap">';
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
print ' &nbsp;</td><td class="nowrap">';
print $form->select_dolusers($filterd,'userdone',1,'',!$canedit);
print '</td></tr>';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap">';
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
print '</td></tr>';
}
if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
$formproject=new FormProjets($db);
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap">';
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64);
print '</td></tr>';
}
print '</table>';
print '</td>';
// Buttons
print '<td align="center" valign="middle" class="nowrap">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '<br>';
print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '<br>';
print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '<br>';
print img_picto($langs->trans("ViewList"),'object_list','class="hideonsmartphone"').' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="'.$langs->trans("ViewList").'">';
print '</td>';
// Legend
if ($conf->use_javascript_ajax && is_array($showextcals))
{
print '<td align="center" valign="middle" class="nowrap">';
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'."\n";
print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'."\n";
print 'jQuery(".family_birthday").toggle();'."\n";
print '});'."\n";
print '</script>'."\n";
print '<table>';
if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{
if (count($showextcals) > 0)
{
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> '.$langs->trans("LocalAgenda").'</td></tr>';
foreach($showextcals as $val)
{
$htmlname=dol_string_nospecial($val['name']);
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#check_'.$htmlname.'").click(function() { jQuery(".family_'.$htmlname.'").toggle(); });'."\n";
print '});'."\n";
print '</script>'."\n";
print '<tr><td><input type="checkbox" id="check_'.$htmlname.'" name="check_'.$htmlname.'" checked="true"> '.$val['name'].'</td></tr>';
}
}
}
print '<tr><td><input type="checkbox" id="check_birthday" name="check_birthday checked="false"> '.$langs->trans("AgendaShowBirthdayEvents").'</td></tr>';
print '</table>';
print '</td>';
}
print '</tr>';
}
print '</table>';
print '</form>';
} }
if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
$formproject=new FormProjets($db);
print '<tr>';
print '<td class="nowrap">';
print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap">';
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64);
print '</td></tr>';
}
print '</table>';
print '</td>';
// Buttons
print '<td align="center" valign="middle" class="nowrap">';
print img_picto ( $langs->trans ( "ViewCal" ), 'object_calendar', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans ( "ViewCal" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewWeek" ), 'object_calendarweek', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="' . $langs->trans ( "ViewWeek" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewDay" ), 'object_calendarday', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewday" value="' . $langs->trans ( "ViewDay" ) . '">';
print '<br>';
print img_picto ( $langs->trans ( "ViewList" ), 'object_list', 'class="hideonsmartphone"' ) . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans ( "ViewList" ) . '">';
print '</td>';
// Legend
if ($conf->use_javascript_ajax && is_array($showextcals))
{
print '<td align="center" valign="middle" class="nowrap">';
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
print 'jQuery(".family_birthday").toggle();' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<table>';
if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{
if (count($showextcals) > 0)
{
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans ( "LocalAgenda" ) . '</td></tr>';
foreach ($showextcals as $val)
{
$htmlname = dol_string_nospecial ( $val ['name'] );
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_' . $htmlname . '").click(function() { jQuery(".family_' . $htmlname . '").toggle(); });' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<tr><td><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . '</td></tr>';
}
}
}
print '<tr><td><input type="checkbox" id="check_birthday" name="check_birthday checked="false"> ' . $langs->trans ( "AgendaShowBirthdayEvents" ) . '</td></tr>';
print '</table>';
print '</td>';
}
print '</tr>';
print '</table>';
print '</form>';
} }

View File

@@ -146,11 +146,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
} }
// Update an input // Update an input
if (ui.item.update) { if (ui.item.update) {
// clear old data before update // loop on each "update" fields
$.each(ui.item.update, function(key, value) {
$("#" + key).val("");
});
// update fields
$.each(ui.item.update, function(key, value) { $.each(ui.item.update, function(key, value) {
$("#" + key).val(value).trigger("change"); $("#" + key).val(value).trigger("change");
}); });

View File

@@ -1226,9 +1226,9 @@ elseif (! empty($object->id))
// Ref supplier // Ref supplier
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey("RefSupplier",'ref_supplier',$langs->trans($object->ref_supplier),$object,$user->rights->fournisseur->commande->creer); print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print '</td><td colspan="2">'; print '</td><td colspan="2">';
print $form->editfieldval("RefSupplier",'ref_supplier',$langs->trans($object->ref_supplier),$object,$user->rights->fournisseur->commande->creer); print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print '</td></tr>'; print '</td></tr>';
// Fournisseur // Fournisseur
@@ -1678,9 +1678,9 @@ elseif (! empty($object->id))
print '<td colspan="3">'; print '<td colspan="3">';
$ajaxoptions=array( $ajaxoptions=array(
'update' => array('qty_predef' => 'qty_predef', 'remise_percent_predef' => 'remise_percent_predef'), 'update' => array('qty_predef'=>'qty','remise_percent_predef' => 'discount'), // html id tag will be edited with which ajax json response key
'option_disabled' => 'addPredefinedProductButton', 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done
'error' => $langs->trans("NoPriceDefinedForThisSupplier") 'error' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
); );
$form->select_produits_fournisseurs($object->fourn_id, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions); $form->select_produits_fournisseurs($object->fourn_id, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions);

View File

@@ -2116,9 +2116,9 @@ else
print '<td colspan="4">'; print '<td colspan="4">';
$ajaxoptions=array( $ajaxoptions=array(
'update' => array('qty_predef' => 'qty_predef', 'remise_percent_predef' => 'remise_percent_predef'), 'update' => array('qty_predef'=>'qty','remise_percent_predef' => 'discount'), // html id tag will be edited with which ajax json response key
'disabled' => 'addPredefinedProductButton', 'disabled' => 'addPredefinedProductButton', // html id to disable once select is done
'error' => $langs->trans("NoPriceDefinedForThisSupplier") 'error' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
); );
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions); $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions);

View File

@@ -107,7 +107,7 @@ if ($action == 'convert')
$newlevel=$level; $newlevel=$level;
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n"; //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); $retm=$objectstatic->updatePrice($objectstatic->id, $newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
if ($retm < 0) if ($retm < 0)
{ {
$error++; $error++;
@@ -136,7 +136,7 @@ if ($action == 'convert')
if (! empty($price_base_type) && ! $updatelevel1) if (! empty($price_base_type) && ! $updatelevel1)
{ {
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n"; //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); $ret=$objectstatic->updatePrice($objectstatic->id,$newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
} }
if ($ret < 0 || $retm < 0) $error++; if ($ret < 0 || $retm < 0) $error++;

View File

@@ -25,7 +25,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("orders"); $langs->load("orders");
@@ -145,8 +145,8 @@ if ($id > 0 || ! empty($ref))
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$commandestatic=new Commande($db); $commandestatic=new CommandeFournisseur($db);
if ($num > 0) if ($num > 0)
{ {
$var=True; $var=True;
@@ -154,17 +154,19 @@ if ($id > 0 || ! empty($ref))
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
$commandestatic->id=$objp->commandeid;
$commandestatic->ref=$objp->ref;
$commandestatic->statut=$objp->statut;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' '; print '<td>'.$commandestatic->getNomUrl(1)."</td>\n";
print $objp->ref;
print "</a></td>\n"; print "</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
print "<td>".$objp->code_client."</td>\n"; print "<td>".$objp->code_client."</td>\n";
print "<td align=\"center\">"; print '<td align="center">'.dol_print_date($db->jdate($objp->date_commande))."</td>";
print dol_print_date($db->jdate($objp->date_commande))."</td>"; print '<td align="right">'.price($objp->total_ht)."</td>\n";
print "<td align=\"right\">".price($objp->total_ht)."</td>\n"; print '<td align="right">'.$commandestatic->getLibStatut(4).'</td>';
print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }