From 19dae2da95687c8c5be0e1ec7a8eb1482cdc8aa2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2010 02:00:50 +0000 Subject: [PATCH] New: Can choose third party to use in point of sale module during logon. --- ChangeLog | 1 + htdocs/cashdesk/admin/cashdesk.php | 4 +-- htdocs/cashdesk/affIndex.php | 2 +- htdocs/cashdesk/facturation_dhtml.php | 2 +- htdocs/cashdesk/include/environnement.php | 18 +++------- htdocs/cashdesk/index.php | 40 +++++++++++++--------- htdocs/cashdesk/index_verif.php | 26 ++++++++++++-- htdocs/cashdesk/tpl/facturation1.tpl.php | 2 +- htdocs/cashdesk/tpl/liste_articles.tpl.php | 2 +- htdocs/cashdesk/tpl/menu.tpl.php | 6 ++-- htdocs/main.inc.php | 18 +++++----- htdocs/societe/ajaxcompanies.php | 8 +++-- 12 files changed, 75 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index bad1a44529d..1aab93c2726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.0 compared to 2.9 ***** For users: +- New: Can choose third party to use in point of sale module during logon. - New: A lot of enhancements into ECM module: Directories can contains special characters, Speed enhancements, diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 1da5730b016..6c3fc93ee61 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -40,7 +40,7 @@ if (!$user->admin) accessforbidden(); $langs->load("admin"); -$langs->load("@cashdesk"); +$langs->load("cashdesk"); /* @@ -91,7 +91,7 @@ print "\n"; $var=!$var; print ''.$langs->trans("CashDeskThirdPartyForSell").''; print ''; -print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','',1,1); +print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',1,1); print ''; if ($conf->banque->enabled) { diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index 0d9190aa5b2..576e85e631a 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008 Laurent Destailleur + * Copyright (C) 2008-2010 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 482299c4d93..ac519330746 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -98,7 +98,7 @@ if ( dol_strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length a } else { - $langs->load("cashdesk@cashdesk"); + $langs->load("cashdesk"); print '
    '; print '
  • '.$langs->trans("NoResults").'
  • '; diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php index f898cd54acd..b907e30eaba 100644 --- a/htdocs/cashdesk/include/environnement.php +++ b/htdocs/cashdesk/include/environnement.php @@ -29,29 +29,19 @@ $conf_db_pass = $dolibarr_main_db_pass; $conf_db_base = $dolibarr_main_db_name; // Identifiant unique correspondant au tiers generique pour la vente -$conf_fksoc = $conf->global->CASHDESK_ID_THIRDPARTY; +$conf_fksoc = (! empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))?$_SESSION["CASHDESK_ID_THIRDPARTY"]:($conf->global->CASHDESK_ID_THIRDPARTY>0?$conf->global->CASHDESK_ID_THIRDPARTY:0); +// Identifiant unique correspondant a l'entrepot a utiliser +$conf_fkentrepot = (! empty($_SESSION["CASHDESK_ID_WAREHOUSE"]))?$_SESSION["CASHDESK_ID_WAREHOUSE"]:($conf->global->CASHDESK_ID_WAREHOUSE>0?$conf->global->CASHDESK_ID_WAREHOUSE:0); + // Identifiant unique correspondant au compte caisse / liquide $conf_fkaccount_cash = (! empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))?$_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]:($conf->global->CASHDESK_ID_BANKACCOUNT_CASH>0?$conf->global->CASHDESK_ID_BANKACCOUNT_CASH:0); // Identifiant unique correspondant au compte cheque $conf_fkaccount_cheque = (! empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))?$_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]:($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE>0?$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE:0); // Identifiant unique correspondant au compte cb $conf_fkaccount_cb = (! empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))?$_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]:($conf->global->CASHDESK_ID_BANKACCOUNT_CB>0?$conf->global->CASHDESK_ID_BANKACCOUNT_CB:0); -// Identifiant unique correspondant a l'entrepot a utiliser -$conf_fkentrepot = (! empty($_SESSION["CASHDESK_ID_WAREHOUSE"]))?$_SESSION["CASHDESK_ID_WAREHOUSE"]:($conf->global->CASHDESK_ID_WAREHOUSE>0?$conf->global->CASHDESK_ID_WAREHOUSE:0); //var_dump($_SESSION); -// Check if setup ok -$error = ''; -if (empty($conf_fksoc)) -{ - $error.= '
    Setup of CashDesk module not complete. Third party not defined
    '; -} -if ($conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb))) -{ - $error.= '
    Setup of CashDesk module not complete. Bank account not defined
    '; -} - // Parametres d'affichage $conf_taille_listes = 200; // Nombre max de lignes a afficher dans les listes $conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index f191ba0ce98..059d7b74191 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -26,6 +26,10 @@ // Set and init common variables // This include will set: config file variable $dolibarr_xxx, $conf, $langs and $mysoc objects require_once("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); + +$langs->load("admin"); +$langs->load("cashdesk"); // Test if user logged if ( $_SESSION['uid'] > 0 ) @@ -35,24 +39,16 @@ if ( $_SESSION['uid'] > 0 ) } -require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); +/* + * View + */ +$form=new Form($db); $formproduct=new FormProduct($db); +$arrayofcss=array(DOL_URL_ROOT.'/cashdesk/css/style.css'); +top_htmlhead('','',0,0,'',$arrayofcss); ?> - - - - -Point of Sale login - - - - - - -
    @@ -68,7 +64,7 @@ $formproduct=new FormProduct($db);