29 if (!defined(
'NOCSRFCHECK')) {
30 define(
'NOCSRFCHECK',
'1');
32 if (!defined(
'NOTOKENRENEWAL')) {
33 define(
'NOTOKENRENEWAL',
'1');
35 if (!defined(
'NOREQUIREMENU')) {
36 define(
'NOREQUIREMENU',
'1');
38 if (!defined(
'NOREQUIREHTML')) {
39 define(
'NOREQUIREHTML',
'1');
41 if (!defined(
'NOREQUIREAJAX')) {
42 define(
'NOREQUIREAJAX',
'1');
45 require
'../main.inc.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
47 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
48 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
52 $langs->loadLangs(array(
"bills",
"cashdesk"));
54 $place = (
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0');
56 $idline =
GETPOST(
'idline',
'int');
57 $action =
GETPOST(
'action',
'aZ09');
59 if (empty($user->rights->takepos->run)) {
66 $invoice->fetch($place);
68 $invoice->fetch(
'',
'(PROV-POS'.$_SESSION[
'takeposterminal'].
'-'.$place.
')');
72 $constforcompanyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
'takeposterminal'];
74 if ($invoice->socid > 0) {
75 $soc->fetch($invoice->socid);
77 $soc->fetch($conf->global->$constforcompanyid);
85 $arrayofcss = array(
'/takepos/css/pos.css.php');
91 var vatRate =
'<?php echo dol_escape_js($vatRateDefault); ?>';
99 function ApplyVATRate(
id, rate) {
100 console.log(
"Save selected VAT Rate into vatRate variable with value "+rate);
102 jQuery(
'button.vat_rate').removeClass(
'selected');
103 jQuery(
'#vat_rate_'+
id).addClass(
'selected');
110 console.log(
"We click so we call page invoice.php with place=<?php echo $place; ?> tva_tx="+vatRate);
111 parent.$(
"#poslines").load(
"invoice.php?action=freezone&place=<?php echo $place; ?>&number="+$(
'#number').val()+
"&tva_tx="+vatRate, {desc:$(
'#desc').val()});
112 parent.$.colorbox.close();
115 $( document ).ready(
function() {
123 <input
type=
"text" id=
"desc" name=
"desc" class=
"takepospay" style=
"width:40%;" placeholder=
"<?php echo $langs->trans('Description'); ?>">
125 if ($action ==
"freezone") {
126 echo
'<input type="text" id="number" name="number" class="takepospay" style="width:15%;" placeholder="'.$langs->trans(
'Price').
'">';
128 if ($action ==
"addnote") {
129 echo
'<input type="hidden" id="number" name="number" value="'.$idline.
'">';
132 <input type=
"hidden" name=
"place" class=
"takepospay" value=
"<?php echo $place; ?>">
133 <input type=
"button" class=
"button takepospay clearboth" value=
"OK" onclick=
"Save();">
135 if ($action ==
'freezone') {
136 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
139 $num =
$form->load_cache_vatrates(
"'".$mysoc->country_code.
"'");
142 print $langs->trans(
'VAT').
' : ';
143 foreach (
$form->cache_vatrates as $rate) {
144 print
'<button type="button" class="button item_value vat_rate'.($rate[
'txtva'] == $vatRateDefault ?
' selected' :
'').
'" id="vat_rate_'.$rate[
'rowid'].
'" onclick="ApplyVATRate(\''.$rate[
'rowid'].
'\', \
''.$rate[
'txtva'].
'\');
">'.$rate['txtva'].' %</button>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
$conf db name
Only used if Module[ID]Name translation string is not found.
Class to manage third parties objects (customers, suppliers, prospects...)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Function that return vat rate of a product line (according to seller, buyer and product vat rate) VAT...
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type