Skip to content
Snippets Groups Projects
Commit 24c0d99c authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Synchro

parent d1313970
No related branches found
No related tags found
No related merge requests found
...@@ -30,23 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/lib/dolibarrmail.class.php"; ...@@ -30,23 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/lib/dolibarrmail.class.php";
*/ */
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
if ($_POST["action"] == 'confirm_rejet')
{
if ( $_POST["confirm"] == yes)
{
$rej = new RejetPrelevement($db, $user);
$rej->create($_GET["id"], $_GET["socid"], $_GET["previd"]);
Header("Location: factures.php?id=".$_GET["id"]);
}
else
{
Header("Location: factures.php?id=".$_GET["id"]);
}
}
llxHeader('','Bon de prlvement'); llxHeader('','Bon de prlvement');
$h = 0; $h = 0;
...@@ -54,6 +37,10 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"]; ...@@ -54,6 +37,10 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"];
$head[$h][1] = $langs->trans("Fiche"); $head[$h][1] = $langs->trans("Fiche");
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$_GET["id"];
$head[$h][1] = $langs->trans("Lignes");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"];
$head[$h][1] = $langs->trans("Factures"); $head[$h][1] = $langs->trans("Factures");
$hselected = $h; $hselected = $h;
...@@ -67,10 +54,11 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"] ...@@ -67,10 +54,11 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]
$head[$h][1] = $langs->trans("Statistiques"); $head[$h][1] = $langs->trans("Statistiques");
$h++; $h++;
$prev_id = $_GET["id"];
if ($_GET["id"]) if ($_GET["id"])
{ {
$prev_id = $_GET["id"];
$bon = new BonPrelevement($db,""); $bon = new BonPrelevement($db,"");
if ($bon->fetch($_GET["id"]) == 0) if ($bon->fetch($_GET["id"]) == 0)
...@@ -78,7 +66,6 @@ if ($_GET["id"]) ...@@ -78,7 +66,6 @@ if ($_GET["id"])
dolibarr_fiche_head($head, $hselected, 'Prlvement : '. $bon->ref); dolibarr_fiche_head($head, $hselected, 'Prlvement : '. $bon->ref);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="20%">Rfrence</td><td>'.$bon->ref.'</td></tr>'; print '<tr><td width="20%">Rfrence</td><td>'.$bon->ref.'</td></tr>';
...@@ -91,55 +78,33 @@ if ($_GET["id"]) ...@@ -91,55 +78,33 @@ if ($_GET["id"])
} }
} }
if ($_GET["action"] == 'rejet')
{
$html = new Form($db);
$soc = new Societe($db);
$soc->fetch($_GET["socid"]);
$html->form_confirm("factures.php"."?id=".$_GET["id"]."&amp;socid=".$_GET["socid"]."&amp;previd=".$_GET["previd"],"Rejet de prlvement","Etes-vous sr de vouloir saisir un rejet de prlvement pour la socit ".$soc->nom." ?","confirm_rejet");
print '<table class="border" width="100%">';
print '<tr><td width="20%">Rfrence</td><td>'.$bon->ref.'</td></tr>';
print '</table><br />';
}
$page = $_GET["page"]; $page = $_GET["page"];
$sortorder = $_GET["sortorder"]; $sortorder = (empty($_GET["sortorder"])) ? "DESC" : $_GET["sortorder"];
$sortfield = $_GET["sortfield"]; $sortfield = (empty($_GET["sortfield"])) ? "p.datec" : $_GET["sortfield"];
if ($page == -1) { $page = 0 ; }
$offset = $conf->liste_limit * $page ; $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") {
$sortorder="DESC";
}
if ($sortfield == "") {
$sortfield="p.datec";
}
/* /*
* Liste des factures * Liste des factures
* *
* *
*/ */
$sql = "SELECT pf.rowid, pf.statut"; $sql = "SELECT pf.rowid";
$sql .= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc"; $sql .= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc";
$sql .= " , s.idp, s.nom"; $sql .= " , s.idp, s.nom";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql .= " , ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."facture as f";
$sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE p.rowid=".$prev_id; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
$sql .= " AND pf.fk_prelevement = p.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid";
$sql .= " AND f.fk_soc = s.idp"; $sql .= " AND f.fk_soc = s.idp";
$sql .= " AND pf.fk_facture = f.rowid"; $sql .= " AND pf.fk_facture = f.rowid";
if ($_GET["id"])
{
$sql .= " AND p.rowid=".$_GET["id"];
}
if ($_GET["socid"]) if ($_GET["socid"])
{ {
...@@ -149,6 +114,7 @@ if ($_GET["socid"]) ...@@ -149,6 +114,7 @@ if ($_GET["socid"])
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows();
...@@ -176,12 +142,13 @@ if ($result) ...@@ -176,12 +142,13 @@ if ($result)
print "<tr $bc[$var]><td>"; print "<tr $bc[$var]><td>";
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">';
print img_file(); print img_object($langs->trans("ShowBill"),"bill");
print '</a>&nbsp;'; print '</a>&nbsp;';
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n"; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom)."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">';
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
print '<td align="center">'.price($obj->total_ttc)."</td>\n"; print '<td align="center">'.price($obj->total_ttc)."</td>\n";
...@@ -200,18 +167,7 @@ if ($result) ...@@ -200,18 +167,7 @@ if ($result)
print '<b>Rejet</b>'; print '<b>Rejet</b>';
} }
print '</td><td>'; print "</td></tr>\n";
if ($obj->statut == 1)
{
print '<a href="factures.php?id='.$_GET["id"].'&amp;action=rejet&amp;socid='.$obj->idp;
print '&amp;previd='.$bon->id.'">';
print "Saisir rejet</a>";
}
print '</td>';
print "</tr>\n";
$total += $obj->total_ttc; $total += $obj->total_ttc;
$var=!$var; $var=!$var;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment