';
- print '';
+ print '';
- print '| '.$langs->trans("Name").' | '.$societe->nom.' | ';
+ print '| '.$langs->trans("Name").' | '.$societe->nom.' | ';
- // Prefix
- print '| '.$langs->trans("Prefix").' | ';
- print ($societe->prefix_comm?$societe->prefix_comm:' ');
- print ' | ';
+ // Prefix
+ print ' | '.$langs->trans("Prefix").' | ';
+ print ($societe->prefix_comm?$societe->prefix_comm:' ');
+ print ' | ';
- if ($societe->client)
- {
- print ' ';
- print '| '.$langs->trans("CustomerCode"). ' | '. $societe->code_client . ' | ';
- print ' ';
- print '';
- print '| '.$langs->trans("CustomerAccountancyCode").' | '.$societe->code_compta.' | ';
- print ' ';
- }
+ if ($societe->client)
+ {
+ print '';
+ print '| '.$langs->trans("CustomerCode"). ' | '. $societe->code_client . ' | ';
+ print ' ';
+ print '';
+ print '| '.$langs->trans("CustomerAccountancyCode").' | '.$societe->code_compta.' | ';
+ print ' ';
+ }
- if ($societe->fournisseur)
- {
- print '';
- print '| '.$langs->trans("SupplierCode"). ' | '. $societe->code_fournisseur . ' | ';
- print ' ';
- print '';
- print '| '.$langs->trans("SupplierAccountancyCode").' | '.$societe->code_compta_fournisseur.' | ';
- print ' ';
- }
+ if ($societe->fournisseur)
+ {
+ print '';
+ print '| '.$langs->trans("SupplierCode"). ' | '. $societe->code_fournisseur . ' | ';
+ print ' ';
+ print '';
+ print '| '.$langs->trans("SupplierAccountancyCode").' | '.$societe->code_compta_fournisseur.' | ';
+ print ' ';
+ }
- print '| '.$langs->trans("Address").' | '.nl2br($societe->adresse)." | ";
+ print '| '.$langs->trans("Address").' | '.nl2br($societe->adresse)." | ";
- print '| '.$langs->trans('Zip').' | '.$societe->cp.' | ';
- print ''.$langs->trans('Town').' | '.$societe->ville.' | ';
+ print '| '.$langs->trans('Zip').' | '.$societe->cp.' | ';
+ print ''.$langs->trans('Town').' | '.$societe->ville.' | ';
// Country
- print '| '.$langs->trans('Country').' | ';
+ print ' | | '.$langs->trans('Country').' | ';
if ($societe->isInEEC()) print $form->textwithpicto($societe->pays,$langs->trans("CountryIsInEEC"),1,0);
else print $societe->pays;
print ' | ';
// Phone
- print '| '.$langs->trans("Phone").' | '.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').' | ';
+ print ' | '.$langs->trans("Phone").' | '.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').' | ';
- // Fax
- print ''.$langs->trans("Fax").' | '.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id,'AC_FAX').' | ';
+ // Fax
+ print ''.$langs->trans("Fax").' | '.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id,'AC_FAX').' | ';
- // EMail
+ // EMail
print ''.$langs->trans('EMail').' | '.dol_print_email($societe->email,0,$societe->id,'AC_EMAIL').' | ';
- // Web
- print '| '.$langs->trans("Web").' | '.dol_print_url($societe->url,'_blank').' | ';
+ // Web
+ print '| '.$langs->trans("Web").' | '.dol_print_url($societe->url,'_blank').' | ';
// Assujeti a TVA ou pas
print '';
@@ -159,185 +159,185 @@ if ($socid > 0)
print '';
print ' ';
- // TVA Intra
- print '| '.$langs->trans('VATIntraVeryShort').' | ';
- print $societe->tva_intra;
- print ' | ';
+ // TVA Intra
+ print '| '.$langs->trans('VATIntraVeryShort').' | ';
+ print $societe->tva_intra;
+ print ' | ';
- if ($societe->client == 1)
- {
- // Remise permanente
- print '| ';
- print '';
- print ' | '.($societe->remise_client?price2num($societe->remise_client,'MT').'%':$langs->trans("DiscountNone")).' | ';
- print ' ';
+ if ($societe->client == 1)
+ {
+ // Remise permanente
+ print '| ';
+ print '';
+ print ' | '.($societe->remise_client?price2num($societe->remise_client,'MT').'%':$langs->trans("DiscountNone")).' | ';
+ print ' ';
- // Reductions (Discounts-Drawbacks-Rebates)
- print '| ';
- print '';
- print ' | ';
- print '';
+ // Reductions (Discounts-Drawbacks-Rebates)
+ print ' | | ';
+ print '';
+ print ' | ';
+ print '';
$amount_discount=$societe->getAvailableDiscounts();
if ($amount_discount < 0) dol_print_error($db,$societe->error);
- if ($amount_discount > 0) print price($amount_discount).' '.$langs->trans("Currency".$conf->monnaie);
- else print $langs->trans("DiscountNone");
- print ' | ';
- print ' ';
- }
+ if ($amount_discount > 0) print price($amount_discount).' '.$langs->trans("Currency".$conf->monnaie);
+ else print $langs->trans("DiscountNone");
+ print '';
+ print '';
+ }
- print " ";
+ print " ";
- print " | \n";
+ print "\n";
- print '';
+ print ' | ';
- // Nbre max d'elements des petites listes
- $MAXLIST=5;
- $tableaushown=1;
+ // Nbre max d'elements des petites listes
+ $MAXLIST=5;
+ $tableaushown=1;
- // Lien recap
- print '';
- print '';
- print ' | ';
- print ' ';
- print ' ';
- print ' ';
+ // Lien recap
+ print '';
+ print '';
+ print ' | ';
+ print ' ';
+ print ' ';
+ print ' ';
- /*
- * Last invoices
- */
- if ($conf->facture->enabled && $user->rights->facture->lire)
- {
- $facturestatic = new Facture($db);
+ /*
+ * Last invoices
+ */
+ if ($conf->facture->enabled && $user->rights->facture->lire)
+ {
+ $facturestatic = new Facture($db);
- print '';
+ print '';
- $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc';
- $sql.= ', '.$db->pdate("f.datef").' as df, f.paye as paye, f.fk_statut as statut';
- $sql.= ', s.nom, s.rowid as socid';
- $sql.= ', sum(pf.amount) as am';
- $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
- $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
- $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
- $sql.= ' GROUP BY f.rowid';
- $sql.= " ORDER BY f.datef DESC, f.datec DESC";
+ $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
+ $sql.= ' '.$db->pdate("f.datef").' as df, '.$db->pdate("f.datec").' as dc, f.paye as paye, f.fk_statut as statut,';
+ $sql.= ' s.nom, s.rowid as socid,';
+ $sql.= ' sum(pf.amount) as am';
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
+ $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
+ $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.total_ttc, f.datef, f.datec, f.paye, f.fk_statut, s.nom, s.rowid';
+ $sql.= " ORDER BY f.datef DESC, f.datec DESC";
- $resql=$db->query($sql);
- if ($resql)
- {
- $var=true;
- $num = $db->num_rows($resql);
- $i = 0;
- if ($num > 0)
- {
- $tableaushown=1;
- print '';
- print ' | ';
- print ' ';
- }
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $var=true;
+ $num = $db->num_rows($resql);
+ $i = 0;
+ if ($num > 0)
+ {
+ $tableaushown=1;
+ print '';
+ print ' | ';
+ print ' ';
+ }
- while ($i < $num && $i < $MAXLIST)
- {
- $objp = $db->fetch_object($resql);
- $var=!$var;
- print "";
- print '| ';
- $facturestatic->id=$objp->facid;
- $facturestatic->ref=$objp->facnumber;
- $facturestatic->type=$objp->type;
- print $facturestatic->getNomUrl(1);
- print ' | ';
- if ($objp->df > 0)
- {
- print "".dol_print_date($objp->df)." | \n";
- }
- else
- {
- print "!!! | \n";
- }
- print "".price($objp->total_ttc)." | \n";
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $objp = $db->fetch_object($resql);
+ $var=!$var;
+ print " ";
+ print '| ';
+ $facturestatic->id=$objp->facid;
+ $facturestatic->ref=$objp->facnumber;
+ $facturestatic->type=$objp->type;
+ print $facturestatic->getNomUrl(1);
+ print ' | ';
+ if ($objp->df > 0)
+ {
+ print "".dol_print_date($objp->df)." | \n";
+ }
+ else
+ {
+ print "!!! | \n";
+ }
+ print "".price($objp->total_ttc)." | \n";
- print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am))." | \n";
- print " \n";
- $i++;
- }
- $db->free($resql);
- }
- else
- {
- dol_print_error($db);
- }
- print " ";
- }
+ print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am))." | \n";
+ print "\n";
+ $i++;
+ }
+ $db->free($resql);
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ print " ";
+ }
- /*
- * Last project
- */
- if ($conf->projet->enabled && $user->rights->projet->lire)
- {
- print '';
+ /*
+ * Last project
+ */
+ if ($conf->projet->enabled && $user->rights->projet->lire)
+ {
+ print '';
- $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
- $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
- $sql .= " WHERE p.fk_soc = $societe->id";
- $sql .= " ORDER by p.dateo";
+ $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
+ $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
+ $sql .= " WHERE p.fk_soc = $societe->id";
+ $sql .= " ORDER by p.dateo";
- if ( $db->query($sql) )
- {
- $var=true;
- $i = 0 ;
- $num = $db->num_rows();
- if ($num > 0)
- {
- $tableaushown=1;
- print '';
- print ' | ';
- print ' ';
- }
- while ($i < $num && $i < $MAXLIST)
- {
- $obj = $db->fetch_object();
- $var = !$var;
- print "";
- print '| '.img_object($langs->trans("ShowProject"),"project")." ".$obj->title.' | ';
+ if ( $db->query($sql) )
+ {
+ $var=true;
+ $i = 0 ;
+ $num = $db->num_rows();
+ if ($num > 0)
+ {
+ $tableaushown=1;
+ print ' ';
+ print ' | ';
+ print ' ';
+ }
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $obj = $db->fetch_object();
+ $var = !$var;
+ print "";
+ print '| '.img_object($langs->trans("ShowProject"),"project")." ".$obj->title.' | ';
- print "".dol_print_date($obj->do,"day") ." | ";
- $i++;
- }
- $db->free();
- }
- else
- {
- dol_print_error($db);
- }
- print " ";
- }
+ print "".dol_print_date($obj->do,"day") ." | ";
+ $i++;
+ }
+ $db->free();
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ print " ";
+ }
- print " |
";
- print "