'; // Confirm remove if ( isset ($_POST['confirm_rm'])) { if ( $cn->count_sql('select * from tva_rate') > 1 ) $cn->exec_sql('select tva_delete($1)',array($_POST['tva_id'])); else echo '
Vous ne pouvez pas effacer tous taux'. ' Si votre société n\'utilise pas la TVA, changer dans le menu société
'; } //----------------------------------------------------- // Record Change if ( isset ($_POST['confirm_mod']) || isset ($_POST['confirm_add'])) { extract($_POST); // remove space $tva_poste=str_replace (" ","",$tva_poste); $err=0; // Error code if ( isNumber($tva_rate) == 0 ) { $err=2; } if ( $err == 0 ) { if ( isset ($_POST['confirm_add']) ) { $sql="select tva_insert($1,$2,$3,$4)"; $res=$cn->exec_sql( $sql, array($tva_label, $tva_rate, $tva_comment, $tva_poste) ); $err=Database::fetch_result($res); } if ( isset ($_POST['confirm_mod']) ) { $Res=$cn->exec_sql( "select tva_modify($tva_id,'$tva_label', '$tva_rate','$tva_comment','$tva_poste')"); $Res=$cn->exec_sql( "select tva_modify($1,$2,$3,$4,$5)", array($tva_id,$tva_label,$tva_rate,$tva_comment,$tva_poste) ); $err=Database::fetch_result($Res); } } if ( $err != 0 ) { $err_code=array(1=>"Tva id n\'est pas un nombre", 2=>"Taux tva invalide", 3=>"Label ne peut être vide", 4=>"Poste invalide", 5=>"Tva id doit être unique"); $str_err=$err_code[$err]; echo ""; ; } } // If company not use VAT $own=new Own($cn); if ( $own->MY_TVA_USE=='N' ) { echo '| Label | Taux | Commentaire | Poste |
|---|---|---|---|
| Label | Taux | Commentaire | Poste |
|---|---|---|---|