adress feedback + massive cleanup
This commit is contained in:
parent
49d009502c
commit
d2903c5de6
@ -53,8 +53,7 @@ $bid = GETPOST('bid', 'int');
|
|||||||
|
|
||||||
// Securite acces client
|
// Securite acces client
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if (isset($user->socid) && $user->socid > 0)
|
if (isset($user->socid) && $user->socid > 0) {
|
||||||
{
|
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
@ -85,48 +84,39 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
|
|||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo
|
||||||
{
|
|
||||||
// Search proposal
|
// Search proposal
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_proposal'] = array('text'=>'Proposal');
|
$listofsearchfields['search_proposal'] = array('text'=>'Proposal');
|
||||||
}
|
}
|
||||||
// Search customer order
|
// Search customer order
|
||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder');
|
$listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder');
|
||||||
}
|
}
|
||||||
// Search supplier proposal
|
// Search supplier proposal
|
||||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire)
|
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
|
$listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
|
||||||
}
|
}
|
||||||
// Search supplier order
|
// Search supplier order
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
|
$listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
|
||||||
}
|
}
|
||||||
// Search intervention
|
// Search intervention
|
||||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
|
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_intervention'] = array('text'=>'Intervention');
|
$listofsearchfields['search_intervention'] = array('text'=>'Intervention');
|
||||||
}
|
}
|
||||||
// Search contract
|
// Search contract
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||||
{
|
|
||||||
$listofsearchfields['search_contract'] = array('text'=>'Contract');
|
$listofsearchfields['search_contract'] = array('text'=>'Contract');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($listofsearchfields))
|
if (count($listofsearchfields)) {
|
||||||
{
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($listofsearchfields as $key => $value)
|
foreach ($listofsearchfields as $key => $value) {
|
||||||
{
|
|
||||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr '.$bc[false].'>';
|
||||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||||
@ -145,8 +135,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
/*
|
/*
|
||||||
* Draft customer proposals
|
* Draft customer proposals
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||||
{
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
@ -164,31 +153,25 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
StartSimpleTableHeader("ProposalsDraft", "comm/propal/list.php", "search_status=0", 2, $num);
|
|
||||||
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("ProposalsDraft", "comm/propal/list.php", "search_status=0", 2, $num);
|
||||||
{
|
|
||||||
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $nbofloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$propalstatic->id = $obj->rowid;
|
$propalstatic->id = $obj->rowid;
|
||||||
$propalstatic->ref = $obj->ref;
|
$propalstatic->ref = $obj->ref;
|
||||||
$propalstatic->ref_client = $obj->ref_client;
|
$propalstatic->ref_client = $obj->ref_client;
|
||||||
$propalstatic->total_ht = $obj->total_ht;
|
$propalstatic->total_ht = $obj->total_ht;
|
||||||
$propalstatic->total_tva = $obj->total_tva;
|
$propalstatic->total_tva = $obj->total_tva;
|
||||||
$propalstatic->total_ttc = $obj->total_ttc;
|
$propalstatic->total_ttc = $obj->total_ttc;
|
||||||
print $propalstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$companystatic->id = $obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name = $obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->client = $obj->client;
|
$companystatic->client = $obj->client;
|
||||||
@ -198,24 +181,20 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
$companystatic->entity = $obj->entity;
|
$companystatic->entity = $obj->entity;
|
||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
$companystatic->code_compta = $obj->code_compta;
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
print $companystatic->getNomUrl(1, 'customer', 16);
|
|
||||||
print '</td>';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
|
print '<td class="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
|
||||||
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 16).'</td>';
|
||||||
|
print '<td class="nowrap right">'.price($obj->total_ht).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ht;
|
$total += $obj->total_ht;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="2" class="right">'.$langs->trans("Total").'</td><td class="right">'.price($total)."</td></tr>";
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table></div><br>";
|
|
||||||
|
|
||||||
|
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
|
||||||
|
finishSimpleTable(true);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -223,12 +202,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draft supplier proposals
|
* Draft supplier proposals
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire)
|
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
||||||
{
|
|
||||||
$langs->load("supplier_proposal");
|
$langs->load("supplier_proposal");
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
@ -246,30 +223,24 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
StartSimpleTableHeader("SupplierProposalsDraft", "supplier_proposal/list.php", "search_status=0", 2, $num);
|
|
||||||
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("SupplierProposalsDraft", "supplier_proposal/list.php", "search_status=0", 2, $num);
|
||||||
{
|
|
||||||
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $nbofloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$supplierproposalstatic->id = $obj->rowid;
|
$supplierproposalstatic->id = $obj->rowid;
|
||||||
$supplierproposalstatic->ref = $obj->ref;
|
$supplierproposalstatic->ref = $obj->ref;
|
||||||
$supplierproposalstatic->total_ht = $obj->total_ht;
|
$supplierproposalstatic->total_ht = $obj->total_ht;
|
||||||
$supplierproposalstatic->total_tva = $obj->total_tva;
|
$supplierproposalstatic->total_tva = $obj->total_tva;
|
||||||
$supplierproposalstatic->total_ttc = $obj->total_ttc;
|
$supplierproposalstatic->total_ttc = $obj->total_ttc;
|
||||||
print $supplierproposalstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$companystatic->id = $obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name = $obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->client = $obj->client;
|
$companystatic->client = $obj->client;
|
||||||
@ -278,24 +249,20 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||||||
$companystatic->canvas = $obj->canvas;
|
$companystatic->canvas = $obj->canvas;
|
||||||
$companystatic->entity = $obj->entity;
|
$companystatic->entity = $obj->entity;
|
||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
print $companystatic->getNomUrl(1, 'supplier', 16);
|
|
||||||
print '</td>';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
|
print '<td class="nowrap">'.$supplierproposalstatic->getNomUrl(1).'</td>';
|
||||||
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 16).'</td>';
|
||||||
|
print '<td class="nowrap right">'.price($obj->total_ht).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ht;
|
$total += $obj->total_ht;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table></div><br>";
|
|
||||||
|
|
||||||
|
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
|
||||||
|
finishSimpleTable(true);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -306,8 +273,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||||||
/*
|
/*
|
||||||
* Draft customer orders
|
* Draft customer orders
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
{
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
@ -325,30 +291,25 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
StartSimpleTableHeader("DraftOrders", "commande/list.php", "search_status=0", 2, $num);
|
|
||||||
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("DraftOrders", "commande/list.php", "search_status=0", 2, $num);
|
||||||
{
|
|
||||||
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $nbofloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$orderstatic->id = $obj->rowid;
|
$orderstatic->id = $obj->rowid;
|
||||||
$orderstatic->ref = $obj->ref;
|
$orderstatic->ref = $obj->ref;
|
||||||
$orderstatic->ref_client = $obj->ref_client;
|
$orderstatic->ref_client = $obj->ref_client;
|
||||||
$orderstatic->total_ht = $obj->total_ht;
|
$orderstatic->total_ht = $obj->total_ht;
|
||||||
$orderstatic->total_tva = $obj->total_tva;
|
$orderstatic->total_tva = $obj->total_tva;
|
||||||
$orderstatic->total_ttc = $obj->total_ttc;
|
$orderstatic->total_ttc = $obj->total_ttc;
|
||||||
print $orderstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$companystatic->id = $obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name = $obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->client = $obj->client;
|
$companystatic->client = $obj->client;
|
||||||
@ -357,29 +318,20 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
$companystatic->canvas = $obj->canvas;
|
$companystatic->canvas = $obj->canvas;
|
||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
$companystatic->entity = $obj->entity;
|
$companystatic->entity = $obj->entity;
|
||||||
print $companystatic->getNomUrl(1, 'customer', 16);
|
|
||||||
print '</td>';
|
print '<tr class="oddeven">';
|
||||||
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
|
print '<td class="nowrap">'.$orderstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 16).'</td>';
|
||||||
} else {
|
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td></tr>';
|
print '</tr>';
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoOrder").'</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
|
|
||||||
|
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
|
||||||
|
finishSimpleTable(true);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -390,8 +342,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
/*
|
/*
|
||||||
* Draft suppliers orders
|
* Draft suppliers orders
|
||||||
*/
|
*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||||
{
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
@ -409,30 +360,25 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
if ($socid) $sql .= " AND cf.fk_soc = ".$socid;
|
if ($socid) $sql .= " AND cf.fk_soc = ".$socid;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
StartSimpleTableHeader("DraftSuppliersOrders", "fourn/commande/list.php", "search_status=0", 2, $num);
|
|
||||||
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("DraftSuppliersOrders", "fourn/commande/list.php", "search_status=0", 2, $num);
|
||||||
{
|
|
||||||
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $nbofloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$supplierorderstatic->id = $obj->rowid;
|
$supplierorderstatic->id = $obj->rowid;
|
||||||
$supplierorderstatic->ref = $obj->ref;
|
$supplierorderstatic->ref = $obj->ref;
|
||||||
$supplierorderstatic->ref_supplier = $obj->ref_suppliert;
|
$supplierorderstatic->ref_supplier = $obj->ref_suppliert;
|
||||||
$supplierorderstatic->total_ht = $obj->total_ht;
|
$supplierorderstatic->total_ht = $obj->total_ht;
|
||||||
$supplierorderstatic->total_tva = $obj->total_tva;
|
$supplierorderstatic->total_tva = $obj->total_tva;
|
||||||
$supplierorderstatic->total_ttc = $obj->total_ttc;
|
$supplierorderstatic->total_ttc = $obj->total_ttc;
|
||||||
print $supplierorderstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$companystatic->id = $obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name = $obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->client = $obj->client;
|
$companystatic->client = $obj->client;
|
||||||
@ -441,47 +387,34 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$companystatic->canvas = $obj->canvas;
|
$companystatic->canvas = $obj->canvas;
|
||||||
$companystatic->entity = $obj->entity;
|
$companystatic->entity = $obj->entity;
|
||||||
$companystatic->email = $obj->email;
|
$companystatic->email = $obj->email;
|
||||||
print $companystatic->getNomUrl(1, 'supplier', 16);
|
|
||||||
print '</td>';
|
print '<tr class="oddeven">';
|
||||||
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
|
print '<td class="nowrap">'.$supplierorderstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 16).'</td>';
|
||||||
} else {
|
print '<td class="nowrap right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc).'</td></tr>';
|
print '</tr>';
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoSupplierOrder").'</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
|
|
||||||
|
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
|
||||||
|
finishSimpleTable(true);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
$max = 3;
|
$max = 3;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last modified customers or prospects
|
* Last modified customers or prospects
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
|
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||||
{
|
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
|
|
||||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
||||||
@ -499,28 +432,26 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
|
|||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
||||||
$num = $db->num_rows($resql);
|
$header = "BoxTitleLastCustomersOrProspects";
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
|
||||||
{
|
|
||||||
StartSimpleTableHeader($langs->trans("BoxTitleLastCustomersOrProspects", min($max, $num)), "societe/list.php", "type=p,c", 1);
|
|
||||||
}
|
}
|
||||||
elseif (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
elseif (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
||||||
{
|
$header = "BoxTitleLastModifiedProspects";
|
||||||
StartSimpleTableHeader($langs->trans("BoxTitleLastModifiedProspects", min($max, $num)), "societe/list.php", "type=p,c", 1);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
StartSimpleTableHeader($langs->trans("BoxTitleLastModifiedCustomers", min($max, $num)), "societe/list.php", "type=p,c", 1);
|
$header = "BoxTitleLastModifiedCustomers";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($num)
|
$num = $db->num_rows($resql);
|
||||||
{
|
startSimpleTable($langs->trans($header, min($max, $num)), "societe/list.php", "type=p,c", 1);
|
||||||
while ($i < $num)
|
|
||||||
{
|
if ($num) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $num && $i < $max) {
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$companystatic->id = $objp->rowid;
|
$companystatic->id = $objp->rowid;
|
||||||
$companystatic->name = $objp->name;
|
$companystatic->name = $objp->name;
|
||||||
$companystatic->client = $objp->client;
|
$companystatic->client = $objp->client;
|
||||||
@ -530,28 +461,30 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
|
|||||||
$companystatic->code_compta = $objp->code_compta;
|
$companystatic->code_compta = $objp->code_compta;
|
||||||
$companystatic->entity = $objp->entity;
|
$companystatic->entity = $objp->entity;
|
||||||
$companystatic->email = $objp->email;
|
$companystatic->email = $objp->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 48).'</td>';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 48).'</td>';
|
||||||
print '<td class="right" nowrap>';
|
print '<td class="right" nowrap>'.$companystatic->getLibCustProspStatut().'</td>';
|
||||||
print $companystatic->getLibCustProspStatut();
|
print '<td class="right" nowrap>'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
|
||||||
print "</td>";
|
|
||||||
print '<td class="right" nowrap>'.dol_print_date($db->jdate($objp->tms), 'day')."</td>";
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addSummaryTableLine(3, $num);
|
||||||
|
finishSimpleTable(true);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
dol_print_error($db);
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last suppliers
|
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire)
|
/*
|
||||||
{
|
* Last suppliers
|
||||||
|
*/
|
||||||
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
|
|
||||||
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
||||||
@ -567,19 +500,16 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$sql .= " ORDER BY s.datec DESC";
|
$sql .= " ORDER BY s.datec DESC";
|
||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($result)
|
if ($resql) {
|
||||||
{
|
$num = $db->num_rows($resql);
|
||||||
$num = $db->num_rows($result);
|
startSimpleTable($langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)), "societe/list.php", "type=f");
|
||||||
|
|
||||||
|
if ($num) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
while ($i < $num && $i < $max) {
|
||||||
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
StartSimpleTableHeader($langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)), "societe/list.php", "type=f");
|
|
||||||
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
while ($i < $num && $i < $max)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$companystatic->id = $objp->rowid;
|
$companystatic->id = $objp->rowid;
|
||||||
$companystatic->name = $objp->name;
|
$companystatic->name = $objp->name;
|
||||||
$companystatic->code_client = $objp->code_client;
|
$companystatic->code_client = $objp->code_client;
|
||||||
@ -587,6 +517,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$companystatic->canvas = $objp->canvas;
|
$companystatic->canvas = $objp->canvas;
|
||||||
$companystatic->entity = $objp->entity;
|
$companystatic->entity = $objp->entity;
|
||||||
$companystatic->email = $objp->email;
|
$companystatic->email = $objp->email;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 44).'</td>';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 44).'</td>';
|
||||||
print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
|
||||||
@ -594,11 +525,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
|
||||||
}
|
}
|
||||||
print '</table>';
|
|
||||||
print '</div><br>';
|
addSummaryTableLine(2, $num);
|
||||||
|
finishSimpleTable(true);
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,8 +539,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
/*
|
/*
|
||||||
* Last actions
|
* Last actions
|
||||||
*/
|
*/
|
||||||
if ($user->rights->agenda->myactions->read)
|
if ($user->rights->agenda->myactions->read) {
|
||||||
{
|
|
||||||
show_array_last_actions_done($max);
|
show_array_last_actions_done($max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,8 +547,7 @@ if ($user->rights->agenda->myactions->read)
|
|||||||
/*
|
/*
|
||||||
* Actions to do
|
* Actions to do
|
||||||
*/
|
*/
|
||||||
if ($user->rights->agenda->myactions->read)
|
if ($user->rights->agenda->myactions->read) {
|
||||||
{
|
|
||||||
show_array_actions_to_do(10);
|
show_array_actions_to_do(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,8 +555,7 @@ if ($user->rights->agenda->myactions->read)
|
|||||||
/*
|
/*
|
||||||
* Latest contracts
|
* Latest contracts
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
|
||||||
{
|
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
|
||||||
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
|
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
|
||||||
@ -646,23 +576,17 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TOD
|
|||||||
$sql .= $db->plimit(5, 0);
|
$sql .= $db->plimit(5, 0);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
startSimpleTable($langs->trans("LastContracts", 5), "", "", 2);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0) {
|
||||||
{
|
|
||||||
StartSimpleTableHeader($langs->trans("LastContracts", 5), "", "", 2);
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$staticcontrat = new Contrat($db);
|
$staticcontrat = new Contrat($db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"), "contract")." ".$obj->ref."</a></td>';
|
|
||||||
print '<td>';
|
|
||||||
$companystatic->id = $objp->rowid;
|
$companystatic->id = $objp->rowid;
|
||||||
$companystatic->name = $objp->name;
|
$companystatic->name = $objp->name;
|
||||||
$companystatic->code_client = $objp->code_client;
|
$companystatic->code_client = $objp->code_client;
|
||||||
@ -670,25 +594,30 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TOD
|
|||||||
$companystatic->canvas = $objp->canvas;
|
$companystatic->canvas = $objp->canvas;
|
||||||
$companystatic->entity = $objp->entity;
|
$companystatic->entity = $objp->entity;
|
||||||
$companystatic->email = $objp->email;
|
$companystatic->email = $objp->email;
|
||||||
print $companystatic->getNomUrl(1, 'customer', 44);
|
|
||||||
print '</td>'."\n";
|
print '<tr class="oddeven">';
|
||||||
print "<td class=\"right\">".$staticcontrat->LibStatut($obj->statut, 3)."</td></tr>\n";
|
print '<td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"), "contract")." ".$obj->ref."</a></td>';
|
||||||
|
print '<td>'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||||
|
print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSummaryTableLine(2, $num);
|
||||||
|
finishSimpleTable(true);
|
||||||
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Opened proposals
|
* Opened proposals
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||||
{
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
|
|
||||||
$sql = "SELECT s.nom as name, s.rowid, s.code_client";
|
$sql = "SELECT s.nom as name, s.rowid, s.code_client";
|
||||||
@ -705,25 +634,18 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
$sql .= " ORDER BY p.rowid DESC";
|
$sql .= " ORDER BY p.rowid DESC";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($result)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
StartSimpleTableHeader("ProposalsOpened", "comm/propal/list.php", "search_status=1", 4, $num);
|
|
||||||
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("ProposalsOpened", "comm/propal/list.php", "search_status=1", 4, $num);
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
// Ref
|
while ($i < $nbofloop) {
|
||||||
print '<td class="nowrap" width="140">';
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$propalstatic->id = $obj->propalid;
|
$propalstatic->id = $obj->propalid;
|
||||||
$propalstatic->ref = $obj->ref;
|
$propalstatic->ref = $obj->ref;
|
||||||
@ -732,6 +654,19 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
$propalstatic->total_tva = $obj->total_tva;
|
$propalstatic->total_tva = $obj->total_tva;
|
||||||
$propalstatic->total_ttc = $obj->total_ttc;
|
$propalstatic->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
$companystatic->id = $obj->rowid;
|
||||||
|
$companystatic->name = $obj->name;
|
||||||
|
$companystatic->client = $obj->client;
|
||||||
|
$companystatic->code_client = $obj->code_client;
|
||||||
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$companystatic->canvas = $obj->canvas;
|
||||||
|
$companystatic->entity = $obj->entity;
|
||||||
|
$companystatic->email = $obj->email;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<td class="nowrap" width="140">';
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $propalstatic->getNomUrl(1);
|
print $propalstatic->getNomUrl(1);
|
||||||
@ -745,52 +680,33 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||||
$companystatic->id = $obj->rowid;
|
print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
|
||||||
$companystatic->name = $obj->name;
|
print '<td class="right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
$companystatic->client = $obj->client;
|
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
print '</tr>';
|
||||||
$companystatic->canvas = $obj->canvas;
|
|
||||||
$companystatic->entity = $obj->entity;
|
|
||||||
$companystatic->email = $obj->email;
|
|
||||||
print $companystatic->getNomUrl(1, 'customer', 44);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="right">';
|
|
||||||
print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
|
||||||
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
|
|
||||||
print '<td class="right">'.price($obj->total_ht).'</td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
|
||||||
}
|
|
||||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
|
|
||||||
print '</tr>'."\n";
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="5" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td> </td></tr>";
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSummaryTableLine(5, $num, $nbofloop, $total, "NoProposal", true);
|
||||||
|
finishSimpleTable(true);
|
||||||
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Opened Order
|
* Opened Order
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
{
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||||
@ -807,25 +723,18 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
$sql .= " ORDER BY c.rowid DESC";
|
$sql .= " ORDER BY c.rowid DESC";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($result)
|
if ($resql) {
|
||||||
{
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
|
||||||
StartSimpleTableHeader("OrdersOpened", "commande/list.php", "search_status=1", 4, $num);
|
|
||||||
|
|
||||||
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||||
while ($i < $nbofloop)
|
startSimpleTable("OrdersOpened", "commande/list.php", "search_status=1", 4, $num);
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
if ($num > 0) {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
// Ref
|
while ($i < $nbofloop) {
|
||||||
print '<td class="nowrap" width="140">';
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$orderstatic->id = $obj->commandeid;
|
$orderstatic->id = $obj->commandeid;
|
||||||
$orderstatic->ref = $obj->ref;
|
$orderstatic->ref = $obj->ref;
|
||||||
@ -834,6 +743,19 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
$orderstatic->total_tva = $obj->total_tva;
|
$orderstatic->total_tva = $obj->total_tva;
|
||||||
$orderstatic->total_ttc = $obj->total_ttc;
|
$orderstatic->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
$companystatic->id = $obj->rowid;
|
||||||
|
$companystatic->name = $obj->name;
|
||||||
|
$companystatic->client = $obj->client;
|
||||||
|
$companystatic->code_client = $obj->code_client;
|
||||||
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$companystatic->canvas = $obj->canvas;
|
||||||
|
$companystatic->entity = $obj->entity;
|
||||||
|
$companystatic->email = $obj->email;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<td class="nowrap" width="140">';
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $orderstatic->getNomUrl(1);
|
print $orderstatic->getNomUrl(1);
|
||||||
@ -847,49 +769,27 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||||
print $formfile->getDocumentsLink($orderstatic->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($orderstatic->element, $filename, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||||
$companystatic->id = $obj->rowid;
|
print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
|
||||||
$companystatic->name = $obj->name;
|
print '<td class="right">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
$companystatic->client = $obj->client;
|
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
$companystatic->canvas = $obj->canvas;
|
|
||||||
$companystatic->entity = $obj->entity;
|
|
||||||
$companystatic->email = $obj->email;
|
|
||||||
print $companystatic->getNomUrl(1, 'customer', 44);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="right">';
|
|
||||||
print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
|
||||||
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
|
|
||||||
print '<td class="right">'.price($obj->total_ht).'</td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
|
||||||
}
|
|
||||||
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>'."\n";
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
if ($num > $nbofloop)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="5" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
|
|
||||||
} elseif ($total > 0)
|
|
||||||
{
|
|
||||||
print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td> </td></tr>";
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
print "</div><br>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSummaryTableLine(5, $num, $nbofloop, $num, $total, "None", true);
|
||||||
|
finishSimpleTable(true);
|
||||||
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
$parameters = array('user' => $user);
|
$parameters = array('user' => $user);
|
||||||
|
|||||||
@ -8673,7 +8673,9 @@ function currentToken()
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a table with headers and a optinal clickable number
|
* Start a table with headers and a optinal clickable number
|
||||||
* (don't forget to close the table with a HTML TABLE and a HTML DIV element)
|
* (don't forget to use "finishSimpleTable()" after the last table row)
|
||||||
|
*
|
||||||
|
* @see finishSimpleTable
|
||||||
*
|
*
|
||||||
* @param string $header The first left header of the table (automatic translated)
|
* @param string $header The first left header of the table (automatic translated)
|
||||||
* @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/")
|
* @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/")
|
||||||
@ -8682,7 +8684,7 @@ function currentToken()
|
|||||||
* @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList"
|
* @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList"
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function StartSimpleTableHeader($header, $link = "", $arguments = "", $emptyRows = 0, $number = -1)
|
function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0, $number = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -8733,3 +8735,69 @@ function StartSimpleTableHeader($header, $link = "", $arguments = "", $emptyRows
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct HTML close tags for "startSimpleTable(...)"
|
||||||
|
* (use after the last table line)
|
||||||
|
*
|
||||||
|
* @see startSimpleTable
|
||||||
|
*
|
||||||
|
* @param bool $addLineBreak (optional) Add a extra line break after the complete table (\<br\>)
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function finishSimpleTable($addLineBreak = false)
|
||||||
|
{
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if($addLineBreak) {
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addSummaryTableLine($tableColumnCount, $num, $nbofloop = 0, $total = 0, $noneWord = "None", $extraRightColumn = false)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
if($num === 0) {
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td colspan="'.$tableColumnCount.'" class="opacitymedium">'.$langs->trans($noneWord ).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($nbofloop === 0)
|
||||||
|
{
|
||||||
|
// don't show a summary line
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($num === 0) {
|
||||||
|
$colspan = $tableColumnCount;
|
||||||
|
}
|
||||||
|
elseif ($num > $nbofloop) {
|
||||||
|
$colspan = $tableColumnCount;
|
||||||
|
} else {
|
||||||
|
$colspan = $tableColumnCount - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($extraRightColumn) {
|
||||||
|
$colspan--;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
|
||||||
|
if($nbofloop > 0 && $num > $nbofloop) {
|
||||||
|
print '<td colspan="'.$colspan.'" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop)).'</td>';
|
||||||
|
} else {
|
||||||
|
print '<td colspan="'.$colspan.'" class="right"> '.$langs->trans("Total").'</td>';
|
||||||
|
print '<td class="right" width="100">'.price($total).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($extraRightColumn) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user