Suggest fix for #13824
This commit is contained in:
parent
6d17b678e4
commit
830a117aa7
@ -1004,6 +1004,7 @@ class BOM extends CommonObject
|
||||
|
||||
/**
|
||||
* BOM costs calculation based on cost_price or pmp of each BOM line
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function calculateCosts()
|
||||
@ -1022,7 +1023,9 @@ class BOM extends CommonObject
|
||||
}
|
||||
|
||||
$this->total_cost = price2num($this->total_cost, 'MT');
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
if ($this->qty) {
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER)
|
||||
print '<td>';
|
||||
print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
|
||||
print '<td>';
|
||||
print "<img src='".DOL_DOCUMENT_ROOT."/takepos/genimg/qr.php?id=".dol_encode($row['rowid'])."' height='42' width='42'>";
|
||||
print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?id=".dol_encode($row['rowid'])."' height='42' width='42'>";
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -274,7 +274,7 @@ if (!empty($conf->service->enabled))
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
||||
print '<td colspan="2">';
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
|
||||
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
|
||||
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php';
|
||||
|
||||
$key = GETPOST('key');
|
||||
|
||||
$module = new modtcpdfbarcode($db);
|
||||
$module = new modTcpdfbarcode($db);
|
||||
$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y');
|
||||
|
||||
@ -31,14 +31,14 @@ 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
|
||||
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
|
||||
if ($_SESSION["publicterminal"]){
|
||||
// Decode place if is a order from customer phone
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
// Decode place if it is an order from customer phone
|
||||
$key = GETPOST('key');
|
||||
$place=dol_decode($key);
|
||||
}
|
||||
@ -53,7 +53,7 @@ if ($setterminal > 0)
|
||||
|
||||
$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter"));
|
||||
|
||||
if ($_SESSION["publicterminal"]) {
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
$_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers
|
||||
}
|
||||
elseif (empty($user->rights->takepos->run)) {
|
||||
|
||||
@ -24,6 +24,10 @@
|
||||
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
||||
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
$_SESSION["basiclayout"] = 1;
|
||||
$_SESSION["publicterminal"] = true; // Is a public customer
|
||||
require '../phone.php';
|
||||
|
||||
define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
|
||||
include '../phone.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user