diff --git a/.travis.yml b/.travis.yml index 393db48438b..dc2c543b07e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,7 +83,8 @@ before_script: - sudo cat /etc/apache2/sites-available/default - sudo /etc/init.d/apache2 restart - wget http://localhost/ - - cat /var/log/apache2/error.log + - sudo cat /etc/apache2/envvars + - sudo cat /var/log/apache2/error.log - cat index.html diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 72b7c8fe549..05402898ee6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -192,7 +192,7 @@ $tabfield[3] = "code,libelle,country_id,country"; $tabfield[4] = "code,label"; $tabfield[5] = "code,label"; $tabfield[6] = "code,libelle,type,color,position"; -$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; +$tabfield[7] = "code,libelle,country,accountancy_code,deductible"; $tabfield[8] = "code,libelle,country_id,country"; $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 61dc0a91d7e..a22b24388b1 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; $langs->load("bookmarks"); +$langs->load("admin"); // Security check if (! $user->rights->bookmark->lire) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 4129b561ed1..fd25287c029 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -90,15 +90,15 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $var=false; - print ''; print ''; print ''; + print '
'; print ''; print ''; print ''; print ''; - print "
'.$langs->trans("SearchACustomerOrder").'
'; print ':
:

\n"; + print "
\n"; } // Search contract diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index db8f216fd60..781de5f2913 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1053,16 +1053,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); } - // Stocks + // Warehouse if (! empty($conf->stock->enabled)) { $langs->load("stocks"); - $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Stocks"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); - if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); - if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); - if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); - if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); - if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); + $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); + $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); + $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); + $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); + if ($conf->fournisseur->enabled) $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); + if ($conf->fournisseur->enabled) $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); } // Expeditions @@ -1233,7 +1233,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate",$langs->trans("MenuMembersNotUpToDate"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0",$langs->trans("MenuMembersResiliated"),2,$user->rights->adherent->lire); - $newmenu->add("/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire); + $newmenu->add("/adherents/stats/index.php?leftmenu=members",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire); $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members",$langs->trans("Subscriptions"),0,$user->rights->adherent->cotisation->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members",$langs->trans("NewSubscription"),1,$user->rights->adherent->cotisation->creer); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index d47433af4f5..c7219c6e415 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -168,30 +168,6 @@ if ($object->id > 0) print $form->editfieldval("Label",'label',$object->label,$object,0); print ''; - // Status - $alreadypaid=$object->getSommePaiement(); - print ''.$langs->trans('Status').''.$object->getLibStatut(4,$alreadypaid).''; - - // Amount - print ''.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).''; - print ''.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).''; - - // Amount Local Taxes - //TODO: Place into a function to control showing by country or study better option - if ($societe->localtax1_assuj=="1") //Localtax1 - { - print ''.$langs->transcountry("AmountLT1",$societe->country_code).''; - print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).''; - print ' '; - } - if ($societe->localtax2_assuj=="1") //Localtax2 - { - print ''.$langs->transcountry("AmountLT2",$societe->country_code).''; - print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).''; - print ''; - } - print ''.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).''; - print '
'; print ''; diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index a7ab0d0576f..afaf4c8e796 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -118,6 +118,13 @@ if ($fourn_id > 0) { $sql .= " AND ppf.fk_soc = ".$fourn_id; } +// Count total nb of records without orderby and limit +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} $sql .= " ORDER BY ".$sortfield." ".$sortorder; $sql .= $db->plimit($limit + 1, $offset); @@ -143,7 +150,7 @@ if ($resql) $param="&tobuy=".$tobuy."&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type)?"&type=".$type:"").(empty($sRefSupplier)?"":"&srefsupplier=".$sRefSupplier); - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); if (isset($catid)) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 7a08148c9ce..b03d26dbe1d 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -23,7 +23,7 @@ ErrorWarehouseLabelRequired=Warehouse label is required CorrectStock=Correct stock ListOfWarehouses=List of warehouses ListOfStockMovements=List of stock movements -StocksArea=Stocks area +StocksArea=Warehouses area Location=Location LocationSummary=Short name location NumberOfDifferentProducts=Number of different products diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 3dd0fcd0b49..5b56ac4568b 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -109,8 +109,8 @@ $sql = "SELECT"; if ($agentid > 0) $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; $sql.= " u.rowid as agent, u.login, u.lastname, u.firstname,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge" ; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index fbc947a7cc9..245b29dfd24 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -164,8 +164,8 @@ $sql = "SELECT"; $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index a8830f777ec..b359287d24f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -166,8 +166,8 @@ $sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref,"; if ($id > 0) $sql.= " d.fk_product,"; if ($id > 0) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht <=0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index a4aae519b98..84dacf8db43 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -298,10 +298,9 @@ else */ print '
'; - print ''; // Boutons actions - print '
'; + print '
'; print ''; print '
'; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1bc30b2df5f..e2898943509 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3249,11 +3249,11 @@ class Product extends CommonObject $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; if ($photo_vignette && $imgarray['height'] > $maxHeight) { $return.= ''; - $return.= ''; + $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">'; } else { $return.= ''; - $return.= ''; + $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">'; } $return.= ''."\n"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index f242121625f..907181634ee 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -129,6 +129,8 @@ else { $texte = $langs->trans("ProductsAndServices"); } + // Add what we are searching for + if (! empty($sall)) $texte.= " - ".$sall; $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,'; $sql.= ' p.fk_product_type, p.tms as datem,'; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index d2078d473e7..dc394f898dc 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -15,7 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 22dc080d6e2..96ecdb1d95d 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -334,15 +334,16 @@ if ($id > 0 || $ref) // Calculating a theorical value print ''.$langs->trans("VirtualStock").''; - print "".$product->stock_theorique; + print "".(empty($product->stock_theorique)?0:$product->stock_theorique); if ($product->stock_theorique < $product->seuil_stock_alerte) { print ' '.img_warning($langs->trans("StockLowerThanLimit")); } print ''; print ''; - + print ''; - $text_stock_options = (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'
':''); + $text_stock_options = ''; + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'
':''); @@ -353,7 +354,6 @@ if ($id > 0 || $ref) print ''; $found=0; - // Number of customer orders running if (! empty($conf->commande->enabled)) { diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index cb551e60761..c600e9b0acd 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -18,7 +18,7 @@ llxHeader(); ?>

-This page is a sample of page using html methods. It is designed to make test with
+This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (edit page to change to test another css)
- jmobile (add parameter dol_use_jmobile=1 to enable view with jmobile)

diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index f42c270fa42..4d19dbe2d10 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -655,6 +655,7 @@ function updateContact($authentication,$contact) $object->province_id=$contact['province_id']; + $object->phone_pro=$contact['phone_pro']; $object->phone_perso=$contact['phone_perso']; $object->phone_mobile=$contact['phone_mobile']; $object->fax=$contact['fax'];