';
- if ($line->fk_product) $order_receipt_printer1 .= $line->product_label;
- else $order_receipt_printer1 .= $line->description;
- $order_receipt_printer1 .= ' '.$line->qty;
+ $headerorder = ''.$langs->trans('Place').' '.$place.''.$langs->trans("Label").' '.$langs->trans("Qty").' ';
+ $footerorder = '
'.dol_print_date(dol_now(), 'dayhour').' ';
+ $order_receipt_printer1 = "";
+ $order_receipt_printer2 = "";
+ $catsprinter1 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_1);
+ $catsprinter2 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_2);
+ foreach ($invoice->lines as $line)
+ {
+ if ($line->special_code == "4") {
+ continue;
+ }
+ $c = new Categorie($db);
+ $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id');
+ $result = array_intersect($catsprinter1, $existing);
+ $count = count($result);
+ if ($count > 0) {
+ $linestoprint++;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='1' where rowid=".$line->id; //Set to print on printer 1
+ $db->query($sql);
+ $order_receipt_printer1 .= ''.$line->product_label.''.$line->qty;
if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1 .= " (".$line->array_options['options_order_notes'].")";
$order_receipt_printer1 .= ' ';
- }
- }
- if (($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $linestoprint > 0) {
+ }
+ }
+ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
$invoice->fetch($placeid); //Reload object before send to printer
$printer->orderprinter = 1;
- echo "";
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='1' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);
$invoice->fetch($placeid); //Reload object after set lines as printed
$linestoprint = 0;
- foreach ($invoice->lines as $line)
- {
- if ($line->special_code == "4") {
- continue;
- }
- $c = new Categorie($db);
- $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id');
- $result = array_intersect($catsprinter2, $existing);
- $count = count($result);
- if ($count > 0) {
- $linestoprint++;
- $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='2' where rowid=".$line->id; //Set to print on printer 2
- $db->query($sql);
- $order_receipt_printer2 .= ''.$line->product_label.''.$line->qty;
+ foreach ($invoice->lines as $line)
+ {
+ if ($line->special_code == "4") {
+ continue;
+ }
+ $c = new Categorie($db);
+ $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id');
+ $result = array_intersect($catsprinter2, $existing);
+ $count = count($result);
+ if ($count > 0) {
+ $linestoprint++;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='2' where rowid=".$line->id; //Set to print on printer 2
+ $db->query($sql);
+ $order_receipt_printer2 .= ' '.$line->product_label.''.$line->qty;
if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer2 .= " (".$line->array_options['options_order_notes'].")";
$order_receipt_printer2 .= ' ';
- }
- }
- if (($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $linestoprint > 0) {
+ }
+ }
+ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
$invoice->fetch($placeid); //Reload object before send to printer
$printer->orderprinter = 2;
- echo "";
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='2' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);
$invoice->fetch($placeid); //Reload object after set lines as printed
- $linestoprint = 0;
-
- foreach ($invoice->lines as $line)
- {
- if ($line->special_code == "4") {
- continue;
- }
- $c = new Categorie($db);
- $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id');
- $result = array_intersect($catsprinter3, $existing);
- $count = count($result);
- if ($count > 0) {
- $linestoprint++;
- $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='3' where rowid=".$line->id; //Set to print on printer 3
- $db->query($sql);
- $order_receipt_printer3 .= ''.$line->product_label.''.$line->qty;
- if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer3 .= " (".$line->array_options['options_order_notes'].")";
- $order_receipt_printer3 .= ' ';
- }
- }
- if (($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $linestoprint > 0) {
- $invoice->fetch($placeid); //Reload object before send to printer
- $printer->orderprinter = 3;
- echo "";
- }
- $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='3' and fk_facture=".$invoice->id; // Set as printed
- $db->query($sql);
- $invoice->fetch($placeid); //Reload object after set lines as printed
}
$sectionwithinvoicelink = '';
-if ($action == "valid" || $action == "history" || $action == 'creditnote')
-{
- $sectionwithinvoicelink .= ''."\n";
- $sectionwithinvoicelink .= '';
- $sectionwithinvoicelink .= $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, -1, '_backoffice')." - ";
- $remaintopay = $invoice->getRemainToPay();
- if ($remaintopay > 0)
- {
- $sectionwithinvoicelink .= $langs->trans('RemainToPay').': '.price($remaintopay, 1, $langs, 1, -1, -1, $conf->currency).' ';
- } else {
- if ($invoice->paye) $sectionwithinvoicelink .= ''.$langs->trans("Paid").' ';
- else $sectionwithinvoicelink .= $langs->trans('BillShortStatusValidated');
- }
- $sectionwithinvoicelink .= ' ';
- if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
+if ($action == "valid" || $action == "history")
+{
+ $sectionwithinvoicelink .= ''."\n";
+ $sectionwithinvoicelink .= '';
+ $sectionwithinvoicelink .= $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, -1, '_backoffice')." - ";
+ $remaintopay = $invoice->getRemainToPay();
+ if ($remaintopay > 0)
+ {
+ $sectionwithinvoicelink .= $langs->trans('RemainToPay').': '.price($remaintopay, 1, $langs, 1, -1, -1, $conf->currency).' ';
+ }
+ else
+ {
+ if ($invoice->paye) $sectionwithinvoicelink .= ''.$langs->trans("Paid").' ';
+ else $sectionwithinvoicelink .= $langs->trans('BillShortStatusValidated');
+ }
+ $sectionwithinvoicelink .= ' ';
+ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
else $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
- } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
- $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
- } else {
- $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
- if ($conf->global->TAKEPOS_GIFT_RECEIPT) {
- $sectionwithinvoicelink .= ' '.$langs->trans('GiftReceipt').' ';
- }
- }
- if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0)
- {
- $sectionwithinvoicelink .= ' '.$langs->trans('SendTicket').' ';
- }
-
- if ($remaintopay <= 0 && $conf->global->TAKEPOS_AUTO_PRINT_TICKETS) $sectionwithinvoicelink .= '';
+ } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
+ $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
+ } else {
+ $sectionwithinvoicelink .= ' '.$langs->trans('PrintTicket').' ';
+ }
+ if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0)
+ {
+ $sectionwithinvoicelink .= ' '.$langs->trans('SendTicket').' ';
+ }
+
+ if ($remaintopay <= 0 && $conf->global->TAKEPOS_AUTO_PRINT_TICKETS) $sectionwithinvoicelink .= '';
}
/*
@@ -852,7 +627,7 @@
else selectedline=this.id;
selectedtext=$('#'+selectedline).find("td:first").html();
global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
- ?>
- $.ajax({
- type: "POST",
- url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
- data: 'invoice='+orderprinter1esc
- });
-
- $.ajax({
- type: "POST",
- url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
- data: ''
- });
- global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
- ?>
- $.ajax({
- type: "POST",
- url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=2',
- data: 'invoice='+orderprinter2esc
- });
-
- $.ajax({
- type: "POST",
- url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print2',
- data: ''
- });
- global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
- ?>
- $.ajax({
- type: "POST",
- url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=3',
- data: 'invoice='+orderprinter3esc
- });
-
- parent.setFocusOnSearchField();
-
+ ?>
$.ajax({
type: "POST",
url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
data: ''
+ print $headerorder.$order_receipt_printer1.$footerorder; ?>'
});
+ $.ajax({
+ type: "POST",
+ url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print2',
+ data: ''
+ });
+
+ parent.setFocusOnSearchField();
+
+ $.ajax({
+ type: "POST",
+ url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
+ data: ''
+ });
+
+ ?>
$('#search').focus();
trans("SendTicket"); ?>"});
}
-function Print(id, gift){
- $.colorbox({href:"receipt.php?facid="+id+"&gift="+gift, width:"40%", height:"90%", transition:"none", iframe:"true", title:"trans("PrintTicket"); ?>"});
+function Print(id){
+ $.colorbox({href:"receipt.php?facid="+id, width:"40%", height:"90%", transition:"none", iframe:"true", title:"trans("PrintTicket"); ?>"});
}
function TakeposPrinting(id){
var receipt;
- console.log("TakeposPrinting" + id);
$.get("receipt.php?facid="+id, function(data, status){
receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '');
$.ajax({
@@ -977,92 +717,78 @@
}
function TakeposConnector(id){
- console.log("TakeposConnector" + id);
- $.get("ajax/ajax.php?action=printinvoiceticket&term=&id="+id, function(data, status){
- $.ajax({
- type: "POST",
- url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
- data: 'invoice='+data
- });
+ var invoice='';
+ $.ajax({
+ type: "POST",
+ url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print.php',
+ data: 'invoice='+invoice
});
}
function DolibarrTakeposPrinting(id) {
- console.log("DolibarrTakeposPrinting Printing invoice ticket " + id)
+ console.log('Printing invoice ticket ' + id)
$.ajax({
type: "GET",
url: "" + id,
});
}
-function CreditNote() {
- $("#poslines").load("invoice.php?action=creditnote&invoiceid="+placeid, function() {
- });
-}
-
$( document ).ready(function() {
- console.log("Set customer info and sales in header placeid= status=statut; ?>");
+ console.log("Set customer info and sales in header");
trans("Customer");
- if ($invoice->id > 0 && ($invoice->socid != $conf->global->$constforcompanyid)) {
- $s = $soc->name;
- }
- ?>
+ $s = $langs->trans("Customer");
+ if ($invoice->id > 0 && ($invoice->socid != $conf->global->$constforcompanyid)) {
+ $s = $soc->name;
+ }
+ ?>
$("#customerandsales").html('');
- $("#customerandsales").append(' ');
+ $("#customerandsales").append(' ');
global->TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED)) {
- // By default, only invoices with a ref not already defined can in list of open invoice we can edit.
- $sql .= " WHERE ref LIKE '(PROV-POS".$db->escape($_SESSION["takeposterminal"])."-0%' AND entity IN (".getEntity('invoice').")";
- } else {
- // If TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED set, we show also draft invoice that already has a reference defined
- $sql .= " WHERE pos_source = '".$db->escape($_SESSION["takeposterminal"])."'";
- $sql .= " AND module_source = 'takepos'";
- $sql .= " AND entity IN (".getEntity('invoice').")";
- }
-
+ $sql .= " WHERE ref LIKE '(PROV-POS".$_SESSION["takeposterminal"]."-0%'";
$sql .= $db->order('datec', 'ASC');
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
- echo 'jdate($obj->datec), '%H:%M', 'tzuser'))).'" onclick="place=\\\'';
+ echo ' ref));
echo $num_sale;
if (str_replace("-", "", $num_sale) > $max_sale) $max_sale = str_replace("-", "", $num_sale);
- echo '\\\'; invoiceid=\\\'';
- echo $obj->rowid;
- echo '\\\'; Refresh();">';
+ echo '\\\';Refresh();">';
if ($placeid == $obj->rowid) echo "";
- echo dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser');
+ echo date('H:i', strtotime($obj->datec));
if ($placeid == $obj->rowid) echo " ";
echo ' \');';
}
echo '$("#customerandsales").append(\' \');';
+ echo '\\\';Refresh();">\');';
} else {
dol_print_error($db);
}
$s = '';
- $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
- if (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1")
- {
- $s = '';
- $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
- $warehouse = new Entrepot($db);
- $warehouse->fetch($conf->global->$constantforkey);
- $s .= $langs->trans("Warehouse").' '.$warehouse->ref;
- $s .= ' ';
- }
+ $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
+ if (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1")
+ {
+ $s = '';
+ $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
+ $warehouse = new Entrepot($db);
+ $warehouse->fetch($conf->global->$constantforkey);
+ $s .= $langs->trans("Warehouse").' '.$warehouse->ref;
+ $s .= ' ';
+ }
?>
$("#infowarehouse").html('');
@@ -1081,7 +807,6 @@
if ($result > 0)
{
$adh->ref = $adh->getFullName($langs);
- if (empty($adh->statut)) { $s .= ""; }
$s .= $adh->getFullName($langs);
$s .= ' - '.$adh->type;
if ($adh->datefin)
@@ -1090,12 +815,15 @@
if ($adh->hasDelay()) {
$s .= " ".img_warning($langs->trans("Late"));
}
- } else {
+ }
+ else
+ {
$s .= ' '.$langs->trans("SubscriptionNotReceived");
if ($adh->statut > 0) $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
}
- if (empty($adh->statut)) { $s .= " "; }
- } else {
+ }
+ else
+ {
$s .= ' '.$langs->trans("ThirdpartyNotLinkedToMember");
}
$s .= ' ';
@@ -1112,63 +840,47 @@
// for tooltip and other js beautifiers must be reexecuted too.
if (!empty($conf->use_javascript_ajax))
{
- print "\n".''."\n";
- print ''."\n";
+ print "\n".''."\n";
+ print ''."\n";
}
print ''."\n";
print '';
print '
';
-if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) {
- print ''.$sectionwithinvoicelink.' ';
-}
print '';
print '';
-// In phone version only show when it is invoice page
-if ($mobilepage == "invoice" || $mobilepage == "") {
- 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;
- }
+ $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." ";
+ print $langs->trans('Place')." ".$label." - ";
+ print $langs->trans('Floor')." ".$floor." - ";
}
elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name;
elseif ($mobilepage == "cats") print $langs->trans('Category');
elseif ($mobilepage == "products") print $langs->trans('Label');
-} else {
- print $langs->trans("Products");
-}
-print ' ';
+}
+// 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 '';
- print ''.$langs->trans('TotalTTCShort').' ';
- // In phone version only show when it is invoice page
- if ($mobilepage == "invoice" || $mobilepage == "") {
- print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).' ';
- if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
- //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
- include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
- $multicurrency = new MultiCurrency($db);
- $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
- print '('.price($invoice->total_ttc * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].') ';
- }
- print ' ';
- }
- print '';
+ print ''.$langs->trans('TotalTTCShort').' ';
}
elseif ($mobilepage == "invoice") print ''.$langs->trans('Qty').' ';
print " \n";
@@ -1180,9 +892,9 @@
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorie = new Categorie($db);
- $categories = $categorie->get_full_arbo('product');
+ $categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
- foreach ($categories as $row) {
+ foreach ($categories as $row) {
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '';
@@ -1250,12 +962,12 @@
//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 (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] .= '
special_code == "4") {
- $htmlforlines .= ' order';
- }
- $htmlforlines .= '" id="'.$line->id.'">';
- $htmlforlines .= '';
+ $htmlforlines = '';
+
+ $htmlforlines .= ' id.'">';
+ $htmlforlines .= '';
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= ''.$line->qty." x ";
- 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) {
- $htmlforlines .= ' - + ';
- }
+ //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) $htmlforlines .= '- + ';
if ($_SESSION["basiclayout"] != 1)
{
$moreinfo = '';
@@ -1338,74 +1053,33 @@
$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;
- if ($line->date_start || $line->date_end) $htmlforlines .= ''.get_date_range($line->date_start, $line->date_end).'
';
+
$htmlforlines .= ' ';
$htmlforlines .= ''.vatrate($line->remise_percent, true).' ';
- $htmlforlines .= '';
- if (!empty($conf->stock->enabled) && !empty($user->rights->stock->mouvement->lire))
- {
- $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
- if (!empty($conf->global->$constantforkey) && $line->fk_product > 0) {
- $sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp";
- $sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
- $sql .= " ".MAIN_DB_PREFIX."product_stock as ps";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
- $sql .= " WHERE ps.reel != 0";
- $sql .= " AND ps.fk_entrepot = ".$conf->global->$constantforkey;
- $sql .= " AND e.entity IN (".getEntity('stock').")";
- $sql .= " AND ps.fk_product = ".$line->fk_product;
- $resql = $db->query($sql);
- if ($resql) {
- $obj = $db->fetch_object($resql);
- $stock_real = price2num($obj->reel, 'MS');
- $htmlforlines .= $line->qty;
- if ($line->qty && $line->qty > $stock_real) $htmlforlines .= '';
- $htmlforlines .= ' ('.$langs->trans("Stock").' '.$stock_real.') ';
- if ($line->qty && $line->qty > $stock_real) $htmlforlines .= " ";
- } else {
- dol_print_error($db);
- }
- } else {
- $htmlforlines .= $line->qty;
- }
- } else {
- $htmlforlines .= $line->qty;
- }
-
- $htmlforlines .= ' ';
- $htmlforlines .= '';
- $htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
- if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
- //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
- include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
- $multicurrency = new MultiCurrency($db);
- $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
- $htmlforlines .= '('.price($line->total_ttc * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].') ';
- }
- $htmlforlines .= ' ';
+ $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 $htmlforlines;
+ }
+ }
+ else
+ {
+ print '
'.$langs->trans("Empty").' ';
+ }
+}
+else { // No invoice generated yet
+ print '
'.$langs->trans("Empty").' ';
}
print '
';
-if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE) {
- print '
'.$langs->trans('CreateCreditNote').' ';
-}
-
if ($action == "search")
{
- print '
+ print '
';
}
--- /tmp/dsg/dolibarr/htdocs/takepos/github_pay.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_pay.php
@@ -34,8 +34,6 @@
require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
-$langs->loadLangs(array("main", "bills", "cashdesk", "banks"));
-
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place is id of table for Bar or Restaurant
$invoiceid = GETPOST('invoiceid', 'int');
@@ -52,55 +50,49 @@
$invoice = new Facture($db);
if ($invoiceid > 0)
{
- $invoice->fetch($invoiceid);
-} else {
- $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
- $resql = $db->query($sql);
- $obj = $db->fetch_object($resql);
- if ($obj)
- {
- $invoiceid = $obj->rowid;
- }
- if (!$invoiceid)
- {
- $invoiceid = 0; // Invoice does not exist yet
- } else {
- $invoice->fetch($invoiceid);
- }
+ $invoice->fetch($invoiceid);
+}
+else
+{
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
+ $resql = $db->query($sql);
+ $obj = $db->fetch_object($resql);
+ if ($obj)
+ {
+ $invoiceid = $obj->rowid;
+ }
+ if (!$invoiceid)
+ {
+ $invoiceid = 0; // Invoice does not exist yet
+ }
+ else
+ {
+ $invoice->fetch($invoiceid);
+ }
}
$arrayofcss = array('/takepos/css/pos.css.php');
$arrayofjs = array();
-$head = '';
-$title = '';
-$disablejs = 0;
-$disablehead = 0;
-
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
-// Define list of possible payments
-$arrayOfValidPaymentModes = array();
-$arrayOfValidBankAccount = array();
+$langs->loadLangs(array("main", "bills", "cashdesk"));
$sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
$sql .= " AND active = 1";
$sql .= " ORDER BY libelle";
$resql = $db->query($sql);
-
+$paiements = array();
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
- $paycode = $obj->code;
- if ($paycode == 'LIQ') $paycode = 'CASH';
- if ($paycode == 'CB') $paycode = 'CB';
- if ($paycode == 'CHQ') $paycode = 'CHEQUE';
-
- $accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
- if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) {
- $arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
- $arrayOfValidPaymentModes[] = $obj;
- }
+ $paycode = $obj->code;
+ if ($paycode == 'LIQ') $paycode = 'CASH';
+ if ($paycode == 'CB') $paycode = 'CB';
+ if ($paycode == 'CHQ') $paycode = 'CHEQUE';
+
+ $accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
+ if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiements, $obj);
}
}
?>
@@ -116,7 +108,7 @@
$remaintopay = 0;
if ($invoice->id > 0)
{
- $remaintopay = $invoice->getRemainToPay();
+ $remaintopay = $invoice->getRemainToPay();
}
$alreadypayed = (is_object($invoice) ? ($invoice->total_ttc - $remaintopay) : 0);
@@ -129,9 +121,9 @@
function addreceived(price)
{
global->TAKEPOS_NUMPAD)) print 'received+=String(price);'."\n";
- else print 'received+=parseFloat(price);'."\n";
- ?>
+ if (empty($conf->global->TAKEPOS_NUMPAD)) print 'received+=String(price);'."\n";
+ else print 'received+=parseFloat(price);'."\n";
+ ?>
$('.change1').html(pricejs(parseFloat(received), 'MT'));
$('.change1').val(parseFloat(received));
alreadypaydplusreceived=price2numjs(alreadypayed + parseFloat(received));
@@ -184,22 +176,14 @@
function Validate(payment)
{
var invoiceid = 0 ? $invoiceid : 0); ?>;
- var accountid = $("#selectaccountid").val();
var amountpayed = $("#change1").val();
- var excess = $("#change2").val();
if (amountpayed > total_ttc; ?>) {
amountpayed = total_ttc; ?>;
}
console.log("We click on the payment mode to pay amount = "+amountpayed);
- parent.$("#poslines").load("invoice.php?place=&action=valid&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() {
- if (amountpayed > || amountpayed == || amountpayed==0 ) {
- console.log("Close popup");
- parent.$.colorbox.close();
- }
- else {
- console.log("Amount is not comple, so we do NOT close popup and reload it.");
- location.reload();
- }
+ parent.$("#poslines").load("invoice.php?place=&action=valid&pay="+payment+"&amount="+amountpayed+"&invoiceid="+invoiceid, function() {
+ if (amountpayed > || amountpayed == || amountpayed==0 ) parent.$.colorbox.close();
+ else location.reload();
});
}
@@ -216,7 +200,7 @@
window.open('sumupmerchant://pay/1.0?affiliate-key=global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php');
var loop = window.setInterval(function () {
- $.ajax('/takepos/smpcb.php?status').done(function (data) {
+ $.ajax('/takepos/smpcb.php?status').done(function (data) {
console.log(data);
if (data === "SUCCESS") {
parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () {
@@ -234,53 +218,39 @@
}
-
-
+
+
-
trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
+trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1) ?>
total_ttc) { ?>
-
trans('RemainToPay'); ?>: multicurrency_code); ?>
+trans('RemainToPay'); ?>:
-
trans("Received"); ?>: multicurrency_code); ?>
+ trans("Received"); ?>:
-
trans("Change"); ?>: multicurrency_code); ?>
-
-global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
- print '
-
';
- $filter = '';
- $form = new Form($db);
- print ''.$langs->trans("BankAccount").': ';
- $form->select_comptes(0, 'accountid', 0, $filter, 1, '');
- print ajax_combobox('selectaccountid');
- print '
- ';
-}
-?>
-
-
-
-
-
+
trans("Change"); ?>:
+
+
+
+
+
"reset()",
"span" => "style='font-size: 150%;'",
"text" => "C",
- "class" => "poscolorblue"
+ "class" => "poscolorblue"
),
array(
"function" => "parent.$.colorbox.close();",
"span" => "id='printtext' style='font-weight: bold; font-size: 18pt;'",
"text" => "X",
- "class" => "poscolordelete"
+ "class" => "poscolordelete"
),
);
$numpad = $conf->global->TAKEPOS_NUMPAD;
@@ -289,21 +259,21 @@
print ''.($numpad == 0 ? '8' : '20').' ';
print ''.($numpad == 0 ? '9' : '50').' ';
?>
- 0) {
- $paycode = $arrayOfValidPaymentModes[0]->code;
+ 0) {
+ $paycode = $paiements[0]->code;
$payIcon = '';
if ($paycode == 'LIQ') {
$paycode = 'cash';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
} elseif ($paycode == 'CB') {
$paycode = 'card';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
} elseif ($paycode == 'CHQ') {
$paycode = 'cheque';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
- }
-
- print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
+ }
+
+ print ''.(!empty($payIcon) ? ' ' : $langs->trans("PaymentTypeShort".$paiements[0]->code)).' ';
} else {
print ''.$langs->trans("NoPaimementModesDefined").' ';
}
@@ -312,21 +282,21 @@
print ''.($numpad == 0 ? '5' : '2').' ';
print ''.($numpad == 0 ? '6' : '5').' ';
?>
- 1) {
- $paycode = $arrayOfValidPaymentModes[1]->code;
+ 1) {
+ $paycode = $paiements[1]->code;
$payIcon = '';
if ($paycode == 'LIQ') {
$paycode = 'cash';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
} elseif ($paycode == 'CB') {
$paycode = 'card';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
} elseif ($paycode == 'CHQ') {
$paycode = 'cheque';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
- }
-
- print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
+ }
+
+ print ''.(!empty($payIcon) ? ' ' : $langs->trans("PaymentTypeShort".$paiements[1]->code)).' ';
} else {
$button = array_pop($action_buttons);
print ''.$button["text"].' ';
@@ -336,23 +306,23 @@
print ''.($numpad == 0 ? '2' : '0.20').' ';
print ''.($numpad == 0 ? '3' : '0.50').' ';
?>
- 2) {
- $paycode = $arrayOfValidPaymentModes[2]->code;
+ 2) {
+ $paycode = $paiements[2]->code;
$payIcon = '';
if ($paycode == 'LIQ') {
$paycode = 'cash';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
} elseif ($paycode == 'CB') {
$paycode = 'card';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
} elseif ($paycode == 'CHQ') {
$paycode = 'cheque';
- if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
- }
-
- print ''.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
+ if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
+ }
+
+ print ''.(!empty($payIcon) ? ' ' : $langs->trans("PaymentTypeShort".$paiements[2]->code)).' ';
} else {
- $button = array_pop($action_buttons);
+ $button = array_pop($action_buttons);
print ''.$button["text"].' ';
}
@@ -361,8 +331,8 @@
print ''.($numpad == 0 ? '.' : '0.05').' ';
$i = 3;
-while ($i < count($arrayOfValidPaymentModes)) {
- print ''.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code).' ';
+while ($i < count($paiements)) {
+ print ''.$langs->trans("PaymentTypeShort".$paiements[$i]->code).' ';
$i = $i + 1;
}
@@ -371,19 +341,16 @@
if (!empty($conf->global->$keyforsumupbank)) {
print 'Sumup ';
} else {
- $langs->loadLangs(array("errors", "admin"));
+ $langs->load("errors");
+ $langs->load("admin");
print 'Sumup ';
}
}
$class = ($i == 3) ? "calcbutton3" : "calcbutton2";
foreach ($action_buttons as $button) {
- $newclass = $class.($button["class"] ? " ".$button["class"] : "");
+ $newclass = $class.($button["class"] ? " ".$button["class"] : "");
print ''.$button["text"].' ';
-}
-
-if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
- print ''.$langs->trans("Reported").' ';
}
?>
--- /tmp/dsg/dolibarr/htdocs/takepos/github_phone.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_phone.php
@@ -43,7 +43,7 @@
} else {
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
}
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$setterminal = GETPOST('setterminal', 'int');
$idproduct = GETPOST('idproduct', 'int');
@@ -64,7 +64,7 @@
if ($action == "productinfo") {
$prod = new Product($db);
- $prod->fetch($idproduct);
+ $prod->fetch($idproduct);
print ''.$langs->trans('Add').' ';
print "".$prod->label." ";
print ' ';
@@ -104,7 +104,7 @@
$printer->printer->feed();
$printer->printer->feed();
$printer->close();
- } else {
+ } else {
print ''.$langs->trans('Cash').' ';
print ''.$langs->trans('CreditCard').' ';
print ' ';
@@ -115,8 +115,8 @@
$invoice = new Facture($db);
$invoice->fetch($placeid);
foreach ($invoice->lines as $line)
- {
- if ($line->id == $selectedline)
+ {
+ if ($line->id == $selectedline)
{
$prod = new Product($db);
$prod->fetch($line->fk_product);
@@ -128,8 +128,8 @@
print '- ';
print '+ ';
print ''.$langs->trans('Note').' ';
- }
- }
+ }
+ }
} else {
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
@@ -151,14 +151,14 @@
$levelofrootcategory = 0;
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0)
{
- foreach ($categories as $key => $categorycursor)
- {
- if ($categorycursor['id'] == $conf->global->TAKEPOS_ROOT_CATEGORY_ID)
- {
- $levelofrootcategory = $categorycursor['level'];
- break;
- }
- }
+ foreach ($categories as $key => $categorycursor)
+ {
+ if ($categorycursor['id'] == $conf->global->TAKEPOS_ROOT_CATEGORY_ID)
+ {
+ $levelofrootcategory = $categorycursor['level'];
+ break;
+ }
+ }
}
$levelofmaincategories = $levelofrootcategory + 1;
@@ -166,12 +166,14 @@
$subcategories = array();
foreach ($categories as $key => $categorycursor)
{
- if ($categorycursor['level'] == $levelofmaincategories)
- {
- $maincategories[$key] = $categorycursor;
- } else {
- $subcategories[$key] = $categorycursor;
- }
+ if ($categorycursor['level'] == $levelofmaincategories)
+ {
+ $maincategories[$key] = $categorycursor;
+ }
+ else
+ {
+ $subcategories[$key] = $categorycursor;
+ }
}
sort($maincategories);
@@ -200,11 +202,11 @@
function LoadPlace(placeid){
place=placeid;
@@ -234,11 +236,11 @@
function AddProductConfirm(placeid, productid){
place=placeid;
if (qty==0){
- $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&token=&place="+place+"&idline="+selectedline, function() {
+ $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
});
}
else{
@@ -262,7 +264,7 @@
else {
?>
if (qty==0){
- $("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&token=&place="+place+"&idline="+selectedline, function() {
+ $("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
});
}
else{
@@ -271,7 +273,7 @@
}
+ ?>
LoadCats();
}
@@ -284,11 +286,11 @@
function LoadCats(){
&payment="+payment, function() {
+ $("#phonediv1").load("auto_order.php?action=checkplease&place=&payment="+payment, function() {
});
}
}
@@ -355,7 +357,7 @@
'.strtoupper(substr($langs->trans('Floors'), 0, 3)).'';
print '
'.strtoupper(substr($langs->trans('Categories'), 0, 3)).' ';
print '
'.strtoupper(substr($langs->trans('Order'), 0, 3)).' ';
--- /tmp/dsg/dolibarr/htdocs/takepos/github_receipt.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_receipt.php
@@ -20,23 +20,12 @@
*/
/**
- * \file htdocs/takepos/receipt.php
+ * \file htdocs/takepos/floors.php
* \ingroup takepos
* \brief Page to show a receipt.
*/
-if (!isset($action)) {
- //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
- //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
- //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
- //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
- if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
- if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
- if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
- if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
-
- require '../main.inc.php'; // If this file is called from send.php avoid load again
-}
+if (!isset($action)) require '../main.inc.php'; // If this file is called from send.php avoid load again
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->loadLangs(array("main", "cashdesk", "companies"));
@@ -44,8 +33,6 @@
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
$facid = GETPOST('facid', 'int');
-
-$gift = GETPOST('gift', 'int');
if (empty($user->rights->takepos->run)) {
accessforbidden();
@@ -60,13 +47,13 @@
if ($place > 0)
{
- $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
- $resql = $db->query($sql);
- $obj = $db->fetch_object($resql);
- if ($obj)
- {
- $facid = $obj->rowid;
- }
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
+ $resql = $db->query($sql);
+ $obj = $db->fetch_object($resql);
+ if ($obj)
+ {
+ $facid = $obj->rowid;
+ }
}
$object = new Facture($db);
$object->fetch($facid);
@@ -75,7 +62,7 @@
$hookmanager->initHooks(array('takeposfrontend'), $facid);
$reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
if (!empty($hookmanager->resPrint)) {
- print $hookmanager->resPrint;
+ print $hookmanager->resPrint;
exit;
}
@@ -102,14 +89,12 @@
global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeText}))
+if (!empty($conf->global->TAKEPOS_HEADER))
{
- $newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
- if (!empty($conf->global->TAKEPOS_HEADER)) $newfreetext .= make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
- if (!empty($conf->global->{$constFreeText})) $newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray);
- print $newfreetext;
+ if (!empty($conf->global->TAKEPOS_HEADER))
+ $newfreetext = make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
+ echo $newfreetext;
}
?>
@@ -138,34 +123,34 @@
trans("Label"); ?>
trans("Qty"); ?>
- trans("Price"); ?>
- trans("TotalTTC"); ?>
+ trans("Price"); ?>
+ trans("TotalTTC"); ?>
lines as $line)
- {
- ?>
+ foreach ($object->lines as $line)
+ {
+ ?>
product_label)) echo $line->product_label;
- else echo $line->description; ?>
+ else echo $line->description; ?>
qty; ?>
- total_ttc / $line->qty, 'MT'), 1); ?>
- total_ttc, 1); ?>
+ total_ttc / $line->qty, 'MT'), 1); ?>
+ total_ttc, 1); ?>
+ }
+ ?>
- trans("TotalHT"); ?>
- total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
+ trans("TotalHT"); ?>
+ total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
global->TAKEPOS_TICKET_VAT_GROUPPED) {
$vat_groups = array();
@@ -177,86 +162,32 @@
$vat_groups[$line->tva_tx] += $line->total_tva;
}
foreach ($vat_groups as $key => $val) {
- ?>
+ ?>
- trans("VAT").' '.vatrate($key, 1); ?>
- currency)."\n"; ?>
+ trans("VAT").' '.vatrate($key, 1); ?>
+ currency)."\n"; ?>
- trans("TotalVAT").' '.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
+ trans("TotalVAT").' '.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
- trans("TotalTTC").' '.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
+ trans("TotalTTC").' '.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?>
-multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
- //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
- include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
- $multicurrency = new MultiCurrency($db);
- $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
- echo '';
- if ($gift != 1) echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].' '.price($object->total_ttc * $multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
- echo ' ';
-}
-
-if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) {
- $sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
- $sql .= " cp.code";
- $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
- $sql .= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$facid;
- $sql .= " ORDER BY p.datep";
- $resql = $db->query($sql);
- if ($resql)
- {
- $num = $db->num_rows($resql);
- $i = 0;
- while ($i < $num) {
- $row = $db->fetch_object($resql);
- echo '';
- echo '';
- echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
- echo ' ';
- echo '';
- $amount_payment = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
- if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
- echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
- echo ' ';
- echo ' ';
- if ($row->code == "LIQ" && $row->pos_change > 0) // Print change only in cash payments
- {
- echo '';
- echo '';
- echo $langs->trans("Change");
- echo ' ';
- echo '';
- echo price($row->pos_change, 1, '', 1, - 1, - 1, $conf->currency);
- echo ' ';
- echo ' ';
- }
- $i++;
- }
- }
-}
-?>
global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeText}))
+if (!empty($conf->global->TAKEPOS_FOOTER))
{
- $newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
- if (!empty($conf->global->{$constFreeText})) $newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray);
- if (!empty($conf->global->TAKEPOS_FOOTER)) $newfreetext .= make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
- print $newfreetext;
+ $newfreetext = make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
+ echo $newfreetext;
}
?>
--- /tmp/dsg/dolibarr/htdocs/takepos/github_reduction.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_reduction.php
@@ -50,21 +50,25 @@
$invoice = new Facture($db);
if ($invoiceid > 0)
{
- $invoice->fetch($invoiceid);
-} else {
- $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
- $resql = $db->query($sql);
- $obj = $db->fetch_object($resql);
- if ($obj)
- {
- $invoiceid = $obj->rowid;
- }
- if (!$invoiceid)
- {
- $invoiceid = 0; // Invoice does not exist yet
- } else {
- $invoice->fetch($invoiceid);
- }
+ $invoice->fetch($invoiceid);
+}
+else
+{
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
+ $resql = $db->query($sql);
+ $obj = $db->fetch_object($resql);
+ if ($obj)
+ {
+ $invoiceid = $obj->rowid;
+ }
+ if (!$invoiceid)
+ {
+ $invoiceid = 0; // Invoice does not exist yet
+ }
+ else
+ {
+ $invoice->fetch($invoiceid);
+ }
}
$arrayofcss = array('/takepos/css/pos.css.php');
@@ -74,9 +78,9 @@
$langs->loadLangs(array('main', 'bills', 'cashdesk'));
-if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
+if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
$htmlReductionPercent = '
';
- $htmlReductionAmount = '
'.$langs->trans('Amount');
+ $htmlReductionAmount = '
';
} else {
$htmlReductionPercent = $langs->trans('ReductionShort').'
%';
$htmlReductionAmount = $langs->trans('ReductionShort').'
'.$langs->trans('Amount');
@@ -198,7 +202,7 @@
trans('Reduction').'">';
+ print ' ';
?>
--- /tmp/dsg/dolibarr/htdocs/takepos/github_send.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_send.php
@@ -24,20 +24,20 @@
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
-if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
+//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
+//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
+if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
-if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
-if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
-if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
+if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
+if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
+if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facid = GETPOST('facid', 'int');
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$email = GETPOST('email', 'alpha');
if (empty($user->rights->takepos->run)) {
@@ -51,31 +51,29 @@
$customer = new Societe($db);
$customer->fetch($invoice->socid);
-if ($action == "send")
+if ($action=="send")
{
- include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail = new FormMail($db);
- $outputlangs = new Translate('', $conf);
- $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE;
- $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id);
- $subject = $arraydefaultmessage->topic;
-
- ob_start(); // turn on output receipt
- include 'receipt.php';
- $receipt = ob_get_contents(); // get the contents of the output buffer
- ob_end_clean();
-
- $msg = "".$arraydefaultmessage->content."
".$receipt."";
- $sendto = $email;
- $from = $mysoc->email;
- $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1);
- if ($mail->error || $mail->errors) {
- setEventMessages($mail->error, $mail->errors, 'errors');
- } else {
- $result = $mail->sendfile();
- }
- exit;
+ include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
+ $formmail = new FormMail($db);
+ $outputlangs = new Translate('', $conf);
+ $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE;
+ $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id);
+ $subject = $arraydefaultmessage->topic;
+ ob_start(); // turn on output receipt
+ include 'receipt.php';
+ $receipt = ob_get_contents(); // get the contents of the output buffer
+ ob_end_clean();
+ $msg="".$arraydefaultmessage->content."
".$receipt."";
+ $sendto=$email;
+ $from=$mysoc->email;
+ $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1);
+ if ($mail->error || $mail->errors) {
+ setEventMessages($mail->error, $mail->errors, 'errors');
+ } else {
+ $result = $mail->sendfile();
+ }
+ exit;
}
$arrayofcss = array('/takepos/css/pos.css.php');
$arrayofjs = array();
--- /tmp/dsg/dolibarr/htdocs/takepos/github_smpcb.php
+++ /tmp/dsg/dolibarr/htdocs/takepos/client_smpcb.php
@@ -1,26 +1,4 @@
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see
.
- */
-
-/**
- * \file htdocs/takepos/smpcb.php
- * \ingroup takepos
- * \brief Page with the content for smpcb payment
- */
-
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
@@ -33,25 +11,25 @@
accessforbidden();
}
-if (GETPOSTISSET('status')) {
+if (isset($_GET['status'])) {
die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
}
-if (GETPOST('smp-status')) {
- print '';
- print '';
- print '
+if ($_GET['smp-status']) {
+ print '
+
+
The HTML5 Herald
-
';
+
- print '';
+
- print '';
- $_SESSION['SMP_CURRENT_PAYMENT'] = GETPOST('smp-status');
+';
+ $_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status'];
print '