Library Update

This commit is contained in:
Michael RICOIS 2017-01-27 15:53:59 +01:00
parent 19e3e26644
commit 08742cddfb
5 changed files with 65 additions and 3704 deletions

View File

@ -207,13 +207,13 @@ class Metier_Partenaires_MFacto
public function getPaiements($siren, $echelle = 'mois')
{
if ($echelle == 'jour') {
$strGroupBy = "GROUP BY p.DATPIE ";
$strGroupBy = "GROUP BY p.DATPIE";
} elseif ($echelle == '' || $echelle == 'mois') {
$strGroupBy = "GROUP BY mois HAVING nbPieces>2 ";
$strGroupBy = "GROUP BY mois HAVING nbPieces>2";
} elseif ($echelle == 'trim') {
$strGroupBy = "GROUP BY trimestre HAVING nbPieces>2 ";
$strGroupBy = "GROUP BY trimestre HAVING nbPieces>2";
} else { // En mois par défaut
$strGroupBy = "GROUP BY mois HAVING nbPieces>2 ";
$strGroupBy = "GROUP BY mois HAVING nbPieces>2";
}
$sql = "SELECT p.NUMACH,
@ -226,7 +226,7 @@ class Metier_Partenaires_MFacto
IF(AVG(DATEDIFF(NOW(), p.DATECH) - DATEDIFF( p.DATPAI, p.DATECH ) ) <6, 0, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <36, 30, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <66, 60, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <96, 90, 120 ) ) ) ) AS nbJours,
SUM(p.MNTPIE) AS mtPieces, SUM(p.MNTFRF) AS mtPaiements, SUM(p.MNTLIT) AS mtLitiges,
p.CODDEV, a.SIRENE, a.RAISOC, a.CODPOS, a.VILLE
FROM dv1.ge_paiements p LEFT JOIN sdv1.ge_acheteurs a ON a.NUMACH=p.NUMACH
FROM sdv1.ge_paiements p LEFT JOIN sdv1.ge_acheteurs a ON a.NUMACH=p.NUMACH
WHERE a.SIRENE=:siren AND DATEDIFF(NOW(),p.DATECH)<736 AND p.DATECH<NOW() $strGroupBy ORDER BY p.DATPIE DESC";
$stmt = $this->conn->prepare($sql);
$stmt->bindValue('siren', $siren);

View File

@ -813,33 +813,28 @@ function clientSphinx(&$formR)
case 'ent':
$host = SPHINX_ENT_HOST;
$port = SPHINX_ENT_PORT;
$version = defined('SPHINX_ENT_VERSION') ? SPHINX_ENT_VERSION : 1;
$version = SPHINX_ENT_VERSION;
break;
case 'dir':
$version = defined('SPHINX_DIR_VERSION') ? SPHINX_DIR_VERSION : 1;
$version = SPHINX_DIR_VERSION;
$host = SPHINX_DIR_HOST;
$port = SPHINX_DIR_PORT;
break;
case 'histo':
$version = defined('SPHINX_HISTO_VERSION') ? SPHINX_HISTO_VERSION : 1;
$version = SPHINX_HISTO_VERSION;
$host = SPHINX_HISTO_HOST;
$port = SPHINX_HISTO_PORT;
break;
case 'act':
$version = defined('SPHINX_ACT_VERSION') ? SPHINX_ACT_VERSION : 1;
$version = SPHINX_ACT_VERSION;
$host = SPHINX_ACT_HOST;
$port = SPHINX_ACT_PORT;
break;
}
switch ($version) {
case 1:
require_once 'SphinxSearch/sphinxapi-0.9.9.php';
break;
case 2:
require_once 'SphinxSearch/sphinxapi-2.2.9.php';
break;
}
$sphinxapiPath = 'SphinxSearch';
$sphinxapiFile = 'sphinxapi-'.$version.'.php';
require_once $sphinxapiPath.'/'.$sphinxapiFile;
// Client Sphinx
$sphinx = new SphinxClient();

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,32 @@
<?php
//
// $Id: sphinxapi.php 4522 2014-01-30 11:00:18Z tomat $
// $Id$
//
//
// Copyright (c) 2001-2014, Andrew Aksyonoff
// Copyright (c) 2008-2014, Sphinx Technologies Inc
// Copyright (c) 2001-2016, Andrew Aksyonoff
// Copyright (c) 2008-2016, Sphinx Technologies Inc
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License. You should have
// received a copy of the GPL license along with this program; if you
// it under the terms of the GNU Library General Public License. You should
// have received a copy of the LGPL license along with this program; if you
// did not, you can find it at http://www.gnu.org/
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// WARNING
// We strongly recommend you to use SphinxQL instead of the API
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// WARNING!!!
//
// As of 2015, we strongly recommend to use either SphinxQL or REST APIs
// rather than the native SphinxAPI.
//
// While both the native SphinxAPI protocol and the existing APIs will
// continue to exist, and perhaps should not even break (too much), exposing
// all the new features via multiple different native API implementations
// is too much of a support complication for us.
//
// That said, you're welcome to overtake the maintenance of any given
// official API, and remove this warning ;)
//
/////////////////////////////////////////////////////////////////////////////
// PHP version of Sphinx searchd client (PHP API)
@ -760,7 +768,7 @@ class SphinxClient
/// set matching mode
function SetMatchMode ( $mode )
{
trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
//trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
assert ( $mode==SPH_MATCH_ALL
|| $mode==SPH_MATCH_ANY
|| $mode==SPH_MATCH_PHRASE
@ -1828,5 +1836,5 @@ class SphinxClient
}
//
// $Id: sphinxapi.php 4522 2014-01-30 11:00:18Z tomat $
// $Id$
//

File diff suppressed because it is too large Load Diff