Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.5' into 3.5_backported
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 28, 2014
2 parents b211427 + ef8b555 commit e678115
Show file tree
Hide file tree
Showing 19 changed files with 301 additions and 88 deletions.
13 changes: 12 additions & 1 deletion ChangeLog
Expand Up @@ -3,6 +3,12 @@ English Dolibarr ChangeLog
--------------------------------------------------------------

***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender.
Fix: Question about warehouse must not be done when module stock is disabled.
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
(missing test at some places).
Fix: Renaming a project with uplaoded files failed.
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
Fix: The object deliverycompany was not used anymore and output of
Expand Down Expand Up @@ -31,7 +37,12 @@ Fix: If multiprice level is used the VAT on addline is not correct
Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part)
Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object
Fix: [ bug #1455 ] outstanding amount
Fix: [ bug #1425 ]
Fix: [ bug #1425 ] LINEBILL_SUPPLIER_DELETE failure trigger leads to an endless loop
Fix: [ bug #1460 ] Several supplier order triggers do not show error messages
Fix: [ bug #1461 ] LINEORDER_SUPPLIER_CREATE does not intercept supplier order line insertion
Fix: [ bug #1484 ] BILL_SUPPLIER_PAYED trigger action does not intercept failure under some circumstances
Fix: [ bug #1482 ] Several supplier invoice triggers do not show trigger error messages
Fix: [ bug #1486 ] LINEBILL_SUPPLIER_CREATE and LINEBILL_SUPPLIER_UPDATE triggers do not intercept trigger action

***** ChangeLog for 3.5.3 compared to 3.5.2 *****
Fix: Error on field accountancy code for export profile of invoices.
Expand Down
3 changes: 2 additions & 1 deletion htdocs/adherents/card_subscriptions.php
Expand Up @@ -813,7 +813,8 @@
$name = $object->getFullName($langs);
if (! empty($name))
{
if ($object->societe) $name.=' ('.$object->societe.')';
if ($object->morphy == 'mor' && ! empty($object->societe)) $name=$object->societe.' ('.$name.')';
else if ($object->societe) $name.=' ('.$object->societe.')';
}
else
{
Expand Down
3 changes: 1 addition & 2 deletions htdocs/admin/agenda_xcal.php
Expand Up @@ -49,7 +49,7 @@
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_PAST_DELAY',trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')),'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db,'MAIN_AGENDA_EXPORT_CACHE',trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')),'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db,'AGENDA_EXPORT_FIX_TZ',trim(GETPOST('AGENDA_EXPORT_FIX_TZ','alpha')),'chaine',0,'',$conf->entity);

if ($i >= 4)
{
$db->commit();
Expand Down Expand Up @@ -174,7 +174,6 @@
$message.=$langs->trans("AgendaUrlOptions2",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login);
print info_admin($message);

if (! empty($conf->use_javascript_ajax))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal.php
Expand Up @@ -731,7 +731,7 @@
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr ==$prod->multiprices_recuperableonly[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
else
{
Expand Down
30 changes: 15 additions & 15 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -290,13 +290,6 @@ function valid($user, $idwarehouse=0)
}
}

// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}

if (! $error)
{
// Appel des triggers
Expand All @@ -307,6 +300,13 @@ function valid($user, $idwarehouse=0)
// Fin appel triggers
}

// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}

if (! $error)
{
$this->db->commit();
Expand Down Expand Up @@ -483,7 +483,7 @@ function cloture($user)
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
$sql.= ' SET fk_statut = 3,';
$sql.= ' fk_user_cloture = '.$user->id.',';
$sql.= ' date_cloture = '.$this->db->idate($now);
$sql.= " date_cloture = '".$this->db->idate($now)."'";
$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut > 0';

if ($this->db->query($sql))
Expand Down Expand Up @@ -1060,7 +1060,7 @@ function createFromProposal($object)
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0)
{
global $mysoc;

$commandeid=$this->id;

dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG);
Expand Down Expand Up @@ -1107,9 +1107,9 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.

$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc);

$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
Expand Down Expand Up @@ -2314,9 +2314,9 @@ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocalt
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.

$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc);

$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
Expand Down Expand Up @@ -2565,8 +2565,8 @@ function load_board($user)
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;

$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
}
return 1;
Expand Down
81 changes: 71 additions & 10 deletions htdocs/commande/fiche.php
Expand Up @@ -117,7 +117,7 @@
if ($object->id > 0)
{
//Because createFromClone modifies the object, we must clone it so that we can restore it later
$orig = clone $object;
$orig = dol_clone($object);

$result=$object->createFromClone($socid);
if ($result > 0)
Expand Down Expand Up @@ -679,7 +679,7 @@
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr ==$prod->multiprices_recuperableonly[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
else
{
Expand Down Expand Up @@ -1003,8 +1003,18 @@
{
$idwarehouse=GETPOST('idwarehouse');

$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

// Check parameters
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == -1)
{
Expand Down Expand Up @@ -1039,8 +1049,18 @@
{
$idwarehouse=GETPOST('idwarehouse');

$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

// Check parameters
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == -1)
{
Expand Down Expand Up @@ -1086,8 +1106,18 @@
{
$idwarehouse=GETPOST('idwarehouse');

$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

// Check parameters
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == -1)
{
Expand Down Expand Up @@ -1879,8 +1909,19 @@
$text.='<br>';
$text.=$notify->confirmMessage('ORDER_VALIDATE',$object->socid);
}

$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

$formquestion=array();
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
Expand All @@ -1898,9 +1939,19 @@
// Confirm back to draft status
if ($action == 'modif')
{
$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

$text=$langs->trans('ConfirmUnvalidateOrder',$object->ref);
$formquestion=array();
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
Expand All @@ -1926,12 +1977,22 @@

/*
* Confirmation de l'annulation
*/
*/
if ($action == 'cancel')
{
$qualified_for_stock_change=0;
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$qualified_for_stock_change=$object->hasProductsOrServices(2);
}
else
{
$qualified_for_stock_change=$object->hasProductsOrServices(1);
}

$text=$langs->trans('ConfirmCancelOrder',$object->ref);
$formquestion=array();
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
{
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
Expand All @@ -1948,7 +2009,7 @@

/*
* Confirmation de la suppression d'une ligne produit
*/
*/
if ($action == 'ask_deleteline')
{
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
Expand Down

0 comments on commit e678115

Please sign in to comment.