';
print '
';
print '';
print '';
print '';
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
$sql = "SELECT floor, label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place);
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
if ($obj)
{
$label = $obj->label;
$floor = $obj->floor;
}
// In phone version only show when is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
print $langs->trans('Place')." ".$label." - ";
print $langs->trans('Floor')." ".$floor." - ";
}
}
// In phone version only show when is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
print $langs->trans('TotalTTC');
print ' : '.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'';
print ' '.$sectionwithinvoicelink;
print ' | ';
}
if ($_SESSION["basiclayout"] != 1)
{
print ''.$langs->trans('ReductionShort').' | ';
print ''.$langs->trans('Qty').' | ';
print ''.$langs->trans('TotalTTCShort').' | ';
}
print "
\n";
if ($_SESSION["basiclayout"] == 1)
{
if ($mobilepage == "cats")
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row) {
$htmlforlines .= '';
$htmlforlines .= '| ';
$htmlforlines .= $row['label'];
$htmlforlines .= ' | ';
$htmlforlines .= '
'."\n";
}
$htmlforlines .= '
';
$htmlforlines .= '';
print $htmlforlines;
}
if ($mobilepage == "products")
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$object = new Categorie($db);
$catid = GETPOST('catid', 'int');
$result = $object->fetch($catid);
$prods = $object->getObjectsInCateg("product");
$htmlforlines = '';
foreach ($prods as $row) {
$htmlforlines .= '
';
$htmlforlines .= '| ';
$htmlforlines .= $row->label;
$htmlforlines .= ' '.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).' ';
$htmlforlines .= ' |
'."\n";
}
$htmlforlines .= '';
print $htmlforlines;
}
if ($mobilepage == "places")
{
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
$resql = $db->query($sql);
$rows = array();
$htmlforlines = '';
while ($row = $db->fetch_array($resql)) {
$rows[] = $row;
$htmlforlines .= '
';
$htmlforlines .= '| ';
$htmlforlines .= $row['label'];
$htmlforlines .= ' | ';
$htmlforlines .= '
'."\n";
}
$htmlforlines .= '';
print $htmlforlines;
}
}
if ($placeid > 0)
{
//In Phone basic layout hide some content depends situation
if ($_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") return;
if (is_array($invoice->lines) && count($invoice->lines))
{
print ''."\n";
$tmplines = array_reverse($invoice->lines);
foreach ($tmplines as $line)
{
if ($line->fk_parent_line != false)
{
$htmlsupplements[$line->fk_parent_line] .= '
fk_parent_line] .= ' order';
$htmlsupplements[$line->fk_parent_line] .= '" id="'.$line->id.'">';
$htmlsupplements[$line->fk_parent_line] .= '';
$htmlsupplements[$line->fk_parent_line] .= img_picto('', 'rightarrow');
if ($line->product_label) $htmlsupplements[$line->fk_parent_line] .= $line->product_label;
if ($line->product_label && $line->desc) $htmlsupplements[$line->fk_parent_line] .= ' ';
if ($line->product_label != $line->desc)
{
$firstline = dolGetFirstLineOfText($line->desc);
if ($firstline != $line->desc)
{
$htmlsupplements[$line->fk_parent_line] .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc);
}
else
{
$htmlsupplements[$line->fk_parent_line] .= $line->desc;
}
}
$htmlsupplements[$line->fk_parent_line] .= ' | ';
if ($_SESSION["basiclayout"] != 1)
{
$htmlsupplements[$line->fk_parent_line] .= ''.vatrate($line->remise_percent, true).' | ';
$htmlsupplements[$line->fk_parent_line] .= ''.$line->qty.' | ';
$htmlsupplements[$line->fk_parent_line] .= ''.price($line->total_ttc).' | ';
}
$htmlsupplements[$line->fk_parent_line] .= '
'."\n";
continue;
}
$htmlforlines = '';
$htmlforlines .= '
id.'">';
$htmlforlines .= '';
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x ";
//if ($line->product_label) $htmlforlines.= ''.$line->product_label.'';
if (isset($line->product_type))
{
if (empty($line->product_type)) $htmlforlines .= img_object('', 'product').' ';
else $htmlforlines .= img_object('', 'service').' ';
}
if (empty($conf->global->TAKEPOS_SHOW_N_FIRST_LINES)) {
$tooltiptext = '';
if ($line->product_ref) {
$tooltiptext .= ''.$langs->trans("Ref").' : '.$line->product_ref.' ';
$tooltiptext .= ''.$langs->trans("Label").' : '.$line->product_label.' ';
if ($line->product_label != $line->desc) {
if ($line->desc) $tooltiptext .= ' ';
$tooltiptext .= $line->desc;
}
}
$htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext);
} else {
if ($line->product_label) $htmlforlines .= $line->product_label;
if ($line->product_label != $line->desc)
{
if ($line->product_label && $line->desc) $htmlforlines .= ' ';
$firstline = dolGetFirstLineOfText($line->desc, $conf->global->TAKEPOS_SHOW_N_FIRST_LINES);
if ($firstline != $line->desc)
{
$htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc);
}
else
{
$htmlforlines .= $line->desc;
}
}
}
if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= " (".$line->array_options['options_order_notes'].")";
if ($_SESSION["basiclayout"] != 1)
{
$moreinfo = '';
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);
if ($line->vat_src_code) $moreinfo .= ' '.$langs->trans("VATCode").': '.$line->vat_src_code;
$moreinfo .= ' '.$langs->transcountry("TotalVAT", $mysoc->country_code).': '.price($line->total_tva);
$moreinfo .= ' '.$langs->transcountry("TotalLT1", $mysoc->country_code).': '.price($line->total_localtax1);
$moreinfo .= ' '.$langs->transcountry("TotalLT2", $mysoc->country_code).': '.price($line->total_localtax2);
$moreinfo .= ' '.$langs->transcountry("TotalTTC", $mysoc->country_code).': '.price($line->total_ttc);
//$moreinfo .= $langs->trans("TotalHT").': '.$line->total_ht;
$htmlforlines .= ' | ';
$htmlforlines .= ''.vatrate($line->remise_percent, true).' | ';
$htmlforlines .= ''.$line->qty.' | ';
$htmlforlines .= ''.price($line->total_ttc).' | ';
}
$htmlforlines .= '
'."\n";
$htmlforlines .= $htmlsupplements[$line->id];
print $htmlforlines;
}
}
else
{
print '
| '.$langs->trans("Empty").' | | | |
';
}
}
else { // No invoice generated yet
print '
| '.$langs->trans("Empty").' | | | |
';
}
print '';
if ($action == "search")
{
print '
';
}
print ' ';