Fix phpcs

This commit is contained in:
Laurent Destailleur 2018-12-15 13:58:39 +01:00
parent c6d76e29f1
commit dbc85b42ba
15 changed files with 255 additions and 257 deletions

View File

@ -1690,11 +1690,11 @@ class pdf_cyan extends ModelePDFPropales
/** /**
* Define Array Column Field * Define Array Column Field
* *
* @param object $object common object * @param object $object common object
* @param outputlangs $outputlangs langs * @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return null
*/ */
function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0)

View File

@ -173,6 +173,7 @@ class doc_generic_reception_odt extends ModelePdfReception
return $texte; return $texte;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to build a document on disk using the generic odt module. * Function to build a document on disk using the generic odt module.
* *
@ -186,6 +187,7 @@ class doc_generic_reception_odt extends ModelePdfReception
*/ */
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
// phpcs:enable
global $user,$langs,$conf,$mysoc,$hookmanager; global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath)) if (empty($srctemplatepath))
@ -517,6 +519,4 @@ class doc_generic_reception_odt extends ModelePdfReception
return -1; return -1;
} }
}
}

View File

@ -406,7 +406,7 @@ class pdf_squille extends ModelePdfReception
$pageposafter=$pageposbefore; $pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit; //print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
@ -585,6 +585,7 @@ class pdf_squille extends ModelePdfReception
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show total to pay * Show total to pay
* *
@ -597,6 +598,7 @@ class pdf_squille extends ModelePdfReception
*/ */
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs,$totalOrdered) function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs,$totalOrdered)
{ {
// phpcs:enable
global $conf,$mysoc; global $conf,$mysoc;
$sign=1; $sign=1;
@ -627,23 +629,23 @@ class pdf_squille extends ModelePdfReception
$totalWeight=$tmparray['weight']; $totalWeight=$tmparray['weight'];
$totalVolume=$tmparray['volume']; $totalVolume=$tmparray['volume'];
$totalToShip=$tmparray['toship']; $totalToShip=$tmparray['toship'];
// Set trueVolume and volume_units not currently stored into database // Set trueVolume and volume_units not currently stored into database
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
{ {
$object->trueVolume= ($object->trueWidth * $object->trueHeight * $object->trueDepth); $object->trueVolume= ($object->trueWidth * $object->trueHeight * $object->trueDepth);
$object->volume_units=$object->size_units * 3; $object->volume_units=$object->size_units * 3;
} }
if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
if ($object->trueVolume) $totalVolumetoshow=showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); if ($object->trueVolume) $totalVolumetoshow=showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255,255,255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1);
@ -962,7 +964,7 @@ class pdf_squille extends ModelePdfReception
// If RECEPTION contact defined, we use it // If RECEPTION contact defined, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->$origin->getIdContact('external','SHIPPING'); $arrayidcontact=$object->$origin->getIdContact('external','SHIPPING');
if (count($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
@ -992,7 +994,7 @@ class pdf_squille extends ModelePdfReception
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($posx+2,$posy); $pdf->SetXY($posx+2,$posy);
$pdf->MultiCell($widthrecbox-2, 4, $carac_client, 0, 'L'); $pdf->MultiCell($widthrecbox-2, 4, $carac_client, 0, 'L');
// Show recipient // Show recipient
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
@ -1007,8 +1009,8 @@ class pdf_squille extends ModelePdfReception
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L'); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L');
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show sender name // Show sender name
$pdf->SetXY($posx+2,$posy+3); $pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B',$default_font_size); $pdf->SetFont('','B',$default_font_size);
@ -1027,7 +1029,7 @@ class pdf_squille extends ModelePdfReception
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF $pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
@ -1039,6 +1041,4 @@ class pdf_squille extends ModelePdfReception
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf,$outputlangs,'RECEPTION_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); return pdf_pagefoot($pdf,$outputlangs,'RECEPTION_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -106,7 +106,7 @@ class mod_reception_beryl extends ModelNumRefReception
$sql.= " FROM ".MAIN_DB_PREFIX."reception"; $sql.= " FROM ".MAIN_DB_PREFIX."reception";
$sql.= " WHERE ref like '".$this->prefix."____-%'"; $sql.= " WHERE ref like '".$this->prefix."____-%'";
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -141,5 +141,4 @@ class mod_reception_beryl extends ModelNumRefReception
{ {
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
}
}

View File

@ -128,10 +128,8 @@ class mod_reception_moonstone extends ModelNumRefReception
* @param Object $objforref Reception object * @param Object $objforref Reception object
* @return string Next free value * @return string Next free value
*/ */
function reception_get_num($objsoc,$objforref) function reception_get_num($objsoc,$objforref)
{ {
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
}
}

View File

@ -32,7 +32,8 @@ abstract class ModelePdfReception extends CommonDocGenerator
var $error=''; var $error='';
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
@ -41,6 +42,7 @@ abstract class ModelePdfReception extends CommonDocGenerator
*/ */
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type='reception'; $type='reception';

View File

@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->fournisseur->enabled)){ if (! empty($conf->fournisseur->enabled)){
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
} }
@ -140,7 +140,7 @@ if (empty($reshook))
$object->fetch($id); $object->fetch($id);
$result = $object->reOpen(); $result = $object->reOpen();
} }
// Confirm back to draft status // Confirm back to draft status
if ($action == 'modif' && $user->rights->reception->creer) if ($action == 'modif' && $user->rights->reception->creer)
{ {
@ -220,7 +220,7 @@ if (empty($reshook))
// Create reception // Create reception
if ($action == 'add' && $user->rights->reception->creer) if ($action == 'add' && $user->rights->reception->creer)
{ {
$error = 0; $error = 0;
$predef = ''; $predef = '';
@ -250,7 +250,7 @@ if (empty($reshook))
$objectsrc->fetch($object->origin_id); $objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid; $object->socid = $objectsrc->socid;
$object->ref_supplier = GETPOST('ref_supplier', 'alpha'); $object->ref_supplier = GETPOST('ref_supplier', 'alpha');
$object->model_pdf = GETPOST('model'); $object->model_pdf = GETPOST('model');
@ -293,23 +293,23 @@ if (empty($reshook))
$stockLocation = "ent1".$i."_0"; $stockLocation = "ent1".$i."_0";
$qty = "qtyl".$i; $qty = "qtyl".$i;
//var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit;
//reception line for product with no batch management and no multiple stock location //reception line for product with no batch management and no multiple stock location
if (GETPOST($qty, 'int') > 0) if (GETPOST($qty, 'int') > 0)
$totalqty += GETPOST($qty, 'int'); $totalqty += GETPOST($qty, 'int');
// Extrafields // Extrafields
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
} }
if ($totalqty > 0) // There is at least one thing to ship if ($totalqty > 0) // There is at least one thing to ship
{ {
@ -325,19 +325,19 @@ if (empty($reshook))
$eatby = "dlc".$i; $eatby = "dlc".$i;
$sellby = "dluo".$i; $sellby = "dluo".$i;
$batch = "batch".$i; $batch = "batch".$i;
$timeFormat = '%d/%m/%Y'; $timeFormat = '%d/%m/%Y';
if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS))
{ {
$ent = "entl".$i; $ent = "entl".$i;
$idl = "idl".$i; $idl = "idl".$i;
$entrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int'); $entrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int');
if ($entrepot_id < 0) if ($entrepot_id < 0)
$entrepot_id = ''; $entrepot_id = '';
if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES))
@ -346,9 +346,9 @@ if (empty($reshook))
$sellby = GETPOST($sellby, 'alpha'); $sellby = GETPOST($sellby, 'alpha');
$eatbydate = str_replace('/','-',$eatby); $eatbydate = str_replace('/','-',$eatby);
$sellbydate = str_replace('/','-',$sellby); $sellbydate = str_replace('/','-',$sellby);
$ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate),strtotime($sellbydate), GETPOST($batch, 'alpha')); $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate),strtotime($sellbydate), GETPOST($batch, 'alpha'));
if ($ret < 0) if ($ret < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@ -356,15 +356,15 @@ if (empty($reshook))
} }
} }
} }
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object); $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++; if ($ret < 0) $error++;
if (! $error) if (! $error)
{ {
$ret=$object->create($user); // This create reception (like Odoo picking) and line of receptions. Stock movement will when validating reception. $ret=$object->create($user); // This create reception (like Odoo picking) and line of receptions. Stock movement will when validating reception.
if ($ret <= 0) if ($ret <= 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@ -572,14 +572,14 @@ if (empty($reshook))
{ {
if ($lines[$i]->id == $line_id) if ($lines[$i]->id == $line_id)
{ {
// delete single warehouse line // delete single warehouse line
$line->id = $line_id; $line->id = $line_id;
if (! $error && $line->delete($user) < 0) if (! $error && $line->delete($user) < 0)
{ {
$error++; $error++;
} }
} }
unset($_POST["lineid"]); unset($_POST["lineid"]);
} }
@ -620,23 +620,23 @@ if (empty($reshook))
$line->fk_product = $lines[$i]->fk_product; $line->fk_product = $lines[$i]->fk_product;
if ($lines[$i]->fk_product > 0) if ($lines[$i]->fk_product > 0)
{ {
// single warehouse reception line // single warehouse reception line
$stockLocation = "entl".$line_id; $stockLocation = "entl".$line_id;
$qty = "qtyl".$line_id; $qty = "qtyl".$line_id;
$comment = "comment".$line_id; $comment = "comment".$line_id;
$line->id = $line_id; $line->id = $line_id;
$line->fk_entrepot = GETPOST($stockLocation, 'int'); $line->fk_entrepot = GETPOST($stockLocation, 'int');
$line->qty = GETPOST($qty, 'int'); $line->qty = GETPOST($qty, 'int');
$line->comment = GETPOST($comment, 'alpha'); $line->comment = GETPOST($comment, 'alpha');
if(!empty($conf->productbatch->enabled)){ if(!empty($conf->productbatch->enabled)){
$batch = "batch".$line_id; $batch = "batch".$line_id;
$dlc = "dlc".$line_id; $dlc = "dlc".$line_id;
@ -649,17 +649,17 @@ if (empty($reshook))
$line->eatby = strtotime($eatbydate); $line->eatby = strtotime($eatbydate);
$line->sellby = strtotime($sellbydate); $line->sellby = strtotime($sellbydate);
} }
if ($line->update($user) < 0) if ($line->update($user) < 0)
{ {
setEventMessages($line->error, $line->errors, 'errors'); setEventMessages($line->error, $line->errors, 'errors');
$error++; $error++;
} }
} }
else // Product no predefined else // Product no predefined
{ {
@ -759,7 +759,7 @@ if ($action == 'create')
{ {
if($origin == 'supplierorder')$classname = 'CommandeFournisseur'; if($origin == 'supplierorder')$classname = 'CommandeFournisseur';
else $classname = ucfirst($origin); else $classname = ucfirst($origin);
$object = new $classname($db); $object = new $classname($db);
if ($object->fetch($origin_id)) // This include the fetch_lines if ($object->fetch($origin_id)) // This include the fetch_lines
{ {
@ -949,13 +949,13 @@ if ($action == 'create')
$pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount
$fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2];
$dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int')); $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'));
} }
// with batch module enabled // with batch module enabled
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
{ {
$numAsked ++; $numAsked ++;
// eat-by date dispatch // eat-by date dispatch
// $numline=$reg[2] + 1; // line of product // $numline=$reg[2] + 1; // line of product
@ -969,10 +969,10 @@ $numAsked ++;
$dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']); $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']);
$fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2];
$dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'),'DLC'=> $dDLC,'DLUO'=> $dDLUO,'lot'=> GETPOST($lot, 'alpha')); $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'),'DLC'=> $dDLC,'DLUO'=> $dDLUO,'lot'=> GETPOST($lot, 'alpha'));
} }
} }
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
@ -1004,7 +1004,7 @@ $numAsked ++;
// Load receptions already done for same order // Load receptions already done for same order
$object->loadReceptions(); $object->loadReceptions();
if ($numAsked) if ($numAsked)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -1022,7 +1022,7 @@ $numAsked ++;
{ {
print '<td align="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>'; print '<td align="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
} }
if (!empty($conf->productbatch->enabled)) if (!empty($conf->productbatch->enabled))
{ {
@ -1044,7 +1044,7 @@ $numAsked ++;
break; break;
} }
} }
// Show product and description // Show product and description
$type=$line->product_type?$line->product_type:$line->fk_product_type; $type=$line->product_type?$line->product_type:$line->fk_product_type;
@ -1055,8 +1055,8 @@ $numAsked ++;
print '<!-- line '.$line->rowid.' for product -->'."\n"; print '<!-- line '.$line->rowid.' for product -->'."\n";
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
// Product label // Product label
if ($line->fk_product > 0) // If predefined product if ($line->fk_product > 0) // If predefined product
{ {
@ -1066,13 +1066,13 @@ $numAsked ++;
print '<td>'; print '<td>';
print '<a name="'.$line->rowid.'"></a>'; // ancre pour retourner sur la ligne print '<a name="'.$line->rowid.'"></a>'; // ancre pour retourner sur la ligne
// Show product and description // Show product and description
$product_static->type=$line->fk_product_type; $product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product; $product_static->id=$line->fk_product;
$product_static->ref=$line->ref; $product_static->ref=$line->ref;
$product_static->status_batch=$line->product_tobatch; $product_static->status_batch=$line->product_tobatch;
$text=$product_static->getNomUrl(1); $text=$product_static->getNomUrl(1);
$text.= ' - '.(! empty($line->label)?$line->label:$line->product_label); $text.= ' - '.(! empty($line->label)?$line->label:$line->product_label);
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->desc)); $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->desc));
@ -1106,7 +1106,7 @@ $numAsked ++;
print_date_range($db->jdate($line->date_start),$db->jdate($line->date_end)); print_date_range($db->jdate($line->date_start),$db->jdate($line->date_end));
print "</td>\n"; print "</td>\n";
} }
// Qty // Qty
print '<td align="center">'.$line->qty; print '<td align="center">'.$line->qty;
print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value=\''.$line->id.'\' />'; print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value=\''.$line->id.'\' />';
@ -1117,14 +1117,14 @@ $numAsked ++;
// Qty already received // Qty already received
print '<td align="center">'; print '<td align="center">';
$quantityDelivered = $object->receptions[$line->id]; $quantityDelivered = $object->receptions[$line->id];
print $quantityDelivered; print $quantityDelivered;
print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">'; print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
print '</td>'; print '</td>';
if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES))
{ {
$quantityToBeDelivered = 0; $quantityToBeDelivered = 0;
@ -1134,18 +1134,18 @@ $numAsked ++;
$quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty'];
} }
$warehouse_id = $dispatchLines[$indiceAsked]['ent']; $warehouse_id = $dispatchLines[$indiceAsked]['ent'];
$warehouseObject = null; $warehouseObject = null;
if ( !empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection if ( !empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
{ {
print '<!-- Case warehouse already known or product not a predefined product -->'; print '<!-- Case warehouse already known or product not a predefined product -->';
$stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number $stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number
$deliverableQty=$dispatchLines[$indiceAsked]['qty']; $deliverableQty=$dispatchLines[$indiceAsked]['qty'];
// Quantity to send // Quantity to send
print '<td align="center">'; print '<td align="center">';
if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
@ -1156,7 +1156,7 @@ $numAsked ++;
} }
else print $langs->trans("NA"); else print $langs->trans("NA");
print '</td>'; print '</td>';
// Stock // Stock
if (! empty($conf->stock->enabled)) if (! empty($conf->stock->enabled))
{ {
@ -1171,7 +1171,7 @@ $numAsked ++;
{ {
print '<!-- Show warehouse selection -->'; print '<!-- Show warehouse selection -->';
print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0 , 0, $line->fk_product, '', 1); print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0 , 0, $line->fk_product, '', 1);
} }
} }
else else
@ -1180,7 +1180,7 @@ $numAsked ++;
} }
print '</td>'; print '</td>';
} }
if(!empty($conf->productbatch->enabled) ){ if(!empty($conf->productbatch->enabled) ){
if( !empty($product->status_batch)){ if( !empty($product->status_batch)){
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>'; print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
@ -1192,19 +1192,19 @@ $numAsked ++;
print '</td>'; print '</td>';
}else { }else {
print '<td colspan="3"></td>'; print '<td colspan="3"></td>';
} }
} }
print "</tr>\n"; print "</tr>\n";
} }
//Display lines extrafields //Display lines extrafields
@ -1257,7 +1257,7 @@ else if ($id || $ref)
$lines = $object->lines; $lines = $object->lines;
$num_prod = count($lines); $num_prod = count($lines);
if ($object->id > 0) if ($object->id > 0)
{ {
if (!empty($object->origin) && $object->origin_id > 0) if (!empty($object->origin) && $object->origin_id > 0)
@ -1273,7 +1273,7 @@ else if ($id || $ref)
$soc->fetch($object->socid); $soc->fetch($object->socid);
$res = $object->fetch_optionals($object->id, $extralabels); $res = $object->fetch_optionals($object->id, $extralabels);
$head=reception_prepare_head($object); $head=reception_prepare_head($object);
dol_fiche_head($head, 'reception', $langs->trans("Reception"), -1, 'reception'); dol_fiche_head($head, 'reception', $langs->trans("Reception"), -1, 'reception');
@ -1355,10 +1355,10 @@ else if ($id || $ref)
$linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Ref customer reception // Ref customer reception
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1);
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
@ -1571,7 +1571,7 @@ else if ($id || $ref)
// Other attributes // Other attributes
$cols = 2; $cols = 2;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print '</table>'; print '</table>';
@ -1616,7 +1616,7 @@ else if ($id || $ref)
print '</tr>'; print '</tr>';
// Tracking Number // Tracking Number
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'tracking_number',$object->tracking_number,$object,$user->rights->reception->creer).'</td><td colspan="3">'; print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'tracking_number',$object->tracking_number,$object,$user->rights->reception->creer).'</td><td colspan="3">';
print $form->editfieldval("TrackingNumber",'tracking_number',$object->tracking_url,$object,$user->rights->reception->creer,'string',$object->tracking_number); print $form->editfieldval("TrackingNumber",'tracking_number',$object->tracking_url,$object,$user->rights->reception->creer,'string',$object->tracking_number);
print '</td></tr>'; print '</td></tr>';
@ -1756,9 +1756,9 @@ else if ($id || $ref)
// Get list of products already sent for same source object into $alreadysent // Get list of products already sent for same source object into $alreadysent
$alreadysent = array(); $alreadysent = array();
$origin = 'commande_fournisseur'; $origin = 'commande_fournisseur';
if ($origin && $origin_id > 0) if ($origin && $origin_id > 0)
{ {
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
@ -1779,7 +1779,7 @@ else if ($id || $ref)
$sql.= " AND ed.fk_reception !=".$object->id; $sql.= " AND ed.fk_reception !=".$object->id;
//if ($filter) $sql.= $filter; //if ($filter) $sql.= $filter;
$sql.= " ORDER BY obj.fk_product"; $sql.= " ORDER BY obj.fk_product";
dol_syslog("get list of reception lines", LOG_DEBUG); dol_syslog("get list of reception lines", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
@ -1828,8 +1828,8 @@ else if ($id || $ref)
print '<td>'; print '<td>';
$text=$lines[$i]->product->getNomUrl(1); $text=$lines[$i]->product->getNomUrl(1);
$text.= ' - '.$label; $text.= ' - '.$label;
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->product->description)); $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->product->description));
@ -1857,7 +1857,7 @@ else if ($id || $ref)
print_date_range($lines[$i]->date_start,$lines[$i]->date_end); print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
print "</td>\n"; print "</td>\n";
} }
if ($action == 'editline' && $lines[$i]->id == $line_id) if ($action == 'editline' && $lines[$i]->id == $line_id)
{ {
print '<td ><textarea name="comment'.$line_id.'" id="comment'.$line_id.'" /> '.$lines[$i]->comment.'</textarea></td>'; print '<td ><textarea name="comment'.$line_id.'" id="comment'.$line_id.'" /> '.$lines[$i]->comment.'</textarea></td>';
@ -1889,7 +1889,7 @@ else if ($id || $ref)
$reception_static->fetch($receptionline_var['reception_id']); $reception_static->fetch($receptionline_var['reception_id']);
print $reception_static->getNomUrl(1); print $reception_static->getNomUrl(1);
print ' - '.$receptionline_var['qty']; print ' - '.$receptionline_var['qty'];
$htmltext=$langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid'])?$langs->trans("Draft"):dol_print_date($receptionline_var['date_valid'], 'dayhour')); $htmltext=$langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid'])?$langs->trans("Draft"):dol_print_date($receptionline_var['date_valid'], 'dayhour'));
if (! empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) if (! empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0)
{ {
@ -1927,7 +1927,7 @@ else if ($id || $ref)
print '</td>'; print '</td>';
} }
print '</tr>'; print '</tr>';
} }
else else
{ {
@ -1953,14 +1953,14 @@ else if ($id || $ref)
if (! empty($conf->stock->enabled)) if (! empty($conf->stock->enabled))
{ {
print '<td align="left">'; print '<td align="left">';
if ($lines[$i]->fk_entrepot > 0) if ($lines[$i]->fk_entrepot > 0)
{ {
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$entrepot->fetch($lines[$i]->fk_entrepot); $entrepot->fetch($lines[$i]->fk_entrepot);
print $entrepot->getNomUrl(1); print $entrepot->getNomUrl(1);
} }
print '</td>'; print '</td>';
} }
@ -1974,13 +1974,13 @@ else if ($id || $ref)
$detail =''; $detail ='';
if ($lines[$i]->product->status_batch) if ($lines[$i]->product->status_batch)
{ {
$detail.= $langs->trans("Batch").': '.$lines[$i]->batch; $detail.= $langs->trans("Batch").': '.$lines[$i]->batch;
$detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby,"day"); $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby,"day");
$detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby,"day");
$detail.= '<br>'; $detail.= '<br>';
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
} }
else else
@ -2006,7 +2006,7 @@ else if ($id || $ref)
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
if ($action == 'editline' && $lines[$i]->id == $line_id) if ($action == 'editline' && $lines[$i]->id == $line_id)
{ {
print '<td align="center" colspan="2" valign="middle">'; print '<td align="center" colspan="2" valign="middle">';
@ -2130,7 +2130,7 @@ else if ($id || $ref)
} }
} }
// Close // Close
if ($object->statut == Reception::STATUS_VALIDATED) if ($object->statut == Reception::STATUS_VALIDATED)
{ {
@ -2173,7 +2173,7 @@ else if ($id || $ref)
$genallowed=$user->rights->reception->lire; $genallowed=$user->rights->reception->lire;
$delallowed=$user->rights->reception->creer; $delallowed=$user->rights->reception->creer;
print $formfile->showdocuments('reception',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); print $formfile->showdocuments('reception',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
@ -2185,7 +2185,7 @@ else if ($id || $ref)
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
} }
if ($action == 'presend') if ($action == 'presend')
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);

View File

@ -73,7 +73,7 @@ class Reception extends CommonObject
var $trueSize; var $trueSize;
var $date_delivery; // Date delivery planed var $date_delivery; // Date delivery planed
/** /**
* Effective delivery date * Effective delivery date
@ -148,10 +148,10 @@ class Reception extends CommonObject
} }
$obj = new $classname(); $obj = new $classname();
$numref = ""; $numref = "";
$numref = $obj->getNextValue($soc,$this); $numref = $obj->getNextValue($soc,$this);
if ( $numref != "") if ( $numref != "")
{ {
return $numref; return $numref;
@ -245,9 +245,9 @@ class Reception extends CommonObject
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."reception"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."reception");
@ -264,13 +264,13 @@ class Reception extends CommonObject
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$this->lines[$i]->fk_reception = $this->id; $this->lines[$i]->fk_reception = $this->id;
if (! $this->lines[$i]->create($user) > 0) if (! $this->lines[$i]->create($user) > 0)
{ {
$error++; $error++;
} }
} }
if (! $error && $this->id && $this->origin_id) if (! $error && $this->id && $this->origin_id)
@ -349,7 +349,7 @@ class Reception extends CommonObject
} }
} }
/** /**
* Get object and lines from database * Get object and lines from database
@ -449,8 +449,8 @@ class Reception extends CommonObject
* Thirparty * Thirparty
*/ */
$result=$this->fetch_thirdparty(); $result=$this->fetch_thirdparty();
// Retrieve all extrafields for reception // Retrieve all extrafields for reception
// fetch optionals attributes and labels // fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@ -521,17 +521,17 @@ class Reception extends CommonObject
$soc = new Societe($this->db); $soc = new Societe($this->db);
$soc->fetch($this->socid); $soc->fetch($this->socid);
// Define new ref // Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{ {
$numref = $this->getNextNumRef($soc); $numref = $this->getNextNumRef($soc);
} }
else { else {
$numref = $this->ref; $numref = $this->ref;
} }
$this->newref = $numref; $this->newref = $numref;
$now=dol_now(); $now=dol_now();
@ -567,8 +567,8 @@ class Reception extends CommonObject
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed";
$sql.= " WHERE ed.fk_reception = ".$this->id; $sql.= " WHERE ed.fk_reception = ".$this->id;
$sql.= " AND cd.rowid = ed.fk_commandefourndet"; $sql.= " AND cd.rowid = ed.fk_commandefourndet";
dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); dol_syslog(get_class($this)."::valid select details", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -578,9 +578,9 @@ class Reception extends CommonObject
for ($i = 0; $i < $cpt; $i++) for ($i = 0; $i < $cpt; $i++)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$qty = $obj->qty; $qty = $obj->qty;
if ($qty <= 0) continue; if ($qty <= 0) continue;
dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
@ -625,7 +625,7 @@ class Reception extends CommonObject
} }
} }
// Change status of order to "reception in process" // Change status of order to "reception in process"
$ret = $this->setStatut(4, $this->origin_id, 'commande_fournisseur'); $ret = $this->setStatut(4, $this->origin_id, 'commande_fournisseur');
@ -731,11 +731,11 @@ class Reception extends CommonObject
$supplierorderline = new CommandeFournisseurLigne($this->db); $supplierorderline = new CommandeFournisseurLigne($this->db);
$supplierorderline->fetch($id); $supplierorderline->fetch($id);
if (! empty($conf->stock->enabled) && ! empty($supplierorderline->fk_product)) if (! empty($conf->stock->enabled) && ! empty($supplierorderline->fk_product))
{ {
$fk_product = $supplierorderline->fk_product; $fk_product = $supplierorderline->fk_product;
if (! ($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_RECEPTIONS)) if (! ($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_RECEPTIONS))
{ {
$langs->load("errors"); $langs->load("errors");
@ -743,13 +743,13 @@ class Reception extends CommonObject
return -1; return -1;
} }
} }
// extrafields // extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
$line->array_options = $array_options; $line->array_options = $array_options;
$line->fk_product = $fk_product; $line->fk_product = $fk_product;
$line->fk_commande = $supplierorderline->fk_commande ; $line->fk_commande = $supplierorderline->fk_commande ;
$line->fk_user = $user->id ; $line->fk_user = $user->id ;
@ -876,11 +876,11 @@ class Reception extends CommonObject
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error=0; $error=0;
$this->error=''; $this->error='';
$this->db->begin(); $this->db->begin();
// Stock control // Stock control
@ -910,11 +910,11 @@ class Reception extends CommonObject
$mouvS = new MouvementStock($this->db); $mouvS = new MouvementStock($this->db);
// we do not log origin because it will be deleted // we do not log origin because it will be deleted
$mouvS->origin = null; $mouvS->origin = null;
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref),'', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref),'', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
} }
} }
else else
@ -1038,7 +1038,7 @@ class Reception extends CommonObject
dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php'); dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php');
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch WHERE fk_reception='.$this->id; $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch WHERE fk_reception='.$this->id;
$resql = $db->query($sql); $resql = $db->query($sql);
if(!empty($resql)){ if(!empty($resql)){
$this->lines = array(); $this->lines = array();
while ($obj = $resql->fetch_object()){ while ($obj = $resql->fetch_object()){
@ -1064,23 +1064,23 @@ class Reception extends CommonObject
$line->description = ''; $line->description = '';
$line->label = $obj->label; $line->label = $obj->label;
} }
$pu_ht=($line->subprice*$line->qty)*(100-$line->remise_percent)/100; $pu_ht=($line->subprice*$line->qty)*(100-$line->remise_percent)/100;
$tva = $pu_ht*$line->tva_tx/100; $tva = $pu_ht*$line->tva_tx/100;
$this->total_ht += $pu_ht; $this->total_ht += $pu_ht;
$this->total_tva += $pu_ht*$line->tva_tx/100; $this->total_tva += $pu_ht*$line->tva_tx/100;
$this->total_ttc += $pu_ht+$tva; $this->total_ttc += $pu_ht+$tva;
$this->lines[]=$line; $this->lines[]=$line;
} }
return 1; return 1;
}else { }else {
return -1; return -1;
} }
} }
/** /**
@ -1252,7 +1252,7 @@ class Reception extends CommonObject
$line->desc=$langs->trans("Description")." ".$xnbp; $line->desc=$langs->trans("Description")." ".$xnbp;
$line->libelle=$langs->trans("Description")." ".$xnbp; $line->libelle=$langs->trans("Description")." ".$xnbp;
$line->qty=10; $line->qty=10;
$line->fk_product=$this->commande->lines[$xnbp]->fk_product; $line->fk_product=$this->commande->lines[$xnbp]->fk_product;
$this->lines[]=$line; $this->lines[]=$line;
@ -1260,7 +1260,7 @@ class Reception extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the planned delivery date * Set the planned delivery date
@ -1388,7 +1388,7 @@ class Reception extends CommonObject
} }
if ($resql < 0) dol_print_error($this->db,''); if ($resql < 0) dol_print_error($this->db,'');
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Activate delivery method. * Activate delivery method.
@ -1406,7 +1406,7 @@ class Reception extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* DesActivate delivery method. * DesActivate delivery method.
@ -1530,16 +1530,16 @@ class Reception extends CommonObject
dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); dol_syslog(get_class($this)."::valid select details", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$cpt = $this->db->num_rows($resql); $cpt = $this->db->num_rows($resql);
for ($i = 0; $i < $cpt; $i++) for ($i = 0; $i < $cpt; $i++)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$qty = $obj->qty; $qty = $obj->qty;
if ($qty <= 0) continue; if ($qty <= 0) continue;
dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
@ -1557,7 +1557,7 @@ class Reception extends CommonObject
$this->errors = $mouvS->errors; $this->errors = $mouvS->errors;
$error++; break; $error++; break;
} }
} }
else else
{ {
@ -1565,14 +1565,14 @@ class Reception extends CommonObject
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr",$numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr",$numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
if ($result < 0) { if ($result < 0) {
$this->error = $mouvS->error; $this->error = $mouvS->error;
$this->errors = $mouvS->errors; $this->errors = $mouvS->errors;
$error++; break; $error++; break;
} }
} }
} }
} }
else else
@ -1621,10 +1621,10 @@ class Reception extends CommonObject
$error=0; $error=0;
$this->db->begin(); $this->db->begin();
$this->setClosed(); $this->setClosed();
$sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1';
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0';
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -1693,7 +1693,7 @@ class Reception extends CommonObject
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed";
$sql.= " WHERE ed.fk_reception = ".$this->id; $sql.= " WHERE ed.fk_reception = ".$this->id;
$sql.= " AND cd.rowid = ed.fk_commandefourndet"; $sql.= " AND cd.rowid = ed.fk_commandefourndet";
dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); dol_syslog(get_class($this)."::valid select details", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -1702,11 +1702,11 @@ class Reception extends CommonObject
for ($i = 0; $i < $cpt; $i++) for ($i = 0; $i < $cpt; $i++)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$qty = $obj->qty; $qty = $obj->qty;
if ($qty <= 0) continue; if ($qty <= 0) continue;
dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid); dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid);
//var_dump($this->lines[$i]); //var_dump($this->lines[$i]);
@ -1754,7 +1754,7 @@ class Reception extends CommonObject
$error++; $error++;
} }
} }
if($this->origin == 'order_supplier'){ if($this->origin == 'order_supplier'){
$commande = new CommandeFournisseur($this->db); $commande = new CommandeFournisseur($this->db);
$commande->fetch($this->origin_id); $commande->fetch($this->origin_id);
@ -1777,8 +1777,8 @@ class Reception extends CommonObject
return -1; return -1;
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set draft status * Set draft status
@ -1840,10 +1840,10 @@ class Reception extends CommonObject
for ($i = 0; $i < $cpt; $i++) for ($i = 0; $i < $cpt; $i++)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$qty = $obj->qty; $qty = $obj->qty;
if ($qty <= 0) continue; if ($qty <= 0) continue;
dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
@ -1861,7 +1861,7 @@ class Reception extends CommonObject
$this->error = $mouvS->error; $this->error = $mouvS->error;
$this->errors = $mouvS->errors; $this->errors = $mouvS->errors;
$error++; break; $error++; break;
} }
} }
else else
@ -1876,7 +1876,7 @@ class Reception extends CommonObject
$error++; break; $error++; break;
} }
} }
} }
} }
else else
@ -1885,7 +1885,7 @@ class Reception extends CommonObject
$error++; $error++;
} }
} }
if (!$error) { if (!$error) {
// Call trigger // Call trigger
$result=$this->call_trigger('RECEPTION_UNVALIDATE',$user); $result=$this->call_trigger('RECEPTION_UNVALIDATE',$user);
@ -1899,7 +1899,7 @@ class Reception extends CommonObject
$origin = $this->origin; $origin = $this->origin;
if ($this->$origin->statut == 4) // If order source of reception is "partially received" if ($this->$origin->statut == 4) // If order source of reception is "partially received"
{ {
// Check if there is no more reception validated. // Check if there is no more reception validated.
$this->$origin->fetchObjectLinked(); $this->$origin->fetchObjectLinked();
$setStatut = 1; $setStatut = 1;
if (!empty($this->$origin->linkedObjects['reception'])) if (!empty($this->$origin->linkedObjects['reception']))
@ -1970,7 +1970,7 @@ class Reception extends CommonObject
$modelpath = "core/modules/reception/doc/"; $modelpath = "core/modules/reception/doc/";
$this->fetch_origin(); $this->fetch_origin();
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }

View File

@ -42,7 +42,7 @@ class ReceptionStats extends Stats
var $from; var $from;
var $field; var $field;
var $where; var $where;
/** /**
* Constructor * Constructor
@ -55,13 +55,13 @@ class ReceptionStats extends Stats
function __construct($db, $socid, $mode, $userid=0) function __construct($db, $socid, $mode, $userid=0)
{ {
global $user, $conf; global $user, $conf;
$this->db = $db; $this->db = $db;
$this->socid = ($socid > 0 ? $socid : 0); $this->socid = ($socid > 0 ? $socid : 0);
$this->userid = $userid; $this->userid = $userid;
$this->cachefilesuffix = $mode; $this->cachefilesuffix = $mode;
$object=new Reception($this->db); $object=new Reception($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as c"; $this->from = MAIN_DB_PREFIX.$object->table_element." as c";
//$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; //$this->from.= ", ".MAIN_DB_PREFIX."societe as s";

View File

@ -52,14 +52,14 @@ if ($id > 0 || ! empty($ref))
{ {
$object->fetch($id, $ref); $object->fetch($id, $ref);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
if (!empty($object->origin)) if (!empty($object->origin))
{ {
$origin = $object->origin; $origin = $object->origin;
$object->fetch_origin(); $object->fetch_origin();
$typeobject = $object->origin; $typeobject = $object->origin;
} }
// Linked documents // Linked documents
@ -94,7 +94,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer)
} }
else else
{ {
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
// Reception card // Reception card
$linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Ref customer reception // Ref customer reception
$morehtmlref.=$form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1);
@ -206,11 +206,11 @@ if ($id > 0 || ! empty($ref))
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
$object->picto = 'sending'; $object->picto = 'sending';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
//print '<div class="fichehalfleft">'; //print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
@ -239,23 +239,23 @@ if ($id > 0 || ! empty($ref))
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
} }
print "</table>"; print "</table>";
//print '</div>'; //print '</div>';
//print '<div class="fichehalfright">'; //print '<div class="fichehalfright">';
//print '<div class="ficheaddleft">'; //print '<div class="ficheaddleft">';
//print '<div class="underbanner clearboth"></div>'; //print '<div class="underbanner clearboth"></div>';
//print '</div>'; //print '</div>';
//print '</div>'; //print '</div>';
print '</div>'; print '</div>';
print '<div class="clearboth"></div>'; print '<div class="clearboth"></div>';
dol_fiche_end(); dol_fiche_end();
// Lignes de contacts // Lignes de contacts
@ -268,7 +268,7 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php'); $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break; if ($res) break;
} }
} }

View File

@ -94,11 +94,11 @@ if ($resql)
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$reception->id=$obj->rowid; $reception->id=$obj->rowid;
$reception->ref=$obj->ref; $reception->ref=$obj->ref;
$reception->ref_supplier=$obj->ref_supplier; $reception->ref_supplier=$obj->ref_supplier;
print '<tr class="oddeven"><td class="nowrap">'; print '<tr class="oddeven"><td class="nowrap">';
print $reception->getNomUrl(1); print $reception->getNomUrl(1);
print "</td>"; print "</td>";
@ -149,10 +149,10 @@ if ($resql)
$orderstatic->ref_supplier=$obj->ref_supplier; $orderstatic->ref_supplier=$obj->ref_supplier;
$orderstatic->statut=$obj->fk_statut; $orderstatic->statut=$obj->fk_statut;
$orderstatic->facturee=0; $orderstatic->facturee=0;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'; print '<td class="nowrap">';
print $orderstatic->getNomUrl(1); print $orderstatic->getNomUrl(1);
@ -203,16 +203,16 @@ if ( $resql )
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$orderstatic->id=$obj->rowid; $orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref; $orderstatic->ref=$obj->ref;
$orderstatic->ref_supplier=$obj->ref_supplier; $orderstatic->ref_supplier=$obj->ref_supplier;
$orderstatic->statut=$obj->status; $orderstatic->statut=$obj->status;
$orderstatic->facturee=$obj->billed; $orderstatic->facturee=$obj->billed;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $orderstatic->getNomUrl(1); print $orderstatic->getNomUrl(1);
print '</td>'; print '</td>';
@ -263,11 +263,11 @@ if ($resql)
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$reception->id=$obj->rowid; $reception->id=$obj->rowid;
$reception->ref=$obj->ref; $reception->ref=$obj->ref;
$reception->ref_supplier=$obj->ref_supplier; $reception->ref_supplier=$obj->ref_supplier;
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $reception->getNomUrl(1); print $reception->getNomUrl(1);
print '</td>'; print '</td>';

View File

@ -169,7 +169,7 @@ if (empty($reshook))
$db->begin(); $db->begin();
$errors =array(); $errors =array();
foreach($receptions as $id_reception) foreach($receptions as $id_reception)
{ {
$rcp = new Reception($db); $rcp = new Reception($db);
// On ne facture que les réceptions validées // On ne facture que les réceptions validées
if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != 1){ if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != 1){
@ -177,14 +177,14 @@ if (empty($reshook))
$error++; $error++;
continue; continue;
} }
$object = new FactureFournisseur($db); $object = new FactureFournisseur($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])){ if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])){
$object = $TFactThird[$rcp->socid]; // If option "one bill per third" is set, we use already created reception. $object = $TFactThird[$rcp->socid]; // If option "one bill per third" is set, we use already created reception.
if(empty($object->rowid)&&$object->id != null)$object->rowid = $object->id; if(empty($object->rowid)&&$object->id != null)$object->rowid = $object->id;
if(!empty($object->rowid))$object->fetchObjectLinked(); if(!empty($object->rowid))$object->fetchObjectLinked();
$rcp->fetchObjectLinked(); $rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['order_supplier']) > 0) if (count($rcp->linkedObjectsIds['order_supplier']) > 0)
{ {
foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value)
@ -193,12 +193,12 @@ if (empty($reshook))
$object->add_object_linked('order_supplier', $value); // add supplier order linked object $object->add_object_linked('order_supplier', $value); // add supplier order linked object
} }
} }
} }
else { else {
$object->socid = $rcp->socid; $object->socid = $rcp->socid;
$object->type = FactureFournisseur::TYPE_STANDARD; $object->type = FactureFournisseur::TYPE_STANDARD;
$object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id; $object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id;
@ -219,7 +219,7 @@ if (empty($reshook))
$object->date = $datefacture; $object->date = $datefacture;
$object->origin = 'reception'; $object->origin = 'reception';
$object->origin_id = $id_reception; $object->origin_id = $id_reception;
$rcp->fetchObjectLinked(); $rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['order_supplier']) > 0) if (count($rcp->linkedObjectsIds['order_supplier']) > 0)
{ {
@ -228,7 +228,7 @@ if (empty($reshook))
$object->linked_objects['order_supplier'] = $value; $object->linked_objects['order_supplier'] = $value;
} }
} }
$res = $object->create($user); $res = $object->create($user);
//var_dump($object->error);exit; //var_dump($object->error);exit;
if($res > 0){ if($res > 0){
@ -251,7 +251,7 @@ if (empty($reshook))
$error++; $error++;
} }
} }
if (! $error) if (! $error)
{ {
$lines = $rcp->lines; $lines = $rcp->lines;
@ -332,11 +332,11 @@ if (empty($reshook))
$lines[$i]->rowid, $lines[$i]->rowid,
0, 0,
$lines[$i]->ref_supplier $lines[$i]->ref_supplier
); );
$rcp->add_object_linked('facture_fourn_det',$result); $rcp->add_object_linked('facture_fourn_det',$result);
if ($result > 0) if ($result > 0)
{ {
$lineid=$result; $lineid=$result;
@ -366,7 +366,7 @@ if (empty($reshook))
// Build doc with all invoices // Build doc with all invoices
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
$toselect = array(); $toselect = array();
if (! $error && $validate_invoices) if (! $error && $validate_invoices)
{ {
$massaction = $action = 'builddoc'; $massaction = $action = 'builddoc';
@ -399,7 +399,7 @@ if (empty($reshook))
} }
else else
{ {
$db->rollback(); $db->rollback();
$action='create'; $action='create';
$_GET["origin"]=$_POST["origin"]; $_GET["origin"]=$_POST["origin"];
@ -408,7 +408,7 @@ if (empty($reshook))
$error++; $error++;
} }
} }
} }
@ -513,7 +513,7 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$reception = new Reception($db); $reception = new Reception($db);
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected=is_array($toselect)?$toselect:array();
$param=''; $param='';
@ -524,12 +524,12 @@ if ($resql)
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv; if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param.= "&amp;search_company=".$search_company; if ($search_company) $param.= "&amp;search_company=".$search_company;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss; if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
if ($search_billed != '' && $search_billed >= 0)$param.= "&amp;search_billed=".$search_billed; if ($search_billed != '' && $search_billed >= 0)$param.= "&amp;search_billed=".$search_billed;
if ($search_town) $param.= "&amp;search_town=".$search_town; if ($search_town) $param.= "&amp;search_town=".$search_town;
if ($search_zip) $param.= "&amp;search_zip=".$search_zip; if ($search_zip) $param.= "&amp;search_zip=".$search_zip;
if ($search_state) $param.= "&amp;search_state=".$search_state; if ($search_state) $param.= "&amp;search_state=".$search_state;
if ($viewstatut) $param.= "&amp;viewstatut=".$viewstatut; if ($viewstatut) $param.= "&amp;viewstatut=".$viewstatut;
if ($search_country) $param.= "&amp;search_country=".$search_country; if ($search_country) $param.= "&amp;search_country=".$search_country;
if ($search_type_thirdparty) $param.= "&amp;search_type_thirdparty=".$search_type_thirdparty; if ($search_type_thirdparty) $param.= "&amp;search_type_thirdparty=".$search_type_thirdparty;
if ($search_ref_supplier) $param.= "&amp;search_ref_supplier=".$search_ref_supplier; if ($search_ref_supplier) $param.= "&amp;search_ref_supplier=".$search_ref_supplier;
// Add $param from extra fields // Add $param from extra fields
@ -539,12 +539,12 @@ if ($resql)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
} }
$arrayofmassactions = array( $arrayofmassactions = array(
// 'presend'=>$langs->trans("SendByMail"), // 'presend'=>$langs->trans("SendByMail"),
); );
if($user->rights->fournisseur->facture->creer)$arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisSupplier"); if($user->rights->fournisseur->facture->creer)$arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisSupplier");
if($massaction == 'createbills') $arrayofmassactions=array(); if($massaction == 'createbills') $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions); $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
@ -562,7 +562,7 @@ if ($resql)
print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num, $nbtotalofrecords, '', 0, '', '', $limit); print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num, $nbtotalofrecords, '', 0, '', '', $limit);
if ($massaction == 'createbills') if ($massaction == 'createbills')
{ {
//var_dump($_REQUEST); //var_dump($_REQUEST);
@ -610,7 +610,7 @@ if ($resql)
print '</div>'; print '</div>';
print '<br>'; print '<br>';
} }
if ($sall) if ($sall)
{ {
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
@ -807,7 +807,7 @@ if ($resql)
$reception->id=$obj->rowid; $reception->id=$obj->rowid;
$reception->ref=$obj->ref; $reception->ref=$obj->ref;
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->ref=$obj->name; $companystatic->ref=$obj->name;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
@ -825,7 +825,7 @@ if ($resql)
$urlsource=$_SERVER['PHP_SELF'].'?id='.$reception->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$reception->rowid;
print $formfile->getDocumentsLink($reception->element, $filename, $filedir); print $formfile->getDocumentsLink($reception->element, $filename, $filedir);
print "</td>\n"; print "</td>\n";
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }

View File

@ -101,7 +101,7 @@ if ($id > 0 || ! empty($ref))
$head=reception_prepare_head($object); $head=reception_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("Reception"), -1, 'sending'); dol_fiche_head($head, 'note', $langs->trans("Reception"), -1, 'sending');
// Reception card // Reception card
$linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/reception/list.php">'.$langs->trans("BackToList").'</a>';
@ -146,13 +146,13 @@ if ($id > 0 || ! empty($ref))
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
$object->picto = 'sending'; $object->picto = 'sending';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
$cssclass='titlefield'; $cssclass='titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';

View File

@ -276,17 +276,17 @@ foreach ($data as $val)
while (! empty($year) && $oldyear > $year+1) while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year { // If we have empty year
$oldyear--; $oldyear--;
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.'">'.$oldyear.'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
/*print '<td align="right">0</td>'; /*print '<td align="right">0</td>';
print '<td align="right">0</td>';*/ print '<td align="right">0</td>';*/
print '</tr>'; print '</tr>';
} }
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center">'; print '<td align="center">';
if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.'">'.$year.'</a>'; if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.'">'.$year.'</a>';

View File

@ -14,7 +14,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/ */
?> ?>