Merge with the branches/rel400

* New module budget
* Detail for impress of account
* Code rewrited
* Group in analytic accountancy
* Fix Bug
This commit is contained in:
Dany De Bontridder 2008-02-26 17:26:24 +00:00
parent 4e4529c51a
commit cd96d07c1e
113 changed files with 1193 additions and 1104 deletions

View file

@ -28,15 +28,15 @@ require_once('class_action.php');
*/
class Document
{
var $db; /*! \enum $db Database connexion*/
var $d_id; /*! \enum $d_id Document id */
var $ag_id; /*! \enum $ag_id action_gestion.ag_id (pk) */
var $d_mimetype; /*! \enum $d_mimetype */
var $d_filename; /*! \enum $d_filename */
var $d_lob; /*! \enum $d_lob the oid of the lob */
var $d_number; /*! \enum $d_number number of the document */
var $md_id; /*! \enum $md_id document's template */
var $d_state; /*! \enum $d_state document.d_state status of the document */
var $db; /*!< $db Database connexion*/
var $d_id; /*!< $d_id Document id */
var $ag_id; /*!< $ag_id action_gestion.ag_id (pk) */
var $d_mimetype; /*!< $d_mimetype */
var $d_filename; /*!< $d_filename */
var $d_lob; /*!< $d_lob the oid of the lob */
var $d_number; /*!< $d_number number of the document */
var $md_id; /*!< $md_id document's template */
var $d_state; /*!< $d_state document.d_state status of the document */
/* Constructor
* \param $p_cn Database connection
*/
@ -655,6 +655,7 @@ class Document
$r=${$id};
break;
case 'TVA_CODE':
extract ($_POST);
$id='e_march'.$counter.'_tva_id';
@ -679,9 +680,8 @@ class Document
$r=$tva['tva_label'];
break;
/* total VAT for one sold */
case 'TVA_AMOUNT':
case 'VEN_TVA':
extract ($_POST);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_sell' ;
@ -700,6 +700,47 @@ class Document
$r=round($r,2);
break;
case 'VEN_ART_TVA':
extract ($_POST);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_sell' ;
$tva='e_march'.$counter.'_tva_id';
if ( !isset (${'e_march'.$counter}) ) return "";
// check that something is sold
if ( ${$price} == 0 || ${$qt} == 0
|| strlen(trim( $price )) ==0
|| strlen(trim($qt)) ==0)
return "";
$a_tva=GetTvaRate($this->db,${$tva});
echo_debug('class_document',__LINE__,'Tva :'.var_export($a_tva,true));
// if no vat returns 0
if ( sizeof($a_tva) == 0 ) return "";
$r=round(${$price},2)*$a_tva['tva_rate'];
$r=round($r,2);
break;
case 'VEN_ART_TVAC':
extract ($_POST);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_sell' ;
$tva='e_march'.$counter.'_tva_id';
if ( !isset (${'e_march'.$counter}) ) return "";
// check that something is sold
if ( ${$price} == 0 || ${$qt} == 0
|| strlen(trim( $price )) ==0
|| strlen(trim($qt)) ==0)
return "";
$a_tva=GetTvaRate($this->db,${$tva});
echo_debug('class_document',__LINE__,'Tva :'.var_export($a_tva,true));
// if no vat returns 0
if ( sizeof($a_tva) == 0 ) {
$r=round(${$price},2);
}else {
$r=round(${$price}*$a_tva['tva_rate']+${$price},2);
}
break;
case 'VEN_ART_QUANT':
extract ($_POST);
$id='e_quant'.$counter;