Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/admin/supplier_order.php htdocs/langs/en_US/admin.lang
This commit is contained in:
commit
09d6826e62
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "orders"));
|
||||
$langs->loadLangs(array("admin", "other", "orders", "stocks"));
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@ -561,25 +561,31 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Option to add a quality/validation step, on products, after reception.
|
||||
$langs->load("stocks");
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
|
||||
if ($conf->reception->enabled)
|
||||
{
|
||||
print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
else
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Notifications
|
||||
*/
|
||||
|
||||
@ -81,8 +81,8 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
|
||||
@ -239,6 +239,23 @@ if ($id > 0 || $ref)
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
/*$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
{
|
||||
@ -298,7 +315,7 @@ if ($id > 0 || $ref)
|
||||
print "<a class=\"butAction\" href=\"card.php?action=setcredited&id=".$object->id."\">".$langs->trans("ClassCredited")."</a>";
|
||||
}
|
||||
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=confirm_delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
@ -356,8 +373,6 @@ if ($id > 0 || $ref)
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($i < min($num, $conf->liste_limit))
|
||||
@ -406,7 +421,10 @@ if ($id > 0 || $ref)
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="right">';
|
||||
if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
|
||||
if (empty($offset) && $num <= $limit) // If we have all record on same page, then the following test/warning can be done
|
||||
{
|
||||
if ($total != $object->amount) print img_warning("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines");
|
||||
}
|
||||
print price($total);
|
||||
print "</td>\n";
|
||||
print '<td> </td>';
|
||||
|
||||
@ -739,14 +739,13 @@ class BonPrelevement extends CommonObject
|
||||
$sql = "SELECT count(f.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE f.fk_statut = 1";
|
||||
$sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.rowid = pfd.fk_facture";
|
||||
$sql.= " AND f.paye = 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
|
||||
dol_syslog(get_class($this)."::SommeAPrelever");
|
||||
dol_syslog(get_class($this)."::NbFactureAPrelever");
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ( $resql )
|
||||
@ -759,7 +758,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error();
|
||||
$this->error=get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1629,8 +1628,8 @@ class BonPrelevement extends CommonObject
|
||||
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
||||
{
|
||||
global $langs;
|
||||
$pre = $langs->trans('RUM').'-';
|
||||
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||
$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
|
||||
return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'widthdrawals', 'companies', 'bills'));
|
||||
$langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills'));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -105,6 +105,7 @@ if (empty($reshook))
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$thirdpartystatic=new Societe($db);
|
||||
@ -207,9 +208,11 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND pfd.fk_facture = f.rowid";
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if ($socid > 0) $sql.= " AND f.fk_soc = ".$socid;
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -293,7 +296,7 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else print '<tr '.$bc[0].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
else print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print "</table>";
|
||||
print "</form>";
|
||||
print "<br>\n";
|
||||
|
||||
@ -35,31 +35,43 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies'));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$status = GETPOST('status', 'int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
|
||||
|
||||
// Get supervariables
|
||||
$page = GETPOST('page', 'int');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.ref";
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
if (!$status)
|
||||
{
|
||||
$title = $langs->trans("RequestStandingOrderToTreat");
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $langs->trans("RequestStandingOrderTreated");
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$invoicestatic=new Facture($db);
|
||||
@ -78,95 +90,126 @@ $sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if (!$statut) $sql.= " AND pfd.traite = 0";
|
||||
if ($statut) $sql.= " AND pfd.traite = ".$statut;
|
||||
if (!$status) $sql.= " AND pfd.traite = 0";
|
||||
if ($status) $sql.= " AND pfd.traite = ".$status;
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND pfd.fk_facture = f.rowid";
|
||||
if (dol_strlen(trim(GETPOST('search_societe', 'alpha'))))
|
||||
{
|
||||
$sql.= natural_search("s.nom", 'search_societe');
|
||||
}
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
$sql.=$db->order($sortfield, $sortorder);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if (!$statut)
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
|
||||
{
|
||||
print_barre_liste($langs->trans("RequestStandingOrderToTreat"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_barre_liste($langs->trans("RequestStandingOrderTreated"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.dol_escape_htmltag(GETPOST('search_facture', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.dol_escape_htmltag(GETPOST('search_societe', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" class="middle">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$users = array();
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$thirdpartystatic->id=$obj->socid;
|
||||
$thirdpartystatic->name=$obj->name;
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit);
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.dol_escape_htmltag(GETPOST('search_facture', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.dol_escape_htmltag(GETPOST('search_societe', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" class="middle">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$users = array();
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) break; // Should not happen
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$thirdpartystatic->id=$obj->socid;
|
||||
$thirdpartystatic->name=$obj->name;
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -71,6 +71,7 @@ $thirdpartystatic=new Societe($db);
|
||||
$invoicestatic=new Facture($db);
|
||||
$bprev = new BonPrelevement($db);
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||
|
||||
@ -100,6 +101,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
|
||||
@ -58,7 +58,7 @@ class modReception extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/reception/receipt",
|
||||
"/reception/receipt/temp",
|
||||
"/doctemplates/reception"
|
||||
"/doctemplates/receptions"
|
||||
);
|
||||
|
||||
// Config pages
|
||||
|
||||
@ -121,15 +121,7 @@ class pdf_squille extends ModelePdfReception
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("deliveries");
|
||||
$outputlangs->load("receptions");
|
||||
$outputlangs->load("productbatch");
|
||||
$outputlangs->loadLangs(array("main","dict","companies","bills","products","propal","deliveries","receptions","productbatch","sendings"));
|
||||
|
||||
$nblines = count($object->lines);
|
||||
|
||||
|
||||
@ -939,8 +939,16 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td></td>';
|
||||
print '<td>' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td>' . $langs->trans("Comment") . '</td>';
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled))
|
||||
|
||||
// Status
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
|
||||
print '<td class="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
}
|
||||
elseif(!empty($conf->reception->enabled)) {
|
||||
print '<td class="center"></td>';
|
||||
}
|
||||
|
||||
print '<td class="center"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1025,17 +1033,15 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
}elseif(!empty($conf->reception->enabled)){
|
||||
} elseif(!empty($conf->reception->enabled)) {
|
||||
print '<td class="right">';
|
||||
if(!empty($reception->id)){
|
||||
print $reception->getLibStatut(5);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td class="center"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -55,13 +55,6 @@ $langs->load("holiday");
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
$cancreate = 0;
|
||||
if (! empty($user->rights->holiday->write_all)) $cancreate=1;
|
||||
if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1;
|
||||
|
||||
$candelete = 0;
|
||||
if (! empty($user->rights->holiday->delete)) $candelete=1;
|
||||
|
||||
$morefilter = 'AND employee = 1';
|
||||
if (! empty($conf->global->HOLIDAY_FOR_NON_SALARIES_TOO)) $morefilter = '';
|
||||
|
||||
@ -82,6 +75,13 @@ if ($id > 0)
|
||||
}
|
||||
}
|
||||
|
||||
$cancreate = 0;
|
||||
if (! empty($user->rights->holiday->write_all)) $cancreate=1;
|
||||
if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1;
|
||||
|
||||
$candelete = 0;
|
||||
if (! empty($user->rights->holiday->delete)) $candelete=1;
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1435,7 +1435,7 @@ else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
if ($user->rights->holiday->delete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused
|
||||
if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete" class="butActionDelete">'.$langs->trans("DeleteCP").'</a>';
|
||||
}
|
||||
|
||||
@ -1940,4 +1940,5 @@ RESTRICT_API_ON_IP=Allow available APIs to some host IP only (wildcard not allow
|
||||
RESTRICT_ON_IP=Allow access to some host IP only (wildcard not allowed, use space between values). Empty means every hosts can access.
|
||||
BaseOnSabeDavVersion=Based on the library SabreDAV version
|
||||
NotAPublicIp=Not a public IP
|
||||
MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation.
|
||||
MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation.
|
||||
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
|
||||
|
||||
@ -825,6 +825,7 @@ Mandatory=Mandatory
|
||||
Hello=Hello
|
||||
GoodBye=GoodBye
|
||||
Sincerely=Sincerely
|
||||
ConfirmDeleteObject=Are you sure you want to delete this object?
|
||||
DeleteLine=Delete line
|
||||
ConfirmDeleteLine=Are you sure you want to delete this line?
|
||||
NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record
|
||||
|
||||
@ -256,7 +256,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
// Confirmation to delete line
|
||||
if ($action == 'deleteline')
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -15,6 +16,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@ -22,41 +31,47 @@
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("receptions");
|
||||
|
||||
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("Reception"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
<td class="linkedcol-element"><?php echo $langs->trans("Reception"); ?>
|
||||
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
|
||||
</td>
|
||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"></td>
|
||||
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
if ($user->rights->reception->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right">
|
||||
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="linkedcol-action right">
|
||||
<?php
|
||||
// For now, receptions must stay linked to order, so link is not deletable
|
||||
if($object->element != 'order_supplier') {
|
||||
?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user