Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Peter Fontaine 2013-10-19 16:11:07 +02:00
commit 270499838d
8 changed files with 117 additions and 11 deletions

View File

@ -3,14 +3,21 @@
# Command run is phpunit
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
notifications:
email:
on_success: never # [always|never|change] default: change
on_failure: always # [always|never|change] default: always
services:
- memcached # will start memcached
# This will tell travis to run phpunit
language: php
php:
# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available
- "5.3"
- "5.4"
- "5.5"
env:
- DB=mysql
@ -20,7 +27,9 @@ before_script:
- echo Start travis
- echo Current dir is `pwd`
- echo Home dir is `echo ~`
- echo Update composer
- export PHPV=`phpenv version-name`
- echo PHP version $PHPV
# - echo Update composer
# - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update
- echo Install phpcs then show installed rules
- pyrus install pear/PHP_CodeSniffer
@ -35,10 +44,12 @@ before_script:
- find $(pwd)/htdocs/documents -type d -exec ls -alt {} \;
- echo Edit php.ini file
- echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "zend_extension_ts = xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"

View File

@ -63,6 +63,7 @@ For users:
- Fix: [bug #1022] correct margin calculation for credit notes.
- New: Can choose contact on event (action com) creation, and filtred by thirdparty.
- New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID.
- New: Add page to make mass stock movement.
For translators:
- Qual: Normalized sort order of all languages files with english reference files.

View File

@ -44,9 +44,9 @@ create table llx_actioncomm
fk_contact integer,
fk_parent integer NOT NULL default 0,
fk_user_action integer, -- user id of owner of action (currently also user id of actor that must do action. In future, actors assigned to action will be an array into table llx_actioncomm_actors)
fk_user_action integer, -- user id of owner of action (currently also user id of actor that must do action. In future, actors assigned to action will be an array into table llx_actioncomm_resources)
transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event (in future version, this field is deprecated and will be stored into table llx_actioncomm_actors)
transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event (in future version, this field is deprecated and will be stored into table llx_actioncomm_resources)
fk_user_done integer, -- user id of people that has made action (deprecated)
priority smallint,

View File

@ -168,3 +168,5 @@ CalculationRuleDesc=To calculate total VAT, there is two methods:<br>Method 1 is
CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
COMPTA_ACCOUNT_CUSTOMER=Accountancy code by default for customer thirdparties
COMPTA_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdparties

View File

@ -167,4 +167,6 @@ Mode2=Mode 2
CalculationRuleDesc=Pour calculer le total de TVA, il existe 2 modes:<br>Le mode 1 consiste à arrondir la tva de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquant afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur.
TurnoverPerProductInCommitmentAccountingNotRelevant=Le chiffre d'affaire par produit, dans une comptabilité en mode <b>comptabilité de caisse</b> n'est pas définissable. Ce rapport n'est disponible qu'en mode de comptabilité dit <b>comptabilité d'engagement</b> (voir la configuration du module de comptabilité).
CalculationMode=Mode de calcul
CalculationMode=Mode de calcul
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
COMPTA_ACCOUNT_SUPPLIER=Code comptable par défaut des tiers fournisseurs

View File

@ -122,12 +122,95 @@ if ($action == 'delline' && $idline != '')
else unset($_SESSION['massstockmove']);
}
if ($action == 'createmovement' && isset($_POST['valid']))
if ($action == 'createmovements')
{
$error=0;
if (! GETPOST("label"))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired"),$langs->transnoentitiesnoconv("LabelMovement"));
}
$db->begin();
if (! $error)
{
$product = new Product($db);
foreach($listofdata as $key => $val) // Loop on each movement to do
{
$id=$val['id'];
$id_product=$val['id_product'];
$id_sw=$val['id_sw'];
$id_tw=$val['id_tw'];
$qty=price2num($val['qty']);
if (! $error && $id_sw <> $id_tw && is_numeric($qty) && $id_product)
{
$result=$product->fetch($id_product);
$product->load_stock(); // Load array product->stock_warehouse
// Define value of products moved
$pricesrc=0;
if (isset($product->stock_warehouse[$id_sw]->pmp)) $pricesrc=$product->stock_warehouse[$id_sw]->pmp;
$pricedest=$pricesrc;
//print 'price src='.$pricesrc.', price dest='.$pricedest;exit;
// Remove stock
$result1=$product->correct_stock(
$user,
$id_sw,
$qty,
1,
GETPOST("label"),
$pricesrc
);
if ($result1 < 0)
{
$error++;
setEventMessage($product->errors,'errors');
}
// Add stock
$result2=$product->correct_stock(
$user,
$id_tw,
$qty,
0,
GETPOST("label"),
$pricedest
);
if ($result2 < 0)
{
$error++;
setEventMessage($product->errors,'errors');
}
}
else
{
dol_print_error('',"Bad value saved into sessions");
$error++;
}
}
}
if (! $error)
{
unset($_SESSION['massstockmove']);
$db->commit();
setEventMessage($langs->trans("StockMovementRecorded"),'mesgs');
header("Location: ".DOL_URL_ROOT.'/product/stock/index.php'); // Redirect to avoid pb when using back
exit;
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
@ -230,8 +313,16 @@ foreach($listofdata as $key => $val)
print '</table>';
print '</form>';
print '<br>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire2">';
print '<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="createmovements">';
// Button to record mass movement
$labelmovement=GETPOST("label")?GETPOST('label'):$langs->trans("MassStockMovement").' '.dol_print_date($now,'%Y-%m-%d %H:%M');
@ -246,7 +337,6 @@ print '</table>';
print '<div class="center"><input class="button" type="submit" name="valid" value="'.dol_escape_htmltag($buttonrecord).'"></div>';
print '</form>';

View File

@ -414,7 +414,7 @@ if ($resql)
print "<tr class=\"liste_titre\">";
//print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"], "m.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"], "m.datem","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LabelMovement"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ProductRef"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ProductLabel"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2010-2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -215,7 +215,7 @@ class CoreTest extends PHPUnit_Framework_TestCase
/**
* testSqlAndScriptInject
*
* return void
* @return void
*/
public function testSqlAndScriptInject()
{