From 22e92d676ae03707f136e4ae4feec9f0dcb8ef59 Mon Sep 17 00:00:00 2001 From: Claire DELBOS Date: Thu, 6 Apr 2017 16:18:44 +0200 Subject: [PATCH] SD-13 Stable before --- .../controllers/IndexController.php | 19 ++++++++++++++++++- .../controllers/InextensoController.php | 1 + .../controllers/PbanswerController.php | 15 +++++++++++++++ .../default/scripts/index/paiement.phtml | 12 ++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/application/modules/achatclient/controllers/IndexController.php b/application/modules/achatclient/controllers/IndexController.php index 866229bd2..91fc736d8 100644 --- a/application/modules/achatclient/controllers/IndexController.php +++ b/application/modules/achatclient/controllers/IndexController.php @@ -154,9 +154,25 @@ class Achatclient_IndexController extends Zend_Controller_Action $this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript'); $this->view->infosfact=$infos['commande']; $this->view->pbparams=null; + $this->view->info='siret'; return; } //Calcul de la TVA + // N° de TVA obligatoire pour la France sauf les dom + if(strtoupper($infos['entrep']['Pays'])=="FRANCE" && empty($infos['entrep']['TvaNumero'])){ + if(substr($infos['entrep']['CP'],0,3)=='971' || substr($infos['entrep']['CP'],0,3)=='972' ||substr($infos['entrep']['CP'],0,3)=='974'){ + $tva=0.085; + }else{ + $infos['commande']['nb_credit']=$nb_credit; + $this->view->message='Merci d\'entrer votre numéro de TVA intracommunautaire'; + $this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript'); + $this->view->infosfact=$infos['commande']; + $this->view->pbparams=null; + $this->view->info='tva'; + return; + } + + } //Si pays France > TVA = 20,00 % $tva=0.2; //var_dump($infos['entrep']);die; @@ -171,10 +187,11 @@ class Achatclient_IndexController extends Zend_Controller_Action $tva=0.2; } } - //Si Guadeloupe (971), Martinique (972), La Réunion (974) > TVA = 8,50 % + //Si Guadeloupe (971), Martinique (972), La Réunion (974) > TVA = 8,50 % if(substr($infos['entrep']['CP'],0,3)=='971' || substr($infos['entrep']['CP'],0,3)=='972' ||substr($infos['entrep']['CP'],0,3)=='974'){ $tva=0.085; } + //Calcul des montants $this->tranches[$idClient][$nb_credit]['tva']=$this->tranches[$idClient][$nb_credit]['montantht']*$tva; $this->tranches[$idClient][$nb_credit]['montant']=$this->tranches[$idClient][$nb_credit]['montantht']+$this->tranches[$idClient][$nb_credit]['tva']; diff --git a/application/modules/achatclient/controllers/InextensoController.php b/application/modules/achatclient/controllers/InextensoController.php index 88eff62b8..78976d023 100644 --- a/application/modules/achatclient/controllers/InextensoController.php +++ b/application/modules/achatclient/controllers/InextensoController.php @@ -13,6 +13,7 @@ class Achatclient_InextensoController extends Zend_Controller_Action protected $maxcredit=2000; + public function init() { if (Zend_Registry::isRegistered('logger')) { diff --git a/application/modules/achatclient/controllers/PbanswerController.php b/application/modules/achatclient/controllers/PbanswerController.php index 8cd9b9cee..08604c3f7 100644 --- a/application/modules/achatclient/controllers/PbanswerController.php +++ b/application/modules/achatclient/controllers/PbanswerController.php @@ -65,7 +65,22 @@ class Achatclient_PbanswerController extends Zend_Controller_Action } $this->redirect("http://".$request->getHttpHost()."/achatclient/?message=".$this->msg); } + public function wspoloAction(){ + $json='[{"nomPartie":"BANQUE POPULAIRE DU MASSIF CENTRAL (BPMC)","qualite":"DE","numero":0,"adresse":{"lignes":["18 BOULEVARD JEAN MOULIN"],"codePostal":"63000","bureauDistributeur":"CLERMONT FERRAND"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DE","nom":"ME FRANCOIS-XAVIER DOS SANTOS","numeroPartie":1,"numeroRepresentant":1}]},{"nomPartie":"SARLh DELTA 2 I (SARL)","qualite":"DF","numero":0,"adresse":{"lignes":["18 RUE JEAN CLARET","PARC TECHNOLOGIQUE LA PARDIEU"],"codePostal":"63000","bureauDistributeur":"CLERMONT FERRAND"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":"89","dossierStatut":"B","dossierChrono":"00507"},"nomGreffeImmat":null,"siren":950372318,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":1,"numeroRepresentant":1}]},{"nomPartie":"EL MOUDNI SI Mohamed","qualite":"DF","numero":0,"adresse":{"lignes":["7 RUE DU CONSUL"],"codePostal":"63670","bureauDistributeur":"ORCET"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":2,"numeroRepresentant":1}]},{"nomPartie":"SELARL MANDATUM, repr\u00e9sent\u00e9e par Me Rapha\u00ebl PETAVY (INTERVENANTE VOLONTAIRE)","qualite":"DF","numero":0,"adresse":{"lignes":["29 BOULEVARD BERTHELOT"],"codePostal":"63400","bureauDistributeur":"CHAMALIERES"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":3,"numeroRepresentant":1}]}]'; + $val=json_decode($json); + var_dump($val);die; + $ws = new Scores_Ws_Client('entreprise', '0.9'); + $params = new stdClass(); + $params->companyId = 552144503; + $params->tiers = 'DE'; + $params->p = 0; + $params->limit = 10; + $params = new stdClass(); + $params->companyId = 552144503;//siren + $infocredit = $ws->getGreffeAffaireList($params); + var_dump($infocredit);die; + } private function error($ligne=0,$message=""){ switch($ligne){ case "index": diff --git a/application/modules/achatclient/views/default/scripts/index/paiement.phtml b/application/modules/achatclient/views/default/scripts/index/paiement.phtml index 7eeea1ed4..62ea5c9ac 100644 --- a/application/modules/achatclient/views/default/scripts/index/paiement.phtml +++ b/application/modules/achatclient/views/default/scripts/index/paiement.phtml @@ -11,6 +11,7 @@ alert{ pbparams)):?> +info=='siret'):?>

ACHAT de CREDITS Informations complémentaires

message ?>

@@ -42,6 +43,17 @@ $(function(){ }); inlineScript(); ?> + +info=='tva'):?> +