Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-05-23 15:37:08 +02:00
commit 9b54ed766b
24 changed files with 832 additions and 77 deletions

View File

@ -267,7 +267,7 @@ if ($resql)
{
$num = $db->num_rows($resql);
$param = '';
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
if ($search_account) $param .= '&search_account='.urlencode($search_account);

View File

@ -458,7 +458,17 @@ if ($conf->use_javascript_ajax) {
}
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AlwaysShowFullArbo").'</td>';
print '<td class="right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_ALWAYS_SHOW_FULL_ARBO');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
}
print "</td>\n";
print "</tr>\n";
print '</table>';
/*

View File

@ -337,6 +337,20 @@ class ActionComm extends CommonObject
*/
public $errors_to;
/**
* Typical value for a event that is in a todo state
*/
const EVENT_TODO = 0;
/**
* Typical value for a event that is in a progress state
*/
const EVENT_IN_PROGRESS = 50;
/**
* Typical value for a event that is in a finished state
*/
const EVENT_FINISHED = 100;
/**
* Constructor
@ -2008,4 +2022,32 @@ class ActionComm extends CommonObject
return $error;
}
/**
* Udpate the percent value of a event with the given id
*
* @param int $id The id of the event
* @param int $percent The new percent value for the event
* @return int 1 when update of the event was suscessfull, otherwise -1
*/
public function updatePercent($id, $percent)
{
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql .= " SET percent = ".(int) $percent;
$sql .= " WHERE id=".$id;
if ($this->db->query($sql))
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
}
}
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
*
* 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
@ -40,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other"));
$action = GETPOST('action', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
@ -49,6 +51,8 @@ $optioncss = GETPOST('optioncss', 'alpha');
$year = GETPOST("year", 'int');
$month = GETPOST("month", 'int');
$day = GETPOST("day", 'int');
$toselect = GETPOST('toselect', 'array');
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('search_actioncode', 'array'))
{
@ -185,9 +189,42 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$datestart = '';
$dateend = '';
$search_status = '';
$toselect = '';
$search_array_options = array();
}
if (empty($reshook) && !empty($massaction))
{
unset($percent);
switch ($massaction)
{
case 'set_all_events_to_todo':
$percent = ActionComm::EVENT_TODO;
break;
case 'set_all_events_to_in_progress':
$percent = ActionComm::EVENT_IN_PROGRESS;
break;
case 'set_all_events_to_finished':
$percent = ActionComm::EVENT_FINISHED;
break;
}
if(isset($percent))
{
foreach ($toselect as $toselectid)
{
$result = $object->updatePercent($toselectid, $percent);
if($result < 0)
{
dol_print_error($db);
break;
}
}
}
}
/*
* View
@ -239,6 +276,15 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
'set_all_events_to_todo' => $langs->trans("SetAllEventsToTodo"),
'set_all_events_to_in_progress' => $langs->trans("SetAllEventsToInProgress"),
'set_all_events_to_finished' => $langs->trans("SetAllEventsToFinished"),
);
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$sql = "SELECT";
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
@ -366,6 +412,8 @@ if ($resql)
$num = $db->num_rows($resql);
$arrayofselected = is_array($toselect) ? $toselect : array();
// Local calendar
$newtitle = '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
//$newtitle=$langs->trans($title);
@ -436,7 +484,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
}
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = '';
@ -740,7 +788,15 @@ if ($resql)
$datep = $db->jdate($obj->datep);
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).'</td>';
}
print '<td></td>';
// Action column
print '<td class="nowrap center">';
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;
if (in_array($obj->id, $arrayofselected)) $selected = 1;
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
print "</tr>\n";
$i++;

View File

@ -1052,11 +1052,11 @@ class pdf_azur extends ModelePDFPropales
* Show total to pay
*
* @param PDF $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Propal $object Object propal
* @param int $deja_regle Amount already paid
* @param int $posy Start position
* @param Translate $outputlangs Objet langs
* @return int Position pour suite
* @return int Position for continuation
*/
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
@ -1068,7 +1068,7 @@ class pdf_azur extends ModelePDFPropales
$tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
// Total table
$col1x = 120; $col2x = 170;
if ($this->page_largeur < 210) // To work with US executive format
{

View File

@ -56,6 +56,7 @@ $search_ref_exp = GETPOST("search_ref_exp", 'alpha');
$search_ref_liv = GETPOST('search_ref_liv', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_company = GETPOST("search_company", 'alpha');
$search_tracking = GETPOST("search_tracking", 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state"));
@ -106,6 +107,7 @@ $fieldstosearchall = array(
'e.ref'=>"Ref",
's.nom'=>"ThirdParty",
'e.note_public'=>'NotePublic',
'e.tracking_number'=>"TrackingNumber",
);
if (empty($user->socid)) $fieldstosearchall["e.note_private"] = "NotePrivate";
@ -120,6 +122,7 @@ $arrayfields = array(
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1),
'e.tracking_number'=>array('label'=>$langs->trans("TrackingNumber"), 'checked'=>1),
'e.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0),
'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@ -172,6 +175,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_state = "";
$search_type = '';
$search_country = '';
$search_tracking='';
$search_type_thirdparty = '';
$search_billed = '';
$search_datedelivery_start = '';
@ -214,7 +218,7 @@ llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,";
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -273,6 +277,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
if ($search_state) $sql .= natural_search("state.nom", $search_state);
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
if ($search_tracking) $sql.= natural_search("e.tracking_number", $search_tracking);
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
@ -330,6 +335,7 @@ if ($resql)
if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale);
if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($search_tracking) $param.= "&amp;search_tracking=".urlencode($search_tracking);
if ($search_town) $param .= '&search_town='.urlencode($search_town);
if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
@ -507,6 +513,13 @@ if ($resql)
print '</div>';
print '</td>';
}
// Tracking number
if (! empty($arrayfields['e.tracking_number']['checked']))
{
print '<td class="liste_titre center">';
print '<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).'">';
print '</td>';
}
if (!empty($arrayfields['l.ref']['checked']))
{
// Delivery ref
@ -579,6 +592,7 @@ if ($resql)
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['e.tracking_number']['checked'])) print_liste_field_titre($arrayfields['e.tracking_number']['label'], $_SERVER["PHP_SELF"], "e.tracking_number", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
// Extra fields
@ -706,6 +720,12 @@ if ($resql)
}*/
print "</td>\n";
}
// Tracking number
if (! empty($arrayfields['e.tracking_number']['checked']))
{
print '<td class="center">'.$obj->tracking_number."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked']))
{

View File

@ -8,7 +8,7 @@
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
*
* 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
@ -38,6 +38,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php';
if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -53,6 +55,8 @@ $ref = GETPOST('ref');
$lineid = GETPOST('lineid', 'int');
$action = GETPOST('action', 'aZ09');
$fk_default_warehouse = GETPOST('fk_default_warehouse', 'int');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
if ($user->socid)
$socid = $user->socid;
@ -366,6 +370,126 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
}
}
// Remove a dispatched line
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->commande->receptionner)
{
$db->begin();
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$result = $supplierorderdispatch->fetch($lineid);
if ($result > 0)
{
$qty = $supplierorderdispatch->qty;
$entrepot = $supplierorderdispatch->fk_entrepot;
$product = $supplierorderdispatch->fk_product;
$price = GETPOST('price');
$comment = $supplierorderdispatch->comment;
$eatby = $supplierorderdispatch->fk_product;
$sellby = $supplierorderdispatch->sellby;
$batch = $supplierorderdispatch->batch;
$result = $supplierorderdispatch->delete($user);
}
if ($result < 0)
{
$errors = $object->errors;
$error++;
}
else
{
// If module stock is enabled and the stock increase is done on purchase order dispatching
if ($entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
{
$mouv = new MouvementStock($db);
if ($product > 0)
{
$mouv->origin = &$object;
$result=$mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch);
if ($result < 0)
{
$errors=$mouv->errors;
$error++;
}
}
}
}
if ($error > 0)
{
$db->rollback();
setEventMessages($error, $errors, 'errors');
}
else
{
$db->commit();
}
}
// Update a dispatched line
if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionner)
{
$db->begin();
$error = 0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$result = $supplierorderdispatch->fetch($lineid);
if ($result > 0)
{
$qty = $supplierorderdispatch->qty;
$entrepot = $supplierorderdispatch->fk_entrepot;
$product = $supplierorderdispatch->fk_product;
$price = GETPOST('price');
$comment = $supplierorderdispatch->comment;
$eatby = $supplierorderdispatch->fk_product;
$sellby = $supplierorderdispatch->sellby;
$batch = $supplierorderdispatch->batch;
$supplierorderdispatch->qty = GETPOST('qty', 'int');
$supplierorderdispatch->fk_entrepot = GETPOST('fk_entrepot');
$result = $supplierorderdispatch->update($user);
}
if ($result < 0)
{
$error++;
$errors=$supplierorderdispatch->errors;
}
else
{
// If module stock is enabled and the stock increase is done on purchase order dispatching
if ($entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
{
$mouv = new MouvementStock($db);
if ($product > 0)
{
$mouv->origin = &$object;
$result=$mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch);
if ($result < 0)
{
$errors=$mouv->errors;
$error++;
}
else
{
$mouv->origin = &$object;
$result=$mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
if ($result < 0)
{
$errors=$mouv->errors;
$error++;
}
}
}
}
}
if ($error > 0)
{
$db->rollback();
setEventMessages($error, $errors, 'errors');
}
else
{
$db->commit();
}
}
/*
* View
@ -379,7 +503,7 @@ $warehouse_static = new Entrepot($db);
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
llxHeader('', $langs->trans("Order"), $help_url, '', 0, 0, array('/fourn/js/lib_dispatch.js.php'));
llxHeader('', $langs->trans("OrderDispatch"), $help_url, '', 0, 0, array('/fourn/js/lib_dispatch.js.php'));
if ($id > 0 || !empty($ref)) {
$soc = new Societe($db);
@ -393,6 +517,23 @@ if ($id > 0 || !empty($ref)) {
$title = $langs->trans("SupplierOrder");
dol_fiche_head($head, 'dispatch', $title, -1, 'order');
$formconfirm='';
// Confirmation to delete line
if ($action == 'ask_deleteline')
{
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
}
// Call Hook formConfirm
$parameters = array('lineid' => $lineid);
// Note that $action and $object may be modified by hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action);
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
// Print form confirm
print $formconfirm;
// Supplier order card
@ -493,6 +634,9 @@ if ($id > 0 || !empty($ref)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$formproduct->loadWarehouses();
$entrepot = new Entrepot($db);
$listwarehouses=$entrepot->list_array(1);
if (empty($conf->reception->enabled))print '<form method="POST" action="dispatch.php?id='.$object->id.'">';
else print '<form method="post" action="'.dol_buildpath('/reception/card.php', 1).'?originid='.$object->id.'&origin=supplierorder">';
@ -567,8 +711,6 @@ if ($id > 0 || !empty($ref)) {
$i = 0;
if ($num) {
$entrepot = new Entrepot($db);
$listwarehouses = $entrepot->list_array(1);
print '<tr class="liste_titre">';
@ -931,9 +1073,11 @@ if ($id > 0 || !empty($ref)) {
$sql = "SELECT p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.ref as entrepot,";
$sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
$sql.=" ,cd.rowid, cd.subprice";
if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p,";
$sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid";
if ($conf->reception->enabled)$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."reception as r ON cfd.fk_reception = r.rowid";
$sql .= " WHERE cfd.fk_commande = ".$object->id;
@ -965,7 +1109,6 @@ if ($id > 0 || !empty($ref)) {
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
}
print '<td class="right">'.$langs->trans("QtyDispatched").'</td>';
print '<td></td>';
print '<td>'.$langs->trans("Warehouse").'</td>';
print '<td>'.$langs->trans("Comment").'</td>';
@ -977,14 +1120,23 @@ if ($id > 0 || !empty($ref)) {
print '<td class="center"></td>';
}
print '<td class="center"></td>';
print '<td class="center" colspan="2"></td>';
print "</tr>\n";
while ($i < $num) {
$objp = $db->fetch_object($resql);
print "<tr ".$bc[$var].">";
if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{
print '<form name="editdispatchedlines" id="editdispatchedlines" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#line_' . GETPOST('lineid') . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="updateline">
<input type="hidden" name="mode" value="">
<input type="hidden" name="lineid" value="' . $objp->dispatchlineid . '">';
}
print '<tr ' . $bc[$var] . ' id="line_'.$objp->dispatchlineid.'" >';
if (!empty($conf->reception->enabled)) {
print '<td>';
@ -1011,14 +1163,37 @@ if ($id > 0 || !empty($ref)) {
}
// Qty
print '<td class="right">'.$objp->qty.'</td>';
print '<td>&nbsp;</td>';
print '<td class="right">';
if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{
print '<input style="width: 50px;" type="number" min="1" name="qty" value="' . $objp->qty . '" />';
}
else
{
print $objp->qty;
}
print '<input type="hidden" name="price" value="'.$objp->subprice.'" />';
print '</td>';
// Warehouse
print '<td>';
$warehouse_static->id = $objp->warehouse_id;
$warehouse_static->libelle = $objp->entrepot;
print $warehouse_static->getNomUrl(1);
if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{
if (count($listwarehouses) > 1) {
print $formproduct->selectWarehouses(GETPOST("fk_entrepot")?GETPOST("fk_entrepot"):($objp->warehouse_id?$objp->warehouse_id:''), "fk_entrepot", '', 1, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} elseif (count($listwarehouses) == 1) {
print $formproduct->selectWarehouses(GETPOST("fk_entrepot")?GETPOST("fk_entrepot"):($objp->warehouse_id?$objp->warehouse_id:''), "fk_entrepot", '', 0, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
}
}
else
{
$warehouse_static->id = $objp->warehouse_id;
$warehouse_static->libelle = $objp->entrepot;
print $warehouse_static->getNomUrl(1);
}
print '</td>';
// Comment
@ -1069,9 +1244,33 @@ if ($id > 0 || !empty($ref)) {
print '</td>';
}
print '<td class="center"></td>';
if ($action != 'editline' ||  && $lineid != $objp->dispatchlineid)
{
print '<td class="linecoledit center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;lineid=' . $objp->dispatchlineid .'#line_'. $objp->dispatchlineid . '">';
print img_edit();
print '</a>';
print '</td>';
print '<td class="linecoldelete center">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=ask_deleteline&amp;lineid=' . $objp->dispatchlineid . '#dispatch_received_products">';
print img_delete();
print '</a>';
print '</td>';
}
else
{
print '<td class="center valignmiddle">';
print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'" />';
print '</td>';
print '<td class="center valignmiddle">';
print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'. $langs->trans("Cancel").'" />';
print '</td>';
}
print "</tr>\n";
if ($action == 'editline' && $lineid == $objp->dispatchlineid) print '</form>';
$i++;
}

View File

@ -154,3 +154,6 @@ EveryMonth=Every month
DayOfMonth=Day of month
DayOfWeek=Day of week
DateStartPlusOne=Date start + 1 hour
SetAllEventsToTodo=Set all events to todo
SetAllEventsToInProgress=Set all events to in progress
SetAllEventsToFinished=Set all events to finished

View File

@ -187,6 +187,8 @@ ShowCardHere=Show card
Search=Search
SearchOf=Search
SearchMenuShortCut=Ctrl + shift + f
QuickAdd=Quick add
QuickAddMenuShortCut=Ctrl + shift + l
Valid=Valid
Approve=Approve
Disapprove=Disapprove
@ -1032,4 +1034,4 @@ DeleteFileHeader=Confirm file delete
DeleteFileText=Do you really want delete this file?
ShowOtherLanguages=Show other languages
SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language
NotUsedForThisCustomer=Not used for this customer
NotUsedForThisCustomer=Not used for this customer

View File

@ -218,3 +218,4 @@ InventoryForASpecificWarehouse=Inventory for a specific warehouse
InventoryForASpecificProduct=Inventory for a specific product
StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use
ForceTo=Force to
AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances)

View File

@ -218,3 +218,4 @@ InventoryForASpecificWarehouse=Inventaire pour un entrepôt spécifique
InventoryForASpecificProduct=Inventaire pour un produit spécifique
StockIsRequiredToChooseWhichLotToUse=Le module Stock est requis pour choisir une lot
ForceTo=Forcer à
AlwaysShowFullArbo=Toujours afficher l'arborescence complète dans le lien vers la fiche

View File

@ -1722,6 +1722,11 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$toprightmenu .= top_menu_search();
}
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
// Add search dropdown
$toprightmenu .= top_menu_quickadd();
}
// Add bookmark dropdown
$toprightmenu .= top_menu_bookmark();
@ -1934,6 +1939,226 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
return $btnUser;
}
/**
* Build the tooltip on top menu quick add
*
* @return string HTML content
*/
function top_menu_quickadd()
{
global $langs, $conf, $db, $hookmanager, $user;
global $menumanager;
$html = '';
// Define $dropDownQuickAddHtml
$dropDownQuickAddHtml = '<div class="dropdown-header bookmark-header center">';
$dropDownQuickAddHtml.= $langs->trans('QuickAdd');
$dropDownQuickAddHtml.= '</div>';
$dropDownQuickAddHtml.= '<div class="quickadd-body dropdown-body">';
$dropDownQuickAddHtml.= '<div class="quickadd">';
if (! empty($conf->societe->enabled) && $user->rights->societe->creer) {
$langs->load("companies");
$dropDownQuickAddHtml.= '
<!-- Thirdparty link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'">
<i class="fal fa-building fa-2x"></i><br>
'.$langs->trans("ThirdParty").'
</a>
</div>
';
}
if (! empty($conf->societe->enabled) && $user->rights->societe->contact->creer) {
$langs->load("companies");
$dropDownQuickAddHtml.= '
<!-- Contact link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'">
<i class="fal fa-address-book fa-2x"></i><br>
'.$langs->trans("Contact").'
</a>
</div>
';
}
if (! empty($conf->propal->enabled) && $user->rights->propale->creer) {
$langs->load("propal");
$dropDownQuickAddHtml.= '
<!-- Propal link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'">
<i class="fal fa-suitcase fa-2x"></i><br>
'.$langs->trans("Proposal").'
</a>
</div>
';
}
if (! empty($conf->commande->enabled) && $user->rights->commande->creer) {
$langs->load("orders");
$dropDownQuickAddHtml.= '
<!-- Order link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fal fa-file-alt fa-2x"></i><br>
'.$langs->trans("Order").'
</a>
</div>
';
}
if (! empty($conf->facture->enabled) && $user->rights->facture->creer) {
$langs->load("bills");
$dropDownQuickAddHtml.= '
<!-- Invoice link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fal fa-coins fa-2x"></i><br>
'.$langs->trans("Bill").'
</a>
</div>
';
}
if (! empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
$langs->load("contracts");
$dropDownQuickAddHtml.= '
<!-- Contract link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'">
<i class="fal fa-file-contract fa-2x"></i><br>
'.$langs->trans("Contract").'
</a>
</div>
';
}
if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
$langs->load("supplier_proposal");
$dropDownQuickAddHtml.= '
<!-- Supplier proposal link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'">
<i class="fal fa-suitcase fa-2x"></i><br>
'.$langs->trans("AskPrice").'
</a>
</div>
';
}
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) {
$langs->load("orders");
$dropDownQuickAddHtml.= '
<!-- Supplier order link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fal fa-file-alt fa-2x"></i><br>
'.$langs->trans("SupplierOrder").'
</a>
</div>
';
}
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) {
$langs->load("bills");
$dropDownQuickAddHtml.= '
<!-- Supplier invoice link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fal fa-coins fa-2x"></i><br>
'.$langs->trans("SupplierBill").'
</a>
</div>
';
}
if (! empty($conf->product->enabled) && $user->rights->produit->creer) {
$langs->load("products");
$dropDownQuickAddHtml.= '
<!-- Product link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=0" title="'.$langs->trans("NewProduct").'">
<i class="fal fa-cube fa-2x"></i><br>
'.$langs->trans("Product").'
</a>
</div>
';
}
if (! empty($conf->service->enabled) && $user->rights->service->creer) {
$langs->load("products");
$dropDownQuickAddHtml.= '
<!-- Service link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=1" title="'.$langs->trans("NewService").'">
<i class="fal fa-concierge-bell fa-2x"></i><br>
'.$langs->trans("Service").'
</a>
</div>
';
}
// Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>')
$parameters = array();
$result = $hookmanager->executeHooks('printQuickAddBlock', $parameters); // Note that $action and $object may have been modified by some hooks
if (is_numeric($result))
{
if ($result == 0)
$dropDownQuickAddHtml.= $hookmanager->resPrint; // add
else
$dropDownQuickAddHtml = $hookmanager->resPrint; // replace
}
else
{
$dropDownQuickAddHtml.= $result; // For backward compatibility
}
$dropDownQuickAddHtml.= '</div>';
$dropDownQuickAddHtml.= '</div>';
$html.= '<!-- div for quick add link -->
<div id="topmenu-quickadd-dropdown" class="atoplogin dropdown inline-block">
<a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans('QuickAdd').' ('.$langs->trans('QuickAddMenuShortCut').')">
<i class="fal fa-plus-circle" ></i>
</a>
<div class="dropdown-menu">
'.$dropDownQuickAddHtml.'
</div>
</div>';
$html .= '
<!-- Code to show/hide the user drop-down -->
<script>
$( document ).ready(function() {
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-quickadd-dropdown").length) {
// Hide the menus.
$("#topmenu-quickadd-dropdown").removeClass("open");
}
});
$("#topmenu-quickadd-dropdown .dropdown-toggle").on("click", function(event) {
openQuickAddDropDown();
});
// Key map shortcut
$(document).keydown(function(e){
if( e.which === 76 && e.ctrlKey && e.shiftKey ){
console.log(\'control + shift + l : trigger open quick add dropdown\');
openQuickAddDropDown();
}
});
var openQuickAddDropDown = function() {
event.preventDefault();
$("#topmenu-quickadd-dropdown").toggleClass("open");
//$("#top-quickadd-search-input").focus();
}
});
</script>
';
return $html;
}
/**
* Build the tooltip on top menu bookmark

View File

@ -122,7 +122,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject
{
global $db, $conf;
// D'abord on recupere la valeur max
// First we get the max value
$posindice = 9;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject";

View File

@ -745,7 +745,7 @@ class Entrepot extends CommonObject
$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 != 2) $result .= ($showfullpath ? $this->get_full_arbo() : (empty($this->label) ? $this->libelle : $this->label));
if ($withpicto != 2) $result .= (($showfullpath || !empty($conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO)) ? $this->get_full_arbo() : (empty($this->label)?$this->libelle:$this->label));
$result .= $linkend;
return $result;

View File

@ -4,6 +4,7 @@ html,body {
margin:0;
height:100%;
width:100%;
background-color: #FFF !important;
}
.container{
@ -17,14 +18,14 @@ html,body {
.phonerow1{
margin: 0 auto;
width: 100%;
height: 40%;
height: auto;
min-height: 40%;
}
.phonerow2{
margin: 0 auto;
width: 100%;
height: 40%;
height: auto;
}
.phonebuttonsrow{
@ -90,7 +91,71 @@ button.publicphonebutton {
text-align: center;
overflow: visible; /* removes extra width in IE */
width:33%;
height:90%;
height:50px;
font-weight: bold;
color: #fff;
}
.phoneblue{
color: #fff;
background-color: #428bca;
border-color: #357ebd;
}
.phonegreen{
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
font-size:20px;
text-align:center;
width:20px;
}
.phonetable{
width:130px;
}
.phoneqty{
font-size:24px;
font-weight: bold;
}
.phonered{
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
font-size:20px;
text-align:center;
width:20px;
}
.phoneorange{
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.total{
width:100% !important;
font-size:24px;
}
.width24{
font-size:24px;
}
.leftcat{
margin-top:15px;
float:left;
width: 50%;
text-align:center;
height:150px;;
overflow:hidden;
margin-bottom:5px;
font-size:18px;
color:#5B5858;
font-weight: bold;
}
@ -107,3 +172,28 @@ button.publicphonebutton2 {
font-weight: bold;
padding: 8px 16px;
}
.div-table-responsive-no-min{
margin-top:20px;
}
.comment {
float: left;
width: 100%;
height: auto;
}
.comment-text-area {
float: left;
width: 80%;
height: auto;
}
.textinput {
float: left;
width: 100%;
min-height: 75px;
outline: none;
resize: none;
border: 1px solid grey;
}

View File

@ -77,7 +77,10 @@ elseif ($query == "pro")
preg_match('@src="([^"]+)"@', $image, $match);
$file = array_pop($match);
if ($file == "") header('Location: ../../public/theme/common/nophoto.png');
else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
else{
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) header('Location: '.$file.'&cache=1');
else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
}
}
else
{

View File

@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array(
'/takepos/css/pos.css.php',
'/takepos/js/jquery.colorbox-min.js'
);
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="css/pos.css.php">
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>';
}
/**
@ -877,6 +879,7 @@ if ($_SESSION["basiclayout"] != 1)
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
}
else print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print "</tr>\n";
@ -889,12 +892,11 @@ if ($_SESSION["basiclayout"] == 1)
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines .= '<div class="leftcat';
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
$htmlforlines .= '<td class="left">';
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
$htmlforlines .= $row['label'];
$htmlforlines .= '</td>';
$htmlforlines .= '</tr>'."\n";
$htmlforlines .= '</div>'."\n";
}
$htmlforlines .= '</table>';
$htmlforlines .= '</table>';
@ -910,12 +912,11 @@ if ($_SESSION["basiclayout"] == 1)
$prods = $object->getObjectsInCateg("product");
$htmlforlines = '';
foreach ($prods as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines .= '<div class="leftcat';
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
$htmlforlines .= '<td class="left">';
$htmlforlines .= $row->label;
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
$htmlforlines .= '</tr>'."\n";
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
$htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
$htmlforlines .= '</div>'."\n";
}
$htmlforlines .= '</table>';
print $htmlforlines;
@ -991,7 +992,7 @@ if ($placeid > 0)
}
$htmlforlines .= '" id="'.$line->id.'">';
$htmlforlines .= '<td class="left">';
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x ";
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
//if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>';
if (isset($line->product_type))
{
@ -1026,7 +1027,8 @@ if ($placeid > 0)
}
}
if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")";
if ($_SESSION["basiclayout"] != 1)
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '</td><td class="right phonetable"><button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty-1).');" class="publicphonebutton2 phonered">-</button>&nbsp;&nbsp;<button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty+1).');" class="publicphonebutton2 phonegreen">+</button>';
if ($_SESSION["basiclayout"] != 1)
{
$moreinfo = '';
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);

View File

@ -62,26 +62,34 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
* View
*/
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/takepos/css/phone.css">';
if ($action == "productinfo") {
$prod = new Product($db);
$prod->fetch($idproduct);
print "<b>".$prod->label."</b><br>";
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
print "<br><b>".$prod->label."</b><br>";
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$idproduct.'">';
print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
}
elseif ($action == "publicpreorder") {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="TakeposPrintingOrder();">'.$langs->trans('Confirm').'</button>';
print "<br><br>";
print '<div class="comment">
<textarea class="textinput" placeholder="'.$langs->trans('Note').'"></textarea>
</div>';
print '<br>';
}
elseif ($action == "publicpayment") {
$langs->loadLangs(array("orders"));
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Payment').'</button>';
print '<br>';
}
elseif ($action == "checkplease") {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Cash').'</button>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('CreditCard').'</button>';
print '<br>';
}
elseif ($action == "editline") {
$placeid = GETPOST('placeid', 'int');
@ -99,13 +107,22 @@ elseif ($action == "editline") {
print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
print '<button type="button" class="publicphonebutton2 phonered width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
print '<button type="button" class="publicphonebutton2 phonegreen width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
print '<button type="button" class="publicphonebutton2 phoneblue width24" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
}
}
}
else {
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array('/takepos/css/phone.css');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
?>
<script language="javascript">
<?php
@ -194,6 +211,11 @@ function AddProduct(placeid, productid){
?>
}
function PublicPreOrder(){
$("#phonediv1").load("auto_order.php?action=publicpreorder&place="+place, function() {
});
}
function AddProductConfirm(placeid, productid){
place=placeid;
<?php
@ -221,7 +243,7 @@ function SetQty(place, selectedline, qty){
}
function SetNote(place, selectedline){
var note = prompt("<?php $langs->trans('Note'); ?>", "Harry Potter");
var note = prompt("<?php $langs->trans('Note'); ?>", "");
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
});
LoadCats();
@ -263,7 +285,9 @@ function TakeposPrintingOrder(){
console.log("TakeposPrintingOrder");
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?action=order&place="+place, function() {
echo '$("#phonediv2").load("auto_order.php?action=order&mobilepage=order&place="+place, function() {
});';
echo '$("#phonediv1").load("auto_order.php?action=publicpayment&place="+place, function() {
});';
}
else {
@ -278,6 +302,8 @@ function Exit(){
}
function CheckPlease(){
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
});
console.log("Request the check to the waiter");
$.ajax({
type: "GET",
@ -287,7 +313,7 @@ function CheckPlease(){
</script>
<body style="overflow: hidden; background-color:#D1D1D1;">
<body style="background-color:#D1D1D1;">
<?php
if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '<div class="dialog-info-takepos-terminal" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
?>
@ -301,18 +327,18 @@ function CheckPlease(){
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
}
else {
print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phoneblue" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phoneorange" onclick="PublicPreOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phonegreen" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
}
?>
</div>
<div class="row1">
<div id="phonediv1" class="phonediv1"></div>
</div>
<div class="row2">
<div class="phonerow2">
<div id="phonediv2" class="phonediv2"></div>
</div>
<div class="phonerow1">
<div id="phonediv1" class="phonediv1"></div>
</div>
</div>
</body>
<?php

View File

@ -9,7 +9,7 @@ button.dropdown-item.global-search-item {
outline: none;
}
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open {
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-quickadd, .open>.dropdown-menu, .dropdown dd ul.open {
display: block;
}
@ -59,6 +59,29 @@ button.dropdown-item.global-search-item {
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.dropdown-quickadd {
border-color: #eee;
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 240px;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.dropdown-menu {
border-color: #eee;
@ -163,7 +186,7 @@ button.dropdown-item.global-search-item {
max-width: 100%;
}
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown {
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-quickadd-dropdown {
<?php if (empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { ?>
line-height: 46px;
<?php } ?>
@ -383,6 +406,58 @@ a.top-menu-dropdown-link {
display: none !important;
}
/*
* QUICK ADD
*/
#topmenu-quickadd-dropdown .dropdown-menu {
width: 300px !important;
color: #444;
}
.quickadd-header {
color: #444 !important;
}
div.quickadd {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-content: center;
-ms-flex-line-pack: center;
align-content: center;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
}
div.quickadd a {
color: #444;
}
div.quickadd a:hover, div.quickadd a:active {
color: #000000;
}
div.quickaddblock {
width: 80px;
display: block ruby;
}
div.quickaddblock:hover,
div.quickaddblock:active,
div.quickaddblock:focus {
background: <?php print $colorbacklinepair1; ?>;
}
/* smartphone */
@media only screen and (max-width: 767px)
{

View File

@ -1339,7 +1339,7 @@ td.showDragHandle {
#id-left {
padding-top: 20px;
padding-bottom: 5px;
<?php if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { ?>
<?php if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN) && ! empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { ?>
padding-top: 8px;
<?php } ?>
}

View File

@ -203,7 +203,7 @@ $disableimages = 0;
$maxwidthloginblock = 180;
if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0; }
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
if (!empty($conf->bookmark->enabled)) { $maxwidthloginblock = $maxwidthloginblock + 55; }

View File

@ -204,7 +204,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase
$localobject->label='New label';
$result=$localobject->update($user);
print __METHOD__." id=".$id." result=".$result."\n";
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
return $localobject->id;

View File

@ -223,7 +223,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase
$result=$localobject->update($user);
$this->assertLessThan($result, 0);
print __METHOD__." id=".$id." result=".$result."\n";
print __METHOD__." id=".$localobject->id." result=".$result."\n";
return $localobject->id;
}

View File

@ -196,7 +196,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase
$result=$localobject->update($user);
$this->assertLessThan($result, 0);
print __METHOD__." id=".$id." result=".$result."\n";
print __METHOD__." id=".$localobject->id." result=".$result."\n";
return $localobject;
}