Fix css for takepos

This commit is contained in:
Laurent Destailleur 2021-12-20 13:39:34 +01:00
parent 19efa37e4b
commit 0465afbc34
4 changed files with 76 additions and 43 deletions

View File

@ -268,4 +268,6 @@ SaveQtyFirst=Save the real inventoried quantities first, before asking creation
InventoryStartedShort=Started InventoryStartedShort=Started
ErrorOnElementsInventory=Operation canceled for the following reason: ErrorOnElementsInventory=Operation canceled for the following reason:
ErrorCantFindCodeInInventory=Can't find the following code in inventory ErrorCantFindCodeInInventory=Can't find the following code in inventory
QtyWasAddedToTheScannedBarcode=Success !! The quantity was added to all the requested barcode. You can close the Scanner tool. QtyWasAddedToTheScannedBarcode=Success !! The quantity was added to all the requested barcode. You can close the Scanner tool.
StockChangeDisabled=Change on stock disabled
NoWarehouseDefinedForTerminal=No warehouse defined for terminal

View File

@ -668,7 +668,7 @@ div#moreinfo, div#infowarehouse {
} }
.row1withhead{ .row1withhead{
height: calc(45% - 100px); height: unset;
} }
div#moreinfo, div#infowarehouse { div#moreinfo, div#infowarehouse {

View File

@ -856,35 +856,43 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<div class="header"> <div class="header">
<div class="topnav"> <div class="topnav">
<div class="topnav-left"> <div class="topnav-left">
<div class="inline-block valignmiddle"> <div class="inline-block valignmiddle">
<a class="topnav-terminalhour" onclick="ModalBox('ModalTerminal');"> <a class="topnav-terminalhour" onclick="ModalBox('ModalTerminal');">
<span class="fa fa-cash-register"></span> <span class="fa fa-cash-register"></span>
<span class="hideonsmartphone"> <span class="hideonsmartphone">
<?php echo $langs->trans("Terminal"); ?> <?php echo $langs->trans("Terminal"); ?>
</span> </span>
<?php echo " "; <?php echo " ";
if ($_SESSION["takeposterminal"] == "") { if ($_SESSION["takeposterminal"] == "") {
echo "1"; echo "1";
} else { } else {
echo $_SESSION["takeposterminal"]; echo $_SESSION["takeposterminal"];
} }
echo '<span class="hideonsmartphone"> - '.dol_print_date(dol_now(), "day").'</span>'; echo '<span class="hideonsmartphone"> - '.dol_print_date(dol_now(), "day").'</span>';
?> ?>
</a> </a>
<?php <?php
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
print '<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>'; print '<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>';
print '<span class="hideonsmartphone">'.$langs->trans("Currency").'</span>'; print '<span class="hideonsmartphone">'.$langs->trans("Currency").'</span>';
print '</a>'; print '</a>';
} }
?> ?>
</div> </div>
<!-- section for customer and open sales --> <!-- section for customer -->
<div class="inline-block valignmiddle" id="customerandsales"> <div class="inline-block valignmiddle" id="customerandsales"></div>
</div> <!-- section for shopping carts -->
<!-- More info about customer --> <div class="inline-block valignmiddle" id="shoppingcart"></div>
<div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="moreinfo"></div> <!-- More info about customer -->
<div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="infowarehouse"></div> <div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="moreinfo"></div>
<?php
if (!empty($conf->stock->enabled)) {
?>
<!-- More info about warehouse -->
<div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="infowarehouse"></div>
<?php
}
?>
</div> </div>
<div class="topnav-right"> <div class="topnav-right">
<div class="login_block_other"> <div class="login_block_other">

View File

@ -1088,6 +1088,7 @@ $( document ).ready(function() {
?> ?>
$("#customerandsales").html(''); $("#customerandsales").html('');
$("#shoppingcart").html('');
$("#customerandsales").append('<a class="valignmiddle tdoverflowmax100 minwidth100" id="customer" onclick="Customer();" title="<?php print dol_escape_js($s); ?>"><span class="fas fa-building paddingrightonly"></span><?php print dol_escape_js($s); ?></a>'); $("#customerandsales").append('<a class="valignmiddle tdoverflowmax100 minwidth100" id="customer" onclick="Customer();" title="<?php print dol_escape_js($s); ?>"><span class="fas fa-building paddingrightonly"></span><?php print dol_escape_js($s); ?></a>');
@ -1108,7 +1109,7 @@ $( document ).ready(function() {
if ($resql) { if ($resql) {
$max_sale = 0; $max_sale = 0;
while ($obj = $db->fetch_object($resql)) { while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\''; echo '$("#shoppingcart").append(\'';
echo '<a class="valignmiddle" title="'.dol_escape_js($langs->trans("SaleStartedAt", dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser')).' - '.$obj->ref).'" onclick="place=\\\''; echo '<a class="valignmiddle" title="'.dol_escape_js($langs->trans("SaleStartedAt", dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser')).' - '.$obj->ref).'" onclick="place=\\\'';
$num_sale = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref)); $num_sale = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref));
echo $num_sale; echo $num_sale;
@ -1127,7 +1128,7 @@ $( document ).ready(function() {
} }
echo '</a>\');'; echo '</a>\');';
} }
echo '$("#customerandsales").append(\'<a onclick="place=\\\'0-'; echo '$("#shoppingcart").append(\'<a onclick="place=\\\'0-';
echo $max_sale + 1; echo $max_sale + 1;
echo '\\\'; invoiceid=0; Refresh();"><div><span class="fa fa-plus" title="'.dol_escape_htmltag($langs->trans("StartAParallelSale")).'"><span class="fa fa-shopping-cart"></span></div></a>\');'; echo '\\\'; invoiceid=0; Refresh();"><div><span class="fa fa-plus" title="'.dol_escape_htmltag($langs->trans("StartAParallelSale")).'"><span class="fa fa-shopping-cart"></span></div></a>\');';
} else { } else {
@ -1136,20 +1137,42 @@ $( document ).ready(function() {
$s = ''; $s = '';
$idwarehouse = 0;
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
if (!empty($conf->stock->enabled) && getDolGlobalString("$constantforkey") != "1") { if (!empty($conf->stock->enabled)) {
$s = '<span class="small">'; if (getDolGlobalString("$constantforkey") != "1") {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
$warehouse = new Entrepot($db); $idwarehouse = getDolGlobalString($constantforkey);
$warehouse->fetch(getDolGlobalString($constantforkey)); if ($idwarehouse > 0) {
$s .= $langs->trans("Warehouse").'<br>'.$warehouse->ref; $s = '<span class="small">';
$s .= '</span>'; $warehouse = new Entrepot($db);
$warehouse->fetch($idwarehouse);
$s .= '<span class="hideonsmartphone">'.$langs->trans("Warehouse").'<br></span>'.$warehouse->ref;
if ($warehouse->statut == Entrepot::STATUS_CLOSED) {
$s .= ' ('.$langs->trans("Closed").')';
}
$s .= '</span>';
print "$('#infowarehouse').html('".dol_escape_js($s)."');";
print '$("#infowarehouse").css("display", "inline-block");';
} else {
$s = '<span class="small hideonsmartphone">';
$s .= $langs->trans("StockChangeDisabled").'<br>'.$langs->trans("NoWarehouseDefinedForTerminal");
$s .= '</span>';
print "$('#infowarehouse').html('".dol_escape_js($s)."');";
if (!empty($conf->dol_optimize_smallscreen)) {
print '$("#infowarehouse").css("display", "none");';
}
}
} else {
$s = '<span class="small hideonsmartphone">'.$langs->trans("StockChangeDisabled").'</span>';
print "$('#infowarehouse').html('".dol_escape_js($s)."');";
if (!empty($conf->dol_optimize_smallscreen)) {
print '$("#infowarehouse").css("display", "none");';
}
}
} }
?>
$("#infowarehouse").html('<?php print dol_escape_js($s); ?>');
<?php
// Module Adherent // Module Adherent
$s = ''; $s = '';
if (!empty($conf->adherent->enabled) && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) { if (!empty($conf->adherent->enabled) && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) {