Merge remote-tracking branch 'upstream/develop' into 14b4
This commit is contained in:
commit
a67ab81b4d
@ -84,7 +84,7 @@ print "<br>\n";
|
||||
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ print "<br>\n";
|
||||
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup
|
||||
print '<br>';
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
// Reception numbering model
|
||||
|
||||
|
||||
@ -142,6 +142,10 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$facturestatic->status = $objp->status;
|
||||
$facturestatic->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
$alreadypaid = $facturestatic->getSommePaiement();
|
||||
|
||||
$facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
@ -188,9 +192,6 @@ class box_factures_fourn extends ModeleBoxes
|
||||
'text' => dol_print_date($date, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
|
||||
@ -134,6 +134,10 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
|
||||
$alreadypaid = $facturestatic->getSommePaiement();
|
||||
|
||||
$facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
@ -174,9 +178,6 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
'text' => dol_print_date($datelimite, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
|
||||
@ -132,7 +132,9 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$datelimite = $this->db->jdate($objp->datelimite);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
|
||||
@ -1386,7 +1386,9 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
||||
return;
|
||||
}
|
||||
|
||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||
if (empty($conf->global->MAIN_SHOW_PASSWORD_INTO_LOG)) {
|
||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||
}
|
||||
|
||||
// If adding log inside HTML page is required
|
||||
if ((!empty($_REQUEST['logtohtml']) && !empty($conf->global->MAIN_ENABLE_LOG_TO_HTML))
|
||||
@ -3509,7 +3511,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
||||
'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
|
||||
'error', 'warning',
|
||||
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
|
||||
'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
|
||||
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'website', 'workstation',
|
||||
@ -3596,7 +3598,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) {
|
||||
$morecss = 'em088';
|
||||
}
|
||||
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
|
||||
if (in_array($pictowithouttext, array('asset', 'intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
|
||||
$morecss = 'em080';
|
||||
}
|
||||
|
||||
|
||||
@ -1233,7 +1233,7 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w,
|
||||
/**
|
||||
* Output line description into PDF
|
||||
*
|
||||
* @param TCPDF $pdf PDF object
|
||||
* @param TCPDF $pdf PDF object
|
||||
* @param Object $object Object
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
|
||||
@ -69,7 +69,7 @@ class modAsset extends DolibarrModules
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
$this->picto = 'accounting';
|
||||
$this->picto = 'asset';
|
||||
|
||||
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
|
||||
// for default path (eg: /asset/core/xxxxx) (0=disable, 1=enable)
|
||||
|
||||
@ -388,6 +388,18 @@ class pdf_squille extends ModelePdfReception
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc - 1;
|
||||
|
||||
// The desc of line is not store into reception, so we force it to the value of product.
|
||||
/*
|
||||
if (empty($object->lines[0]->desc)) {
|
||||
// TODO We must get value from fk_commendefourndet
|
||||
$sqldesc = 'SELECT description FROM '.MAIN_DB_PREFIX.' WHERE rowid = '.((int) $object->lines[0]->fk_commandefourndet);
|
||||
$resqldesc = $this->db->query($sqldesc);
|
||||
if ($resqldesc) {
|
||||
$objdesc = $this->db->fetch_object($resqldesc);
|
||||
$object->lines[0]->desc = $objdesc->description;
|
||||
}
|
||||
}*/
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc);
|
||||
|
||||
|
||||
@ -82,21 +82,6 @@ if (empty($origin_id)) {
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
if ($origin == 'expedition') {
|
||||
$result = restrictedArea($user, $origin, $id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'expedition');
|
||||
if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
@ -121,18 +106,24 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
|
||||
|
||||
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
||||
//var_dump($object->lines[0]->detail_batch);
|
||||
|
||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'expedition', $object->id, '');
|
||||
|
||||
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
||||
//var_dump($object->lines[0]->detail_batch);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1525,7 +1516,7 @@ if ($action == 'create') {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
@ -108,13 +108,6 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
/*
|
||||
elseif ($action == 'setaddress' && $user->rights->expedition->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
@ -143,7 +136,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$langs->trans("OrderCard");
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Shipment card
|
||||
|
||||
@ -99,7 +99,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->expedition->dir_output.'/sending/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@ -89,7 +89,7 @@ $form = new Form($db);
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Shipment card
|
||||
|
||||
@ -2501,6 +2501,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
}
|
||||
if (isset($this->status)) {
|
||||
$alreadypaid = -1;
|
||||
if (isset($this->alreadypaid)) {
|
||||
$alreadypaid = $this->alreadypaid;
|
||||
}
|
||||
|
||||
$label .= ' '.$this->getLibStatut(5, $alreadypaid);
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
@ -2527,9 +2531,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
if ($moretitle) {
|
||||
$label .= ' - '.$moretitle;
|
||||
}
|
||||
if (isset($this->statut) && isset($this->alreadypaid)) {
|
||||
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5, $this->alreadypaid);
|
||||
}
|
||||
|
||||
$ref = $this->ref;
|
||||
if (empty($ref)) {
|
||||
@ -2567,8 +2568,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result .= '<a href="'.DOL_URL_ROOT.'/fourn/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
|
||||
$result .= img_picto('', 'note');
|
||||
$result .= '</a>';
|
||||
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
|
||||
//$result.='</a>';
|
||||
$result .= '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
|
||||
$qty = $supplierorderdispatch->qty;
|
||||
$entrepot = $supplierorderdispatch->fk_entrepot;
|
||||
$product = $supplierorderdispatch->fk_product;
|
||||
$price = GETPOST('price');
|
||||
$price = price2num(GETPOST('price', 'alpha'), 'MU');
|
||||
$comment = $supplierorderdispatch->comment;
|
||||
$eatby = $supplierorderdispatch->eatby;
|
||||
$sellby = $supplierorderdispatch->sellby;
|
||||
|
||||
@ -1521,7 +1521,7 @@ if ($dirins && $action == 'generatepackage') {
|
||||
|
||||
$arrayversion = explode('.', $moduleobj->version, 3);
|
||||
if (count($arrayversion)) {
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].($arrayversion[1] ? '.'.$arrayversion[1] : '').($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
|
||||
|
||||
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
||||
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
|
||||
@ -3022,7 +3022,7 @@ if ($module == 'initmodule') {
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<table class="noborder small">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
@ -3044,51 +3044,51 @@ if ($module == 'initmodule') {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $menu['type'];
|
||||
print dol_escape_htmltag($menu['type']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['fk_menu'];
|
||||
print dol_escape_htmltag($menu['fk_menu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['titre'];
|
||||
print dol_escape_htmltag($menu['titre']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['mainmenu'];
|
||||
print dol_escape_htmltag($menu['mainmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['leftmenu'];
|
||||
print dol_escape_htmltag($menu['leftmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($menu['url']).'">';
|
||||
print dol_escape_htmltag($menu['url']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['url'];
|
||||
print dol_escape_htmltag($menu['langs']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['langs'];
|
||||
print dol_escape_htmltag($menu['position']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
||||
print dol_escape_htmltag($menu['enabled']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
||||
print dol_escape_htmltag($menu['perms']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['position'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['enabled'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['perms'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['target'];
|
||||
print dol_escape_htmltag($menu['target']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
print $menu['user'];
|
||||
print dol_escape_htmltag($menu['user']);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -3447,7 +3447,7 @@ if ($module == 'initmodule') {
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <span class="opacitymedium">'.$langs->trans("NoWidget").'</span>';
|
||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initwidget&format=php">'.img_picto('Generate', 'generate', 'class="paddingleft"').'</a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -3792,7 +3792,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledoc;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -3806,7 +3806,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledocpdf;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -3860,7 +3860,7 @@ if ($module == 'initmodule') {
|
||||
|
||||
$arrayversion = explode('.', $moduleobj->version, 3);
|
||||
if (count($arrayversion)) {
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2] ? ".".$arrayversion[2] : "").".zip";
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? ".".$arrayversion[2] : '').".zip";
|
||||
$outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP;
|
||||
}
|
||||
|
||||
@ -3872,7 +3872,7 @@ if ($module == 'initmodule') {
|
||||
} else {
|
||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
|
||||
@ -117,6 +117,26 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of
|
||||
|
||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||
|
||||
$object = new Reception($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if (!empty($object->origin)) {
|
||||
$origin = $object->origin;
|
||||
|
||||
$object->fetch_origin();
|
||||
$typeobject = $object->origin;
|
||||
}
|
||||
|
||||
// Linked documents
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) {
|
||||
$origin_id = $object->$typeobject->id;
|
||||
$objectsrc = new CommandeFournisseur($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
@ -124,13 +144,10 @@ if ($user->socid) {
|
||||
}
|
||||
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $id);
|
||||
$result = restrictedArea($user, 'reception', $id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
@ -150,14 +167,12 @@ if ($reshook < 0) {
|
||||
if (empty($reshook)) {
|
||||
if ($cancel) {
|
||||
$action = '';
|
||||
$object->fetch($id); // show reception also after canceling modification
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Reopen
|
||||
if ($action == 'reopen' && $user->rights->reception->creer) {
|
||||
$object->fetch($id);
|
||||
$result = $object->reOpen();
|
||||
}
|
||||
|
||||
@ -192,7 +207,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'setref_supplier') {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -328,8 +342,6 @@ if (empty($reshook)) {
|
||||
$sellby = "dluo".$i;
|
||||
$batch = "batch".$i;
|
||||
|
||||
$timeFormat = '%d/%m/%Y';
|
||||
|
||||
if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) {
|
||||
$ent = "entl".$i;
|
||||
|
||||
@ -354,7 +366,6 @@ if (empty($reshook)) {
|
||||
$eatbydate = str_replace('/', '-', $eatby);
|
||||
$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'));
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@ -531,14 +542,12 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'classifybilled') {
|
||||
$object->fetch($id);
|
||||
$result = $object->setBilled();
|
||||
if ($result >= 0) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'classifyclosed') {
|
||||
$object->fetch($id);
|
||||
$result = $object->setClosed();
|
||||
if ($result >= 0) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
@ -546,7 +555,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
} elseif ($action == 'deleteline' && !empty($line_id)) {
|
||||
// delete a line
|
||||
$object->fetch($id);
|
||||
$lines = $object->lines;
|
||||
$line = new CommandeFournisseurDispatch($db);
|
||||
|
||||
@ -958,6 +966,7 @@ if ($action == 'create') {
|
||||
if ($numAsked) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyToReceive");
|
||||
@ -1056,18 +1065,22 @@ if ($action == 'create') {
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
// Comment
|
||||
//$defaultcomment = 'Line create from order line id '.$line->id;
|
||||
$defaultcomment = '';
|
||||
print '<td>';
|
||||
print '<input type="text" class="maxwidth100" name="comment'.$indiceAsked.'" value="'.$defaultcomment.'">';
|
||||
print '</td>';
|
||||
|
||||
// Qty
|
||||
print '<td class="center">'.$line->qty;
|
||||
print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value=\''.$line->id.'\' />';
|
||||
print '<textarea style="display:none;" name="comment'.$indiceAsked.'" >'.$line->desc.'</textarea>';
|
||||
print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value="'.$line->id.'">';
|
||||
print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">';
|
||||
print '</td>';
|
||||
$qtyProdCom = $line->qty;
|
||||
|
||||
// Qty already received
|
||||
print '<td class="center">';
|
||||
|
||||
|
||||
$quantityDelivered = $object->receptions[$line->id];
|
||||
print $quantityDelivered;
|
||||
print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
|
||||
@ -1137,8 +1150,8 @@ if ($action == 'create') {
|
||||
print '<td colspan="3"></td>';
|
||||
}
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
//Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||
@ -1321,7 +1334,6 @@ if ($action == 'create') {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
@ -1329,7 +1341,7 @@ if ($action == 'create') {
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) {
|
||||
@ -1493,11 +1505,11 @@ if ($action == 'create') {
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Reception method
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('ReceptionMethod');
|
||||
print '</td>';
|
||||
|
||||
@ -1584,7 +1596,7 @@ if ($action == 'create') {
|
||||
// Product/Service
|
||||
print '<td>'.$langs->trans("Products").'</td>';
|
||||
// Comment
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
// Qty
|
||||
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
if ($origin && $origin_id > 0) {
|
||||
@ -1747,9 +1759,9 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
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><input name="comment'.$line_id.'" id="comment'.$line_id.'" value="'.dol_escape_htmltag($lines[$i]->comment).'"></td>';
|
||||
} else {
|
||||
print '<td style="white-space: pre-wrap;max-width: 200px;" >'.$lines[$i]->comment.'</td>';
|
||||
print '<td style="white-space: pre-wrap; max-width: 200px;">'.dol_escape_htmltag($lines[$i]->comment).'</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -1778,7 +1790,7 @@ if ($action == 'create') {
|
||||
$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) {
|
||||
$warehousestatic->fetch($receptionline_var['warehouse']);
|
||||
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1);
|
||||
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
|
||||
}
|
||||
print ' '.$form->textwithpicto('', $htmltext, 1);
|
||||
}
|
||||
|
||||
@ -1043,13 +1043,15 @@ class Reception extends CommonObject
|
||||
$line = new CommandeFournisseurDispatch($this->db);
|
||||
$line->fetch($obj->rowid);
|
||||
$line->fetch_product();
|
||||
$sql_commfourndet = 'SELECT qty, ref, label, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent FROM llx_commande_fournisseurdet WHERE rowid='.$line->fk_commandefourndet;
|
||||
$sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent';
|
||||
$sql_commfourndet .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet';
|
||||
$sql_commfourndet .= ' WHERE rowid = '.((int) $line->fk_commandefourndet);
|
||||
$resql_commfourndet = $this->db->query($sql_commfourndet);
|
||||
if (!empty($resql_commfourndet)) {
|
||||
$obj = $this->db->fetch_object($resql_commfourndet);
|
||||
$line->qty_asked = $obj->qty;
|
||||
$line->description = $line->comment;
|
||||
$line->desc = $line->comment;
|
||||
$line->description = $obj->description;
|
||||
$line->desc = $obj->description;
|
||||
$line->tva_tx = $obj->tva_tx;
|
||||
$line->vat_src_code = $obj->vat_src_code;
|
||||
$line->subprice = $obj->subprice;
|
||||
@ -1060,6 +1062,7 @@ class Reception extends CommonObject
|
||||
} else {
|
||||
$line->qty_asked = 0;
|
||||
$line->description = '';
|
||||
$line->desc = '';
|
||||
$line->label = $obj->label;
|
||||
}
|
||||
|
||||
|
||||
@ -35,9 +35,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
$langs->load("orders");
|
||||
$langs->load("receptions");
|
||||
$langs->load("companies");
|
||||
$langs->loadLangs(array("orders", "receptions", "companies"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -62,7 +60,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
@ -70,11 +67,8 @@ if ($user->socid > 0) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
@ -119,13 +113,6 @@ if ($action == 'addcontact' && $user->rights->reception->creer) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
/*
|
||||
elseif ($action == 'setaddress' && $user->rights->reception->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
@ -141,11 +128,7 @@ $contactstatic = new Contact($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode vue et edition */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
// View mode
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$langs->trans("OrderCard");
|
||||
@ -199,7 +182,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
@ -70,13 +70,14 @@ if ($user->socid > 0) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +148,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user