|
Server IP : 10.128.40.6 / Your IP : 216.73.217.20 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/logmcpe/www/TEST/../TMCPRO/pages/feuillesroute/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// echo "yassin <br/>" ;
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// exit() ;
$req= dbi_fetch_row(dbi_query("SELECT * FROM `facture` WHERE `num_fact` = ".$_POST['rowid'])) ;
$client_id = $req['client_id'] ;
$annee = $year = date('Y');
$mois = $month = date('m');
$from = $annee.''.$mois.'01';
$to = $annee.''.$mois.'31';
$num_factt = $_POST['rowid'] ;
// si il a un probléme de avoir cest facile ... la requet affiche aussi les avoirs
$query2 = "SELECT
f.fact_id, total,date_debut,date_fin,
total-if(p.paye is null, 0, p.paye)-if(a.avoir is null, 0, a.avoir) AS paye,
if(a.avoir is null, 0, a.avoir) avoir,
f.date_fact, if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) >= total, 'Réglé', if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) = 0, 'Pas de règlement', 'Règlement partiel')) statut,
f.relance,client_nom nom,f.client_id,reglement_delai
FROM ".TABLE_FACT." f
LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) paye, fact_id FROM ".TABLE_PAIEMENT." group by fact_id) p ON f.fact_id = p.fact_id
LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) avoir, fact_id FROM ".TABLE_AVOIR." group by fact_id) a ON f.fact_id = a.fact_id
LEFT JOIN ".TABLE_CLIENT." c ON f.client_id = c.client_id
WHERE f.num_fact = $num_factt and f.date_fin<=$to
GROUP BY date_fact, f.fact_id, total
order by num_fact DESC" ;
// echo $query2 ;
// exit() ;
$q2 = dbi_query(sprintf($query2, '<')) ;
$ff = dbi_fetch_row($q2) ;
?>
<div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
<h4 class="modal-title">Relance par e-mail <?php echo $prestationid ;?></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form role="form" enctype="multipart/form-data" method='POST' action=''>
<!-- /.card-header -->
<div class="card-body" >
<div class="row">
<?php
?>
<?php $client = $client_id ? dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CLIENT." WHERE client_id = $client_id")) : array() ; ?>
<input type="hidden" name="client_id" value="<?=$client_id?>">
<input type="hidden" name="num_fact" value="<?=$_POST['rowid']?>">
<input name="reg" type="hidden" />
<div class="col-sm-12">
<div class="form-row">
<label> À :</label>
<select class="form-control" name="contact_email">
<?php
$qm = dbi_query("SELECT * FROM contact where client_id = '$client_id'") ;
while($email = dbi_fetch_row($qm))
{
?>
<option value="<?=$email['contact_email'] ?>" ><?=$email['contact_email'] ?></option>
<?
}
?>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-row">
</div>
</div>
<div class="col-sm-12">
<div class="form-row">
<label> Objet :</label>
<input class="form-control" type="text" name="objet" value="MC PRO : Facture en attente de règlement" class="field required" />
</div>
</div>
<div class="form-row">
<?php
$contenu = "Bonjour,<br/>
L’examen de votre compte fait apparaître, sauf erreur ou omission de notre part, un solde débiteur de <strong>".$req['total']."</strong>€ :
<br/> <br/>
<table border=3 width=95%>
<tr>
<th>NUMÉRO</th>
<th>DATE FACTURE </th>
<th> MONTANT</th>
<th> NET À PAYER</th>
<th> RÈGLEMENT</th>
</tr>
<tr>
<td>".$req['num_fact']."</td>
<td>".int2date($req['date_fact'])."</td>
<td>".$req['total']."</td>
<td>".$ff['paye']."</td>
<td>".$ff['statut']."</td>
</tr>
</table>
<br/>
Nous vous demandons de bien vouloir régulariser votre facture arrivée à échéance à réception de la présente relance.
Nous vous remercions de votre compréhension et restons à votre disposition pour tout complément d’information.
<br/>
Cordialement,
<br/>
Tiffany MAZELLA
<br/>
Service comptabilité et recouvrement
<br/>
<strong > <span style = 'color: rgb(235, 27, 175)';> </span><span style = 'color: rgb(12, 224, 249)';> MCPRO </span> </strong> "
;
?>
<!-- /.card-header -->
<div class="form-group col-md-12">
<label for="inputAddresse">Message</label>
<textarea class="textarea" placeholder="Place some text here"
style="width: 100%; height: 600px; font-size: 36px; line-height: 36px; border: 1px solid #dddddd; padding: 36px;" name="contenu" > <?php echo $contenu ; ?> </textarea>
</div>
</div>
<div class="form-group col-md-4">
<label for="exampleInputFile">Ajouter une piéce jointe</label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" name="file" >
<label class="custom-file-label" for="exampleInputFile">Choisir....</label>
</div>
<div class="input-group-append">
<span class="input-group-text" id="">Upload</span>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="chantier_ID" value="<?=$red['chantier_ID'] ?>">
<div class="modal-footer justify-content-between">
<button type="submit" value=" Enregistrer " class="btn btn-primary" >Envoyé l'email + Terminer l'action </button>
</div>
</form>
<script src="../../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<script src="../../plugins/summernote/summernote-bs4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
bsCustomFileInput.init();
});
$(function () {
// Summernote
$('.textarea').summernote()
})
</script>
