Skip to content

Commit

Permalink
Qual: Removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 13, 2011
1 parent f671df6 commit 8ab4ec8
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 84 deletions.
11 changes: 8 additions & 3 deletions htdocs/cashdesk/affContenu.php
Expand Up @@ -44,7 +44,12 @@
}

print '<div class="liste_articles">';
include('liste_articles.php');

require ('tpl/liste_articles.tpl.php');

$obj_facturation->prix_total_ht($lst_total_ht);
$obj_facturation->prix_total_ttc($lst_total_ttc);

print '</div>';

print '<div class="principal">';
Expand All @@ -55,11 +60,11 @@
}
else
{
include ('facturation.php');
include('facturation.php');
}

print '</div>';

$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
$_SESSION['serObjFacturation'] = serialize($obj_facturation);

?>
2 changes: 1 addition & 1 deletion htdocs/cashdesk/affIndex.php
Expand Up @@ -29,7 +29,7 @@
// Test if already logged
if ( $_SESSION['uid'] <= 0 )
{
header ('Location: index.php');
header('Location: index.php');
exit;
}

Expand Down
22 changes: 9 additions & 13 deletions htdocs/cashdesk/class/Auth.class.php
Expand Up @@ -34,58 +34,54 @@ class Auth
/**
* Enter description here ...
*
* @param unknown_type $DB
* @param DoliDB $DB Database handler
* @return void
*/
function Auth($DB)
{

$this->db = $DB;
$this->reponse(null);

}

/**
* Enter description here ...
*
* @param unknown_type $aLogin
* @param string $aLogin Login
* @return void
*/
function login($aLogin)
{

$this->login = $aLogin;

}

/**
* Enter description here ...
*
* @param unknown_type $aPasswd
* @param string $aPasswd Password
* @return void
*/
function passwd($aPasswd)
{

$this->passwd = $aPasswd;


}

/**
* Enter description here ...
*
* @param unknown_type $aReponse
* @param string $aReponse Response
* @return void
*/
function reponse($aReponse)
{

$this->reponse = $aReponse;

}

/**
* Validate login/pass
*
* @param string $aLogin Login
* @param string $aPasswd Password
* @return int 0 or 1
*/
function verif($aLogin, $aPasswd)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/deconnexion.php
Expand Up @@ -26,7 +26,7 @@
// This destroy tag that say "Point of Sale session is on".
unset($_SESSION['uid']);

header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php');
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php');
exit;

?>
37 changes: 18 additions & 19 deletions htdocs/cashdesk/facturation.php
Expand Up @@ -93,28 +93,27 @@
$tab_designations=$ret;
}

$nbr_enreg = count ($tab_designations);

if ( $nbr_enreg > 1 ) {

if ( $nbr_enreg > $conf_taille_listes ) {
$nbr_enreg = count($tab_designations);

if ( $nbr_enreg > 1 )
{
if ( $nbr_enreg > $conf_taille_listes )
{
$top_liste_produits = '----- '.$conf_taille_listes.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';

} else {

}
else
{
$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';

}

} else if ( $nbr_enreg == 1 ) {

}
else if ( $nbr_enreg == 1 )
{
$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----';

} else {

}
else
{
$top_liste_produits = '----- '.$langs->transnoentitiesnoconv("NoProductFound"). ' -----';

}


Expand Down Expand Up @@ -152,10 +151,10 @@


// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation
$obj_facturation->mode_reglement ('RESET');
$obj_facturation->montant_encaisse ('RESET');
$obj_facturation->montant_rendu ('RESET');
$obj_facturation->paiement_le ('RESET');
$obj_facturation->mode_reglement('RESET');
$obj_facturation->montant_encaisse('RESET');
$obj_facturation->montant_rendu('RESET');
$obj_facturation->paiement_le('RESET');


// Affichage des templates
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/facturation_dhtml.php
Expand Up @@ -41,7 +41,7 @@
header("Content-type: text/html; charset=".$conf->file->character_set_client);

// Search from criteria
if ( dol_strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length at least
if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least
{
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
Expand Down
6 changes: 3 additions & 3 deletions htdocs/cashdesk/facturation_verif.php
Expand Up @@ -25,7 +25,7 @@
require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
/** end add Ditto */

$obj_facturation = unserialize ($_SESSION['serObjFacturation']);
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset ($_SESSION['serObjFacturation']);


Expand Down Expand Up @@ -156,9 +156,9 @@
}


$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
$_SESSION['serObjFacturation'] = serialize($obj_facturation);

header ('Location: '.$redirection);
header('Location: '.$redirection);
exit;

?>
4 changes: 2 additions & 2 deletions htdocs/cashdesk/index.php
Expand Up @@ -34,7 +34,7 @@
// Test if user logged
if ( $_SESSION['uid'] > 0 )
{
header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php');
header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php');
exit;
}

Expand Down Expand Up @@ -129,7 +129,7 @@
?></div>
</div>

<?php include ('affPied.php'); ?></div>
<?php include('affPied.php'); ?></div>
</div>
</div>
</body>
Expand Down
14 changes: 7 additions & 7 deletions htdocs/cashdesk/index_verif.php
Expand Up @@ -37,38 +37,38 @@
if (empty($username))
{
$retour=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login"));
header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}
// Check third party id
if (! ($thirdpartyid > 0))
{
$retour=$langs->trans("ErrorFieldRequired",$langs->transnoentities("CashDeskThirdPartyForSell"));
header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}

// If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished.
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
{
$retour=$langs->trans("CashDeskSetupStock");
header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}

if (! empty($_POST['txtUsername']) && $conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
{
$langs->load("errors");
$retour=$langs->trans("ErrorModuleSetupNotComplete");
header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}



// Check password
$auth = new Auth($db);
$retour = $auth->verif ($username, $password);
$retour = $auth->verif($username, $password);

if ( $retour >= 0 )
{
Expand Down Expand Up @@ -97,7 +97,7 @@
$_SESSION['CASHDESK_ID_WAREHOUSE'] = $warehouseid;
//var_dump($_SESSION);exit;

header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&id=NOUV');
header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&id=NOUV');
exit;
}
else
Expand All @@ -111,7 +111,7 @@
$langs->load("errors");
$langs->load("other");
$retour=$langs->trans("ErrorBadLoginPassword");
header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}

Expand Down
24 changes: 0 additions & 24 deletions htdocs/cashdesk/liste_articles.php

This file was deleted.

6 changes: 3 additions & 3 deletions htdocs/cashdesk/validation.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007-2008 J�r�mie Ollivier <jeremie.o@laposte.net>
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
*
* 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
Expand All @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Affichage des templates
require ('tpl/validation1.tpl.php');
// Affichage des templates
require ('tpl/validation1.tpl.php');

?>
6 changes: 3 additions & 3 deletions htdocs/cashdesk/validation_ticket.php
Expand Up @@ -19,14 +19,14 @@
require_once(DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php');
require_once(DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php');

$obj_facturation = unserialize ($_SESSION['serObjFacturation']);
unset ($_SESSION['serObjFacturation']);
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);


require ('tpl/ticket.tpl.php');


$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
$_SESSION['serObjFacturation'] = serialize($obj_facturation);

?>

Expand Down
8 changes: 4 additions & 4 deletions htdocs/cashdesk/validation_verif.php
Expand Up @@ -51,7 +51,7 @@

$obj_facturation->num_facture($num);

$obj_facturation->mode_reglement ($_POST['hdnChoix']);
$obj_facturation->mode_reglement($_POST['hdnChoix']);

// Si paiement autre qu'en especes, montant encaisse = prix total
$mode_reglement = $obj_facturation->mode_reglement();
Expand All @@ -65,7 +65,7 @@
$obj_facturation->montant_encaisse($montant);

//Determination de la somme rendue
$total = $obj_facturation->prix_total_ttc ();
$total = $obj_facturation->prix_total_ttc();
$encaisse = $obj_facturation->montant_encaisse();

$obj_facturation->montant_rendu($encaisse - $total);
Expand Down Expand Up @@ -283,7 +283,7 @@



$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
$_SESSION['serObjFacturation'] = serialize($obj_facturation);

header ('Location: '.$redirection);
header('Location: '.$redirection);
?>

0 comments on commit 8ab4ec8

Please sign in to comment.