FIX status on tooltip on widgets
This commit is contained in:
parent
4cf2d2317f
commit
753b1d1e11
@ -93,7 +93,7 @@ class box_factures extends ModeleBoxes
|
||||
$sql .= ", f.tva as total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.datef as df";
|
||||
$sql .= ", f.paye, f.fk_statut, f.datec, f.tms";
|
||||
$sql .= ", f.paye, f.fk_statut as status, f.datec, f.tms";
|
||||
$sql .= ", f.date_lim_reglement as datelimite";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
@ -131,8 +131,10 @@ class box_factures extends ModeleBoxes
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
$facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite);
|
||||
$facturestatic->alreadypaid = $objp->paye;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
@ -181,7 +183,7 @@ class box_factures extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 3),
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->paye),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -86,6 +86,8 @@ class box_factures_fourn extends ModeleBoxes
|
||||
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
@ -93,7 +95,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$sql .= ", f.total_ht";
|
||||
$sql .= ", f.total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut";
|
||||
$sql .= ", f.paye, f.fk_statut as status";
|
||||
$sql .= ', f.datef as df';
|
||||
$sql .= ', f.datec as datec';
|
||||
$sql .= ', f.date_lim_reglement as datelimite, f.tms, f.type';
|
||||
@ -118,6 +120,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$datelimite = $this->db->jdate($objp->datelimite);
|
||||
$date = $this->db->jdate($objp->df);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
@ -128,7 +131,8 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->date_echeance = $datelimite;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
$facturestatic->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
@ -182,7 +186,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 3, $alreadypaid, $objp->type),
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -82,6 +82,8 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
@ -90,13 +92,13 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$sql .= ", f.total_ht as total_ht";
|
||||
$sql .= ", f.tva as total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut, f.type";
|
||||
$sql .= ", f.paye, f.fk_statut as status, f.type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ",".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity = ".$conf->entity;
|
||||
$sql .= " AND f.paye=0";
|
||||
$sql .= " AND f.paye = 0";
|
||||
$sql .= " AND fk_statut = 1";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||
@ -126,7 +128,8 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->date_echeance = $datelimite;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
@ -173,7 +176,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 3, $alreadypaid, $objp->type),
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -98,7 +98,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
$sql .= ", f.total as total_ht";
|
||||
$sql .= ", f.tva as total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut, f.rowid as facid";
|
||||
$sql .= ", f.paye, f.fk_statut as status, f.rowid as facid";
|
||||
$sql .= ", sum(pf.amount) as am";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -136,8 +136,10 @@ class box_factures_imp extends ModeleBoxes
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
$facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite);
|
||||
$facturestatic->alreadypaid = $objp->paye;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
@ -186,7 +188,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 3, $objp->am),
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->am),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -82,7 +82,7 @@ class box_ficheinter extends ModeleBoxes
|
||||
|
||||
if (!empty($user->rights->ficheinter->lire))
|
||||
{
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut";
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut as status";
|
||||
$sql .= ", f.datec";
|
||||
$sql .= ", f.date_valid as datev";
|
||||
$sql .= ", f.tms as datem";
|
||||
@ -113,7 +113,8 @@ class box_ficheinter extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
|
||||
$ficheinterstatic->statut = $objp->fk_statut;
|
||||
$ficheinterstatic->statut = $objp->status;
|
||||
$ficheinterstatic->status = $objp->status;
|
||||
$ficheinterstatic->id = $objp->rowid;
|
||||
$ficheinterstatic->ref = $objp->ref;
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ class box_propales extends ModeleBoxes
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms";
|
||||
$sql .= ", p.rowid, p.ref, p.fk_statut as status, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -121,6 +121,8 @@ class box_propales extends ModeleBoxes
|
||||
$propalstatic->total_ht = $objp->total_ht;
|
||||
$propalstatic->total_tva = $objp->total_tva;
|
||||
$propalstatic->total_ttc = $objp->total_ttc;
|
||||
$propalstatic->statut = $objp->status;
|
||||
$propalstatic->status = $objp->status;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
@ -133,7 +135,7 @@ class box_propales extends ModeleBoxes
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
$late = '';
|
||||
if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->propal->cloture->warning_delay)) {
|
||||
if ($objp->status == 1 && $dateterm < ($now - $conf->propal->cloture->warning_delay)) {
|
||||
$late = img_warning($langs->trans("Late"));
|
||||
}
|
||||
|
||||
@ -162,7 +164,7 @@ class box_propales extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $propalstatic->LibStatut($objp->fk_statut, 3),
|
||||
'text' => $propalstatic->LibStatut($objp->status, 3),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -90,7 +90,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
$sql .= ", c.total_ht";
|
||||
$sql .= ", c.tva as total_tva";
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.fk_statut";
|
||||
$sql .= ", c.fk_statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -115,6 +115,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
|
||||
$supplierorderstatic->id = $objp->rowid;
|
||||
$supplierorderstatic->ref = $objp->ref;
|
||||
$supplierorderstatic->statut = $objp->status;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
@ -150,7 +151,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $supplierorderstatic->LibStatut($objp->fk_statut, 3),
|
||||
'text' => $supplierorderstatic->LibStatut($objp->status, 3),
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
||||
@ -90,7 +90,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
$sql .= ", c.total_ht";
|
||||
$sql .= ", c.tva as total_tva";
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.fk_statut";
|
||||
$sql .= ", c.fk_statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -115,11 +115,10 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
$delivery_date = $this->db->jdate($objp->delivery_date);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$supplierorderstatic->delivery_date = $delivery_date;
|
||||
$supplierorderstatic->statut = $objp->fk_statut;
|
||||
|
||||
$supplierorderstatic->id = $objp->rowid;
|
||||
$supplierorderstatic->ref = $objp->ref;
|
||||
$supplierorderstatic->delivery_date = $delivery_date;
|
||||
$supplierorderstatic->statut = $objp->status;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
|
||||
@ -485,6 +485,10 @@ abstract class CommonObject
|
||||
*/
|
||||
public $sendtoid;
|
||||
|
||||
/**
|
||||
* @var float Amount already paid (used to show correct status)
|
||||
*/
|
||||
public $alreadypaid;
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
|
||||
@ -3272,7 +3272,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'help', 'holiday',
|
||||
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot',
|
||||
'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next',
|
||||
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
|
||||
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billr', 'object_billd', 'object_bom',
|
||||
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
|
||||
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
||||
@ -3312,7 +3312,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
|
||||
$arrayconvpictotofa = array(
|
||||
'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book',
|
||||
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'cubes',
|
||||
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'cubes',
|
||||
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
|
||||
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
|
||||
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
|
||||
@ -3381,7 +3381,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$arrayconvpictotomorcess = array(
|
||||
'action'=>'infobox-action', 'account'=>'infobox-bank_account', 'accountline'=>'infobox-bank_account', 'accountancy'=>'infobox-bank_account',
|
||||
'bank_account'=>'bg-infobox-bank_account',
|
||||
'bill'=>'infobox-commande', 'billa'=>'infobox-commande', 'billd'=>'infobox-commande',
|
||||
'bill'=>'infobox-commande', 'billa'=>'infobox-commande', 'billr'=>'infobox-commande', 'billd'=>'infobox-commande',
|
||||
'cash-register'=>'infobox-bank_account', 'contract'=>'infobox-contrat', 'check'=>'font-status4', 'conversation'=>'infobox-contrat',
|
||||
'donation'=>'infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'infobox-action',
|
||||
'hrm'=>'infobox-adherent', 'group'=>'infobox-adherent', 'intervention'=>'infobox-contrat',
|
||||
|
||||
@ -2299,6 +2299,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("InvoiceReplace").'</u>';
|
||||
elseif ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
|
||||
elseif ($this->type == self::TYPE_DEPOSIT) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("Deposit").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$alreadypaid = -1;
|
||||
$label .= ' '.$this->getLibStatut(5, $alreadypaid);
|
||||
}
|
||||
if (!empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (!empty($this->ref_supplier))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user