SQL modifications for multicompany compatibility
Thanks to hregis
This commit is contained in:
parent
833da30af1
commit
32303bbe48
@ -43,7 +43,10 @@ $langs->loadLangs(array("admin", "cashdesk"));
|
||||
|
||||
global $db;
|
||||
|
||||
$sql="SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement WHERE active=1 ORDER BY libelle";
|
||||
$sql = "SELECT code, libelle 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){
|
||||
|
||||
@ -40,10 +40,6 @@ $number = GETPOST('number');
|
||||
$idline = GETPOST('idline');
|
||||
$desc = GETPOST('desc', 'alpha');
|
||||
$pay = GETPOST('pay');
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS-".$place.")'";
|
||||
$resql = $db->query($sql);
|
||||
$row = $db->fetch_array($resql);
|
||||
$placeid = $row[0];
|
||||
|
||||
$placeid = 0; // $placeid is id of invoice
|
||||
|
||||
@ -53,7 +49,9 @@ if ($ret > 0) $placeid = $invoice->id;
|
||||
|
||||
|
||||
// Retrieve paiementid
|
||||
$sql="SELECT id FROM ".MAIN_DB_PREFIX."c_paiement WHERE code='$pay'";
|
||||
$sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
$sql.= " WHERE entity IN (".getEntity('c_paiement').")";
|
||||
$sql.= " AND code = '$pay'";
|
||||
$resql = $db->query($sql);
|
||||
$codes = $db->fetch_array($resql);
|
||||
$paiementid=$codes[0];
|
||||
|
||||
@ -51,7 +51,10 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
|
||||
$langs->loadLangs(array("main", "bills", "cashdesk"));
|
||||
|
||||
$sql="SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement WHERE active=1 ORDER BY libelle";
|
||||
$sql = "SELECT code, libelle 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){
|
||||
|
||||
@ -451,7 +451,10 @@ $( document ).ready(function() {
|
||||
<?php
|
||||
// TakePOS setup check
|
||||
// TODO
|
||||
$sql="SELECT code,libelle FROM ".MAIN_DB_PREFIX."c_paiement WHERE active=1 ORDER BY libelle";
|
||||
$sql = "SELECT code, libelle 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);
|
||||
$paiementsModes = array();
|
||||
if($resql){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user