Modif look page propal compta
This commit is contained in:
parent
93194643f1
commit
3af2f86bf2
@ -579,7 +579,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
print '<a class="butAction" href="facture.php?propalid='.$propal->id."&action=create\">".$langs->trans("BuildBill")."</a>";
|
print '<a class="butAction" href="facture.php?propalid='.$propal->id."&action=create\">".$langs->trans("BuildBill")."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->statut == 2 && sizeof($propal->facture_liste_array()))
|
if ($obj->statut == 2 && sizeof($propal->getFactureListeArray()))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4\">".$langs->trans("ClassifyBilled")."</a>";
|
print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4\">".$langs->trans("ClassifyBilled")."</a>";
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$html->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
$somethingshown=$html->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -618,7 +618,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
$staticcommande=new Commande($db);
|
$staticcommande=new Commande($db);
|
||||||
|
|
||||||
$total=0;
|
$total=0;
|
||||||
print '<br>';
|
if ($somethingshown) { print '<br>'; $somethingshown=1; }
|
||||||
print_titre($langs->trans('RelatedOrders'));
|
print_titre($langs->trans('RelatedOrders'));
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -655,7 +655,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
{
|
{
|
||||||
$num_fac_asso = $db->num_rows($resql);
|
$num_fac_asso = $db->num_rows($resql);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
print "<br>";
|
if ($somethingshown) { print '<br>'; $somethingshown=1; }
|
||||||
if ($num_fac_asso > 1) print_titre($langs->trans("RelatedBills"));
|
if ($num_fac_asso > 1) print_titre($langs->trans("RelatedBills"));
|
||||||
else print_titre($langs->trans("RelatedBill"));
|
else print_titre($langs->trans("RelatedBill"));
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -1263,15 +1263,26 @@ class Propal
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoie un tableau contenant les numéros de factures associées
|
* \brief Renvoie un tableau contenant les numéros de factures associées
|
||||||
|
* \return array Tableau des id de factures
|
||||||
*/
|
*/
|
||||||
function facture_liste_array ()
|
function getFactureListeArray ()
|
||||||
|
{
|
||||||
|
return $this->FactureListeArray($this->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie un tableau contenant les numéros de factures associées
|
||||||
|
* \param id Id propal
|
||||||
|
* \return array Tableau des id de factures
|
||||||
|
*/
|
||||||
|
function FactureListeArray($id)
|
||||||
{
|
{
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT fk_facture FROM ".MAIN_DB_PREFIX."fa_pr as fp";
|
$sql = "SELECT fk_facture FROM ".MAIN_DB_PREFIX."fa_pr as fp";
|
||||||
$sql .= " WHERE fk_propal = " . $this->id;
|
$sql .= " WHERE fk_propal = " . $id;
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$nump = $this->db->num_rows();
|
$nump = $this->db->num_rows();
|
||||||
|
|
||||||
@ -1290,7 +1301,7 @@ class Propal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1567,7 +1578,7 @@ class Propal
|
|||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
$this->nbtodo=$this->nbtodolate=0;
|
$this->nbtodo=$this->nbtodolate=0;
|
||||||
$sql ="SELECT p.rowid,".$this->db->pdate("p.datec")." as datec,".$this->db->pdate("p.fin_validite")." as datefin";
|
$sql ="SELECT p.rowid, p.ref, ".$this->db->pdate("p.datec")." as datec,".$this->db->pdate("p.fin_validite")." as datefin";
|
||||||
if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."propal as p";
|
$sql.=" FROM ".MAIN_DB_PREFIX."propal as p";
|
||||||
if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -1581,7 +1592,13 @@ class Propal
|
|||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$this->nbtodo++;
|
$this->nbtodo++;
|
||||||
if ($obj->datefin < (time() - $conf->propal->cloture->warning_delay)) $this->nbtodolate++;
|
if ($obj->datefin < (time() - $conf->propal->cloture->warning_delay))
|
||||||
|
{
|
||||||
|
if ($mode == 'opened') $this->nbtodolate++;
|
||||||
|
if ($mode == 'signed') $this->nbtodolate++;
|
||||||
|
// \todo Definir règle des propales à facturer en retard
|
||||||
|
// if ($mode == 'signed' && ! sizeof($this->FactureListeArray($obj->rowid))) $this->nbtodolate++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user