Fix bug and add verification

This commit is contained in:
sparkyx 2007-12-03 21:56:55 +00:00
parent 9ba93fa008
commit 779285ee69
7 changed files with 96 additions and 4 deletions

View file

@ -76,7 +76,7 @@ BODY {
<script src="js/scripts.js" type="text/javascript"></script>
</head>
<BODY onLoad="SetFocus(\'login\',0)">
Version 3.0.2
Version 3.0.3
<div class="remark">
<p class="gras">Il est conseill&eacute; de ne PAS utiliser Internet Explorer.
</p><p>

View file

@ -28,7 +28,7 @@ function showfiche(p_sessid,p_qcode)
{
p_dossier=document.getElementById("gDossier").value;
var a=window.open('show_fiche.php?PHPSESSID='+p_sessid+'&gDossier='+p_dossier+'&q='+p_qcode,'','toolbar=no,width=350,height=450,scrollbar=yes,statusbar=no');
return false;
}
/* type must be cred or deb and name is
@ -40,6 +40,7 @@ function SearchCard(p_sessid,type,name,jrn)
var search=document.getElementById(name).value;
var gDossier=document.getElementById('gDossier').value;
var a=window.open('fiche_search.php?first&search&fic_search='+search+'&p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name+'&gDossier='+gDossier,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
return false;
}
function NewCard(p_sessid,type,name,jrn)
{
@ -47,6 +48,8 @@ function SearchCard(p_sessid,type,name,jrn)
var gDossier=document.getElementById('gDossier').value;
var a=window.open('fiche_new.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name+'&gDossier='+gDossier,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
return false;
}
/* SetValue( p_ctl,p_value )
/* p_ctl is the name of the control

View file

@ -62,6 +62,10 @@ switch ($p_action) {
case 'periode';
$high=2;
break;
case 'verif';
$high=10;
break;
default:
$high=0;
@ -158,8 +162,77 @@ if ($p_action=="preod") {
echo '</table>';
}
echo '</div>';
exit();
}
//----------------------------------------------------------------------
// Verification solde
//----------------------------------------------------------------------
if ( $p_action=='verif' ) {
echo '<div class="u_content">';
$User->db=$cn;
$sql_year=" and c_periode in (select p_id from parm_periode where p_exercice='".$User->GetExercice()."')";
echo '<ol>';
$deb=getDbValue($cn,"select sum (c_montant) from centralized where c_debit='t' $sql_year ");
$cred=getDbValue($cn,"select sum (c_montant) from centralized where c_debit='f' $sql_year ");
if ( $cred == $deb ) {
$result ='<span style="color:green;font-size:120%;font-weight:bold;"> OK </span>';}
else {
$result ='<span style="color:red;font-size:120%;font-weight:bold;"> NON OK </span>';}
printf ('<li> Solde Grand Livre centralis&eacute;: debit %f credit %f %s</li>',$deb,$cred,$result);
$sql="select jrn_def_id,jrn_def_name from jrn_def";
$res=ExecSql($cn,$sql);
$jrn=pg_fetch_all($res);
foreach ($jrn as $l) {
$id=$l['jrn_def_id'];
$name=$l['jrn_def_name'];
$deb=getDbValue($cn,"select sum (c_montant) from centralized where c_debit='t' and c_jrn_def=$id $sql_year ");
$cred=getDbValue($cn,"select sum (c_montant) from centralized where c_debit='f' and c_jrn_def=$id $sql_year ");
if ( $cred == $deb ) {
$result ='<span style="color:green;font-size:120%;font-weight:bold;"> OK </span>';}
else {
$result ='<span style="color:red;font-size:120%;font-weight:bold;"> NON OK </span>';}
printf ('<li> Journal %s Solde centralis&eacute;: debit %f credit %f %s</li>',$name,$deb,$cred,$result);
}
echo '</ol>';
echo '<ol>';
$sql_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$User->GetExercice()."')";
$deb=getDbValue($cn,"select sum (j_montant) from jrnx where j_debit='t' $sql_year ");
$cred=getDbValue($cn,"select sum (j_montant) from jrnx where j_debit='f' $sql_year ");
if ( $cred == $deb ) {
$result ='<span style="color:green;font-size:120%;font-weight:bold;"> OK </span>';}
else {
$result ='<span style="color:red;font-size:120%;font-weight:bold;"> NON OK </span>';}
printf ('<li> Solde Grand Livre non centralis&eacute;: debit %f credit %f %s</li>',$deb,$cred,$result);
$sql="select jrn_def_id,jrn_def_name from jrn_def";
$res=ExecSql($cn,$sql);
$jrn=pg_fetch_all($res);
foreach ($jrn as $l) {
$id=$l['jrn_def_id'];
$name=$l['jrn_def_name'];
$deb=getDbValue($cn,"select sum (j_montant) from jrnx where j_debit='t' and j_jrn_def=$id $sql_year ");
$cred=getDbValue($cn,"select sum (j_montant) from jrnx where j_debit='f' and j_jrn_def=$id $sql_year ");
if ( $cred == $deb ) {
$result ='<span style="color:green;font-size:120%;font-weight:bold;"> OK </span>';}
else {
$result ='<span style="color:red;font-size:120%;font-weight:bold;"> NON OK </span>';}
printf ('<li> Journal %s Solde non centralis&eacute;: debit %f credit %f %s</li>',$name,$deb,$cred,$result);
}
echo '</div>';
}
html_page_stop();

View file

@ -42,5 +42,12 @@ echo '<div class="u_redcontent">';
echo '<FORM ACTION="bilan.php" METHOD="GET">';
echo $bilan->display_form ($filter_year);
echo '</FORM>';
echo '<span class="notice"> Attention : si le bilan n\'est pas &eacute;quilibr&eacute;.<br> V&eacute;rifiez <ul>
<li>L\'affectation du r&eacute;sultat est fait</li>
<li>Vos comptes actifs ont un solde d&eacute;biteur (sauf les comptes dit invers&eacute;s)</li>
<li> les comptes passifs ont un solde cr&eacute;diteur (sauf les comptes dit invers&eacute;s) </li>
</ul>
Utilisez la balance des comptes pour v&eacute;rifier. </span>';
echo '</div>';
?>

View file

@ -242,5 +242,7 @@ echo '</TABLE>';
print $w->Submit('bt_html','Impression');
echo '</FORM>';
echo '<span class="notice"> Attention : en-cas d\'impression de journaux centralis&eacute;s, dans le PDF, les montants d&eacute;bit et cr&eacute;dit calcul&eacute;s par page sont la somme des montants de la page uniquement. Si une op&eacute;ration est sur 2 pages ces montants diff&egrave;reront évidemment. Ces montants doivent &ecirc;tre &eacute;gaux sur la derni&egrave;re page. Pour v&eacute;rifier la balance, utilisez la balance des comptes ou Avanc&eacute;->V&eacute;rification</span>';
echo '</div>';
?>

View file

@ -73,6 +73,7 @@ if ( isset ($_POST["FMOD_NAME"]) ) {
$Res=ExecSql($cn_mod,"truncate table stock_goods");
$Res=ExecSql($cn_mod,"truncate table jrn");
$Res=ExecSql($cn_mod,"delete from jrnx");
$Res=ExecSql($cn_mod,'delete from operation_analytique');
// TODO
// Nettoyage table quant_*
@ -140,7 +141,10 @@ if ( isset ($_POST["FMOD_NAME"]) ) {
}
if ( isset($_POST['CANAL'])) {
$Res=ExecSql($cn_mod,'delete from poste_analytique');
$Res=ExecSql($cn_mod,'delete from plan_analytique');
}
}
// Show all available templates
@ -214,6 +218,8 @@ if ( $count != 0 ) {
<TR><TD>Nettoyage des Documents et courriers (ce qui n'effacera pas les modèles de documents)</TD><TD> <input type="checkbox" name="DOC"></TD></TR>
<TR><TD>Nettoyage de toutes les fiches (ce qui effacera client, op&eacute;rations pr&eacute;d&eacute;finies fournisseurs et documents)</TD><TD> <input type="checkbox" name="CARD"></TD></TR>
<TR><TD>Nettoyage de la comptabilit&eacute; analytique : effacement des plans et des postes, les op&eacute;rations sont de toute fa&ccedil;on effac&eacute;es </TD><TD> <input type="checkbox" name="CANAL"></TD></TR>
<TR>

View file

@ -553,7 +553,8 @@ function ShowMenuAdvanced($default="") {
array('compta.php?p_action=stock&'.$str_dossier,'Stock',"Gestion des stocks",5),
array('form.php?'.$str_dossier,'Rapport',"Rapport",6),
array('import.php?'.$str_dossier,'Import Banque',"Banque",7),
array('ecrit_ouv.php?'.$str_dossier,'Ecriture ouverture',"",8)
array('ecrit_ouv.php?'.$str_dossier,'Ecriture ouverture',"",8),
array('user_advanced.php?p_action=verif&'.$str_dossier,'V&eacute;rification',"",10)
),
'H',"mtitle","mtitle",$default);
$r='<div class="u_subtmenu">'.$left_menu."</div>";