Ajout mode de réglement

This commit is contained in:
Rodolphe Quiedeville 2005-12-07 11:29:21 +00:00
parent b75ffc8ca1
commit 0e40a48019

View File

@ -203,7 +203,7 @@ if ($_POST["action"] == 'add')
if(! is_numeric($temporel)) if(! is_numeric($temporel))
{ {
$error++; $error = 1030;
$verif = "nok"; $verif = "nok";
$mesg .= "Tarif France Invalide"; $mesg .= "Tarif France Invalide";
} }
@ -211,14 +211,14 @@ if ($_POST["action"] == 'add')
{ {
if ($temporel > 0.04 ) if ($temporel > 0.04 )
{ {
$error++; $error = 1031;
$verif = "nok"; $verif = "nok";
$mesg .= "Tarif France Invalide : $temporel > 0.04 !"; $mesg .= "Tarif France Invalide : $temporel > 0.04 !";
} }
if ($temporel < 0.016 ) if ($temporel < 0.016 )
{ {
$error++; $error = 1031;
$verif = "nok"; $verif = "nok";
$mesg .= "Tarif France Invalide : $temporel < 0.016 !"; $mesg .= "Tarif France Invalide : $temporel < 0.016 !";
} }
@ -238,13 +238,13 @@ if ($_POST["action"] == 'add')
{ {
if ($temporel > 0.40 ) if ($temporel > 0.40 )
{ {
$error++; $error = 1033;
$verif = "nok"; $verif = "nok";
$mesg .= "Tarif Mobile Invalide : $temporel > 0.40 !"; $mesg .= "Tarif Mobile Invalide : $temporel > 0.40 !";
} }
if ($temporel < 0.16 ) if ($temporel < 0.16 )
{ {
$error++; $error = 1034;
$verif = "nok"; $verif = "nok";
$mesg .= "Tarif Mobile Invalide : $temporel < 0.16 !"; $mesg .= "Tarif Mobile Invalide : $temporel < 0.16 !";
} }
@ -283,8 +283,8 @@ if ($_POST["action"] == 'add')
} }
else else
{ {
$mesg = nl2br($soc->error); $mesg = nl2br($soc->error) . " (result $result)\n";
$error++; $error = 1035;
} }
} }
@ -298,7 +298,7 @@ if ($_POST["action"] == 'add')
} }
else else
{ {
$error++; $error = 1024;
} }
} }
@ -313,7 +313,7 @@ if ($_POST["action"] == 'add')
} }
else else
{ {
$error++; $error = 1025;
} }
} }
@ -326,13 +326,13 @@ if ($_POST["action"] == 'add')
$contrat->client_facture = $soc->id; $contrat->client_facture = $soc->id;
$contrat->commercial_sign = $_POST["commercial_sign"]; $contrat->commercial_sign = $_POST["commercial_sign"];
if ( $contrat->create($user) == 0) if ( $contrat->create($user,'oui',$_POST["mode_paiement"]) == 0)
{ {
$contrat->add_contact_facture($contact->id); $contrat->add_contact_facture($contact->id);
} }
else else
{ {
$error++; $error = 1026;
} }
} }
@ -366,7 +366,7 @@ if ($_POST["action"] == 'add')
} }
else else
{ {
$error++; $error = 1027;
$mesg.= "Impossible de créer la ligne #1 0".$_POST["cli"]; $mesg.= "Impossible de créer la ligne #1 0".$_POST["cli"];
} }
} }
@ -399,6 +399,7 @@ if ($_POST["action"] == 'add')
else else
{ {
//$error++; //$error++;
$error = 1028;
$mesg.= "Impossible de créer la ligne #2 0".$_POST["cli2"]; $mesg.= "Impossible de créer la ligne #2 0".$_POST["cli2"];
} }
} }
@ -430,6 +431,7 @@ if ($_POST["action"] == 'add')
else else
{ {
//$error++; //$error++;
$error = 1029;
$mesg.= "Impossible de créer la ligne #3 0".$_POST["cli3"]; $mesg.= "Impossible de créer la ligne #3 0".$_POST["cli3"];
} }
} }
@ -523,6 +525,10 @@ if ($_POST["action"] == 'add')
{ {
Header("Location: ".DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id); Header("Location: ".DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id);
} }
else
{
$mesg .= $error;
}
} }
@ -629,6 +635,21 @@ if ($user->rights->telephonie->ligne->creer)
print '<input type="text" size="4" maxlength="4" '.$focus.' name="rib_iban" value="'.$_POST["rib_iban"].'">'; print '<input type="text" size="4" maxlength="4" '.$focus.' name="rib_iban" value="'.$_POST["rib_iban"].'">';
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="20%">Règlement</td><td colspan="3">';
print '<select name="mode_paiement">';
if ($_POST["mode_paiement"] == 'vir')
{
print '<option value="pre">Prélèvement</option>';
print '<option value="vir" SELECTED>Virement</option>';
}
else
{
print '<option value="pre" SELECTED>Prélèvement</option>';
print '<option value="vir">Virement</option>';
}
print '</select>';
print '</td></tr>';
print "</table>\n"; print "</table>\n";
print "</fieldset><br />\n"; print "</fieldset><br />\n";