Merge pull request #592 from marcosgdf/minor

Minor changes related to commit 8ac33e9
This commit is contained in:
Laurent Destailleur 2013-01-10 12:10:49 -08:00
commit 9251d9a6ac
2 changed files with 9 additions and 9 deletions

View File

@ -60,7 +60,7 @@ For users:
- New: [ task #210 ] Can choose cash account during POS login. - New: [ task #210 ] Can choose cash account during POS login.
- New: [ task #104 ] Can create an invoice from several orders. - New: [ task #104 ] Can create an invoice from several orders.
- New: Update libs/tools/logo for DoliWamp (now use PHP 5.3). - New: Update libs/tools/logo for DoliWamp (now use PHP 5.3).
- New: Added ODT Template tag {object_total_discount} - New: Added ODT Template tag {object_total_discount_ht}
- New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices - New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices
- New: English bank account need a bank code (called sort code) to identify an account. - New: English bank account need a bank code (called sort code) to identify an account.
- New: Can choose menu entry to show with external site module. - New: Can choose menu entry to show with external site module.

View File

@ -1525,20 +1525,20 @@ abstract class CommonObject
if ($this->total_localtax1 == 0) if ($this->total_localtax1 == 0)
{ {
// Search to know if there is a localtax of type 7 // Search to know if there is a localtax of type 7
// TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate // TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate
global $mysoc; global $mysoc;
$localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
if (empty($obj->localtax1_type)) if (empty($obj->localtax1_type))
{ {
$obj->localtax1_type = $localtax1_array[0]; $obj->localtax1_type = $localtax1_array[0];
$obj->localtax1_tx = $localtax1_array[1]; $obj->localtax1_tx = $localtax1_array[1];
} }
//end TODO //end TODO
if ($obj->localtax1_type == '7') if ($obj->localtax1_type == '7')
{ {
$this->total_localtax1 += $obj->localtax1_tx; $this->total_localtax1 += $obj->localtax1_tx;
$this->total_ttc += $obj->localtax1_tx; $this->total_ttc += $obj->localtax1_tx;
} }
} }
if ($this->total_localtax2 == 0) if ($this->total_localtax2 == 0)
@ -2255,11 +2255,11 @@ abstract class CommonObject
/** /**
* Function that returns the total amount HT of discounts applied for all lines. * Function that returns the total amount HT of discounts applied for all lines.
* *
* @return in 0 if no discount * @return float
*/ */
function getTotalDiscount() function getTotalDiscount()
{ {
$total_discount=0; $total_discount=0.00;
$sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht"; $sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."det"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."det";
@ -2289,7 +2289,7 @@ abstract class CommonObject
else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR); else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR);
//print $total_discount; exit; //print $total_discount; exit;
return price2num($total_discount); return price2num($total_discount);
} }
/** /**