/[dolibarr]/dolibarr/htdocs/telephonie/client/new.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/client/new.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by rodolphe, Mon Oct 31 09:54:20 2005 UTC revision 1.8 by rodolphe, Wed Dec 7 11:29:21 2005 UTC
# Line 203  if ($_POST["action"] == 'add') Line 203  if ($_POST["action"] == 'add')
203        
204        if(! is_numeric($temporel))        if(! is_numeric($temporel))
205          {          {
206            $error++;            $error = 1030;
207            $verif = "nok";            $verif = "nok";
208            $mesg .= "Tarif France Invalide";            $mesg .= "Tarif France Invalide";
209          }          }
# Line 211  if ($_POST["action"] == 'add') Line 211  if ($_POST["action"] == 'add')
211          {          {
212            if ($temporel > 0.04 )            if ($temporel > 0.04 )
213              {              {
214                $error++;                $error = 1031;
215                $verif = "nok";                $verif = "nok";
216                $mesg .= "Tarif France Invalide : $temporel > 0.04 !";                $mesg .= "Tarif France Invalide : $temporel > 0.04 !";
217              }              }
218                        
219            if ($temporel < 0.016 )            if ($temporel < 0.016 )
220              {              {
221                $error++;                $error = 1031;
222                $verif = "nok";                $verif = "nok";
223                $mesg .= "Tarif France Invalide : $temporel <  0.016 !";                $mesg .= "Tarif France Invalide : $temporel <  0.016 !";
224              }              }
# Line 238  if ($_POST["action"] == 'add') Line 238  if ($_POST["action"] == 'add')
238          {                {      
239            if ($temporel > 0.40 )            if ($temporel > 0.40 )
240              {              {
241                $error++;                $error = 1033;
242                $verif = "nok";                $verif = "nok";
243                $mesg .= "Tarif Mobile Invalide : $temporel > 0.40 !";                $mesg .= "Tarif Mobile Invalide : $temporel > 0.40 !";
244              }              }
245            if ($temporel <  0.16 )            if ($temporel <  0.16 )
246              {              {
247                $error++;                $error = 1034;
248                $verif = "nok";                $verif = "nok";
249                $mesg .= "Tarif Mobile Invalide : $temporel <  0.16 !";                $mesg .= "Tarif Mobile Invalide : $temporel <  0.16 !";
250              }              }
# Line 270  if ($_POST["action"] == 'add') Line 270  if ($_POST["action"] == 'add')
270    
271    if (!$error && $verif == "ok")    if (!$error && $verif == "ok")
272      {          {    
273        $soc->code_client           = $_POST["code_client"]."00";        $soc->code_client = $_POST["code_client"]."00";
274        $result = $soc->create($user);        $result = $soc->create($user);
275                
276        if ($result == 0)        if ($result == 0)
# Line 283  if ($_POST["action"] == 'add') Line 283  if ($_POST["action"] == 'add')
283          }          }
284        else        else
285          {          {
286            $mesg = nl2br($soc->error);            $mesg = nl2br($soc->error) . " (result $result)\n";
287            $error++;            $error = 1035;
288          }          }
289      }      }
290        
# Line 298  if ($_POST["action"] == 'add') Line 298  if ($_POST["action"] == 'add')
298          }          }
299        else        else
300          {          {
301            $error++;            $error = 1024;
302          }          }
303      }      }
304    
# Line 313  if ($_POST["action"] == 'add') Line 313  if ($_POST["action"] == 'add')
313          }          }
314        else        else
315          {          {
316            $error++;            $error = 1025;
317          }          }
318      }      }
319    
# Line 326  if ($_POST["action"] == 'add') Line 326  if ($_POST["action"] == 'add')
326        $contrat->client_facture  = $soc->id;        $contrat->client_facture  = $soc->id;
327        $contrat->commercial_sign = $_POST["commercial_sign"];        $contrat->commercial_sign = $_POST["commercial_sign"];
328                
329        if ( $contrat->create($user) == 0)        if ( $contrat->create($user,'oui',$_POST["mode_paiement"]) == 0)
330          {          {
331            $contrat->add_contact_facture($contact->id);            $contrat->add_contact_facture($contact->id);
332          }          }
333        else        else
334          {          {
335            $error++;            $error = 1026;
336          }          }
337      }      }
338        
# Line 366  if ($_POST["action"] == 'add') Line 366  if ($_POST["action"] == 'add')
366              }              }
367            else            else
368              {              {
369                $error++;                $error = 1027;
370                $mesg.= "Impossible de créer la ligne #1 0".$_POST["cli"];                $mesg.= "Impossible de créer la ligne #1 0".$_POST["cli"];
371              }              }
372          }          }
# Line 399  if ($_POST["action"] == 'add') Line 399  if ($_POST["action"] == 'add')
399            else            else
400              {              {
401                //$error++;                //$error++;
402                  $error = 1028;
403                $mesg.= "Impossible de créer la ligne #2 0".$_POST["cli2"];                $mesg.= "Impossible de créer la ligne #2 0".$_POST["cli2"];
404              }              }
405          }          }
# Line 430  if ($_POST["action"] == 'add') Line 431  if ($_POST["action"] == 'add')
431            else            else
432              {              {
433                //$error++;                //$error++;
434                  $error = 1029;
435                $mesg.= "Impossible de créer la ligne #3 0".$_POST["cli3"];                $mesg.= "Impossible de créer la ligne #3 0".$_POST["cli3"];
436              }              }
437          }          }
# Line 522  if ($_POST["action"] == 'add') Line 524  if ($_POST["action"] == 'add')
524    if (!$error && $verif == "ok")    if (!$error && $verif == "ok")
525      {      {
526        Header("Location: ".DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id);        Header("Location: ".DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id);
527      }          }
528      else
529        {
530          $mesg .= $error;
531        }
532        
533  }  }
534    
# Line 629  if ($user->rights->telephonie->ligne->cr Line 635  if ($user->rights->telephonie->ligne->cr
635    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"].'">';
636    print '</td></tr>';    print '</td></tr>';
637        
638      print '<tr><td width="20%">Règlement</td><td colspan="3">';
639      print '<select name="mode_paiement">';
640      if ($_POST["mode_paiement"] == 'vir')
641        {
642          print '<option value="pre">Prélèvement</option>';
643          print '<option value="vir" SELECTED>Virement</option>';
644        }
645      else
646        {
647          print '<option value="pre" SELECTED>Prélèvement</option>';
648          print '<option value="vir">Virement</option>';
649        }
650      print '</select>';
651      print '</td></tr>';
652    
653    print "</table>\n";    print "</table>\n";
654    print "</fieldset><br />\n";    print "</fieldset><br />\n";
655        

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26