1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| public static function createType2($libelle, $codeTresorerie, $codeCollectivite, $typeFacturation, $minimumFacture, $plancherFacture, $actionPlancher, PresentationFacture $presentationFacture, PresentationBordereau $presentationBordereau, Gestionnaire $gestionnaire, $journal = "",
$signataire = "", $fonction = "", $aEchoir = 0, $idTipi = "",$transfertTipi="", $ics = "", $iban = "", $bic = "", $numCodique = "", $codeBudget = "",
$codeProduitLocale = "", $siret = "",$codePeriode, $ibanTresorerie = "", $bicTresorerie = "", $refCrediteur = "", $refMessageSepa = "") {
$insert = "INSERT INTO " . self::$NOM_TABLE . " (LIBELLE, CODE_TRESORERIE, CODE_COLLECTIVITE, TYPE_FACTURATION, "
. "MINIMUM_FACTURE, PLANCHER_FACTURE, ACTION_PLANCHER, PRESENTATION_FACTURE, PRESENTATION_BORDEREAU, GESTIONNAIRE, JOURNAL, SIGNATAIRE, FONCTION, A_ECHOIR, ID_TIPI,t.Transfert_TIPI, ICS, IBAN, BIC, NUMCODIQUE, CODEBUDGET, CODEPRODUITLOCALE, SIRET,CODEPERIODE, IBAN_TRESORERIE, BIC_TRESORERIE, REF_CREDITEUR, REF_MESSAGE_SEPA)";
$values = "VALUES ('" . addslashes($libelle)
. "', '" . addslashes($codeTresorerie)
. "', '" . addslashes($codeCollectivite)
. "', '" . addslashes($typeFacturation)
. "', " . floatval($minimumFacture)
. ", " . floatval($plancherFacture)
. ", '" . addslashes($actionPlancher)
. "', ". $presentationFacture->getId()
. ", " . $presentationBordereau->getId()
. ", " . $gestionnaire->getId()
. ", '" . addslashes($journal)
. "', '" . addslashes($signataire)
. "', '" . addslashes($fonction)
. "', " . intval($aEchoir)
. ", '" . addslashes($idTipi)
. "', '" . addslashes($transfertTipi)
. "', '" . addslashes($iban)
. "', '". addslashes($bic)
. "', '" . addslashes($numCodique)
. "', '" . addslashes($codeBudget)
. "', '" . addslashes($codeProduitLocale)
. "', '" . addslashes($siret)
. "', '". addslashes($codePeriode)
. "', '" . addslashes($ibanTresorerie)
. "', '" . addslashes($bicTresorerie)
. "', '" . addslashes($refCrediteur)
."', '" . addslashes($refMessageSepa). "')";
$db = DbConnection::getInstance();
$res = $db->performRequest($insert . " " . $values);
if ($res !== false) {
$id = DbUtil::getLastId(self::$NOM_TABLE);
if ($id !== false)
return new TypeFacture ($id, $libelle, $codeTresorerie, $codeCollectivite, $typeFacturation, $minimumFacture, $plancherFacture,
$actionPlancher, $presentationFacture->getId(), $presentationBordereau->getId(), $gestionnaire->getId(), $journal, $aEchoir, $idTipi,$transfertTipi, $ics, $iban, $bic, $numCodique, $codeBudget, $codeProduitLocale, $siret,$codePeriode, $ibanTresorerie, $bicTresorerie, $refCrediteur, $refMessageSepa);
}
return false;
} |
Partager