Merge fix of 3.3

This commit is contained in:
Laurent Destailleur 2013-03-02 16:17:12 +01:00
parent 6f51925c7b
commit 51d23d7c48
5 changed files with 19 additions and 6 deletions

View File

@ -37,6 +37,16 @@ For translators:
- Update language files.
***** ChangeLog for 3.3.1 compared to 3.3 *****
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
- Fix: Package for launchpad
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
- Fix: Localtax2 for Spain must be based into buyer
***** ChangeLog for 3.3 compared to 3.2.3 *****
For users:
- New: Add holiday module, to declare and follow holidays of your employees.

View File

@ -722,9 +722,10 @@ abstract class CommonObject
* @param string $table To force other table element or element line
* @param int $id To force other object id
* @param string $format Data format ('text' by default, 'date')
* @param string $id_field To force rowid field name
* @return int <0 if KO, >0 if OK
*/
function setValueFrom($field, $value, $table='', $id='', $format='text')
function setValueFrom($field, $value, $table='', $id='', $format='text', $id_field='rowid')
{
global $conf;
@ -736,7 +737,7 @@ abstract class CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'";
$sql.= " WHERE rowid = ".$id;
$sql.= " WHERE ".$id_field." = ".$id;
dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -2720,10 +2720,10 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller id=".$thirdparty_seller->id);
// Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain and localtaxes 1, tax is qualified if buyer use local taxe
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
{
if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0;
}
else
{

View File

@ -583,6 +583,7 @@ class InterfaceActionsAuto
$ret=$actioncomm->add($user); // User qui saisit l'action
if ($ret > 0)
{
$_SESSION['LAST_ACTION_CREATED'] = $ret;
return 1;
}
else

View File

@ -295,7 +295,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
//print "xx".$tva_tx; exit;
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
$ret=$object->fetch($object->id); // Reload to get new records
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
@ -307,7 +309,6 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$outputlangs->setDefaultLang($newlang);
}
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
unset($_POST['qty']);