home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 46 / Mobiclic46.iso / pc / DATA / SHARED / COMMUNS.CST / 00014_Script_anciensNums < prev    next >
Text File  |  2002-07-12  |  3KB  |  111 lines

  1. ----------------------------------------------------------------
  2. --                    MARKETING APPLICATION
  3. --              "ANCIENS NUMEROS" MODULE SCRIPTS
  4. --                  Gyorgy Gutierrez, Mai 2002
  5. ----------------------------------------------------------------
  6.  
  7. ----------------------------------------------------------------
  8. -------------- declaration des variables globales --------------
  9. ----------------------------------------------------------------
  10.  
  11. global Prix, Port 
  12. global ListeCom, ListeQte, ListeTotal, SommeTotal, gCodeEuro
  13. global gMyParent
  14.  
  15. ----------------------------------------------------------------
  16. -------- masquer les champs editables non necessaires ----------
  17. ----------------------------------------------------------------
  18.  
  19. on affichQte
  20.   repeat with i = 1 to (12 - ListeCom.count)
  21.     masquerPistes (32 - i)
  22.   end repeat
  23. end
  24.  
  25. ----------------------------------------------------------------
  26. ----------- creation de la liste des numeros choisis -----------
  27. ----------------------------------------------------------------
  28.  
  29. on creerListe
  30.   -- liste des numeros  
  31.   sort ListeCom
  32.   temp = ""
  33.   repeat with i = 1 to ListeCom.count
  34.     put ListeCom[i] into temp.line[i]
  35.   end repeat
  36.   member("ListeCom").text = temp
  37.   
  38.   -- liste des references 
  39.   temp = ""
  40.   case gMyParent of
  41.     1 : refmag = "60 00"
  42.     2 : refmag = "62 00"
  43.   end  case  
  44.   repeat with i = 1 to ListeCom.count
  45.     if ListeCom[i] < 10 then
  46.       put refmag && "0" & ListeCom[i] into temp.line[i]
  47.     else
  48.       put refmag && ListeCom[i] into temp.line[i]      
  49.     end if    
  50.   end repeat
  51.   member("ListeRef").text = temp
  52.   
  53.   -- liste des quantites 
  54.   repeat with i = 1 to ListeQte.count
  55.     put string(ListeQte[i]) into member("Qte" & string(i))
  56.   end repeat
  57.   calculs
  58.   
  59.   -- liste des totaux
  60.   temp = ""
  61.   repeat with i = 1 to ListeTotal.count
  62.     put ListeTotal[i] && gCodeEuro into line i of temp
  63.   end repeat
  64.   member("ListeTotal").text = temp
  65.   
  66.   -- total
  67.   if SommeTotal = 0 then
  68.     member("SommeTotal").text = ""    
  69.   else
  70.     member("SommeTotal").text = string(SommeTotal) && gCodeEuro
  71.   end if
  72.   updateStage
  73. end
  74.  
  75. ----------------------------------------------------------------
  76. ------------ calculs des montants de la commande ---------------
  77. ----------------------------------------------------------------
  78.  
  79. on calculs
  80.   -- calcul des sommes intermediares
  81.   ListeTotal = []
  82.   repeat with i = 1 to ListeQte.count
  83.     total = ListeQte[i] * Prix
  84.     ListeTotal[i] = total
  85.   end repeat
  86.   
  87.   -- calcul du montant total de la commande
  88.   SommeTotal = 0
  89.   if ListeTotal.count <> 0 then
  90.     repeat with i = 1 to ListeTotal.count
  91.       SommeTotal = SommeTotal + ListeTotal[i]
  92.     end repeat
  93.     SommeTotal = SommeTotal + Port
  94.   else
  95.     SommeTotal = 0    
  96.   end if  
  97. end
  98.  
  99. ----------------------------------------------------------------
  100. ------------------- impression de l'Θcran ----------------------
  101. ----------------------------------------------------------------
  102.  
  103. on imprimer
  104.   set doc = new(xtra "PrintOMatic")
  105.   if not objectP(doc) then exit
  106.   setLandscapeMode doc, 1
  107.   newPage doc
  108.   drawStagePicture doc, Point(1,1), Rect(2,2,638,478)
  109.   if doJobSetup (doc) = TRUE then print doc
  110. end
  111.