add new rule
This commit is contained in:
parent
f5688b2eec
commit
a25ed0e041
@ -291,7 +291,7 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
||||
#if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
@ -183,8 +183,7 @@ if ($action != 'create_updater' && $action != 'edit_updater')
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr colspan="7"><td class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</td></tr>';
|
||||
@ -276,8 +275,7 @@ if ($action != 'create_variable' && $action != 'edit_variable')
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td colspan="7" class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</td></tr>';
|
||||
|
||||
@ -82,8 +82,7 @@ if ($action == 'setcodeproduct')
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
@ -112,8 +111,7 @@ if ($action == 'other')
|
||||
$res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0, 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'PRODUCT_PRICE_UNIQ', 1, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$multirule = explode('&', $princingrules);
|
||||
foreach ($multirule as $rulesselected)
|
||||
{
|
||||
@ -121,7 +119,7 @@ if ($action == 'other')
|
||||
}
|
||||
}
|
||||
}
|
||||
else // We clear this mode
|
||||
else // We clear this mode
|
||||
{
|
||||
if (strpos($rule, '&') === false) {
|
||||
$res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity);
|
||||
@ -202,14 +200,12 @@ if ($action == 'specimen') // For products
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=product&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
@ -271,8 +267,7 @@ if ($action)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("SetupNotError"), null, 'errors');
|
||||
}
|
||||
}
|
||||
@ -362,8 +357,7 @@ foreach ($dirproduct as $dirroot)
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print "</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$disabled = false;
|
||||
if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true);
|
||||
print '<td class="center">';
|
||||
@ -404,8 +398,7 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -476,8 +469,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
@ -489,8 +481,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
@ -517,8 +508,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
@ -572,8 +562,7 @@ if (empty($conf->multicompany->enabled))
|
||||
{
|
||||
print '<td>'.$langs->trans("PricingRule").'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td>'.$form->textwithpicto($langs->trans("PricingRule"), $langs->trans("SamePriceAlsoForSharedCompanies"), 1).'</td>';
|
||||
}
|
||||
print '<td width="60" class="right">';
|
||||
@ -617,8 +606,7 @@ if (empty($conf->use_javascript_ajax))
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td width="60" class="right">';
|
||||
$arrval = array(
|
||||
'0'=>$langs->trans("No"),
|
||||
@ -743,8 +731,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY))
|
||||
print '</td><td class="right">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$file.'&value=0">'.$langs->trans("Disable").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' </td><td class="right">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$file.'&value=1">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
@ -756,8 +743,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY))
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($dir.' '.$langs->trans("IsNotADir"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,8 +121,7 @@ if ($action == 'convert')
|
||||
$newprice = price2num($objectstatic->multiprices_ttc[$level], 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
|
||||
$newminprice = $objectstatic->multiprices_min_ttc[$level];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$newprice = price2num($objectstatic->multiprices[$level], 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
|
||||
$newminprice = $objectstatic->multiprices_min[$level];
|
||||
}
|
||||
@ -152,8 +151,7 @@ if ($action == 'convert')
|
||||
$newprice = price2num($objectstatic->price_ttc, 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
|
||||
$newminprice = $objectstatic->price_min_ttc;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$newprice = price2num($objectstatic->price, 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
|
||||
$newminprice = $objectstatic->price_min;
|
||||
}
|
||||
@ -252,8 +250,7 @@ if ($action == 'convert')
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
@ -263,8 +260,7 @@ if ($action == 'convert')
|
||||
if ($nbrecordsmodified > 0) setEventMessages($langs->trans("RecordsModified", $nbrecordsmodified), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("NoRecordFound"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
@ -290,8 +286,7 @@ if (empty($mysoc->country_code))
|
||||
$warnpicto = img_error($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="action" value="convert" />';
|
||||
|
||||
@ -41,8 +41,7 @@ if (GETPOST('actioncode', 'array'))
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
@ -163,8 +163,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id))
|
||||
|
||||
echo json_encode($outjson);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
|
||||
$langs->loadLangs(array("main", "products"));
|
||||
|
||||
@ -288,8 +288,7 @@ class ActionsCardProduct
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db, $sql);
|
||||
}
|
||||
}
|
||||
@ -428,8 +427,7 @@ class ActionsCardProduct
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,8 +268,7 @@ class ActionsCardService
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db, $sql);
|
||||
}
|
||||
}
|
||||
@ -361,8 +360,7 @@ class ActionsCardService
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $sql;
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,8 +175,7 @@ if (empty($reshook))
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("errors");
|
||||
if ($result == -1) $errors[] = 'ErrorBadBarCodeSyntax';
|
||||
elseif ($result == -2) $errors[] = 'ErrorBarCodeRequired';
|
||||
@ -222,12 +221,10 @@ if (empty($reshook))
|
||||
|
||||
if ($object->price_base_type == 'TTC')
|
||||
$object->price_ttc = GETPOST('price');
|
||||
else
|
||||
$object->price = GETPOST('price');
|
||||
else $object->price = GETPOST('price');
|
||||
if ($object->price_base_type == 'TTC')
|
||||
$object->price_min_ttc = GETPOST('price_min');
|
||||
else
|
||||
$object->price_min = GETPOST('price_min');
|
||||
else $object->price_min = GETPOST('price_min');
|
||||
|
||||
$tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)'
|
||||
|
||||
@ -340,8 +337,7 @@ if (empty($reshook))
|
||||
$object->multiprices["$i"] = price2num($_POST["price_".$i], 'MU');
|
||||
$object->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->multiprices["$i"] = "";
|
||||
}
|
||||
}
|
||||
@ -369,14 +365,12 @@ if (empty($reshook))
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
|
||||
else setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$action = "create";
|
||||
@ -391,8 +385,7 @@ if (empty($reshook))
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$object->oldcopy = clone $object;
|
||||
@ -489,15 +482,13 @@ if (empty($reshook))
|
||||
|
||||
$action = 'view';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
|
||||
else setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors');
|
||||
else setEventMessages($langs->trans("ErrorProductBadRefOrLabel"), null, 'errors');
|
||||
$action = 'edit';
|
||||
@ -514,8 +505,7 @@ if (empty($reshook))
|
||||
{
|
||||
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->begin();
|
||||
|
||||
$originalId = $id;
|
||||
@ -578,8 +568,7 @@ if (empty($reshook))
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$id = $originalId;
|
||||
|
||||
if ($object->error == 'ErrorProductAlreadyExists')
|
||||
@ -594,16 +583,14 @@ if (empty($reshook))
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$object->fetch($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
if (count($object->errors))
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
dol_print_error($db, $object->errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
@ -613,8 +600,7 @@ if (empty($reshook))
|
||||
unset($object->context['createfromclone']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
@ -632,8 +618,7 @@ if (empty($reshook))
|
||||
header('Location: '.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'&delprod='.urlencode($object->ref));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$reload = 0;
|
||||
$action = '';
|
||||
@ -743,8 +728,7 @@ if (empty($reshook))
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$buyprice = $result;
|
||||
}
|
||||
|
||||
@ -786,8 +770,7 @@ if (empty($reshook))
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$buyprice = $result;
|
||||
}
|
||||
|
||||
@ -829,8 +812,7 @@ if (empty($reshook))
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$buyprice = $result;
|
||||
}
|
||||
|
||||
@ -937,8 +919,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||
$objcanvas->display_canvas($action); // Show template
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// -----------------------------------------
|
||||
// When used in standard mode
|
||||
// -----------------------------------------
|
||||
@ -1030,8 +1011,7 @@ else
|
||||
{
|
||||
$fk_barcode_type = GETPOST('fk_barcode_type');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
||||
@ -1080,8 +1060,7 @@ else
|
||||
print '<input name="desiredstock" class="maxwidth50" value="'.GETPOST('desiredstock').'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input name="seuil_stock_alerte" type="hidden" value="0">';
|
||||
print '<input name="desiredstock" type="hidden" value="0">';
|
||||
}
|
||||
@ -1215,8 +1194,7 @@ else
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Price
|
||||
@ -1416,8 +1394,7 @@ else
|
||||
print '<option value="1" selected>'.$langs->trans("OnSell").'</option>';
|
||||
print '<option value="0">'.$langs->trans("NotOnSell").'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<option value="1">'.$langs->trans("OnSell").'</option>';
|
||||
print '<option value="0" selected>'.$langs->trans("NotOnSell").'</option>';
|
||||
}
|
||||
@ -1432,8 +1409,7 @@ else
|
||||
print '<option value="1" selected>'.$langs->trans("ProductStatusOnBuy").'</option>';
|
||||
print '<option value="0">'.$langs->trans("ProductStatusNotOnBuy").'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<option value="1">'.$langs->trans("ProductStatusOnBuy").'</option>';
|
||||
print '<option value="0" selected>'.$langs->trans("ProductStatusNotOnBuy").'</option>';
|
||||
}
|
||||
@ -1463,8 +1439,7 @@ else
|
||||
{
|
||||
$fk_barcode_type = GETPOST('fk_barcode_type');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$fk_barcode_type = $object->barcode_type;
|
||||
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
|
||||
}
|
||||
@ -1526,8 +1501,7 @@ else
|
||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Nature
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="3">';
|
||||
$statutarray = array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
|
||||
@ -1734,8 +1708,7 @@ else
|
||||
print '</form>';
|
||||
}
|
||||
// Fiche en mode visu
|
||||
else
|
||||
{
|
||||
else {
|
||||
$showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode = 0;
|
||||
|
||||
@ -1791,8 +1764,7 @@ else
|
||||
{
|
||||
print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->fetch_barcode();
|
||||
print $object->barcode_type_label ? $object->barcode_type_label : ($object->barcode ? '<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>' : '');
|
||||
}
|
||||
@ -1819,8 +1791,7 @@ else
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $object->barcode;
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
@ -2012,8 +1983,7 @@ else
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Nature
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td colspan="2">';
|
||||
print $object->getLibFinished();
|
||||
@ -2025,8 +1995,7 @@ else
|
||||
{
|
||||
print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -2042,8 +2011,7 @@ else
|
||||
if ($object->height) print " x ".$object->height;
|
||||
print ' '.measuringUnitString(0, "size", $object->length_units);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -2056,8 +2024,7 @@ else
|
||||
{
|
||||
print $object->surface." ".measuringUnitString(0, "surface", $object->surface_units);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -2070,8 +2037,7 @@ else
|
||||
{
|
||||
print $object->volume." ".measuringUnitString(0, "volume", $object->volume_units);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -2085,8 +2051,7 @@ else
|
||||
{
|
||||
print $object->net_measure." ".measuringUnitString($object->net_measure_units);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' ';
|
||||
}
|
||||
}
|
||||
@ -2215,8 +2180,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<span id="action-clone" class="butAction">'.$langs->trans('ToClone').'</span>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=clone&id='.$object->id.'">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
}
|
||||
@ -2231,18 +2195,15 @@ if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ProductIsUsed").'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
@ -2276,8 +2237,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
$html .= $form->selectarray("propalid", $otherprop, 0, 1);
|
||||
$html .= '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$html .= '<tr><td style="width: 200px;">';
|
||||
$html .= $langs->trans("AddToDraftProposals").'</td><td>';
|
||||
$html .= $langs->trans("NoDraftProposals");
|
||||
@ -2300,8 +2260,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
$html .= $form->selectarray("commandeid", $othercom, 0, 1);
|
||||
$html .= '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$html .= '<tr><td style="width: 200px;">';
|
||||
$html .= $langs->trans("AddToDraftOrders").'</td><td>';
|
||||
$html .= $langs->trans("NoDraftOrders");
|
||||
@ -2324,8 +2283,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
$html .= $form->selectarray("factureid", $otherinvoice, 0, 1);
|
||||
$html .= '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$html .= '<tr><td style="width: 200px;">';
|
||||
$html .= $langs->trans("AddToDraftInvoices").'</td><td>';
|
||||
$html .= $langs->trans("NoDraftInvoices");
|
||||
|
||||
@ -303,8 +303,7 @@ class Products extends DolibarrApi
|
||||
// We update price only if it was changed
|
||||
$pricemodified = false;
|
||||
if ($this->product->price_base_type != $oldproduct->price_base_type) { $pricemodified = true;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
if ($this->product->tva_tx != $oldproduct->tva_tx) { $pricemodified = true;
|
||||
}
|
||||
if ($this->product->tva_npr != $oldproduct->tva_npr) { $pricemodified = true;
|
||||
@ -318,8 +317,7 @@ class Products extends DolibarrApi
|
||||
if ($this->product->price_min_ttc != $oldproduct->price_min_ttc) { $pricemodified = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($this->product->price != $oldproduct->price) { $pricemodified = true;
|
||||
}
|
||||
if ($this->product->price_min != $oldproduct->price_min) { $pricemodified = true;
|
||||
@ -805,7 +803,7 @@ class Products extends DolibarrApi
|
||||
|
||||
$product_fourn = new ProductFournisseur($this->db);
|
||||
$product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0);
|
||||
foreach($product_fourn_list as $tmpobj) {
|
||||
foreach ($product_fourn_list as $tmpobj) {
|
||||
$this->_cleanObjectDatas($tmpobj);
|
||||
}
|
||||
//var_dump($product_fourn_list->db);exit;
|
||||
|
||||
@ -102,8 +102,7 @@ class FormProduct
|
||||
{
|
||||
$sql .= ", pb.qty as stock";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= ", ps.reel as stock";
|
||||
}
|
||||
}
|
||||
@ -126,8 +125,7 @@ class FormProduct
|
||||
{
|
||||
$sql .= " AND e.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " AND e.statut = 1";
|
||||
}
|
||||
|
||||
@ -179,8 +177,7 @@ class FormProduct
|
||||
|
||||
return $num;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -271,8 +268,7 @@ class FormProduct
|
||||
if ($arraytypes['stock'] <= 0) {
|
||||
$label .= ' <span class= \'text-warning\'>('.$langs->trans("Stock").':'.$arraytypes['stock'].')</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$label .= ' <span class=\'opacitymedium\'>('.$langs->trans("Stock").':'.$arraytypes['stock'].')</span>';
|
||||
}
|
||||
}
|
||||
@ -437,8 +433,7 @@ class FormProduct
|
||||
{
|
||||
if (!empty($fk_product)) $productIdArray[] = $fk_product;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->fk_product) $productIdArray[] = $line->fk_product;
|
||||
}
|
||||
@ -459,8 +454,7 @@ class FormProduct
|
||||
{
|
||||
$productIdArray = array($fk_product); // only show lot stock for product
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($this->cache_lot as $key => $value)
|
||||
{
|
||||
$productIdArray[] = $key;
|
||||
@ -527,8 +521,7 @@ class FormProduct
|
||||
{
|
||||
return count($this->cache_lot);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// clear cache
|
||||
$this->cache_lot = array();
|
||||
$productIdList = implode(',', $productIdArray);
|
||||
@ -561,8 +554,7 @@ class FormProduct
|
||||
|
||||
return $num;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -457,8 +457,7 @@ class Product extends CommonObject
|
||||
if ($err > 0) {
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -683,34 +682,29 @@ class Product extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = 'ErrorFailedToGetInsertedId';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Product already exists with this ref
|
||||
$langs->load("products");
|
||||
$error++;
|
||||
$this->error = "ErrorProductAlreadyExists";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
@ -727,14 +721,12 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -$error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING);
|
||||
return -3;
|
||||
@ -811,8 +803,7 @@ class Product extends CommonObject
|
||||
$result = $mod->verif($this->db, $valuetotest, $this, 0, $typefortest);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -1104,14 +1095,12 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -$error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
if (empty($conf->barcode->enabled) || empty($this->barcode)) {
|
||||
@ -1123,8 +1112,7 @@ class Product extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
@ -1132,8 +1120,7 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING);
|
||||
return -3;
|
||||
@ -1281,8 +1268,7 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
@ -1292,8 +1278,7 @@ class Product extends CommonObject
|
||||
return -$error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "ErrorRecordIsUsedCantDelete";
|
||||
return 0;
|
||||
}
|
||||
@ -1332,8 +1317,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note";
|
||||
}
|
||||
@ -1370,8 +1354,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note";
|
||||
}
|
||||
@ -1392,8 +1375,7 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// language is not current language and we didn't provide a multilang description for this language
|
||||
}
|
||||
}
|
||||
@ -1435,8 +1417,7 @@ class Product extends CommonObject
|
||||
// End call triggers
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
@ -1498,8 +1479,7 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -1538,8 +1518,7 @@ class Product extends CommonObject
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error: ".$this->db->lasterror()." - ".$sql;
|
||||
return -1;
|
||||
}
|
||||
@ -1581,8 +1560,7 @@ class Product extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1609,8 +1587,7 @@ class Product extends CommonObject
|
||||
if ($resql) {
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -1687,8 +1664,7 @@ class Product extends CommonObject
|
||||
{
|
||||
$pu_ht = $priceforthequantityarray['unitprice'];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu_ttc = $priceforthequantityarray['unitprice'];
|
||||
}
|
||||
break;
|
||||
@ -1708,8 +1684,7 @@ class Product extends CommonObject
|
||||
{
|
||||
$pu_ht = $priceforthequantityarray['unitprice'];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu_ttc = $priceforthequantityarray['unitprice'];
|
||||
}
|
||||
break;
|
||||
@ -1852,20 +1827,17 @@ class Product extends CommonObject
|
||||
$result = $obj->fk_product;
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1; // Ce produit n'existe pas avec cet id tarif fournisseur ou existe mais qte insuffisante, ni pour le couple produit/ref fournisseur dans la quantité.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -2;
|
||||
}
|
||||
@ -1937,14 +1909,12 @@ class Product extends CommonObject
|
||||
$price_min = price2num($newminprice) / (1 + ($newvat / 100));
|
||||
$price_min = price2num($price_min, 'MU');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$price_min = 0;
|
||||
$price_min_ttc = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$price = price2num($newprice, 'MU');
|
||||
$price_ttc = ($newnpr != 1) ? price2num($newprice) * (1 + ($newvat / 100)) : $price;
|
||||
$price_ttc = price2num($price_ttc, 'MU');
|
||||
@ -1955,8 +1925,7 @@ class Product extends CommonObject
|
||||
$price_min_ttc = price2num($price_min_ttc, 'MU');
|
||||
//print 'X'.$newminprice.'-'.$price_min;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$price_min = 0;
|
||||
$price_min_ttc = 0;
|
||||
}
|
||||
@ -1969,7 +1938,7 @@ class Product extends CommonObject
|
||||
$localtaxtype2 = $localtaxes_array['2'];
|
||||
$localtax2 = $localtaxes_array['3'];
|
||||
}
|
||||
else // old method. deprecated because ot can't retreive type
|
||||
else // old method. deprecated because ot can't retreive type
|
||||
{
|
||||
$localtaxtype1 = '0';
|
||||
$localtax1 = get_localtax($newvat, 1);
|
||||
@ -2045,8 +2014,7 @@ class Product extends CommonObject
|
||||
|
||||
$this->db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
@ -2281,8 +2249,7 @@ class Product extends CommonObject
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -2330,15 +2297,13 @@ class Product extends CommonObject
|
||||
}
|
||||
$this->prices_by_qty_list[0] = $resultat;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -2394,15 +2359,13 @@ class Product extends CommonObject
|
||||
}
|
||||
$this->prices_by_qty_list[$i] = $resultat;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -2427,13 +2390,11 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -2507,8 +2468,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2558,8 +2518,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2661,8 +2620,7 @@ class Product extends CommonObject
|
||||
if ($reshook > 0) $this->stats_commande = $hookmanager->resArray['stats_commande'];
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2718,8 +2676,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error().' sql='.$sql;
|
||||
return -1;
|
||||
}
|
||||
@ -2802,8 +2759,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2855,8 +2811,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -2946,8 +2901,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -3020,8 +2974,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error().' sql='.$sql;
|
||||
return -1;
|
||||
}
|
||||
@ -3094,8 +3047,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -3147,8 +3099,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -3182,8 +3133,7 @@ class Product extends CommonObject
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error().' sql='.$sql;
|
||||
return -1;
|
||||
}
|
||||
@ -3192,8 +3142,7 @@ class Product extends CommonObject
|
||||
$year = strftime('%Y', time());
|
||||
$month = strftime('%m', time());
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year.
|
||||
}
|
||||
$result = array();
|
||||
@ -3674,8 +3623,7 @@ class Product extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
@ -3683,16 +3631,14 @@ class Product extends CommonObject
|
||||
$this->error = "isFatherOfThis";
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec)';
|
||||
$sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.')';
|
||||
if (!$this->db->query($sql)) {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3736,8 +3682,7 @@ class Product extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3800,13 +3745,11 @@ class Product extends CommonObject
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -3896,21 +3839,18 @@ class Product extends CommonObject
|
||||
$this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
// If the supplier price already exists for this product and quantity
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->product_fourn_price_id = $obj->rowid;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -2;
|
||||
}
|
||||
@ -4106,8 +4046,7 @@ class Product extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -4218,8 +4157,7 @@ class Product extends CommonObject
|
||||
if ($obj) { $nb = $obj->nb;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -4304,8 +4242,7 @@ class Product extends CommonObject
|
||||
}
|
||||
return $prods;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -4369,8 +4306,7 @@ class Product extends CommonObject
|
||||
|
||||
return $prods;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -4498,8 +4434,7 @@ class Product extends CommonObject
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
|
||||
$linkclose .= ' class="nowraponall classfortooltip"';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$linkclose = ' class="nowraponall"';
|
||||
}
|
||||
|
||||
@ -4574,8 +4509,7 @@ class Product extends CommonObject
|
||||
if (!empty($conf->global->PRODUCT_ADDON_PDF)) {
|
||||
$modele = $conf->global->PRODUCT_ADDON_PDF;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$modele = 'strato';
|
||||
}
|
||||
}
|
||||
@ -4744,8 +4678,7 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $movementstock->error;
|
||||
$this->errors = $movementstock->errors;
|
||||
|
||||
@ -4792,8 +4725,7 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $movementstock->error;
|
||||
$this->errors = $movementstock->errors;
|
||||
|
||||
@ -4872,8 +4804,7 @@ class Product extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -5019,8 +4950,7 @@ class Product extends CommonObject
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$this->db->rollback();
|
||||
return array();
|
||||
@ -5258,8 +5188,7 @@ class Product extends CommonObject
|
||||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
@ -5395,8 +5324,7 @@ class Product extends CommonObject
|
||||
$this->db->free($resql);
|
||||
return $label;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error().' sql='.$sql;
|
||||
dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
@ -5629,8 +5557,7 @@ class Product extends CommonObject
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,8 +120,7 @@ class Productbatch extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
@ -179,8 +178,7 @@ class Productbatch extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -233,8 +231,7 @@ class Productbatch extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -275,8 +272,7 @@ class Productbatch extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -331,8 +327,7 @@ class Productbatch extends CommonObject
|
||||
$this->db->commit();
|
||||
return $object->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -425,8 +420,7 @@ class Productbatch extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -495,8 +489,7 @@ class Productbatch extends CommonObject
|
||||
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error = "Error ".$db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -140,8 +140,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
@ -199,8 +198,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
@ -273,8 +271,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::fetch_by_product ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
@ -334,8 +331,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -377,8 +373,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -427,8 +422,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -470,8 +464,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -526,8 +519,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
$this->db->commit();
|
||||
return $object->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -81,27 +81,23 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se
|
||||
//var_dump($i.' '.GETPOST("prod_id_".$i, 'int'), $qty, GETPOST("prod_incdec_".$i, 'int'));
|
||||
$action = 'edit';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$action = 're-edit';
|
||||
if ($object->error == "isFatherOfThis") {
|
||||
setEventMessages($langs->trans("ErrorAssociationIsFatherOfThis"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($object->del_sousproduit($id, GETPOST("prod_id_".$i, 'int')) > 0)
|
||||
{
|
||||
$action = 'edit';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
$action = 're-edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@ -235,8 +231,7 @@ if ($id > 0 || !empty($ref))
|
||||
{
|
||||
print price($object->price_ttc).' '.$langs->trans($object->price_base_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print price($object->price).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT');
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -247,8 +242,7 @@ if ($id > 0 || !empty($ref))
|
||||
{
|
||||
print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print price($object->price_min).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT');
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -299,8 +293,7 @@ if ($id > 0 || !empty($ref))
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
|
||||
print '</tr>';
|
||||
@ -378,8 +371,7 @@ if ($id > 0 || !empty($ref))
|
||||
{
|
||||
$pricesell = 'Variable';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$totallinesell = price2num($value['nb'] * ($pricesell), 'MT');
|
||||
$totalsell += $totallinesell;
|
||||
}
|
||||
@ -405,8 +397,7 @@ if ($id > 0 || !empty($ref))
|
||||
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$hide = '';
|
||||
if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide = ' hideobject'; // By default, we do not show this. It makes screen very difficult to understand
|
||||
|
||||
@ -469,8 +460,7 @@ if ($id > 0 || !empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$colspan = 8;
|
||||
if (!empty($conf->stock->enabled)) $colspan++;
|
||||
|
||||
@ -600,8 +590,7 @@ if ($id > 0 || !empty($ref))
|
||||
$qty = $object->is_sousproduit_qty;
|
||||
$incdec = $object->is_sousproduit_incdec;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//$addchecked = '';
|
||||
$qty = 0;
|
||||
$incdec = 0;
|
||||
@ -615,8 +604,7 @@ if ($id > 0 || !empty($ref))
|
||||
// Inc Dec
|
||||
print '<td class="center">';
|
||||
if ($qty) print '<input type="checkbox" name="prod_incdec_'.$i.'" value="1" '.($incdec ? 'checked' : '').'>';
|
||||
else
|
||||
{
|
||||
else {
|
||||
// TODO Hide field and show it when setting a qty
|
||||
print '<input type="checkbox" name="prod_incdec_'.$i.'" value="1" checked>';
|
||||
//print '<input type="checkbox" disabled name="prod_incdec_'.$i.'" value="1" checked>';
|
||||
@ -636,8 +624,7 @@ if ($id > 0 || !empty($ref))
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -314,8 +314,7 @@ if ($object->id)
|
||||
$checked = ' checked ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (array_key_exists($filetoadd['name'], $filetomerge->lines))
|
||||
{
|
||||
$checked = ' checked ';
|
||||
@ -338,8 +337,7 @@ if ($object->id)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
@ -124,8 +124,7 @@ class PriceExpression
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
@ -163,13 +162,11 @@ class PriceExpression
|
||||
$this->expression = $obj->expression;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -206,8 +203,7 @@ class PriceExpression
|
||||
$this->db->free($resql);
|
||||
return $retarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -237,13 +233,11 @@ class PriceExpression
|
||||
{
|
||||
return (int) $obj->rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -302,8 +296,7 @@ class PriceExpression
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -360,8 +353,7 @@ class PriceExpression
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -129,8 +129,7 @@ class PriceGlobalVariable
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
@ -163,13 +162,11 @@ class PriceGlobalVariable
|
||||
$this->checkParameters();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -226,8 +223,7 @@ class PriceGlobalVariable
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -283,8 +279,7 @@ class PriceGlobalVariable
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -350,8 +345,7 @@ class PriceGlobalVariable
|
||||
$this->db->free($resql);
|
||||
return $retarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -145,8 +145,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
@ -183,13 +182,11 @@ class PriceGlobalVariableUpdater
|
||||
$this->checkParameters();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -250,8 +247,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -306,8 +302,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -400,8 +395,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->free($resql);
|
||||
return $retarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -442,8 +436,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->free($resql);
|
||||
return $retarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -599,8 +592,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -645,8 +637,7 @@ class PriceGlobalVariableUpdater
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -78,8 +78,7 @@ if ($action == 'add')
|
||||
if ($price_result < 0) { //Expression is not valid
|
||||
setEventMessages($priceparser->translatedError(), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$price_expression->title = $title;
|
||||
$price_expression->expression = $expression;
|
||||
$result = $price_expression->create($user);
|
||||
@ -88,8 +87,7 @@ if ($action == 'add')
|
||||
$eid = $price_expression->id;
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages("add: ".$price_expression->error, $price_expression->errors, 'errors');
|
||||
}
|
||||
}
|
||||
@ -98,8 +96,7 @@ if ($action == 'add')
|
||||
{
|
||||
setEventMessages("add find: ".$price_expression->error, $price_expression->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
}
|
||||
}
|
||||
@ -118,8 +115,7 @@ if ($action == 'update')
|
||||
if ($price_result < 0) { //Expression is not valid
|
||||
setEventMessages($priceparser->translatedError(), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$price_expression->id = $eid;
|
||||
$price_expression->title = $title;
|
||||
$price_expression->expression = $expression;
|
||||
@ -128,8 +124,7 @@ if ($action == 'update')
|
||||
{
|
||||
setEventMessages("update: ".$price_expression->error, $price_expression->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
@ -138,8 +133,7 @@ if ($action == 'update')
|
||||
{
|
||||
setEventMessages("update find: ".$price_expression->error, $price_expression->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
}
|
||||
}
|
||||
@ -221,8 +215,7 @@ if ($eid == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><span id="action-delete" class="butActionRefused classfortooltip">'.$langs->trans('Delete').'</span></div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&tab='.$tab.'&eid='.$eid.'&action=delete">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -128,8 +128,7 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -211,8 +210,7 @@ if (empty($reshook))
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$_POST["price"] = 0;
|
||||
}
|
||||
}
|
||||
@ -316,8 +314,7 @@ if (empty($reshook))
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($conf->dynamicprices->enabled) && $price_expression !== '')
|
||||
{
|
||||
//Check the expression validity by parsing it
|
||||
@ -347,13 +344,11 @@ if (empty($reshook))
|
||||
$db->commit();
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'add_price';
|
||||
}
|
||||
}
|
||||
@ -453,8 +448,7 @@ if ($id > 0 || $ref)
|
||||
$object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price
|
||||
print load_fiche_titre($langs->trans("ChangeSupplierPrice"));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print load_fiche_titre($langs->trans("AddSupplierPrice"));
|
||||
}
|
||||
|
||||
@ -478,8 +472,7 @@ if ($id > 0 || $ref)
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$events = array();
|
||||
$events[] = array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array());
|
||||
print $form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events);
|
||||
@ -503,8 +496,7 @@ if ($id > 0 || $ref)
|
||||
print '<input type="hidden" name="ref_fourn_old" value="'.$object->ref_supplier.'">';
|
||||
print '<input class="flat" name="ref_fourn" size="12" value="'.$object->ref_supplier.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input class="flat" name="ref_fourn" size="12" value="'.(GETPOST("ref_fourn") ?GETPOST("ref_fourn") : '').'">';
|
||||
}
|
||||
print '</td>';
|
||||
@ -529,8 +521,7 @@ if ($id > 0 || $ref)
|
||||
print '<input type="hidden" name="qty" value="'.$object->fourn_qty.'">';
|
||||
print $object->fourn_qty;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input class="flat" name="qty" size="5" value="'.$quantity.'">';
|
||||
}
|
||||
// Units
|
||||
@ -564,8 +555,7 @@ if ($id > 0 || $ref)
|
||||
$default_vat = $tmpproductsupplier->fourn_tva_tx;
|
||||
$default_npr = $tmpproductsupplier->fourn_tva_npr;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($default_vat))
|
||||
{
|
||||
$default_vat = $object->tva_tx;
|
||||
@ -945,8 +935,7 @@ SCRIPT;
|
||||
{
|
||||
print '<td class="left">'.$productfourn->getNomUrl().'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="left">'.$productfourn->fourn_ref.'</td>';
|
||||
}
|
||||
|
||||
@ -1099,8 +1088,7 @@ SCRIPT;
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -1110,8 +1098,7 @@ SCRIPT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
@ -226,8 +226,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
|
||||
{
|
||||
$dataseries[] = array($obj->label, round($obj->nb));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$rest += $obj->nb;
|
||||
}
|
||||
$total += $obj->nb;
|
||||
@ -248,8 +247,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
|
||||
$dolgraph->draw('idstatscategproduct');
|
||||
print $dolgraph->show($total ? 0 : 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
@ -386,8 +384,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
@ -457,8 +454,7 @@ function activitytrim($product_type)
|
||||
|
||||
if ($product_type == 0)
|
||||
print '<tr class="liste_titre"><td class=left>'.$langs->trans("ProductSellByQuarterHT").'</td>';
|
||||
else
|
||||
print '<tr class="liste_titre"><td class=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>';
|
||||
else print '<tr class="liste_titre"><td class=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>';
|
||||
print '<td class=right>'.$langs->trans("Quarter1").'</td>';
|
||||
print '<td class=right>'.$langs->trans("Quarter2").'</td>';
|
||||
print '<td class=right>'.$langs->trans("Quarter3").'</td>';
|
||||
|
||||
@ -21,8 +21,7 @@ switch ($put)
|
||||
|
||||
echo $det->qty_view;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo -2;
|
||||
}
|
||||
|
||||
@ -41,8 +40,7 @@ switch ($put)
|
||||
|
||||
echo $det->new_pmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo -2;
|
||||
}
|
||||
|
||||
|
||||
@ -42,8 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
$result = restrictedArea($user, 'stock', $id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
|
||||
}
|
||||
|
||||
@ -81,8 +80,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
$permissiontoadd = $user->rights->stock->creer;
|
||||
$permissiontodelete = $user->rights->stock->supprimer;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$permissiontoadd = $user->rights->stock->inventory_advance->write;
|
||||
$permissiontodelete = $user->rights->stock->inventory_advance->write;
|
||||
}
|
||||
@ -337,8 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
}
|
||||
|
||||
@ -346,8 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Validate").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Validate').'</a>'."\n";
|
||||
}
|
||||
|
||||
@ -355,8 +351,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,8 +466,7 @@ class Inventory extends CommonObject
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,8 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
$result = restrictedArea($user, 'stock', $id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
|
||||
}
|
||||
|
||||
@ -81,8 +80,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
$permissiontoadd = $user->rights->stock->creer;
|
||||
$permissiontodelete = $user->rights->stock->supprimer;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$permissiontoadd = $user->rights->stock->inventory_advance->write;
|
||||
$permissiontodelete = $user->rights->stock->inventory_advance->write;
|
||||
}
|
||||
@ -283,8 +281,7 @@ if ($object->id > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Edit").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Edit').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
@ -295,8 +292,7 @@ if ($object->id > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Validate').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,8 +77,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
$result = restrictedArea($user, 'stock', $objectid);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance');
|
||||
}
|
||||
|
||||
@ -256,8 +255,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
|
||||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -292,13 +292,11 @@ if ($search_type != '' && $search_type != '-1')
|
||||
{
|
||||
$texte = $langs->trans("Services");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$texte = $langs->trans("Products");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$texte = $langs->trans("ProductsAndServices");
|
||||
}
|
||||
|
||||
@ -1411,8 +1409,7 @@ if ($resql)
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -67,8 +67,7 @@ elseif ($type == '1')
|
||||
{
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
}
|
||||
$title = $langs->trans("Statistics");
|
||||
@ -153,8 +152,7 @@ if ($resql)
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
//var_dump($infoprod);
|
||||
|
||||
@ -67,8 +67,7 @@ elseif ($type == '1')
|
||||
{
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
}
|
||||
$title = $langs->trans("Statistics");
|
||||
@ -153,8 +152,7 @@ if ($resql)
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
//var_dump($infoprod);
|
||||
|
||||
@ -170,8 +170,7 @@ if (empty($reshook))
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
@ -767,8 +766,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
//print vatrate($object->multiprices_tva_tx[$soc->price_level], true);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// TVA
|
||||
print '<tr><td>'.$langs->trans("DefaultTaxRate").'</td><td>';
|
||||
|
||||
@ -787,8 +785,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||
{
|
||||
// We show only vat for level 1
|
||||
@ -796,8 +793,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
print '<td colspan="2">'.vatrate($object->multiprices_tva_tx[1], true).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// TVA
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultTaxRate").'</td><td>';
|
||||
|
||||
@ -846,8 +842,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("SellingPrice").' '.$i;
|
||||
if (!empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
|
||||
}
|
||||
@ -872,8 +867,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
{
|
||||
print price($object->multiprices_min_ttc[$i]).' '.$langs->trans($object->multiprices_base_type[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print price($object->multiprices_min[$i]).' '.$langs->trans($object->multiprices_base_type[$i]);
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -954,8 +948,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// TVA
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultTaxRate").'</td><td>';
|
||||
|
||||
@ -998,8 +991,7 @@ else
|
||||
if ($object->prices_by_qty[0] == 0) {
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=activate_price_by_qty&level=1">('.$langs->trans("Activate").')';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable_price_by_qty&level=1">('.$langs->trans("DisablePriceByQty").')';
|
||||
}
|
||||
print '</td><td>';
|
||||
@ -1289,8 +1281,7 @@ if ($action == 'edit_price' && $object->getRights()->creer)
|
||||
|
||||
print '<br></form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<!-- Edit price per level -->'."\n";
|
||||
?>
|
||||
<script>
|
||||
@ -1551,8 +1542,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right">'.$title."</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">';
|
||||
if (empty($objp->price_by_qty)) {
|
||||
print price($objp->price);
|
||||
@ -1606,8 +1596,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'&lineid='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
} else
|
||||
print ' '; // Can not delete last price (it's current price)
|
||||
} else print ' '; // Can not delete last price (it's current price)
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -1877,8 +1866,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
//print '<td class="right">' . $langs->trans("INCVATONLY") . '</td>';
|
||||
print '<td class="right">'.$langs->trans("INCT").'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">'.$langs->trans("TTC").'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
|
||||
@ -1900,8 +1888,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
$pu = $line->price;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu = $line->price_ttc;
|
||||
}
|
||||
|
||||
@ -1940,8 +1927,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
//print '<td class="right">' . price($line->price_ttc) . "</td>";
|
||||
print '<td class="right">'.price($resultarray[2]).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">'.price($line->price_ttc)."</td>";
|
||||
}
|
||||
|
||||
@ -2014,8 +2000,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
//print '<td class="right">' . $langs->trans("INCVATONLY") . '</td>';
|
||||
print '<td class="right">'.$langs->trans("INCT").'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">'.$langs->trans("TTC").'</td>';
|
||||
}
|
||||
|
||||
@ -2030,8 +2015,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
$pu = $object->price;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu = $object->price_ttc;
|
||||
}
|
||||
|
||||
@ -2071,8 +2055,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
//print '<td class="right">' . price($object->price_ttc) . "</td>";
|
||||
print '<td class="right">'.price($resultarray[2]).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">'.price($object->price_ttc)."</td>";
|
||||
}
|
||||
|
||||
@ -2111,8 +2094,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
$pu = $line->price;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$pu = $line->price_ttc;
|
||||
}
|
||||
|
||||
@ -2150,8 +2132,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
//print '<td class="right">' . price($line->price_ttc) . "</td>";
|
||||
print '<td class="right">'.price($resultarray[2]).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<td class="right">'.price($line->price_ttc)."</td>";
|
||||
}
|
||||
|
||||
|
||||
@ -137,8 +137,7 @@ if (dol_strlen($type))
|
||||
{
|
||||
$sql .= " AND p.fk_product_type = '1'";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " AND p.fk_product_type <> '1'";
|
||||
}
|
||||
}
|
||||
@ -404,8 +403,7 @@ if ($resql)
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -140,8 +140,7 @@ if (dol_strlen($type))
|
||||
{
|
||||
$sql .= " AND p.fk_product_type = '1'";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " AND p.fk_product_type <> '1'";
|
||||
}
|
||||
}
|
||||
@ -423,8 +422,7 @@ if ($resql)
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -97,8 +97,7 @@ if (!$id && empty($ref))
|
||||
//$title=$langs->trans("StatisticsOfServices");
|
||||
$title = $langs->trans("Statistics");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
//$title=$langs->trans("StatisticsOfProductsOrServices");
|
||||
$title = $langs->trans("Statistics");
|
||||
@ -109,8 +108,7 @@ if (!$id && empty($ref))
|
||||
|
||||
print load_fiche_titre($title, $mesg, $picto);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
$title = $langs->trans('ProductServiceCard');
|
||||
@ -325,8 +323,7 @@ if ($result || empty($id))
|
||||
{
|
||||
// TODO Load cachefile $graphfiles[$key]['file']
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$morefilters = '';
|
||||
if ($search_categ > 0)
|
||||
{
|
||||
@ -371,8 +368,7 @@ if ($result || empty($id))
|
||||
$graphfiles[$key]['total'] = $px->total();
|
||||
$graphfiles[$key]['output'] = $px->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db, 'Error for calculating graph on key='.$key.' - '.$object->error);
|
||||
}
|
||||
}
|
||||
@ -402,8 +398,7 @@ if ($result || empty($id))
|
||||
{
|
||||
print "\n".'<div class="fichecenter"><div class="fichehalfleft">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "\n".'<div class="fichehalfright"><div class="ficheaddleft">'."\n";
|
||||
}
|
||||
|
||||
@ -413,8 +408,7 @@ if ($result || empty($id))
|
||||
if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) $dategenerated = $langs->trans("GeneratedOn", dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']), "dayhour"));
|
||||
else $dategenerated = $langs->trans("GeneratedOn", dol_print_date(dol_now(), "dayhour"));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$dategenerated = ($mesg ? '<font class="error">'.$mesg.'</font>' : $langs->trans("ChartNotGenerated"));
|
||||
}
|
||||
$linktoregenerate = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id') ?GETPOST('id') : $object->id).((string) $type != '' ? '&type='.$type : '').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').'</a>';
|
||||
@ -437,8 +431,7 @@ if ($result || empty($id))
|
||||
{
|
||||
print "\n".'</div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "\n".'</div></div></div>';
|
||||
print '<div class="clear"><div class="fichecenter"><br></div></div>'."\n";
|
||||
}
|
||||
|
||||
@ -221,15 +221,13 @@ if ($id > 0 || !empty($ref))
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error();
|
||||
}
|
||||
|
||||
|
||||
@ -214,15 +214,13 @@ if ($id > 0 || !empty($ref))
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error();
|
||||
}
|
||||
|
||||
|
||||
@ -137,8 +137,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorWarehouseRefRequired"), null, 'errors');
|
||||
$action = "create"; // Force retour sur page creation
|
||||
}
|
||||
@ -155,8 +154,7 @@ if (empty($reshook))
|
||||
header("Location: ".DOL_URL_ROOT.'/product/stock/list.php?restore_lastsearch_values=1');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
@ -197,8 +195,7 @@ if (empty($reshook))
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -316,8 +313,7 @@ if ($action == 'create')
|
||||
{
|
||||
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<option value="'.$key.'">'.$langs->trans($value).'</option>';
|
||||
}
|
||||
}
|
||||
@ -346,8 +342,7 @@ if ($action == 'create')
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$id = GETPOST("id", 'int');
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
@ -499,13 +494,11 @@ else
|
||||
{
|
||||
if ($user->rights->stock->creer)
|
||||
print "<a class=\"butAction\" href=\"card.php?action=edit&id=".$object->id."\">".$langs->trans("Modify")."</a>";
|
||||
else
|
||||
print "<a class=\"butActionRefused classfortooltip\" href=\"#\">".$langs->trans("Modify")."</a>";
|
||||
else print "<a class=\"butActionRefused classfortooltip\" href=\"#\">".$langs->trans("Modify")."</a>";
|
||||
|
||||
if ($user->rights->stock->supprimer)
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
else
|
||||
print "<a class=\"butActionRefused classfortooltip\" href=\"#\">".$langs->trans("Delete")."</a>";
|
||||
else print "<a class=\"butActionRefused classfortooltip\" href=\"#\">".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,8 +664,7 @@ else
|
||||
print '<td class="liste_total"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>\n";
|
||||
@ -751,8 +743,7 @@ else
|
||||
{
|
||||
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<option value="'.$key.'">'.$langs->trans($value).'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,8 +166,7 @@ class Entrepot extends CommonObject
|
||||
$this->statuts[self::STATUS_OPEN_ALL] = 'OpenAll';
|
||||
$this->statuts[self::STATUS_OPEN_INTERNAL] = 'OpenInternal';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->statuts[self::STATUS_OPEN_ALL] = 'Opened';
|
||||
}
|
||||
}
|
||||
@ -236,8 +235,7 @@ class Entrepot extends CommonObject
|
||||
$this->db->commit();
|
||||
return $id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_syslog(get_class($this)."::create return -3");
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
@ -249,8 +247,7 @@ class Entrepot extends CommonObject
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
dol_syslog(get_class($this)."::create Error ".$this->db->error());
|
||||
$this->db->rollback();
|
||||
@ -426,8 +423,7 @@ class Entrepot extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -461,8 +457,7 @@ class Entrepot extends CommonObject
|
||||
{
|
||||
$sql .= " WHERE rowid = '".$id."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
if ($ref) $sql .= " AND ref = '".$this->db->escape($ref)."'";
|
||||
}
|
||||
@ -500,14 +495,12 @@ class Entrepot extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Record Not Found";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
@ -554,8 +547,7 @@ class Entrepot extends CommonObject
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
@ -619,8 +611,7 @@ class Entrepot extends CommonObject
|
||||
$ret['nb'] = $obj->nb;
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -654,8 +645,7 @@ class Entrepot extends CommonObject
|
||||
$ret['value'] = $obj->value;
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -131,8 +131,7 @@ if ($_GET["id"])
|
||||
print '<br><img src="'.$url.'" alt="Valorisation du stock annee '.($year - 1).'">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$langs->load("errors");
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
}
|
||||
|
||||
@ -122,8 +122,7 @@ if ($result)
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -142,8 +142,7 @@ function ordered($product_id)
|
||||
return null; //img_picto('', 'stcomm-1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error = $db->lasterror();
|
||||
dol_print_error($db);
|
||||
|
||||
|
||||
@ -293,8 +293,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -126,8 +126,7 @@ if ($action == 'addline')
|
||||
if ($producttmp->hasbatch())
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,8 +225,7 @@ if ($action == 'createmovements')
|
||||
setEventMessages($product->errors, $product->errorss, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$arraybatchinfo = $product->loadBatchInfo($batch);
|
||||
if (count($arraybatchinfo) > 0)
|
||||
{
|
||||
@ -236,8 +234,7 @@ if ($action == 'createmovements')
|
||||
$dluo = $firstrecord['sellby'];
|
||||
//var_dump($batch); var_dump($arraybatchinfo); var_dump($firstrecord); var_dump($dlc); var_dump($dluo); exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$dlc = '';
|
||||
$dluo = '';
|
||||
}
|
||||
@ -281,8 +278,7 @@ if ($action == 'createmovements')
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// dol_print_error('',"Bad value saved into sessions");
|
||||
$error++;
|
||||
}
|
||||
@ -298,8 +294,7 @@ if ($action == 'createmovements')
|
||||
header("Location: ".DOL_URL_ROOT.'/product/stock/index.php'); // Redirect to avoid pb when using back
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
@ -364,8 +359,7 @@ if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) $filtertype = '';
|
||||
if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
|
||||
$limit = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$limit = $conf->global->PRODUIT_LIMIT_SIZE;
|
||||
}
|
||||
|
||||
|
||||
@ -208,8 +208,7 @@ if ($action == "correct_stock")
|
||||
$origin_id
|
||||
); // We do not change value of stock for a correction
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $product->correct_stock(
|
||||
$user,
|
||||
$id,
|
||||
@ -228,8 +227,7 @@ if ($action == "correct_stock")
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
$action = 'correction';
|
||||
@ -313,14 +311,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
$eatby = $pdluo->eatby;
|
||||
$sellby = $pdluo->sellby;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($pdluo->error, $pdluo->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$srcwarehouseid = $id;
|
||||
$batch = GETPOST('batch_number', 'alpha');
|
||||
$eatby = $d_eatby;
|
||||
@ -357,8 +353,7 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Remove stock
|
||||
$result1 = $product->correct_stock(
|
||||
$user,
|
||||
@ -390,14 +385,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: movement_list.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
$db->rollback();
|
||||
$action = 'transfert';
|
||||
@ -506,8 +499,7 @@ if (empty($search_inventorycode))
|
||||
{
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$limit = 0;
|
||||
}
|
||||
|
||||
@ -543,8 +535,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
if ($msid) $texte = $langs->trans('StockMovementForId', $msid);
|
||||
else
|
||||
{
|
||||
else {
|
||||
$texte = $langs->trans("ListOfStockMovements");
|
||||
if ($id) $texte .= ' ('.$langs->trans("ForThisWarehouse").')';
|
||||
}
|
||||
@ -621,8 +612,7 @@ if ($resql)
|
||||
$obj = $db->fetch_object($resqlbis);
|
||||
$lastmovementdate = $db->jdate($obj->datem);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -631,8 +621,7 @@ if ($resql)
|
||||
{
|
||||
print dol_print_date($lastmovementdate, 'dayhour');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("None");
|
||||
}
|
||||
print "</td></tr>";
|
||||
@ -1150,8 +1139,7 @@ if ($resql)
|
||||
//print '</td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -231,8 +231,7 @@ if ($action == "correct_stock")
|
||||
$origin_id
|
||||
); // We do not change value of stock for a correction
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $product->correct_stock(
|
||||
$user,
|
||||
$id,
|
||||
@ -251,8 +250,7 @@ if ($action == "correct_stock")
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
$action = 'correction';
|
||||
@ -336,14 +334,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
$eatby = $pdluo->eatby;
|
||||
$sellby = $pdluo->sellby;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($pdluo->error, $pdluo->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$srcwarehouseid = $id;
|
||||
$batch = GETPOST('batch_number', 'alphanohtml');
|
||||
$eatby = $d_eatby;
|
||||
@ -376,8 +372,7 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Remove stock
|
||||
$result1 = $product->correct_stock(
|
||||
$user,
|
||||
@ -409,14 +404,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: movement_list.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
$db->rollback();
|
||||
$action = 'transfert';
|
||||
@ -504,8 +497,7 @@ if (empty($search_inventorycode))
|
||||
{
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$limit = 0;
|
||||
}
|
||||
|
||||
@ -541,8 +533,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
if ($msid) $texte = $langs->trans('StockMovementForId', $msid);
|
||||
else
|
||||
{
|
||||
else {
|
||||
$texte = $langs->trans("ListOfStockMovements");
|
||||
if ($id) $texte .= ' ('.$langs->trans("ForThisWarehouse").')';
|
||||
}
|
||||
@ -619,8 +610,7 @@ if ($resql)
|
||||
$objbis = $db->fetch_object($resqlbis);
|
||||
$lastmovementdate = $db->jdate($objbis->datem);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -629,8 +619,7 @@ if ($resql)
|
||||
{
|
||||
print dol_print_date($lastmovementdate, 'dayhour');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("None");
|
||||
}
|
||||
print "</td></tr>";
|
||||
@ -1194,8 +1183,7 @@ if ($resql)
|
||||
//print '</td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -256,8 +256,7 @@ if ($action == "correct_stock" && !$cancel)
|
||||
$origin_id
|
||||
); // We do not change value of stock for a correction
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $object->correct_stock(
|
||||
$user,
|
||||
GETPOST("id_entrepot"),
|
||||
@ -278,14 +277,12 @@ if ($action == "correct_stock" && !$cancel)
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'correction';
|
||||
}
|
||||
@ -357,14 +354,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
$eatby = $pdluo->eatby;
|
||||
$sellby = $pdluo->sellby;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($pdluo->error, $pdluo->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$srcwarehouseid = GETPOST('id_entrepot', 'int');
|
||||
$batch = $batchnumber;
|
||||
$eatby = $d_eatby;
|
||||
@ -402,8 +397,7 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
if ($result2 < 0) $error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!$error)
|
||||
{
|
||||
// Remove stock
|
||||
@ -444,14 +438,12 @@ if ($action == "transfert_stock" && !$cancel)
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: product.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
$action = 'transfert';
|
||||
@ -473,8 +465,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans('Save'))
|
||||
if ((!GETPOST("sellby")) && (!GETPOST("eatby")) && (!$batchnumber)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("atleast1batchfield")), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$d_eatby = dol_mktime(0, 0, 0, $_POST['eatbymonth'], $_POST['eatbyday'], $_POST['eatbyyear']);
|
||||
$d_sellby = dol_mktime(0, 0, 0, $_POST['sellbymonth'], $_POST['sellbyday'], $_POST['sellbyyear']);
|
||||
$pdluo->batch = $batchnumber;
|
||||
@ -487,13 +478,11 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans('Save'))
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans('BatchInformationNotfound'), null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($pdluo->error, null, 'errors');
|
||||
}
|
||||
header("Location: product.php?id=".$id);
|
||||
@ -754,8 +743,7 @@ if ($id > 0 || $ref)
|
||||
print '<br><br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error();
|
||||
}
|
||||
|
||||
@ -780,13 +768,11 @@ if (empty($reshook))
|
||||
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=correction">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
|
||||
@ -796,13 +782,11 @@ if (empty($reshook))
|
||||
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("TransferStock").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CorrectStock").'</a>';
|
||||
}
|
||||
|
||||
@ -1093,8 +1077,7 @@ if (!$variants) {
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
@ -180,12 +180,11 @@ if (empty($reshook))
|
||||
{
|
||||
// Creation KO
|
||||
if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
@ -218,16 +217,14 @@ if (empty($reshook))
|
||||
{
|
||||
$action = 'view';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Creation KO
|
||||
if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
@ -243,8 +240,7 @@ if (empty($reshook))
|
||||
header("Location: ".dol_buildpath('/stock/list.php', 1));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
}
|
||||
|
||||
@ -155,8 +155,7 @@ if ($object->id)
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
@ -542,8 +542,7 @@ if ($resql)
|
||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -182,8 +182,7 @@ if ($action == 'order' && isset($_POST['valid']))
|
||||
{
|
||||
$errorQty++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error = $db->lasterror();
|
||||
dol_print_error($db);
|
||||
}
|
||||
@ -273,8 +272,7 @@ if ($action == 'order' && isset($_POST['valid']))
|
||||
header('Location: replenishorders.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -420,8 +418,7 @@ if ($usevirtualstock)
|
||||
$sqlProductionToProduce .= " AND mp5.fk_product = p.rowid";
|
||||
$sqlProductionToProduce .= " AND mp5.role IN ('toproduce', 'produced')";
|
||||
$sqlProductionToProduce .= " AND mm5.status IN (1,2))";
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
$sqlProductionToConsume = '0';
|
||||
$sqlProductionToProduce = '0';
|
||||
}
|
||||
@ -673,8 +670,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
||||
// If option to increase/decrease is not on an object validation, virtual stock may differs from physical stock.
|
||||
$stock = $prod->stock_theorique;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$stock = $prod->stock_reel;
|
||||
}
|
||||
|
||||
|
||||
@ -315,8 +315,7 @@ if ($resql)
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +47,7 @@ if ($pdluoid > 0)
|
||||
{
|
||||
$pdluoid = $pdluo->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db, $pdluo->error, $pdluo->errors);
|
||||
}
|
||||
}
|
||||
@ -105,8 +104,7 @@ if (!empty($conf->productbatch->enabled) &&
|
||||
print '<input type="text" name="batch_number_bis" size="40" disabled="disabled" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
print '<input type="hidden" name="batch_number" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<input type="text" name="batch_number" size="40" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -150,8 +150,7 @@ if ($result)
|
||||
print '<br><img src="'.$url.'">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -79,8 +79,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
||||
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
|
||||
@ -91,8 +90,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'add';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -115,8 +113,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||
@ -127,8 +124,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -148,8 +144,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user