Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ "650182655", // Id organization "IdCli" => "1000.KL48ACSNU2NS34520ESYY3FWZUBS0E", // Id client "Secret" => "3b4a8173e9dbd396aaeb2603db7560f5ff9a323bb6", // Secret ] ); if($_REQUEST['ope']) { // STOP la facture dasn tout les cas $Desactiv = $MyCde->UpdateCmd("UPDATE zoho_factures SET stop='".date('Y-m-d H:i:s')."' WHERE idunique='".$_REQUEST['idu']."'"); if($Desactiv<>'OK') { $Msg ="Echec de désactivation : ".$Desactiv; } else { //echo "

=>".$Desactiv."

"; if( $_REQUEST['idr'] ) { $refresh_token = "1000.22c19beee7288032a8fef7398c164f5d.337b11b1cc5478129acacb05623673b9"; // Si l acces token change il faut changer ce code $Url = "https://accounts.zoho.com/oauth/v2/token?refresh_token=$refresh_token&client_id=" . APIZOHO['IdCli'] . "&client_secret=" . APIZOHO['Secret'] . "&grant_type=refresh_token"; $Param = ['url' => $Url, 'method' => 'POST']; $Result = $MyCde->MyCurl_APIZOHO_V2($Param); $Result = json_decode($Result, TRUE); $Token = "Zoho-oauthtoken " . $Result['access_token']; $_SESSION['CDEV2']['FACTURES']['TOKEN'] = $Token; //$_REQUEST['idu'] = "838708000011959139"; $JsonFactR = ['JSONString' => '{"recurring_invoice_id": "' . $_REQUEST['idu'] . '"}']; $Url = 'https://books.zoho.com/api/v3/recurringinvoices/' . $_REQUEST['idr'] . '/status/stop?organization_id=' . APIZOHO['IdOrg']; $ParamF = ['url' => $Url, 'method' => 'POST', 'header' => ["Authorization: $Token", "contentType: application/x-www-form-urlencoded;charset=UTF-8"], 'body' => $JsonFactR]; $ResultF = $MyCde->MyCurl_APIZOHO_V2($ParamF); $FactP = json_decode($ResultF, TRUE); // Array /* echo "$Url
";
                print_r($FactP);
                echo "
"; */ $MsgZ = $FactP['data']['message']; } $Msg ="Désactivation : OK\n".$MsgZ; } $emailweb = 'luc@bvcs.fr'; $Msg = utf8_decode($Msg); mail("$emailweb",utf8_decode("[CDE V2] Action Désactivation"),"Idunique : ".$_REQUEST['idu']."\n".$Msg,"From: $emailweb\nX-Mailer: $emailweb\nReply-To: $emailweb\nX-Mailer: PHP"); } ?>

CDE V2 - FACTURES (ZCRM)

Cliquez sur le bouton rouge d'une facture active pour la désactiver.

"; $Fact = $MyCde->LstCmdZOHO(['etat'=>'active','aaaa'=>$_REQUEST['fact_on']]); foreach($Fact as $key=>$ligne) { $ClassTR = ""; $Go = false; if(isset($_REQUEST['qst']) && $_REQUEST['idu']==$ligne['idunique']) { $ClassTR = "table-danger"; $Go = true; } echo ""; echo ""; echo ""; ($ligne['id_rec'])? $Lib='Fact.Périodique' : $Lib='En cours'; echo ""; echo ""; echo ""; if($Go) { if($_REQUEST['qst']) $Info = "
La facture périodique de ZOHO sera désactivée."; else $Info ="
Il n'y a pas de facture périodique."; echo ""; echo ""; echo ""; } } } // INCATIVE if(isset($_REQUEST['fact_off'])) { echo ""; $Fact = $MyCde->LstCmdZOHO(['etat'=>'inactive','aaaa'=>$_REQUEST['fact_off']]); foreach($Fact as $key=>$ligne) { echo ""; echo ""; echo ""; echo ""; echo ""; } } ?>
#idClientProcessusAction
".$ligne['idunique']."".strtoupper($ligne['ste'])."
".$ligne['email']."
".$Lib."X
Voulez-vous stopper le processus pour ce client ?
Cela implique l'arret complet d'envoi de mail et de paiements automatiques.".$Info."
"; echo ""; echo "
#idClientStoppée le
".$ligne['idunique']."".$ligne['ste']."
".$ligne['email']."
".$ligne['stop']."
"; print_r($Fact); echo ""; ?>
Version 1.0