Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
92856788a3
@ -467,24 +467,6 @@ if ($action == 'edit')
|
|||||||
$liste = array();
|
$liste = array();
|
||||||
$liste['user'] = $langs->trans('UserEmail');
|
$liste['user'] = $langs->trans('UserEmail');
|
||||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||||
/*
|
|
||||||
$sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1';
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i=0;
|
|
||||||
while($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
if ($obj)
|
|
||||||
{
|
|
||||||
$liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>';
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dol_print_error($db);*/
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
||||||
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
|
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
|
||||||
@ -655,7 +637,8 @@ else
|
|||||||
$liste = array();
|
$liste = array();
|
||||||
$liste['user'] = $langs->trans('UserEmail');
|
$liste['user'] = $langs->trans('UserEmail');
|
||||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1';
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql.= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,13 +69,14 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||||||
if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
if (!$sortorder) $sortorder = "ASC";
|
||||||
|
|
||||||
// Protection if external user
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) // Protection if external user
|
||||||
{
|
{
|
||||||
//$socid = $user->socid;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
//$result = restrictedArea($user, 'mymodule', $id, '');
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
$search_all = trim(GETPOST("search_all", 'alpha'));
|
||||||
@ -97,7 +98,7 @@ $arrayfields = array();
|
|||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled']);
|
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||||
@ -161,8 +162,6 @@ if (empty($reshook))
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'EmailSenderProfile';
|
$objectclass = 'EmailSenderProfile';
|
||||||
$objectlabel = 'EmailSenderProfile';
|
$objectlabel = 'EmailSenderProfile';
|
||||||
$permissiontoread = $user->admin;
|
|
||||||
$permissiontodelete = $user->admin;
|
|
||||||
$uploaddir = $conf->admin->dir_output.'/senderprofiles';
|
$uploaddir = $conf->admin->dir_output.'/senderprofiles';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
@ -185,8 +184,6 @@ if (empty($reshook))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$limit = (GETPOSTISSET('limit') ? $limit : 0);
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@ -196,7 +193,7 @@ $help_url = '';
|
|||||||
$title = $langs->trans("EMailsSetup");
|
$title = $langs->trans("EMailsSetup");
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('', $title);
|
||||||
|
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
$titlepicto = 'title_setup';
|
$titlepicto = 'title_setup';
|
||||||
@ -234,6 +231,10 @@ foreach ($search as $key => $val)
|
|||||||
{
|
{
|
||||||
if ($key == 'status' && $search[$key] == -1) continue;
|
if ($key == 'status' && $search[$key] == -1) continue;
|
||||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||||
|
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
|
||||||
|
if ($search[$key] == '-1') $search[$key] = '';
|
||||||
|
$mode_search = 2;
|
||||||
|
}
|
||||||
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||||
}
|
}
|
||||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
@ -254,6 +255,7 @@ foreach($object->fields as $key => $val)
|
|||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||||
|
}
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -375,6 +377,9 @@ if ($action != 'create') {
|
|||||||
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
|
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||||
|
print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id));
|
||||||
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.GETPOST('position', 'int').'"></td></tr>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.GETPOST('position', 'int').'"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print $form->selectyesno('active', GETPOST('active', 'int'), 1);
|
print $form->selectyesno('active', GETPOST('active', 'int'), 1);
|
||||||
@ -443,7 +448,10 @@ foreach ($object->fields as $key => $val)
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||||
if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75');
|
if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75');
|
||||||
else print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
elseif (strpos($val['type'], 'integer:') === 0) {
|
||||||
|
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||||
|
}
|
||||||
|
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,11 +517,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
if (empty($obj)) break; // Should not happen
|
if (empty($obj)) break; // Should not happen
|
||||||
|
|
||||||
// Store properties in $object
|
// Store properties in $object
|
||||||
$object->id = $obj->rowid;
|
$object->setVarsFromFetchObj($obj);
|
||||||
foreach ($object->fields as $key => $val)
|
|
||||||
{
|
|
||||||
if (property_exists($obj, $key)) $object->$key = $obj->$key;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show here line of result
|
// Show here line of result
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -532,21 +536,20 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
{
|
{
|
||||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||||
if ($key == 'status') print $object->getLibStatut(5);
|
if ($key == 'status') print $object->getLibStatut(5);
|
||||||
elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
|
else print $object->showOutputField($val, $key, $object->$key, '');
|
||||||
else print $object->showOutputField($val, $key, $obj->$key, '');
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
if (!empty($val['isameasure']))
|
if (!empty($val['isameasure']))
|
||||||
{
|
{
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||||
$totalarray['val']['t.'.$key] += $obj->$key;
|
$totalarray['val']['t.'.$key] += $object->$key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
@ -562,8 +565,8 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
{
|
{
|
||||||
$selected = 0;
|
$selected = 0;
|
||||||
if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
|
if (in_array($object->id, $arrayofselected)) $selected = 1;
|
||||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -264,7 +264,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("BarCodePrintsheet"));
|
llxHeader('', $langs->trans("BarCodePrintsheet"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("BarCodePrintsheet"));
|
print load_fiche_titre($langs->trans("BarCodePrintsheet"), '', 'barcode');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print $langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).'<br>';
|
print $langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).'<br>';
|
||||||
|
|||||||
@ -746,6 +746,9 @@ class BOM extends CommonObject
|
|||||||
$label = '<u>'.$langs->trans("BillOfMaterials").'</u>';
|
$label = '<u>'.$langs->trans("BillOfMaterials").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
|
||||||
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
// Onglets
|
// Onglets
|
||||||
$head = account_statement_prepare_head($object, $num);
|
$head = account_statement_prepare_head($object, $num);
|
||||||
dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), -1, 'account');
|
dol_fiche_head($head, 'document', $langs->trans("AccountStatement"), -1, 'account');
|
||||||
|
|
||||||
|
|
||||||
// Build file list
|
// Build file list
|
||||||
@ -118,7 +118,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
|
|
||||||
$title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
$title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
||||||
print load_fiche_titre($title, '', 'title_bank.png');
|
print load_fiche_titre($title, '', '');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2017 Patrick Delcroix <pmpdelcroix@gmail.com>
|
* Copyright (C) 2017 Patrick Delcroix <pmpdelcroix@gmail.com>
|
||||||
@ -369,7 +369,7 @@ else
|
|||||||
|
|
||||||
// Onglets
|
// Onglets
|
||||||
$head = account_statement_prepare_head($object, $numref);
|
$head = account_statement_prepare_head($object, $numref);
|
||||||
dol_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), -1, 'account');
|
dol_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account');
|
||||||
|
|
||||||
|
|
||||||
$mesprevnext = '';
|
$mesprevnext = '';
|
||||||
@ -382,7 +382,7 @@ else
|
|||||||
$mesprevnext .= '</ul></div>';
|
$mesprevnext .= '</ul></div>';
|
||||||
|
|
||||||
$title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
$title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
||||||
print load_fiche_titre($title, $mesprevnext, 'title_bank.png');
|
print load_fiche_titre($title, $mesprevnext, '');
|
||||||
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'title_bank.png', 0, '', '', 0, 1);
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'title_bank.png', 0, '', '', 0, 1);
|
||||||
|
|
||||||
print "<form method=\"post\" action=\"releve.php\">";
|
print "<form method=\"post\" action=\"releve.php\">";
|
||||||
|
|||||||
@ -226,7 +226,7 @@ if ($object->id > 0)
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
|
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
|
||||||
@ -282,7 +282,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Date invoice
|
// Date invoice
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('DateInvoice');
|
print $langs->trans('DateInvoice');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||||
@ -309,7 +309,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Payment condition
|
// Payment condition
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('PaymentConditionsShort');
|
print $langs->trans('PaymentConditionsShort');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||||
@ -334,7 +334,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Date payment term
|
// Date payment term
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('DateMaxPayment');
|
print $langs->trans('DateMaxPayment');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||||
@ -362,7 +362,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||||
@ -409,7 +409,7 @@ if ($object->id > 0)
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1114,6 +1114,7 @@ if ($action == 'create')
|
|||||||
if (GETPOST('origin') && GETPOST('originid'))
|
if (GETPOST('origin') && GETPOST('originid'))
|
||||||
{
|
{
|
||||||
// Parse element/subelement (ex: project_task)
|
// Parse element/subelement (ex: project_task)
|
||||||
|
$regs = array();
|
||||||
$element = $subelement = GETPOST('origin');
|
$element = $subelement = GETPOST('origin');
|
||||||
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs))
|
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs))
|
||||||
{
|
{
|
||||||
@ -1544,7 +1545,7 @@ else
|
|||||||
$sql .= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
$sql .= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
||||||
$sql .= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
|
$sql .= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
|
||||||
$sql .= " cd.fk_unit,";
|
$sql .= " cd.fk_unit,";
|
||||||
$sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
|
$sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity, p.tosell, p.tobuy, p.tobatch";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||||
$sql .= " WHERE cd.rowid = ".$object->lines[$cursorline - 1]->id;
|
$sql .= " WHERE cd.rowid = ".$object->lines[$cursorline - 1]->id;
|
||||||
@ -1577,12 +1578,16 @@ else
|
|||||||
// Label
|
// Label
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td>';
|
|
||||||
$productstatic->id = $objp->fk_product;
|
$productstatic->id = $objp->fk_product;
|
||||||
$productstatic->type = $objp->ptype;
|
$productstatic->type = $objp->ptype;
|
||||||
$productstatic->ref = $objp->pref;
|
$productstatic->ref = $objp->pref;
|
||||||
$productstatic->entity = $objp->pentity;
|
$productstatic->entity = $objp->pentity;
|
||||||
$productstatic->label = $objp->plabel;
|
$productstatic->label = $objp->plabel;
|
||||||
|
$productstatic->status = $objp->tosell;
|
||||||
|
$productstatic->status_buy = $objp->tobuy;
|
||||||
|
$productstatic->status_batch = $objp->tobatch;
|
||||||
|
|
||||||
|
print '<td>';
|
||||||
$text = $productstatic->getNomUrl(1, '', 32);
|
$text = $productstatic->getNomUrl(1, '', 32);
|
||||||
if ($objp->plabel)
|
if ($objp->plabel)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1381,10 +1381,10 @@ class Contrat extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Ajoute une ligne de contrat en base
|
* Ajoute une ligne de contrat en base
|
||||||
*
|
*
|
||||||
* @param string $desc Description de la ligne
|
* @param string $desc Description of line
|
||||||
* @param float $pu_ht Prix unitaire HT
|
* @param float $pu_ht Unit price net
|
||||||
* @param int $qty Quantite
|
* @param int $qty Quantity
|
||||||
* @param float $txtva Taux tva
|
* @param float $txtva Vat rate
|
||||||
* @param float $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param float $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param int $fk_product Id produit
|
* @param int $fk_product Id produit
|
||||||
|
|||||||
@ -352,6 +352,7 @@ if (!$error && $massaction == 'confirm_presend')
|
|||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
|
$reg = array();
|
||||||
$fromtype = GETPOST('fromtype');
|
$fromtype = GETPOST('fromtype');
|
||||||
if ($fromtype === 'user') {
|
if ($fromtype === 'user') {
|
||||||
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
||||||
|
|||||||
@ -273,6 +273,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
|||||||
|
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
|
$reg = array();
|
||||||
$fromtype = GETPOST('fromtype', 'alpha');
|
$fromtype = GETPOST('fromtype', 'alpha');
|
||||||
if ($fromtype === 'robot') {
|
if ($fromtype === 'robot') {
|
||||||
$from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
$from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
||||||
@ -292,7 +293,8 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
|||||||
$from = trim($tmp[($reg[1] - 1)]);
|
$from = trim($tmp[($reg[1] - 1)]);
|
||||||
}
|
}
|
||||||
elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
|
elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1];
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql .= ' WHERE rowid = '.(int) $reg[1];
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
|
|||||||
@ -4199,6 +4199,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$product_static->ref = $line->ref; //can change ref in hook
|
$product_static->ref = $line->ref; //can change ref in hook
|
||||||
$product_static->label = $line->label; //can change label in hook
|
$product_static->label = $line->label; //can change label in hook
|
||||||
|
|
||||||
$text = $product_static->getNomUrl(1);
|
$text = $product_static->getNomUrl(1);
|
||||||
|
|
||||||
// Define output language and label
|
// Define output language and label
|
||||||
@ -7523,7 +7524,10 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If field is an implicit foreign key field
|
// If field is an implicit foreign key field
|
||||||
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) $values[$key] = 'null';
|
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) {
|
||||||
|
if (isset($this->fields[$key]['default'])) $values[$key] = $this->fields[$key]['default'];
|
||||||
|
else $values[$key] = 'null';
|
||||||
|
}
|
||||||
if (!empty($this->fields[$key]['foreignkey']) && empty($values[$key])) $values[$key] = 'null';
|
if (!empty($this->fields[$key]['foreignkey']) && empty($values[$key])) $values[$key] = 'null';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file class/emailsenderprofile.class.php
|
* \file core/class/emailsenderprofile.class.php
|
||||||
* \ingroup monmodule
|
* \ingroup core
|
||||||
* \brief This file is a CRUD class file for EmailSenderProfile (Create/Read/Update/Delete)
|
* \brief This file is a CRUD class file for EmailSenderProfile (Create/Read/Update/Delete)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
|||||||
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||||
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for EmailSenderProfile
|
* Class for EmailSenderProfile
|
||||||
*/
|
*/
|
||||||
@ -60,24 +61,29 @@ class EmailSenderProfile extends CommonObject
|
|||||||
const STATUS_ENABLED = 1;
|
const STATUS_ENABLED = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float')
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
* 'label' the translation key.
|
* 'label' the translation key.
|
||||||
* 'enabled' is a condition when the field must be managed.
|
* 'enabled' is a condition when the field must be managed.
|
||||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
* 'position' is the sort order of field.
|
||||||
* 'noteditable' says if field is not editable (1 or 0)
|
|
||||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
* 'index' if we want an index in database.
|
* 'index' if we want an index in database.
|
||||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
* 'position' is the sort order of field.
|
|
||||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||||
* 'help' is a string visible as a tooltip on field
|
* 'help' is a string visible as a tooltip on field
|
||||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
|
||||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// BEGIN MODULEBUILDER PROPERTIES
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
@ -90,8 +96,8 @@ class EmailSenderProfile extends CommonObject
|
|||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
|
||||||
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
|
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
|
||||||
//'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
//'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
//'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,),
|
'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
|
||||||
'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>-1, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
|
'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
|
||||||
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
|
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
|
|||||||
@ -569,7 +569,9 @@ class FormMail extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add also email aliases from the c_email_senderprofile table
|
// Add also email aliases from the c_email_senderprofile table
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position';
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
|
||||||
|
$sql .= ' ORDER BY position';
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -172,7 +172,7 @@ function account_statement_prepare_head($object, $num)
|
|||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$object->id.'&num='.$num;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$object->id.'&num='.$num;
|
||||||
$head[$h][1] = $langs->trans("AccountStatements");
|
$head[$h][1] = $langs->trans("AccountStatement");
|
||||||
$head[$h][2] = 'statement';
|
$head[$h][2] = 'statement';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -2963,19 +2963,22 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$perm = GETPOST('perm');
|
/*$perm = GETPOST('perm', 'aZ09');
|
||||||
$subperm = GETPOST('subperm');
|
$subperm = GETPOST('subperm', 'aZ09');
|
||||||
if ($perm || $subperm)
|
if ($perm || $subperm)
|
||||||
{
|
{
|
||||||
if (($perm && !$subperm && $fuser->rights->$modulepart->$perm) || ($perm && $subperm && $fuser->rights->$modulepart->$perm->$subperm)) $accessallowed = 1;
|
if (($perm && !$subperm && $fuser->rights->$modulepart->$perm) || ($perm && $subperm && $fuser->rights->$modulepart->$perm->$subperm)) $accessallowed = 1;
|
||||||
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{*/
|
||||||
|
// Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read
|
||||||
|
$partsofdirinoriginalfile = explode('/', $original_file);
|
||||||
|
$partofdirinoriginalfile = $partsofdirinoriginalfile[0];
|
||||||
|
if ($partofdirinoriginalfile && ($fuser->rights->$modulepart->$partofdirinoriginalfile->{$lire} || $fuser->rights->$modulepart->$partofdirinoriginalfile->{$read})) $accessallowed = 1;
|
||||||
if ($fuser->rights->$modulepart->{$lire} || $fuser->rights->$modulepart->{$read}) $accessallowed = 1;
|
if ($fuser->rights->$modulepart->{$lire} || $fuser->rights->$modulepart->{$read}) $accessallowed = 1;
|
||||||
|
//}
|
||||||
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// For modules who wants to manage different levels of permissions for documents
|
// For modules who wants to manage different levels of permissions for documents
|
||||||
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
|
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
|
||||||
|
|||||||
@ -3060,7 +3060,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||||
'address', 'bank', 'bookmark', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
||||||
'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
||||||
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
||||||
|
|||||||
@ -66,11 +66,11 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
|
|||||||
|
|
||||||
$coldisplay = 0; ?>
|
$coldisplay = 0; ?>
|
||||||
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
||||||
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> >
|
<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
|
||||||
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||||
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td>
|
<td class="linecolnum center"><?php $coldisplay++; ?><?php print ($i + 1); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
|
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
|
||||||
<?php
|
<?php
|
||||||
if (($line->info_bits & 2) == 2) {
|
if (($line->info_bits & 2) == 2) {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
|
||||||
@ -88,32 +88,32 @@ if (($line->info_bits & 2) == 2) {
|
|||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0)
|
elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
|
||||||
// Add date of deposit
|
// Add date of deposit
|
||||||
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE))
|
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE))
|
||||||
echo ' ('.dol_print_date($discount->datec).')';
|
print ' ('.dol_print_date($discount->datec).')';
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0)
|
elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description);
|
print ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ else
|
|||||||
|
|
||||||
if ($line->fk_product > 0)
|
if ($line->fk_product > 0)
|
||||||
{
|
{
|
||||||
echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -132,30 +132,30 @@ else
|
|||||||
|
|
||||||
if (!empty($line->label)) {
|
if (!empty($line->label)) {
|
||||||
$text .= ' <strong>'.$line->label.'</strong>';
|
$text .= ' <strong>'.$line->label.'</strong>';
|
||||||
echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||||
} else {
|
} else {
|
||||||
if (!empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
if (!empty($line->fk_parent_line)) print img_picto('', 'rightarrow');
|
||||||
if (preg_match('/^\(DEPOSIT\)/', $line->description)) {
|
if (preg_match('/^\(DEPOSIT\)/', $line->description)) {
|
||||||
$newdesc = preg_replace('/^\(DEPOSIT\)/', $langs->trans("Deposit"), $line->description);
|
$newdesc = preg_replace('/^\(DEPOSIT\)/', $langs->trans("Deposit"), $line->description);
|
||||||
echo $text.' '.dol_htmlentitiesbr($newdesc);
|
print $text.' '.dol_htmlentitiesbr($newdesc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo $text.' '.dol_htmlentitiesbr($line->description);
|
print $text.' '.dol_htmlentitiesbr($line->description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show date range
|
// Show date range
|
||||||
if ($line->element == 'facturedetrec') {
|
if ($line->element == 'facturedetrec') {
|
||||||
if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">';
|
if ($line->date_start_fill || $line->date_end_fill) print '<br><div class="clearboth nowraponall">';
|
||||||
if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
|
if ($line->date_start_fill) print $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
|
||||||
if ($line->date_start_fill && $line->date_end_fill) echo ' - ';
|
if ($line->date_start_fill && $line->date_end_fill) print ' - ';
|
||||||
if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
|
if ($line->date_end_fill) print $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
|
||||||
if ($line->date_start_fill || $line->date_end_fill) echo '</div>';
|
if ($line->date_start_fill || $line->date_end_fill) print '</div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
|
if ($line->date_start || $line->date_end) print '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
|
||||||
//echo get_date_range($line->date_start, $line->date_end, $format);
|
//print get_date_range($line->date_start, $line->date_end, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add description in form
|
// Add description in form
|
||||||
@ -170,15 +170,16 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
$productfourn = new ProductFournisseur($this->db);
|
$productfourn = new ProductFournisseur($this->db);
|
||||||
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
|
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
|
||||||
echo '<div class="clearboth"></div><span class="opacitymedium">'.$langs->trans('Supplier').' : </span>'.$productfourn->getSocNomUrl(1, 'supplier').' - <span class="opacitymedium">'.$langs->trans('Ref').' : </span>';
|
print '<div class="clearboth"></div>';
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans('Supplier').' : </span>'.$productfourn->getSocNomUrl(1, 'supplier').' - <span class="opacitymedium">'.$langs->trans('Ref').' : </span>';
|
||||||
// Supplier ref
|
// Supplier ref
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here
|
if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here
|
||||||
{
|
{
|
||||||
echo $productfourn->getNomUrl();
|
print $productfourn->getNomUrl();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo $productfourn->ref_supplier;
|
print $productfourn->ref_supplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,14 +187,14 @@ if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0)
|
|||||||
{
|
{
|
||||||
$accountingaccount = new AccountingAccount($this->db);
|
$accountingaccount = new AccountingAccount($this->db);
|
||||||
$accountingaccount->fetch($line->fk_accounting_account);
|
$accountingaccount->fetch($line->fk_accounting_account);
|
||||||
echo '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1);
|
print '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
||||||
{
|
{
|
||||||
print '<td class="linecolrefsupplier">';
|
print '<td class="linecolrefsupplier">';
|
||||||
echo ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier);
|
print ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// VAT Rate
|
// VAT Rate
|
||||||
@ -204,18 +205,18 @@ if (price2num($line->tva_tx)) $positiverates .= ($positiverates ? '/' :
|
|||||||
if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx);
|
if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx);
|
||||||
if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx);
|
if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx);
|
||||||
if (empty($positiverates)) $positiverates = '0';
|
if (empty($positiverates)) $positiverates = '0';
|
||||||
echo vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits);
|
print vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits);
|
||||||
//echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
|
//print vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
|
||||||
?></td>
|
?></td>
|
||||||
|
|
||||||
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>
|
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php print price($line->subprice); ?></td>
|
||||||
|
|
||||||
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
|
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
|
||||||
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td>
|
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php print price($line->multicurrency_subprice); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if ($inputalsopricewithtax) { ?>
|
if ($inputalsopricewithtax) { ?>
|
||||||
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td>
|
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php print (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
||||||
@ -225,8 +226,8 @@ if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
|
|||||||
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
||||||
// must also not be output for most entities (proposal, intervention, ...)
|
// must also not be output for most entities (proposal, intervention, ...)
|
||||||
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
||||||
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
print price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
||||||
} else echo ' ';
|
} else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($conf->global->PRODUCT_USE_UNITS)
|
if ($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -242,7 +243,7 @@ if (!empty($line->remise_percent) && $line->special_code != 3) {
|
|||||||
print '<td class="linecoldiscount right">';
|
print '<td class="linecoldiscount right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
echo dol_print_reduction($line->remise_percent, $langs);
|
print dol_print_reduction($line->remise_percent, $langs);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="linecoldiscount"> </td>';
|
print '<td class="linecoldiscount"> </td>';
|
||||||
@ -264,17 +265,17 @@ if ($this->situation_cycle_ref)
|
|||||||
if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid))
|
if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid))
|
||||||
{
|
{
|
||||||
if (!empty($user->rights->margins->creer)) { ?>
|
if (!empty($user->rights->margins->creer)) { ?>
|
||||||
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
|
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php print price($line->pa_ht); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
|
if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
|
||||||
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0) ? 'n/a' : price(price2num($line->marge_tx, 'MT')).'%'); ?></td>
|
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php print (($line->pa_ht == 0) ? 'n/a' : price(price2num($line->marge_tx, 'MT')).'%'); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
||||||
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price(price2num($line->marque_tx, 'MT')).'%'; ?></td>
|
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php print price(price2num($line->marque_tx, 'MT')).'%'; ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
if ($line->special_code == 3) { ?>
|
if ($line->special_code == 3) { ?>
|
||||||
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
|
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php print $langs->trans('Option'); ?></td>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
print '<td class="linecolht nowrap right">';
|
print '<td class="linecolht nowrap right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
@ -309,8 +310,8 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
||||||
} else { ?>
|
} else { ?>
|
||||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>">
|
<a href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>">
|
||||||
<?php echo img_edit().'</a>';
|
<?php print img_edit().'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -327,13 +328,13 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
print '<td class="linecolmove tdlineupdown center">';
|
print '<td class="linecolmove tdlineupdown center">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if ($i > 0) { ?>
|
if ($i > 0) { ?>
|
||||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||||
<?php echo img_up('default', 0, 'imgupforline'); ?>
|
<?php print img_up('default', 0, 'imgupforline'); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php }
|
<?php }
|
||||||
if ($i < $num - 1) { ?>
|
if ($i < $num - 1) { ?>
|
||||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||||
<?php echo img_down('default', 0, 'imgdownforline'); ?>
|
<?php print img_down('default', 0, 'imgdownforline'); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php }
|
<?php }
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -347,7 +348,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'selectlines') { ?>
|
if ($action == 'selectlines') { ?>
|
||||||
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i + 1; ?>]" value="<?php echo $line->id; ?>" ></td>
|
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Copyright (C) 2001-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
-- Copyright (C) 2001-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
-- it under the terms of the GNU General Public License as published by
|
-- it under the terms of the GNU General Public License as published by
|
||||||
@ -21,7 +21,7 @@ create table llx_c_email_senderprofile
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
private smallint DEFAULT 0 NOT NULL, -- Template public (0) or private (id of user)
|
||||||
date_creation datetime,
|
date_creation datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
label varchar(255), -- Label of predefined email
|
label varchar(255), -- Label of predefined email
|
||||||
|
|||||||
@ -26,8 +26,8 @@ fk_inventory integer DEFAULT 0,
|
|||||||
fk_warehouse integer DEFAULT 0,
|
fk_warehouse integer DEFAULT 0,
|
||||||
fk_product integer DEFAULT 0,
|
fk_product integer DEFAULT 0,
|
||||||
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||||
|
qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition
|
||||||
qty_view double DEFAULT NULL, -- must be filled once regulation is done
|
qty_view double DEFAULT NULL, -- must be filled once regulation is done
|
||||||
qty_stock double DEFAULT NULL, -- can be filled during draft edition
|
|
||||||
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
|
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
|
||||||
)
|
)
|
||||||
ENGINE=InnoDB;
|
ENGINE=InnoDB;
|
||||||
|
|||||||
@ -484,6 +484,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
|||||||
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
|
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
|
||||||
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
|
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
|
||||||
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
|
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
|
||||||
|
'MAIN_MODULE_RESOURCE'=>'newboxdefonly',
|
||||||
'MAIN_MODULE_SALARIES'=>'newboxdefonly',
|
'MAIN_MODULE_SALARIES'=>'newboxdefonly',
|
||||||
'MAIN_MODULE_SYSLOG'=>'newboxdefonly',
|
'MAIN_MODULE_SYSLOG'=>'newboxdefonly',
|
||||||
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
|
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
|
||||||
|
|||||||
@ -193,6 +193,7 @@ TheoricalQty=Theorique qty
|
|||||||
TheoricalValue=Theorique qty
|
TheoricalValue=Theorique qty
|
||||||
LastPA=Last BP
|
LastPA=Last BP
|
||||||
CurrentPA=Curent BP
|
CurrentPA=Curent BP
|
||||||
|
RecordedQty=Recorded Qty
|
||||||
RealQty=Real Qty
|
RealQty=Real Qty
|
||||||
RealValue=Real Value
|
RealValue=Real Value
|
||||||
RegulatedQty=Regulated Qty
|
RegulatedQty=Regulated Qty
|
||||||
|
|||||||
@ -732,6 +732,9 @@ class MyObject extends CommonObject
|
|||||||
$label = '<u>'.$langs->trans("MyObject").'</u>';
|
$label = '<u>'.$langs->trans("MyObject").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
|
||||||
$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -964,6 +964,9 @@ class Mo extends CommonObject
|
|||||||
$label = '<u>'.$langs->trans("MO").'</u>';
|
$label = '<u>'.$langs->trans("MO").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
|
||||||
$url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ else dol_print_error($db, '');
|
|||||||
$title = $langs->trans("OpenSurveyArea");
|
$title = $langs->trans("OpenSurveyArea");
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
print load_fiche_titre($title, '', 'wrench');
|
print load_fiche_titre($title, '', 'generic');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@ -4240,10 +4240,7 @@ class Product extends CommonObject
|
|||||||
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
|
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if ($this->type == Product::TYPE_SERVICE)
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
if (!empty($conf->accounting->enabled) && $this->status) {
|
if (!empty($conf->accounting->enabled) && $this->status) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
$label .= '<br><b>'.$langs->trans('ProductAccountancySellCode').':</b> '.length_accountg($this->accountancy_code_sell);
|
$label .= '<br><b>'.$langs->trans('ProductAccountancySellCode').':</b> '.length_accountg($this->accountancy_code_sell);
|
||||||
@ -4256,6 +4253,11 @@ class Product extends CommonObject
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
$label .= '<br><b>'.$langs->trans('ProductAccountancyBuyCode').':</b> '.length_accountg($this->accountancy_code_buy);
|
$label .= '<br><b>'.$langs->trans('ProductAccountancyBuyCode').':</b> '.length_accountg($this->accountancy_code_buy);
|
||||||
}
|
}
|
||||||
|
if (isset($this->status) && isset($this->status_buy)) {
|
||||||
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5, 0);
|
||||||
|
$label.= ' '.$this->getLibStatut(5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($this->entity)) {
|
if (!empty($this->entity)) {
|
||||||
$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80);
|
$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80);
|
||||||
if ($this->nbphoto > 0) { $label .= '<br>'.$tmpphoto;
|
if ($this->nbphoto > 0) { $label .= '<br>'.$tmpphoto;
|
||||||
|
|||||||
@ -312,6 +312,15 @@ if ($result)
|
|||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
|
$product_static->id = $objp->rowid;
|
||||||
|
$product_static->ref = $objp->ref;
|
||||||
|
$product_static->label = $objp->label;
|
||||||
|
$product_static->type = $objp->fk_product_type;
|
||||||
|
$product_static->entity = $objp->entity;
|
||||||
|
$product_static->status = $objp->tosell;
|
||||||
|
$product_static->status_buy = $objp->tobuy;
|
||||||
|
$product_static->status_batch = $objp->tobatch;
|
||||||
|
|
||||||
//Multilangs
|
//Multilangs
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS))
|
if (!empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
@ -331,12 +340,6 @@ if ($result)
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$product_static->id = $objp->rowid;
|
|
||||||
$product_static->ref = $objp->ref;
|
|
||||||
$product_static->label = $objp->label;
|
|
||||||
$product_static->type = $objp->fk_product_type;
|
|
||||||
$product_static->entity = $objp->entity;
|
|
||||||
$product_static->status_batch = $objp->tobatch;
|
|
||||||
print $product_static->getNomUrl(1, '', 16);
|
print $product_static->getNomUrl(1, '', 16);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td>'.dol_trunc($objp->label, 32).'</td>';
|
print '<td>'.dol_trunc($objp->label, 32).'</td>';
|
||||||
|
|||||||
@ -302,7 +302,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
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>';
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent tableforfield">'."\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||||
|
|||||||
@ -124,6 +124,11 @@ class Inventory extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_warehouse;
|
public $fk_warehouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
|
public $fk_product;
|
||||||
|
|
||||||
public $date_inventory;
|
public $date_inventory;
|
||||||
public $title;
|
public $title;
|
||||||
|
|
||||||
|
|||||||
@ -101,13 +101,7 @@ if (empty($reshook))
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
||||||
|
$backtopage = DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id;
|
||||||
if (empty($backtopage) || ($cancel && empty($id))) {
|
|
||||||
//var_dump($backurlforlist);exit;
|
|
||||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist;
|
|
||||||
else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.($id > 0 ? $id : '__ID__');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Actions cancel, add, update, delete or clone
|
// Actions cancel, add, update, delete or clone
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||||
@ -153,7 +147,7 @@ jQuery(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals();
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
@ -242,7 +236,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
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>';
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent tableforfield">'."\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||||
@ -260,7 +254,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
|
|
||||||
// Buttons for actions
|
// Buttons for actions
|
||||||
if ($action != 'presend' && $action != 'editline') {
|
if ($action == 'edit') {
|
||||||
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
|
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("InventoryDesc").'</span><br>';
|
||||||
|
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
print '<div class="tabsAction">'."\n";
|
print '<div class="tabsAction">'."\n";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
@ -272,7 +281,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Validate").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Edit").'</a>'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Edit').'</a>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->status == Inventory::STATUS_DRAFT)
|
||||||
|
{
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -280,7 +301,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->status == Inventory::STATUS_VALIDATED)
|
/*if ($object->status == Inventory::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
@ -290,12 +311,121 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('RecordVerb').'</a>'."\n";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('RecordVerb').'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/product/inventory/tpl/inventory.tpl.php';
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
//print '<div class="fichehalfleft">';
|
||||||
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
//print load_fiche_titre($langs->trans('Consumption'), '', '');
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table id="tablelines" class="noborder noshadow centpercent">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Product").'</td>';
|
||||||
|
if ($conf->productbatch->enabled) {
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans("Batch");
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print '<td class="right">'.$langs->trans("RecordedQty").'</td>';
|
||||||
|
print '<td class="right">'.$langs->trans("RealQty").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
|
$sql = 'SELECT ps.rowid, ps.fk_entrepot as fk_warehouse, ps.fk_product';
|
||||||
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'entrepot as e';
|
||||||
|
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||||
|
$sql .= ' AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid';
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND p.fk_product_type = 0";
|
||||||
|
if ($object->fk_product > 0) $sql .= ' AND ps.fk_product = '.$object->fk_product;
|
||||||
|
if ($object->fk_warehouse > 0) $sql .= ' AND ps.fk_entrepot = '.$object->fk_warehouse;
|
||||||
|
|
||||||
|
$cacheOfProducts = array();
|
||||||
|
$cacheOfWarehouses = array();
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
$totalarray = array();
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
if (is_object($cacheOfWarehouses[$obj->fk_warehouse])) {
|
||||||
|
$warehouse_static = $cacheOfWarehouses[$obj->fk_warehouse];
|
||||||
|
} else {
|
||||||
|
$warehouse_static = new Entrepot($db);
|
||||||
|
$warehouse_static->fetch($obj->fk_warehouse);
|
||||||
|
|
||||||
|
$cacheOfWarehouses[$warehouse_static->id] = $warehouse_static;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_object($cacheOfProducts[$obj->fk_product])) {
|
||||||
|
$product_static = $cacheOfProducts[$obj->fk_product];
|
||||||
|
} else {
|
||||||
|
$product_static = new Product($db);
|
||||||
|
$product_static->fetch($obj->fk_product);
|
||||||
|
|
||||||
|
$option = 'nobatch';
|
||||||
|
$option .= ',novirtual';
|
||||||
|
$product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock()
|
||||||
|
|
||||||
|
$cacheOfProducts[$product_static->id] = $product_static;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>';
|
||||||
|
print $warehouse_static->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $product_static->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
if ($conf->productbatch->enabled) {
|
||||||
|
print '<td>';
|
||||||
|
print '';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td>';
|
||||||
|
print '';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
//print '</div>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if ($action == 'edit') {
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// Protection to avoid direct call of template
|
|
||||||
if (empty($conf) || ! is_object($conf))
|
|
||||||
{
|
|
||||||
print "Error, template page can't be called as URL";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
TODO...
|
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ $title=$langs->trans("ProductsAndServices");
|
|||||||
|
|
||||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
||||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||||
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,';
|
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tosell, p.tobuy, p.tobatch,';
|
||||||
$sql.= ' ps.fk_entrepot,';
|
$sql.= ' ps.fk_entrepot,';
|
||||||
$sql.= ' e.ref as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
|
$sql.= ' e.ref as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
|
||||||
$sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
|
$sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
|
||||||
@ -160,7 +160,7 @@ if ($search_warehouse) $sql .= natural_search("e.ref", $search_warehouse);
|
|||||||
if ($search_batch) $sql .= natural_search("pb.batch", $search_batch);
|
if ($search_batch) $sql .= natural_search("pb.batch", $search_batch);
|
||||||
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
|
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
|
||||||
$sql.= " p.fk_product_type, p.tms,";
|
$sql.= " p.fk_product_type, p.tms,";
|
||||||
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,";
|
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tosell, p.tobuy, p.tobatch,";
|
||||||
$sql.= " ps.fk_entrepot,";
|
$sql.= " ps.fk_entrepot,";
|
||||||
$sql.= " e.ref, e.lieu, e.fk_parent,";
|
$sql.= " e.ref, e.lieu, e.fk_parent,";
|
||||||
$sql.= " pb.batch, pb.eatby, pb.sellby,";
|
$sql.= " pb.batch, pb.eatby, pb.sellby,";
|
||||||
@ -206,21 +206,21 @@ if ($resql)
|
|||||||
$texte.=' ('.$langs->trans("StocksByLotSerial").')';
|
$texte.=' ('.$langs->trans("StocksByLotSerial").')';
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
if ($sall) $param.="&sall=".$sall;
|
if ($sall) $param.="&sall=".urlencode($sall);
|
||||||
if ($tosell) $param.="&tosell=".$tosell;
|
if ($tosell) $param.="&tosell=".urlencode($tosell);
|
||||||
if ($tobuy) $param.="&tobuy=".$tobuy;
|
if ($tobuy) $param.="&tobuy=".urlencode($tobuy);
|
||||||
if ($type) $param.="&type=".$type;
|
if ($type) $param.="&type=".urlencode($type);
|
||||||
if ($fourn_id) $param.="&fourn_id=".$fourn_id;
|
if ($fourn_id) $param.="&fourn_id=".urlencode($fourn_id);
|
||||||
if ($snom) $param.="&snom=".$snom;
|
if ($snom) $param.="&snom=".urlencode($snom);
|
||||||
if ($sref) $param.="&sref=".$sref;
|
if ($sref) $param.="&sref=".urlencode($sref);
|
||||||
if ($search_batch) $param.="&search_batch=".$search_batch;
|
if ($search_batch) $param.="&search_batch=".urlencode($search_batch);
|
||||||
if ($sbarcode) $param.="&sbarcode=".$sbarcode;
|
if ($sbarcode) $param.="&sbarcode=".urlencode($sbarcode);
|
||||||
if ($search_warehouse) $param.="&search_warehouse=".$search_warehouse;
|
if ($search_warehouse) $param.="&search_warehouse=".urlencode($search_warehouse);
|
||||||
if ($catid) $param.="&catid=".$catid;
|
if ($catid) $param.="&catid=".urlencode($catid);
|
||||||
if ($toolowstock) $param.="&toolowstock=".$toolowstock;
|
if ($toolowstock) $param.="&toolowstock=".urlencode($toolowstock);
|
||||||
if ($search_sale) $param.="&search_sale=".$search_sale;
|
if ($search_sale) $param.="&search_sale=".urlencode($search_sale);
|
||||||
if ($search_categ) $param.="&search_categ=".$search_categ;
|
if ($search_categ) $param.="&search_categ=".urlencode($search_categ);
|
||||||
/*if ($eatby) $param.="&eatby=".$eatby;
|
/*if ($eatby) $param.="&eatby=".$eatby;
|
||||||
if ($sellby) $param.="&sellby=".$sellby;*/
|
if ($sellby) $param.="&sellby=".$sellby;*/
|
||||||
|
|
||||||
@ -349,6 +349,8 @@ if ($resql)
|
|||||||
$product_static->label = $objp->label;
|
$product_static->label = $objp->label;
|
||||||
$product_static->type=$objp->fk_product_type;
|
$product_static->type=$objp->fk_product_type;
|
||||||
$product_static->entity=$objp->entity;
|
$product_static->entity=$objp->entity;
|
||||||
|
$product_static->status=$objp->tosell;
|
||||||
|
$product_static->status_buy=$objp->tobuy;
|
||||||
$product_static->status_batch=$objp->tobatch;
|
$product_static->status_batch=$objp->tobatch;
|
||||||
|
|
||||||
$product_lot_static->batch=$objp->batch;
|
$product_lot_static->batch=$objp->batch;
|
||||||
|
|||||||
@ -701,10 +701,12 @@ class Entrepot extends CommonObject
|
|||||||
|
|
||||||
$label = '<u>' . $langs->trans("ShowWarehouse").'</u>';
|
$label = '<u>' . $langs->trans("ShowWarehouse").'</u>';
|
||||||
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . (empty($this->ref)?(empty($this->label)?$this->libelle:$this->label):$this->ref);
|
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . (empty($this->ref)?(empty($this->label)?$this->libelle:$this->label):$this->ref);
|
||||||
if (! empty($this->lieu))
|
if (! empty($this->lieu)) {
|
||||||
$label.= '<br><b>' . $langs->trans('LocationSummary').':</b> '.$this->lieu;
|
$label.= '<br><b>' . $langs->trans('LocationSummary').':</b> '.$this->lieu;
|
||||||
if (isset($this->statut))
|
}
|
||||||
|
if (isset($this->statut)) {
|
||||||
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -195,12 +195,12 @@ if ($action == "correct_stock")
|
|||||||
|
|
||||||
if ($product->hasbatch())
|
if ($product->hasbatch())
|
||||||
{
|
{
|
||||||
$batch = GETPOST('batch_number');
|
$batch = GETPOST('batch_number', 'alphanohtml');
|
||||||
|
|
||||||
//$eatby=GETPOST('eatby');
|
//$eatby=GETPOST('eatby');
|
||||||
//$sellby=GETPOST('sellby');
|
//$sellby=GETPOST('sellby');
|
||||||
$eatby = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
|
$eatby = dol_mktime(0, 0, 0, GETPOST('eatbymonth', 'int'), GETPOST('eatbyday', 'int'), GETPOST('eatbyyear', 'int'));
|
||||||
$sellby = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
|
$sellby = dol_mktime(0, 0, 0, GETPOST('sellbymonth', 'int'), GETPOST('sellbyday', 'int'), GETPOST('sellbyyear', 'int'));
|
||||||
|
|
||||||
$result = $product->correct_stock_batch(
|
$result = $product->correct_stock_batch(
|
||||||
$user,
|
$user,
|
||||||
@ -210,7 +210,7 @@ if ($action == "correct_stock")
|
|||||||
GETPOST("label", 'san_alpha'),
|
GETPOST("label", 'san_alpha'),
|
||||||
GETPOST('unitprice'),
|
GETPOST('unitprice'),
|
||||||
$eatby, $sellby, $batch,
|
$eatby, $sellby, $batch,
|
||||||
GETPOST('inventorycode'),
|
GETPOST('inventorycode', 'alphanohtml'),
|
||||||
$origin_element,
|
$origin_element,
|
||||||
$origin_id
|
$origin_id
|
||||||
); // We do not change value of stock for a correction
|
); // We do not change value of stock for a correction
|
||||||
@ -224,7 +224,7 @@ if ($action == "correct_stock")
|
|||||||
GETPOST("mouvement"),
|
GETPOST("mouvement"),
|
||||||
GETPOST("label", 'san_alpha'),
|
GETPOST("label", 'san_alpha'),
|
||||||
GETPOST('unitprice'),
|
GETPOST('unitprice'),
|
||||||
GETPOST('inventorycode'),
|
GETPOST('inventorycode', 'alphanohtml'),
|
||||||
$origin_element,
|
$origin_element,
|
||||||
$origin_id
|
$origin_id
|
||||||
); // We do not change value of stock for a correction
|
); // We do not change value of stock for a correction
|
||||||
@ -329,7 +329,7 @@ if ($action == "transfert_stock" && !$cancel)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$srcwarehouseid = $id;
|
$srcwarehouseid = $id;
|
||||||
$batch = GETPOST('batch_number');
|
$batch = GETPOST('batch_number', 'alphanohtml');
|
||||||
$eatby = $d_eatby;
|
$eatby = $d_eatby;
|
||||||
$sellby = $d_sellby;
|
$sellby = $d_sellby;
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ if ($action == "transfert_stock" && !$cancel)
|
|||||||
GETPOST("label", 'san_alpha'),
|
GETPOST("label", 'san_alpha'),
|
||||||
$pricedest,
|
$pricedest,
|
||||||
$eatby, $sellby, $batch,
|
$eatby, $sellby, $batch,
|
||||||
GETPOST('inventorycode')
|
GETPOST('inventorycode', 'alphanohtml')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,9 +368,9 @@ if ($action == "transfert_stock" && !$cancel)
|
|||||||
$id,
|
$id,
|
||||||
GETPOST("nbpiece"),
|
GETPOST("nbpiece"),
|
||||||
1,
|
1,
|
||||||
GETPOST("label"),
|
GETPOST("label", 'san_alpha'),
|
||||||
$pricesrc,
|
$pricesrc,
|
||||||
GETPOST('inventorycode')
|
GETPOST('inventorycode', 'alphanohtml')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add stock
|
// Add stock
|
||||||
@ -379,9 +379,9 @@ if ($action == "transfert_stock" && !$cancel)
|
|||||||
GETPOST("id_entrepot_destination"),
|
GETPOST("id_entrepot_destination"),
|
||||||
GETPOST("nbpiece"),
|
GETPOST("nbpiece"),
|
||||||
0,
|
0,
|
||||||
GETPOST("label"),
|
GETPOST("label", 'san_alpha'),
|
||||||
$pricedest,
|
$pricedest,
|
||||||
GETPOST('inventorycode')
|
GETPOST('inventorycode', 'alphanohtml')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!$error && $result1 >= 0 && $result2 >= 0)
|
if (!$error && $result1 >= 0 && $result2 >= 0)
|
||||||
@ -424,7 +424,7 @@ $formother = new FormOther($db);
|
|||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.entity,";
|
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.tosell, p.tobuy, p.tobatch, p.fk_product_type as type, p.entity,";
|
||||||
$sql .= " e.ref as warehouse_ref, e.rowid as entrepot_id, e.lieu, e.fk_parent, e.statut,";
|
$sql .= " e.ref as warehouse_ref, e.rowid as entrepot_id, e.lieu, e.fk_parent, e.statut,";
|
||||||
$sql .= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
|
$sql .= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
|
||||||
$sql .= " m.batch, m.price,";
|
$sql .= " m.batch, m.price,";
|
||||||
@ -976,6 +976,8 @@ if ($resql)
|
|||||||
$productstatic->label = $objp->produit;
|
$productstatic->label = $objp->produit;
|
||||||
$productstatic->type = $objp->type;
|
$productstatic->type = $objp->type;
|
||||||
$productstatic->entity = $objp->entity;
|
$productstatic->entity = $objp->entity;
|
||||||
|
$productstatic->status = $objp->tosell;
|
||||||
|
$productstatic->status_buy = $objp->tobuy;
|
||||||
$productstatic->status_batch = $objp->tobatch;
|
$productstatic->status_batch = $objp->tobatch;
|
||||||
|
|
||||||
$productlot->id = $objp->lotid;
|
$productlot->id = $objp->lotid;
|
||||||
|
|||||||
@ -214,6 +214,8 @@ $sql.= " t.import_key,";
|
|||||||
$sql.= " p.fk_product_type as product_type,";
|
$sql.= " p.fk_product_type as product_type,";
|
||||||
$sql.= " p.ref as product_ref,";
|
$sql.= " p.ref as product_ref,";
|
||||||
$sql.= " p.label as product_label,";
|
$sql.= " p.label as product_label,";
|
||||||
|
$sql.= " p.tosell,";
|
||||||
|
$sql.= " p.tobuy,";
|
||||||
$sql.= " p.tobatch";
|
$sql.= " p.tobatch";
|
||||||
// Add fields for extrafields
|
// Add fields for extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
@ -300,7 +302,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'barcode', 0, '', '', $limit);
|
||||||
|
|
||||||
$topicmail = "Information";
|
$topicmail = "Information";
|
||||||
$modelmail = "productlot";
|
$modelmail = "productlot";
|
||||||
@ -418,6 +420,7 @@ if ($resql)
|
|||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$productlot->id = $obj->rowid;
|
$productlot->id = $obj->rowid;
|
||||||
|
$productlot->status = $obj->tosell;
|
||||||
$productlot->batch = $obj->batch;
|
$productlot->batch = $obj->batch;
|
||||||
|
|
||||||
// You can use here results
|
// You can use here results
|
||||||
@ -438,7 +441,10 @@ if ($resql)
|
|||||||
$productstatic->type = $obj->product_type;
|
$productstatic->type = $obj->product_type;
|
||||||
$productstatic->ref = $obj->product_ref;
|
$productstatic->ref = $obj->product_ref;
|
||||||
$productstatic->label = $obj->product_label;
|
$productstatic->label = $obj->product_label;
|
||||||
|
$productstatic->status = $obj->tosell;
|
||||||
|
$productstatic->status_buy = $obj->tobuy;
|
||||||
$productstatic->status_batch = $obj->tobatch;
|
$productstatic->status_batch = $obj->tobatch;
|
||||||
|
|
||||||
print '<td>'.$productstatic->getNomUrl(1).'</td>';
|
print '<td>'.$productstatic->getNomUrl(1).'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -306,7 +306,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0)
|
|||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php'.(!empty($socid) ? '?id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
|||||||
@ -942,25 +942,54 @@ class Dolresource extends CommonObject
|
|||||||
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
|
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
|
||||||
* @param string $get_params Parametres added to url
|
* @param string $get_params Parametres added to url
|
||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
|
* @param string $morecss Add more css on link
|
||||||
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$label = $langs->trans("ShowResource").': '.$this->ref;
|
$label = '<u>'.$langs->trans("ShowResource").'</u>';
|
||||||
|
$label .= '<br>';
|
||||||
$linkstart = '';
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
$linkend = '';
|
/*if (isset($this->status)) {
|
||||||
if ($option == '')
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
{
|
}*/
|
||||||
$linkstart = '<a href="'.dol_buildpath('/resource/card.php', 1).'?id='.$this->id.$get_params.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
if (isset($this->type_label)) {
|
||||||
$picto = 'resource';
|
$label.= '<br><b>' . $langs->trans("ResourceType").":</b> ".$this->type_label;
|
||||||
$label = $langs->trans("ShowResource").': '.$this->ref;
|
|
||||||
$linkend = '</a>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$url = DOL_URL_ROOT.'/resource/card.php?id='.$this->id;
|
||||||
|
|
||||||
|
if ($option != 'nolink')
|
||||||
|
{
|
||||||
|
// Add param to save lastsearch_values or not
|
||||||
|
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
|
||||||
|
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
|
||||||
|
}
|
||||||
|
|
||||||
|
$linkclose = '';
|
||||||
|
if (empty($notooltip))
|
||||||
|
{
|
||||||
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label = $langs->trans("ShowMyObject");
|
||||||
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
||||||
|
}
|
||||||
|
else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.$get_params.'"';
|
||||||
|
$linkstart .= $linkclose.'>';
|
||||||
|
$linkend = '</a>';
|
||||||
|
/*$linkstart = '<a href="'.dol_buildpath('/resource/card.php', 1).'?id='.$this->id.$get_params.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
$linkend = '</a>';*/
|
||||||
|
|
||||||
$result .= $linkstart;
|
$result .= $linkstart;
|
||||||
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||||
if ($withpicto != 2) $result .= $this->ref;
|
if ($withpicto != 2) $result .= $this->ref;
|
||||||
|
|||||||
@ -229,7 +229,7 @@ if (empty($reshook))
|
|||||||
dol_print_error($db, $object->error);
|
dol_print_error($db, $object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create askprice
|
// Create supplier proposal
|
||||||
elseif ($action == 'add' && $user->rights->supplier_proposal->creer)
|
elseif ($action == 'add' && $user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
$object->socid = $socid;
|
$object->socid = $socid;
|
||||||
@ -630,7 +630,7 @@ if (empty($reshook))
|
|||||||
elseif (GETPOST('idprodfournprice', 'alpha') > 0)
|
elseif (GETPOST('idprodfournprice', 'alpha') > 0)
|
||||||
{
|
{
|
||||||
//$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
|
//$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
|
||||||
$qtytosearch = -1; // We force qty to -1 to be sure to find if a supplier price exist
|
$qtytosearch = -1; // We force qty to -1 to be sure to find if the supplier price that exists
|
||||||
$idprod = $productsupplier->get_buyprice(GETPOST('idprodfournprice', 'alpha'), $qtytosearch);
|
$idprod = $productsupplier->get_buyprice(GETPOST('idprodfournprice', 'alpha'), $qtytosearch);
|
||||||
$res = $productsupplier->fetch($idprod);
|
$res = $productsupplier->fetch($idprod);
|
||||||
}
|
}
|
||||||
@ -660,7 +660,8 @@ if (empty($reshook))
|
|||||||
$pu_ht = $productsupplier->fourn_pu;
|
$pu_ht = $productsupplier->fourn_pu;
|
||||||
if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value
|
if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value
|
||||||
|
|
||||||
$fournprice = 0;
|
// If GETPOST('idprodfournprice') is a numeric, we can use it. If it is empty or if it is 'idprod_123', we should use -1 (not used)
|
||||||
|
$fournprice = (is_numeric(GETPOST('idprodfournprice', 'alpha')) ? GETPOST('idprodfournprice', 'alpha') : -1);
|
||||||
$buyingprice = 0;
|
$buyingprice = 0;
|
||||||
|
|
||||||
$result = $object->addline(
|
$result = $object->addline(
|
||||||
|
|||||||
@ -388,7 +388,7 @@ class SupplierProposal extends CommonObject
|
|||||||
* @param int $rang Position of line
|
* @param int $rang Position of line
|
||||||
* @param int $special_code Special code (also used by externals modules!)
|
* @param int $special_code Special code (also used by externals modules!)
|
||||||
* @param int $fk_parent_line Id of parent line
|
* @param int $fk_parent_line Id of parent line
|
||||||
* @param int $fk_fournprice Id supplier price
|
* @param int $fk_fournprice Id supplier price. If 0, we will take best price. If -1 we keep it empty.
|
||||||
* @param int $pa_ht Buying price without tax
|
* @param int $pa_ht Buying price without tax
|
||||||
* @param string $label ???
|
* @param string $label ???
|
||||||
* @param array $array_option extrafields array
|
* @param array $array_option extrafields array
|
||||||
@ -583,15 +583,16 @@ class SupplierProposal extends CommonObject
|
|||||||
|
|
||||||
// infos marge
|
// infos marge
|
||||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||||
// by external module, take lowest buying price
|
// When fk_fournprice is 0, we take the lowest buying price
|
||||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
$productFournisseur = new ProductFournisseur($this->db);
|
$productFournisseur = new ProductFournisseur($this->db);
|
||||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||||
} else {
|
} else {
|
||||||
$this->line->fk_fournprice = $fk_fournprice;
|
$this->line->fk_fournprice = ($fk_fournprice > 0 ? $fk_fournprice : 0); // If fk_fournprice is -1, we will not use fk_fournprice
|
||||||
}
|
}
|
||||||
$this->line->pa_ht = $pa_ht;
|
$this->line->pa_ht = $pa_ht;
|
||||||
|
//var_dump($this->line->fk_fournprice);exit;
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$this->line->fk_multicurrency = $this->fk_multicurrency;
|
$this->line->fk_multicurrency = $this->fk_multicurrency;
|
||||||
|
|||||||
@ -148,9 +148,9 @@ if ($action != 'edit') {
|
|||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
}
|
}
|
||||||
print '<table class="border" style="width: 100%">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield fieldrequired">'.$langs->trans('Ref').'</td>';
|
print '<td class="titlefield'.($action == 'edit' ? ' fieldrequired' : '').'">'.$langs->trans('Ref').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<input type="text" name="ref" value="'.$object->ref.'">';
|
print '<input type="text" name="ref" value="'.$object->ref.'">';
|
||||||
@ -160,7 +160,7 @@ if ($action == 'edit') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">'.$langs->trans('Label').'</td>';
|
print '<td'.($action == 'edit' ? ' class="fieldrequired"' : '').'>'.$langs->trans('Label').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<input type="text" name="label" value="'.$object->label.'">';
|
print '<input type="text" name="label" value="'.$object->label.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user