This commit is contained in:
Michael RICOIS 2014-05-23 07:41:51 +00:00
parent 7111104200
commit f3ba67be30
5 changed files with 50 additions and 39 deletions

View File

@ -23,10 +23,10 @@ class DeliveryController extends Zend_Controller_Action
if ( $row !== null ) {
$c = Zend_Registry::get('config');
$html = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html';
$html = $c->profil->path->pages . '/' . $row->cmdId . '.html';
//Save the HTML file
copy($html, $c->profil->path->data . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $id.'.html');
copy($html, $c->profil->path->data . '/' . $row->cmdId . '.html');
//Generate the PDF
$pdf = new Scores_Wkhtml_Pdf();
@ -79,8 +79,8 @@ class DeliveryController extends Zend_Controller_Action
//Regen command
if ($regen !== null) {
$source = $c->profil->path->data . DIRECTORY_SEPARATOR . $cmdId . '.html';
$dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $cmdId . '.html';
$source = $c->profil->path->data . '/' . $cmdId . '.html';
$dest = $c->profil->path->pages . '/' . $cmdId . '.html';
copy($source, $dest);
//Generate the PDF
@ -124,19 +124,25 @@ class DeliveryController extends Zend_Controller_Action
$sql = $commandM->select()->where('cmdId = ?',$cmdId);
$row = $commandM->fetchRow($sql);
//Selection de la facture
$billM = new Application_Model_ReportBill();
$sql = $billM->select()->where('cmdId = ?',$cmdId);
$bill = $billM->fetchRow($sql);
//Verif
if ( $row !== null) {
$c = Zend_Registry::get('config');
$path = $c->profil->path->data.'/bill/';
//Selection de la facture
$billM = new Application_Model_ReportBill();
$sql = $billM->select()->where('cmdId = ?', $cmdId);
$bill = $billM->fetchRow($sql);
if ( $bill === null ) {
$regen = true;
} elseif ( empty($bill->file) ) {
$regen = true;
}
//Générer la facture
if ($bill === null || $bill->file == '' || $regen!==null) {
if ( $regen !== null ) {
//Prepare information in database
if ( $bill === null ) {
@ -144,9 +150,9 @@ class DeliveryController extends Zend_Controller_Action
$mois = substr($row->dateInsert, 5,2);
$lastItemSql = $billM->select()
->where('annee=?', $annee)
->where('mois=?', $mois)
->order('num DESC')->limit(1);
->where('annee=?', $annee)
->where('mois=?', $mois)
->order('num DESC')->limit(1);
$lastItem = $billM->fetchRow($lastItemSql);
$NumCmd = $lastItem->num + 1;
$billM->insert(array(
@ -155,7 +161,7 @@ class DeliveryController extends Zend_Controller_Action
'mois' => $mois,
'num' => $NumCmd,
));
} elseif ( $bill !== null && $regen !== null ) {
} else {
$NumCmd = $bill->num;
}
@ -233,7 +239,7 @@ class DeliveryController extends Zend_Controller_Action
$pdf->save($path.$file);
$billM->update(array('file' => $file), 'id='.$NumCmd);
$billM->update(array('file' => $file), 'cmdId="'.$cmdId.'"');
}
//Distribuer la facture
else {

View File

@ -24,10 +24,11 @@ class ReportController extends Zend_Controller_Action
$prestation = null;
$session = new Zend_Session_Namespace('Cmd');
$session->unlock();
// Get partner parameters
if ( Zend_Session::isReadable() && Zend_Session::namespaceIsset('Cmd') ) {
$session = new Zend_Session_Namespace('Cmd');
$session->unlock();
if ( isset($session->p) ) {
$prestation = $session->p;
} else {
$p = $request->getParam('p');
@ -222,9 +223,7 @@ class ReportController extends Zend_Controller_Action
if ( !isset($session->CmdID) || empty($session->CmdID) ) {
//Get the report
if (intval($siren)>100) {
$login = $c->profil->report->username;
$password = $c->profil->report->password;
$report = new Scores_Partner_Report('indiscore3', $siren, $login, $password);
$report = new Scores_Partner_Report('indiscore3', $siren, $this->pLogin, $this->pPassword);
$html = $report->getContent();
if ( $html !== false ) {
@ -582,10 +581,10 @@ class ReportController extends Zend_Controller_Action
if ( $row !== null ) {
$c = Zend_Registry::get('config');
$html = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html';
$html = $c->profil->path->pages . '/' . $row->cmdId . '.html';
//Save the HTML file
copy($html, $c->profil->path->data . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $id.'.html');
copy($html, $c->profil->path->data . '/' . $id . '.html');
//Generate the PDF
$pdf = new Scores_Wkhtml_Pdf();
@ -638,8 +637,8 @@ class ReportController extends Zend_Controller_Action
//Regen command
if ($regen !== null) {
$source = $c->profil->path->data . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . $cmdId . 'html';
$dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $cmdId . '.html';
$source = $c->profil->path->data . '/' . $cmdId . 'html';
$dest = $c->profil->path->pages . '/' . $cmdId . '.html';
copy($source, $dest);
//Generate the PDF
@ -649,7 +648,7 @@ class ReportController extends Zend_Controller_Action
//Serve the file
$path = $c->profil->path->pages;
$file = $path . DIRECTORY_SEPARATOR . $cmdId . '.pdf';
$file = $path . '/' . $cmdId . '.pdf';
if( file_exists($file) && filesize($file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: application/pdf');

View File

@ -31,4 +31,9 @@ class Scores_Partner_Report_Html extends Scores_Partner_Report_Helpers
{
$this->{$name} = $value;
}
public function translate($txt)
{
return $txt;
}
}

View File

@ -2674,6 +2674,7 @@ class WsScores
}
return $reponse->getIdentiteLightResult;
} catch (SoapFault $fault) {
print_r($fault);
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
@ -3037,7 +3038,7 @@ class WsScores
}
}
}
/**
* getScoreHistorique pour les derniers 5 ans
* @param string $siret

View File

@ -1,29 +1,29 @@
[local]
webservices.interne.wsdl = "http://webservice-2.6.sd.dev/interne/v0.6?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.7.sd.dev/interne/v0.6?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.6.sd.dev/entreprise/v0.8?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.7.sd.dev/entreprise/v0.8?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.6.sd.dev/gestion/v0.3?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.7.sd.dev/gestion/v0.3?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.6.sd.dev/saisie/v0.2?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.7.sd.dev/saisie/v0.2?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.6.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.7.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
webservices.catalog.wsdl = "http://webservice-2.6.sd.dev/catalog/v0.1?wsdl-auto"
webservices.catalog.wsdl = "http://webservice-2.7.sd.dev/catalog/v0.1?wsdl-auto"
webservices.catalog.options.soap_version = SOAP_1_2
[sdsrvdev01]
webservices.interne.wsdl = "http://webservice-2.6.sd.lan/interne/v0.6?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.7.sd.lan/interne/v0.6?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.6.sd.lan/entreprise/v0.8?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.7.sd.lan/entreprise/v0.8?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.6.sd.lan/gestion/v0.3?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.7.sd.lan/gestion/v0.3?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.6.sd.lan/saisie/v0.2?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.7.sd.lan/saisie/v0.2?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.6.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.7.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
webservices.catalog.wsdl = "http://webservice-2.6.sd.lan/catalog/v0.1?wsdl-auto"
webservices.catalog.wsdl = "http://webservice-2.7.sd.lan/catalog/v0.1?wsdl-auto"
webservices.catalog.options.soap_version = SOAP_1_2
[sd-25137]