| Current Path : /home/happyrenas/old/huissier-express.fr/administration/panel/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/old/huissier-express.fr/administration/panel/compta.php |
<?
session_start();
$page="compta";
include("../../config.php");
$departement_id = $_REQUEST['departement_id'];
$pnp = $_REQUEST['pnp'];
$constat_id = $_REQUEST['constat_id'];
$annee = $_REQUEST['annee'];
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="fr">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title>ADMINISTRATION</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<link href="../assets/global/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/jquery-file-upload/blueimp-gallery/blueimp-gallery.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/jquery-file-upload/css/jquery.fileupload.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/jquery-file-upload/css/jquery.fileupload-ui.css" rel="stylesheet" type="text/css" />
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL STYLES -->
<link href="../assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
<link href="../assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
<!-- END THEME GLOBAL STYLES -->
<!-- BEGIN THEME LAYOUT STYLES -->
<link href="../assets/layouts/layout2/css/layout.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/layouts/layout2/css/themes/grey.css" rel="stylesheet" type="text/css" id="style_color" />
<link href="../assets/layouts/layout2/css/custom.min.css" rel="stylesheet" type="text/css" />
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="../../images/favicon.ico">
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
<body class="page-header-fixed page-sidebar-closed-hide-logo page-container-bg-solid">
<!-- BEGIN HEADER -->
<?include("header_top.php");?>
<!-- END HEADER -->
<!-- BEGIN CONTAINER -->
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<div class="page-sidebar navbar-collapse collapse">
<?include("header_left.php");?>
</div>
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<!-- /.modal -->
<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<!-- BEGIN STYLE CUSTOMIZER -->
<!-- END STYLE CUSTOMIZER -->
<!-- BEGIN PAGE HEADER-->
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<i class="fa fa-home"></i>
<a href="index.php">Accueil</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
Tableau de comptabilité <b><?echo $annee;?></b>
</li>
</ul>
<div class="page-toolbar">
<div class="btn-group pull-right">
<a href="compta_export.php?annee=<?echo $annee;?>">
<button type="button" class="btn blue">
EXPORT
</button>
</a>
</div>
</div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<?
$myquery = "SELECT * from facture where 1 and statut_paiement=1 order by id";
if ($annee) {$myquery = "SELECT * from facture where 1 and statut_paiement=1 and year(date_creation)= ".$annee." order by id";}
$myquery_calls = $db->get_results($myquery);
$num = $db->num_rows;
?>
<div class="row">
<div class="col-md-12">
<!-- BEGIN SAMPLE TABLE PORTLET-->
<div class="portlet box blue-steel">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Les factures : <?echo $num;?>
</div>
</div>
<div class="portlet-body">
<div class="table-scrollable">
<table class="table table-bordered table-striped table-condensed flip-content">
<thead>
<tr>
<th width="7%"> </th>
<th width="7%">Réf facture</th>
<th width="10px;">Réf commande</th>
<th width="10px;">Destinataire</th>
<th width="10px;">Encaisse H.T. Client</th>
<th width="10px;">Encaisse TVA</th>
<th width="10px;">Encaisse TTC</th>
<th width="10px;">TTC reversé</th>
<th width="10px;">commissions prélevées H.T. Client</th>
<th width="10px;">commissions prélevées TVA</th>
<th width="10px;">commissions prélevées TTC</th>
<th width="10px;"></th>
</tr>
</thead>
<tbody>
<?
if (!empty($myquery_calls))
{
foreach ( $myquery_calls as $factures )
{
$ref_commande="";
$compteur=$compteur+1;
$destinataire="";
$montant_facture_ht="";
$montant_tva="";
$montant_ttc="";
$montant_total="";
$montant_total_tva="";
$montant_total_ttc="";
$reverse="";
$pdf_facture="";
if ($factures->constat_id)
{
$myquery="select * from constat where id=".$factures->constat_id;
$constat = $db->get_row($myquery);
if ($constat->id<=979) {$pourcentage=0.06;} else {$pourcentage=0.09;}
$ref_commande="HE/".date("Y", strtotime($constat->date_creation))."/C/".$constat->id;
$montant_facture_ht = round($constat->tarif/1.2,2);
$montant_tva = round($constat->tarif-$montant_facture_ht,2);
$montant_ttc = round($constat->tarif,2);
$montant_total = round($pourcentage*$montant_facture_ht,2);
$montant_total_tva = round(0.2*$montant_total,2);
$montant_total_ttc = $montant_total+$montant_total_tva;
$reverse=-$montant_total_ttc+$montant_ttc;
$pdf_facture="../fpdfi/facture.php?constat_id=".$factures->constat_id."&facture_id=".$factures->id."&huissier_id=".$factures->huissier_id."&tva=&save=non";
}
if ($factures->impaye_id)
{
$myquery="select * from impaye where id=".$factures->impaye_id;
$impaye = $db->get_row($myquery);
$ref_commande="HE/".date("Y", strtotime($impaye->date_creation))."/I/".$impaye->id;
$montant_facture_ht = round(21/1.2,2);
$montant_tva = round(21-$montant_facture_ht,2);
$montant_ttc = round($impaye->tarif,2);
$montant_total = round($montant_facture_ht,2);
$montant_total_tva = round(0.2*$montant_total,2);
$montant_total_ttc = $montant_total+$montant_total_tva;
$reverse=-$montant_total_ttc+$montant_ttc;
$pdf_facture="../fpdfi/facture_impaye.php?impaye_id=".$factures->impaye_id."&facture_id=".$factures->id."&huissier_id=".$factures->huissier_id."&tva=&save=non";
}
if ($factures->urgence_id)
{
$myquery="select * from urgence where id=".$factures->urgence_id;
$urgence = $db->get_row($myquery);
$ref_commande="HE/".date("Y", strtotime($urgence->date_creation))."/U/".$urgence->id;
$montant_facture_ht = round(24/1.2,2);
$montant_tva = round(24-$montant_facture_ht,2);
$montant_ttc = round($urgence->tarif,2);
$montant_total = round($montant_facture_ht,2);
$montant_total_tva = round(0.2*$montant_total,2);
$montant_total_ttc = $montant_total+$montant_total_tva;
$reverse=-$montant_total_ttc+$montant_ttc;
$pdf_facture="../fpdfi/facture_urgence.php?urgence_id=".$factures->urgence_id."&facture_id=".$factures->id."&huissier_id=".$factures->huissier_id."&tva=&save=non";
}
if ($factures->huissier_id)
{
$myquery="select * from huissier where id=".$factures->huissier_id;
$huissier = $db->get_row($myquery);
$destinataire=$huissier->huissier;
}
if ($ref_commande=="")
{
$ref_commande="HE/".date("Y", strtotime($factures->date_creation))."/A/".$huissier->id;
$montant_total = 15;
$montant_total_tva = 3;
$montant_total_ttc = 18;
$pdf_facture="../fpdfi/facture.php?facture_id=".$factures->id."&huissier_id=".$factures->huissier_id."&tva=&save=non";
}
?>
<tr>
<td class="text-center"><?echo date("d-m-Y", strtotime($factures->date_creation));?><small> - <?echo $pourcentage;?> %</small></td>
<td class="text-center"><?echo $factures->facture_numero;?></td>
<td class="text-center"><?echo $ref_commande;?></td>
<td class="text-center"><?echo $destinataire;?></td>
<td class="text-center"><?echo $montant_facture_ht;?></td>
<td class="text-center"><?echo $montant_tva;?></td>
<td class="text-center"><?echo $montant_ttc;?></td>
<td class="text-center"><?echo $reverse;?></td>
<td class="text-center"><?echo $montant_total;?></td>
<td class="text-center"><?echo $montant_total_tva;?></td>
<td class="text-center"><?echo $montant_total_ttc;?></td>
<td class="text-center"><a target="_blank" href="<?echo $pdf_facture;?>"><i class="fa fa-file-pdf-o"></i></a></td>
</tr>
<?
$TOTAL_montant_facture_ht=$TOTAL_montant_facture_ht+$montant_facture_ht;
$TOTAL_montant_tva=$TOTAL_montant_tva+$montant_tva;
$TOTAL_montant_ttc=$TOTAL_montant_ttc+$montant_ttc;
$TOTAL_reverse=$TOTAL_reverse+$reverse;
$TOTAL_montant_total=$TOTAL_montant_total+$montant_total;
$TOTAL_montant_total_tva=$TOTAL_montant_total_tva+$montant_total_tva;
$TOTAL_montant_total_ttc=$TOTAL_montant_total_ttc+$montant_total_ttc;
}
}
?>
<tr>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"><b><?echo $TOTAL_montant_facture_ht;?></b></td>
<td class="text-center"><b><?echo $TOTAL_montant_tva;?></b></td>
<td class="text-center"><b><?echo $TOTAL_montant_ttc;?></b></td>
<td class="text-center"><b><?echo $TOTAL_reverse;?></b></td>
<td class="text-center"><b><?echo $TOTAL_montant_total;?></b></td>
<td class="text-center"><b><?echo $TOTAL_montant_total_tva;?></b></td>
<td class="text-center"><b><?echo $TOTAL_montant_total_ttc;?></b></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- END SAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- BEGIN QUICK SIDEBAR -->
<!--Cooming Soon...-->
<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<?
include("footer.php");
?>
</div>
<!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script>
<script src="../assets/global/plugins/ie8.fix.min.js"></script>
<![endif]-->
<!-- BEGIN CORE PLUGINS -->
<script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="../assets/global/plugins/fancybox/source/jquery.fancybox.pack.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/vendor/tmpl.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/vendor/load-image.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/vendor/canvas-to-blob.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/blueimp-gallery/jquery.blueimp-gallery.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-process.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-image.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-audio.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-video.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-validate.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-file-upload/js/jquery.fileupload-ui.js" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="../assets/global/scripts/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="../assets/pages/scripts/form-fileupload.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="../assets/layouts/layout2/scripts/layout.min.js" type="text/javascript"></script>
<script src="../assets/layouts/layout2/scripts/demo.min.js" type="text/javascript"></script>
<script src="../assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="../assets/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<!-- END THEME LAYOUT SCRIPTS -->
</body>
</html>