commit
ec15f9251d
@ -288,15 +288,16 @@ class Members extends DolibarrApi
|
||||
return $member;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
// Remove the subscriptions because they are handled as a subresource.
|
||||
|
||||
@ -266,15 +266,16 @@ class MembersTypes extends DolibarrApi
|
||||
return $membertype;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->array_options);
|
||||
|
||||
@ -274,7 +274,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id;
|
||||
}
|
||||
else if ($modulepart == 'adherent' || $modulepart == 'member')
|
||||
elseif ($modulepart == 'adherent' || $modulepart == 'member')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
@ -290,7 +290,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'member');
|
||||
}
|
||||
else if ($modulepart == 'propal' || $modulepart == 'proposal')
|
||||
elseif ($modulepart == 'propal' || $modulepart == 'proposal')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
|
||||
@ -306,7 +306,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->propal->multidir_output[$object->entity] . "/" . get_exdir(0, 0, 0, 1, $object, 'propal');
|
||||
}
|
||||
else if ($modulepart == 'commande' || $modulepart == 'order')
|
||||
elseif ($modulepart == 'commande' || $modulepart == 'order')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
@ -322,7 +322,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'commande');
|
||||
}
|
||||
else if ($modulepart == 'shipment' || $modulepart == 'expedition')
|
||||
elseif ($modulepart == 'shipment' || $modulepart == 'expedition')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
|
||||
@ -338,7 +338,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->expedition->dir_output . "/sending/" . get_exdir(0, 0, 0, 1, $object, 'shipment');
|
||||
}
|
||||
else if ($modulepart == 'facture' || $modulepart == 'invoice')
|
||||
elseif ($modulepart == 'facture' || $modulepart == 'invoice')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@ -354,7 +354,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
}
|
||||
else if ($modulepart == 'produit' || $modulepart == 'product')
|
||||
elseif ($modulepart == 'produit' || $modulepart == 'product')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
@ -370,7 +370,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'product');
|
||||
}
|
||||
else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
@ -600,7 +600,8 @@ class Documents extends DolibarrApi
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _validate_file($data) {
|
||||
private function _validate_file($data)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = array();
|
||||
foreach (Documents::$DOCUMENT_FIELDS as $field) {
|
||||
|
||||
@ -273,14 +273,16 @@ class Setup extends DolibarrApi
|
||||
return $list;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->error);
|
||||
|
||||
@ -283,14 +283,16 @@ class BillOfMaterialsApi extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
/*unset($object->note);
|
||||
|
||||
@ -261,15 +261,16 @@ class Categories extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Categorie $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
// Remove fields not relevent to categories
|
||||
|
||||
@ -313,15 +313,16 @@ class AgendaEvents extends DolibarrApi
|
||||
return $event;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->usermod);
|
||||
|
||||
@ -782,15 +782,16 @@ class Proposals extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->note);
|
||||
|
||||
@ -838,15 +838,16 @@ class Orders extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->note);
|
||||
|
||||
@ -248,14 +248,16 @@ class BankAccounts extends DolibarrApi
|
||||
return $account;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->rowid);
|
||||
|
||||
@ -1417,15 +1417,16 @@ class Invoices extends DolibarrApi
|
||||
return $paiement_id;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->note);
|
||||
|
||||
@ -633,15 +633,16 @@ class Contracts extends DolibarrApi
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->address);
|
||||
|
||||
@ -326,15 +326,16 @@ class Donations extends DolibarrApi
|
||||
return $this->_cleanObjectDatas($this->don);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->note);
|
||||
|
||||
@ -610,15 +610,16 @@ class Shipments extends DolibarrApi
|
||||
}
|
||||
*/
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->thirdparty); // id already returned
|
||||
|
||||
@ -489,15 +489,16 @@ class ExpenseReports extends DolibarrApi
|
||||
);
|
||||
}*/
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->barcode_type);
|
||||
|
||||
@ -417,15 +417,16 @@ class Interventions extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->statuts_short);
|
||||
|
||||
@ -333,15 +333,16 @@ class SupplierInvoices extends DolibarrApi
|
||||
);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->rowid);
|
||||
|
||||
@ -330,15 +330,16 @@ class SupplierOrders extends DolibarrApi
|
||||
);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->rowid);
|
||||
|
||||
@ -280,14 +280,16 @@ class MyModuleApi extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
/*unset($object->note);
|
||||
|
||||
@ -468,15 +468,16 @@ class Products extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->regeximgext);
|
||||
|
||||
@ -274,15 +274,16 @@ class StockMovements extends DolibarrApi
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param MouvementStock $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
// Remove useless data
|
||||
|
||||
@ -243,15 +243,16 @@ class Warehouses extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Entrepot $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
// Remove the subscriptions because they are handled as a subresource.
|
||||
|
||||
@ -534,15 +534,16 @@ class Projects extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->titre);
|
||||
|
||||
@ -547,15 +547,16 @@ class Tasks extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->barcode_type);
|
||||
|
||||
@ -379,15 +379,16 @@ class Contacts extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->total_ht);
|
||||
|
||||
@ -1626,14 +1626,16 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array(
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->nom); // ->name already defined and nom deprecated
|
||||
|
||||
@ -190,15 +190,16 @@ class Supplierproposals extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->name);
|
||||
|
||||
@ -1839,7 +1839,7 @@ a.tmenuimage {
|
||||
$found=1;
|
||||
break;
|
||||
}
|
||||
else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité
|
||||
elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité
|
||||
{
|
||||
$url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
|
||||
$found=1;
|
||||
|
||||
@ -1819,7 +1819,7 @@ foreach($mainmenuusedarray as $val)
|
||||
$found=1;
|
||||
break;
|
||||
}
|
||||
else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité
|
||||
elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité
|
||||
{
|
||||
$url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
|
||||
$found=1;
|
||||
|
||||
@ -513,7 +513,7 @@ class Tickets extends DolibarrApi
|
||||
return $ticket;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
@ -523,9 +523,9 @@ class Tickets extends DolibarrApi
|
||||
* @todo use an array for properties to clean
|
||||
*
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
// Other attributes to clean
|
||||
|
||||
@ -354,14 +354,16 @@ class Users extends DolibarrApi
|
||||
return $this->useraccount->delete(DolibarrApiAccess::$user);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
private function _cleanObjectDatas($object)
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
@ -162,27 +162,27 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
// Do a list of movement into warehouse 1
|
||||
|
||||
// Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9
|
||||
// Create an input movement (type = 3) of price 9.9 -> should update PMP to 9.9
|
||||
$result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.9, 'Movement for unit test 1', '', '', '', '', 0, 'Inventory Code Test');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an input movement (type = 3) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.7, 'Movement for unit test 2', '', '', '', '', 0, 'Inventory Code Test');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 2) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->livraison($user, $product1id, $warehouse1id, 5, 999, 'Movement for unit test 3', '', '', '', '', 0, 'Inventory Code Test');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->_create($user, $product1id, $warehouse1id, 1, 0, 0, 'Input from transfer', 'Transfert X');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->_create($user, $product1id, $warehouse1id, -2, 1, 0, 'Output from transfer', 'Transfert Y');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
@ -190,27 +190,27 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
// Do same but into warehouse 2
|
||||
|
||||
// Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9
|
||||
// Create an input movement (type = 3) of price 9.9 -> should update PMP to 9.9
|
||||
$result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.9, 'Movement for unit test 1 wh 2', '', '', '', '', 0, 'Inventory Code Test 2');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an input movement (type = 3) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.7, 'Movement for unit test 2 wh 2', '', '', '', '', 0, 'Inventory Code Test 2');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 2) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->livraison($user, $product1id, $warehouse2id, 5, 999, 'Movement for unit test 3 wh 2', '', '', '', '', 0, 'Inventory Code Test 2');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->_create($user, $product1id, $warehouse2id, 1, 0, 0, 'Input from transfer wh 2', 'Transfert X 2');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
// Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8
|
||||
// Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8
|
||||
$result=$localobject->_create($user, $product1id, $warehouse2id, -2, 1, 0, 'Output from transfer wh 2', 'Transfert Y 2');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user