mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX : travis feedbacks
This commit is contained in:
parent
3c71784272
commit
846f0366d3
|
|
@ -122,10 +122,7 @@ if ($action == 'updateMask') {
|
|||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
elseif ($action == 'set') {
|
||||
} elseif ($action == 'set') { // Activate a model
|
||||
$ret = addDocumentModel($value, 'stocktransfer', $label, $scandir);
|
||||
} elseif ($action == 'del') {
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
|
|
@ -135,10 +132,7 @@ elseif ($action == 'set') {
|
|||
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
elseif ($action == 'setdoc') {
|
||||
} elseif ($action == 'setdoc') { // Set default model
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
||||
|
|
|
|||
|
|
@ -500,9 +500,12 @@ class modStockTransfer extends DolibarrModules
|
|||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns next available id to insert new roles in llx_c_type_contact
|
||||
* @return int > 0 if OK, < 0 if KO
|
||||
*/
|
||||
function getNextId()
|
||||
{
|
||||
|
||||
global $db;
|
||||
|
||||
// Get free id for insert
|
||||
|
|
@ -514,6 +517,7 @@ class modStockTransfer extends DolibarrModules
|
|||
$newid = ($obj->newid + 1);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
return -1;
|
||||
}
|
||||
return $newid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -824,6 +824,12 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to know if at least one line of Stock Transfer object has a batch set
|
||||
*
|
||||
* @param $object Stock Transfer object
|
||||
* @return bool true if at least one line has batch set, false if not
|
||||
*/
|
||||
function atLeastOneBatch($object)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -347,6 +347,13 @@ class StockTransfer extends CommonObject
|
|||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to sort lines by rank
|
||||
*
|
||||
* @param $a 1st element to test
|
||||
* @param $b 1st element to test
|
||||
* @return int
|
||||
*/
|
||||
function cmp($a, $b)
|
||||
{
|
||||
if ($a->rang == $b->rang) {
|
||||
|
|
@ -355,6 +362,11 @@ class StockTransfer extends CommonObject
|
|||
return ($a->rang < $b->rang) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to get total PMP amount of all quantities of products of Stock Transfer
|
||||
*
|
||||
* @return float total amount of Stock Transfer
|
||||
*/
|
||||
function getValorisationTotale()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -435,6 +435,14 @@ class StockTransferLine extends CommonObject
|
|||
return $this->deleteLineCommon($user, $idline, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes all stock movements (add quantity, remove quantity or cancel all actions)
|
||||
*
|
||||
* @param string $label label of stock movement
|
||||
* @param int $fk_entrepot Warehouse concerned by stock movement
|
||||
* @param int $direction add or remove qty
|
||||
* @return int 1 if ok, <= 0 if ko
|
||||
*/
|
||||
function doStockMovement($label, $fk_entrepot, $direction = 1)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -494,30 +494,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Destock confirmation
|
||||
elseif ($action == 'destock') {
|
||||
} elseif ($action == 'destock') { // Destock confirmation
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size'=>40));
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Destock confirmation cancel
|
||||
elseif ($action == 'destockcancel') {
|
||||
} elseif ($action == 'destockcancel') { // Destock confirmation cancel
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size'=>40));
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Addstock confirmation
|
||||
elseif ($action == 'addstock') {
|
||||
} elseif ($action == 'addstock') { // Addstock confirmation
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size'=>40));
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Addstock confirmation cancel
|
||||
elseif ($action == 'addstockcancel') {
|
||||
} elseif ($action == 'addstockcancel') { // Addstock confirmation cancel
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size'=>40));
|
||||
|
|
|
|||
|
|
@ -92,17 +92,11 @@ if ($action == 'addcontact' && $user->rights->stocktransfer->stocktransfer->writ
|
|||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle the status of a contact
|
||||
elseif ($action == 'swapstatut' && $user->rights->stocktransfer->stocktransfer->write) {
|
||||
} elseif ($action == 'swapstatut' && $user->rights->stocktransfer->stocktransfer->write) { // Toggle the status of a contact
|
||||
if ($object->id > 0) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne'));
|
||||
}
|
||||
}
|
||||
|
||||
// Deletes a contact
|
||||
elseif ($action == 'deletecontact' && $user->rights->stocktransfer->stocktransfer->write) {
|
||||
} elseif ($action == 'deletecontact' && $user->rights->stocktransfer->stocktransfer->write) { // Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user