diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index b47240b6ac0..eb39379ace0 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -161,7 +161,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $sql.= " ORDER BY dlr ASC"; // Supplier invoices - $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.facnumber as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; + $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; $sql2.= " s.rowid as socid, s.nom, s.fournisseur"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 5fbb2f62a87..458d9a66bca 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ class box_factures_fourn extends ModeleBoxes $now=dol_now(); $i = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; while ($i < $num) { @@ -95,7 +95,7 @@ class box_factures_fourn extends ModeleBoxes $datec=$db->jdate($objp->datec); $late = ''; - if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); + if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index a73ab937e01..3d984757072 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -198,7 +198,7 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur { $object->fetch($id); $object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']); - if ($object->date_echeance < $object->date) + if (! empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance=$object->date; setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings'); diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 0807480361c..0c95236b1d5 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -229,6 +229,6 @@ ALTER TABLE llx_societe ADD COLUMN note_public text after note; ALTER TABLE llx_actioncomm ADD COLUMN transparency integer after fk_user_action; -ALTER TABLE llx_facture_fourn_det ADD COLUMN info_bits integer DEFAULT 0; +ALTER TABLE llx_facture_fourn_det ADD COLUMN info_bits integer DEFAULT 0; INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) VALUES (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29); diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 811f41f64e8..69168ff2425 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -378,12 +378,12 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $modulesfile = array(); foreach ($conf->file->dol_document_root as $type => $dirroot) { - $handlemodule=@opendir($dirroot); + $handlemodule=@opendir($dirroot); // $dirroot may be '..' if (is_resource($handlemodule)) { while (($filemodule = readdir($handlemodule))!==false) { - if (is_dir($dirroot.'/'.$filemodule.'/sql')) + if (! preg_match('/\./',$filemodule) && is_dir($dirroot.'/'.$filemodule.'/sql')) // We exclude filemodule that contains . (are not directories) and are not directories. { //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file; if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file)) diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index e86321c9b2c..42e5dda7636 100755 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -378,7 +378,13 @@ function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) $obj=$db->fetch_object($resql); $invoice=new FactureFournisseur($db); - $invoice->fetch($obj->facid); + $result=$invoice->fetch($obj->facid); + if ($result < 0) + { + $error++; + $errorcode=$result; $errorlabel=$invoice->error; + break; + } // Define lines of invoice $linesresp=array();