You are on page 1of 5

* Asigna variables.

lText10ena = Thisform.Text10.Enabled
lText32ena = Thisform.Text32.Enabled
lCombosena = Thisform.Combo5.Enabled
* Desactiva controles.
Thisform.Text4.Enabled = .F.
Thisform.Text5.Enabled = .F.
Thisform.Text7.Enabled = .F.
Thisform.Text9.Enabled = .F.
Thisform.Text10.Enabled = .F.
Thisform.Text11.Enabled = .F.
Thisform.Text22.Enabled = .F.
Thisform.Text23.Enabled = .F.
Thisform.Text24.Enabled = .F.
Thisform.Text25.Enabled = .F.
Thisform.Text26.Enabled = .F.
Thisform.Text27.Enabled = .F.
Thisform.Text28.Enabled = .F.
Thisform.Text29.Enabled = .F.
Thisform.Text30.Enabled = .F.
Thisform.Text31.Enabled = .F.
Thisform.Text32.Enabled = .F.
Thisform.Text34.Enabled = .F.
Thisform.Text35.Enabled = .F.
Thisform.Command21.Enabled = .F.
Thisform.Command22.Enabled = .F.
Thisform.Command23.Enabled = .F.
Thisform.Command24.Enabled = .F.
Thisform.Command25.Enabled = .F.
Thisform.Command26.Enabled = .F.
Thisform.Command27.Enabled = .F.
Thisform.Command28.Enabled = .F.
Thisform.Command29.Enabled = .F.
Thisform.Command30.Enabled = .F.
Thisform.Command21.Visible = .F.
Thisform.Command22.Visible = .F.
Thisform.Command23.Visible = .F.
Thisform.Command24.Visible = .F.
Thisform.Command25.Visible = .F.
Thisform.Command26.Visible = .F.
Thisform.Command27.Visible = .F.
Thisform.Command28.Visible = .F.
Thisform.Command29.Visible = .F.
Thisform.Command30.Visible = .F.
Thisform.Combo1.Enabled = .F.
Thisform.Combo2.Enabled = .F.
Thisform.Combo3.Enabled = .F.
Thisform.Combo4.Enabled = .F.
Thisform.Combo5.Enabled = .F.
Thisform.Combo6.Enabled = .F.
Thisform.Combo7.Enabled = .F.
Thisform.Combo8.Enabled = .F.
Thisform.Combo9.Enabled = .F.
Thisform.Combo10.Enabled = .F.
Thisform.Combo11.Enabled = .F.
Thisform.Combo12.Enabled = .F.
Thisform.Combo13.Enabled = .F.
Thisform.Combo14.Enabled = .F.
Thisform.Combo1.Visible = .F.
Thisform.Combo2.Visible = .F.
Thisform.Combo3.Visible = .F.
Thisform.Combo4.Visible = .F.
Thisform.Combo5.Visible = .F.
Thisform.Combo6.Visible = .F.
Thisform.Combo7.Visible = .F.
Thisform.Combo8.Visible = .F.
Thisform.Combo9.Visible = .F.
Thisform.Combo10.Visible = .F.
Thisform.Combo11.Visible = .F.
Thisform.Combo12.Visible = .F.
Thisform.Combo13.Visible = .F.
Thisform.Combo14.Visible = .F.
* Utiliza tabla de recepción de cortes clientes externos.
SELECT Tbrepcortesext
nCorrecto = 1
IF LEN(ALLTRIM(Thisform.Text3.Value)) = 0
* Indica que no hay cliente.
cMenErr = "NO HAY CLIENTE"
Thisform.Text3.BorderColor = RGB(255,0,0)
Thisform.Text3.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. LEN(ALLTRIM(Thisform.Text4.Value)) = 0
* Indica que no hay corte.
cMenErr = "NO HAY CORTE"
Thisform.Text4.BorderColor = RGB(255,0,0)
Thisform.Text4.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
*IF nCorrecto = 1 .and. LEN(ALLTRIM(Thisform.Text5.Value)) = 0
* * Indica que no hay modelo.
* cMenErr = "NO HAY MODELO"
* Thisform.Text5.BorderColor = RGB(255,0,0)
* Thisform.Text5.DisabledBackColor = RGB(255,225,225)
* nCorrecto = 2
*ENDIF
IF nCorrecto = 1 .and. LEN(ALLTRIM(Thisform.Text6.Value)) = 0
* Indica que no hay marca.
cMenErr = "NO HAY MARCA"
Thisform.Text6.BorderColor = RGB(255,0,0)
Thisform.Text6.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. LEN(ALLTRIM(Thisform.Text7.Value)) = 0
* Indica que no hay remisión/nota.
cMenErr = "NO HAY REMISION/NOTA"
Thisform.Text7.BorderColor = RGB(255,0,0)
Thisform.Text7.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Optiongroup1.Value >= 2 .and. LEN(ALLTRIM(Thisform.Text8.Value)) = 0
* Indica piezas entalladas incorrecto.
cMenErr = "PIEZAS ENTALLADAS INCORRECTO"
Thisform.Text8.BorderColor = RGB(255,0,0)
Thisform.Text8.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Text8.Value = "SI"
* Revisa relación y cantidades de tallas.
FOR nC1 = 12 TO 21
cTexto1 = "Thisform.Text"+ALLTRIM(STR(nC1))+".Value"
cTextobc1 = "Thisform.Text"+ALLTRIM(STR(nC1))+".BorderColor"
cTextodbc1 = "Thisform.Text"+ALLTRIM(STR(nC1))+".DisabledBackColor"
IF LEN(ALLTRIM(&cTexto1)) <> 0
* Revisa tallas repetidas.
IF nC1 < 21
* Asigna tallas a revisar.
FOR nC2 = nC1+1 TO 21
cTexto2 = "Thisform.Text"+ALLTRIM(STR(nC2))+".Value"
cTextobc2 = "Thisform.Text"+ALLTRIM(STR(nC2))+".BorderColor"
cTextodbc2 = "Thisform.Text"+ALLTRIM(STR(nC2))+".DisabledBackColor"
IF ALLTRIM(&cTexto1) = ALLTRIM(&cTexto2)
* Indica tallas repetidas.
cMenerr = "TALLA "+ALLTRIM(STR(nC1-11))+" Y TALLA "+ALLTRIM(STR(nC2-11))+" REPETIDAS"
nC1 = 21
nC2 = 21
&cTextobc1 = RGB(255,0,0)
&cTextobc2 = RGB(255,0,0)
&cTextodbc1 = RGB(255,225,225)
&cTextodbc2 = RGB(255,225,225)
nCorrecto = 2
ENDIF
ENDFOR
ENDIF
ENDIF
IF nCorrecto = 1
* Asigna cantidad por talla.
cTexto2 = "Thisform.Text"+ALLTRIM(STR(nC1+10))+".Value"
cTextobc2 = "Thisform.Text"+ALLTRIM(STR(nC1+10))+".BorderColor"
cTextodbc2 = "Thisform.Text"+ALLTRIM(STR(nC1+10))+".DisabledBackColor"
* Revisa cantidades por talla.
IF (LEN(ALLTRIM(&cTexto1)) <> 0 .and. &cTexto2 <= 0) .or. (LEN(ALLTRIM(&cTexto1)) = 0 .and. &cTexto2 <> 0)
* Indica cantidad por talla incorrecta.
cMenerr = "CANTIDAD POR TALLA "+ALLTRIM(STR(nC1-11))+" INCORRECTA"
nC1 = 21
&cTextobc1 = RGB(255,0,0)
&cTextobc2 = RGB(255,0,0)
&cTextodbc1 = RGB(255,225,225)
&cTextodbc2 = RGB(255,225,225)
nCorrecto = 2
ENDIF
ENDIF
ENDFOR
* Revisa cantidad y cantidades por talla.
IF nCorrecto = 1 .and. Thisform.Text10.Value <>
Thisform.Text22.Value+Thisform.Text23.Value+Thisform.Text24.Value+Thisform.Text25.Value+Thisform.Text26.Value+Thisform.Text27.Value+Thisform.Text28.Va
lue+Thisform.Text29.Value+Thisform.Text30.Value+Thisform.Text31.Value
* Indica cantidad y cantidades por talla incorrectas.
cMenErr = "CANTIDAD Y CANTIDADES POR TALLA INCORRECTAS"
Thisform.Text10.BorderColor = RGB(255,0,0)
Thisform.Text10.DisabledBackColor = RGB(255,225,225)
IF Thisform.Text22.Value <> 0
Thisform.Text22.BorderColor = RGB(255,0,0)
Thisform.Text22.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text23.Value <> 0
Thisform.Text23.BorderColor = RGB(255,0,0)
Thisform.Text23.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text24.Value <> 0
Thisform.Text24.BorderColor = RGB(255,0,0)
Thisform.Text24.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text25.Value <> 0
Thisform.Text25.BorderColor = RGB(255,0,0)
Thisform.Text25.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text26.Value <> 0
Thisform.Text26.BorderColor = RGB(255,0,0)
Thisform.Text26.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text27.Value <> 0
Thisform.Text27.BorderColor = RGB(255,0,0)
Thisform.Text27.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text28.Value <> 0
Thisform.Text28.BorderColor = RGB(255,0,0)
Thisform.Text28.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text29.Value <> 0
Thisform.Text29.BorderColor = RGB(255,0,0)
Thisform.Text29.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text30.Value <> 0
Thisform.Text30.BorderColor = RGB(255,0,0)
Thisform.Text30.DisabledBackColor = RGB(255,225,225)
ENDIF
IF Thisform.Text31.Value <> 0
Thisform.Text31.BorderColor = RGB(255,0,0)
Thisform.Text31.DisabledBackColor = RGB(255,225,225)
ENDIF
nCorrecto = 2
ENDIF
ENDIF
IF nCorrecto = 1 .and. Thisform.Optiongroup1.Value = 1 .and. Thisform.Text9.Value <= 0
* Indica cantidad de rollos incorrecta.
cMenErr = "CANTIDAD DE ROLLOS INCORRECTA"
Thisform.Text9.BorderColor = RGB(255,0,0)
Thisform.Text9.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Text10.Value <= 0
* Indica cantidad incorrecta.
cMenErr = "CANTIDAD DE "+IIF(Thisform.Optiongroup1.Value = 1,"MTS. TOTAL","PIEZAS")+" INCORRECTA"
Thisform.Text10.BorderColor = RGB(255,0,0)
Thisform.Text10.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Optiongroup1.Value >= 2 .and. Thisform.Text32.Value <= 0
* Indica cantidad en nota incorrecta.
cMenErr = "CANTIDAD EN NOTA INCORRECTA"
Thisform.Text32.BorderColor = RGB(255,0,0)
Thisform.Text32.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Optiongroup1.Value >= 2 .and. Thisform.Text34.Value = {}
* Indica fecha de la nota incorrecta.
cMenErr = "FECHA DE LA NOTA INCORRECTA"
Thisform.Text34.BorderColor = RGB(255,0,0)
Thisform.Text34.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1 .and. Thisform.Optiongroup1.Value >= 2 .and. LEN(ALLTRIM(Thisform.Text35.Value)) = 0
* Indica nombre de quien entrega incorrecto.
cMenErr = "NOMBRE DE QUIEN ENTREGA INCORRECTO"
Thisform.Text35.BorderColor = RGB(255,0,0)
Thisform.Text35.DisabledBackColor = RGB(255,225,225)
nCorrecto = 2
ENDIF
IF nCorrecto = 1
* Busca folio.
SET ORDER TO tag Folio
SEEK Thisform.Text1.Value
SET ORDER TO
IF FOUND()
* Indica registro ocupado por otro usuario.
DO FORM \Sipro20\Menerror WITH "REGISTRO OCUPADO POR OTRO USUARIO"
ELSE
* Agrega registro en blanco.
APPEND BLANK
REPLACE Folio WITH Thisform.Text1.Value
REPLACE Fecha WITH Thisform.Text2.Value
REPLACE Cliente WITH Thisform.Text3.Value
REPLACE Nocorte WITH LTRIM(Thisform.Text4.Value)
*REPLACE Modelo WITH LTRIM(Thisform.Text5.Value)
REPLACE Marca WITH Thisform.Text6.Value
REPLACE Remision WITH LTRIM(Thisform.Text7.Value)
REPLACE Entallada WITH Thisform.Text8.Value
REPLACE Cantrollo WITH Thisform.Text9.Value
REPLACE Cantidad WITH Thisform.Text10.Value
REPLACE Seccion WITH Thisform.Text11.Value
REPLACE Recepcion WITH Thisform.Optiongroup1.Value
REPLACE Captura WITH .F.
REPLACE Captcte WITH .F.
REPLACE Usado WITH .F.
REPLACE Cant1 WITH 0
REPLACE Cant2 WITH 0
REPLACE Cant3 WITH 0
REPLACE Cant4 WITH 0
REPLACE Cant5 WITH 0
REPLACE Cant6 WITH 0
REPLACE Cant7 WITH 0
REPLACE Cant8 WITH 0
REPLACE Cant9 WITH 0
REPLACE Cant10 WITH 0
IF Thisform.Text8.Value = "SI"
* Graba datos de tallas.
REPLACE Talla1 WITH Thisform.Text12.Value
REPLACE Talla2 WITH Thisform.Text13.Value
REPLACE Talla3 WITH Thisform.Text14.Value
REPLACE Talla4 WITH Thisform.Text15.Value
REPLACE Talla5 WITH Thisform.Text16.Value
REPLACE Talla6 WITH Thisform.Text17.Value
REPLACE Talla7 WITH Thisform.Text18.Value
REPLACE Talla8 WITH Thisform.Text19.Value
REPLACE Talla9 WITH Thisform.Text20.Value
REPLACE Talla10 WITH Thisform.Text21.Value
REPLACE Cant1 WITH Thisform.Text22.Value
REPLACE Cant2 WITH Thisform.Text23.Value
REPLACE Cant3 WITH Thisform.Text24.Value
REPLACE Cant4 WITH Thisform.Text25.Value
REPLACE Cant5 WITH Thisform.Text26.Value
REPLACE Cant6 WITH Thisform.Text27.Value
REPLACE Cant7 WITH Thisform.Text28.Value
REPLACE Cant8 WITH Thisform.Text29.Value
REPLACE Cant9 WITH Thisform.Text30.Value
REPLACE Cant10 WITH Thisform.Text31.Value
ENDIF
REPLACE Cantnota WITH Thisform.Text32.Value
REPLACE Fechanota WITH Thisform.Text34.Value
REPLACE Entganota WITH Thisform.Text35.Value
ENDIF
Thisform.Command11.Click
ELSE
* Indica mensaje de error.
DO FORM \Sipro20\Menerror WITH cMenerr
* Activa controles.
Thisform.Text3.BorderColor = RGB(0,192,96)
Thisform.Text4.BorderColor = RGB(0,192,96)
*Thisform.Text5.BorderColor = RGB(0,192,96)
Thisform.Text6.BorderColor = RGB(0,192,96)
Thisform.Text7.BorderColor = RGB(0,192,96)
Thisform.Text8.BorderColor = RGB(0,192,96)
Thisform.Text9.BorderColor = RGB(0,192,96)
Thisform.Text10.BorderColor = RGB(0,192,96)
Thisform.Text12.BorderColor = RGB(0,192,96)
Thisform.Text13.BorderColor = RGB(0,192,96)
Thisform.Text14.BorderColor = RGB(0,192,96)
Thisform.Text15.BorderColor = RGB(0,192,96)
Thisform.Text16.BorderColor = RGB(0,192,96)
Thisform.Text17.BorderColor = RGB(0,192,96)
Thisform.Text18.BorderColor = RGB(0,192,96)
Thisform.Text19.BorderColor = RGB(0,192,96)
Thisform.Text20.BorderColor = RGB(0,192,96)
Thisform.Text21.BorderColor = RGB(0,192,96)
Thisform.Text22.BorderColor = RGB(0,192,96)
Thisform.Text23.BorderColor = RGB(0,192,96)
Thisform.Text24.BorderColor = RGB(0,192,96)
Thisform.Text25.BorderColor = RGB(0,192,96)
Thisform.Text26.BorderColor = RGB(0,192,96)
Thisform.Text27.BorderColor = RGB(0,192,96)
Thisform.Text28.BorderColor = RGB(0,192,96)
Thisform.Text29.BorderColor = RGB(0,192,96)
Thisform.Text30.BorderColor = RGB(0,192,96)
Thisform.Text31.BorderColor = RGB(0,192,96)
Thisform.Text32.BorderColor = RGB(0,192,96)
Thisform.Text34.BorderColor = RGB(0,192,96)
Thisform.Text35.BorderColor = RGB(0,192,96)
Thisform.Text3.DisabledBackColor = RGB(205,255,205)
Thisform.Text4.DisabledBackColor = RGB(205,255,205)
*Thisform.Text5.DisabledBackColor = RGB(205,255,205)
Thisform.Text6.DisabledBackColor = RGB(205,255,205)
Thisform.Text7.DisabledBackColor = RGB(205,255,205)
Thisform.Text8.DisabledBackColor = RGB(205,255,205)
Thisform.Text9.DisabledBackColor = RGB(205,255,205)
Thisform.Text10.DisabledBackColor = RGB(205,255,205)
Thisform.Text12.DisabledBackColor = RGB(205,255,205)
Thisform.Text13.DisabledBackColor = RGB(205,255,205)
Thisform.Text14.DisabledBackColor = RGB(205,255,205)
Thisform.Text15.DisabledBackColor = RGB(205,255,205)
Thisform.Text16.DisabledBackColor = RGB(205,255,205)
Thisform.Text17.DisabledBackColor = RGB(205,255,205)
Thisform.Text18.DisabledBackColor = RGB(205,255,205)
Thisform.Text19.DisabledBackColor = RGB(205,255,205)
Thisform.Text20.DisabledBackColor = RGB(205,255,205)
Thisform.Text21.DisabledBackColor = RGB(205,255,205)
Thisform.Text22.DisabledBackColor = RGB(205,255,205)
Thisform.Text23.DisabledBackColor = RGB(205,255,205)
Thisform.Text24.DisabledBackColor = RGB(205,255,205)
Thisform.Text25.DisabledBackColor = RGB(205,255,205)
Thisform.Text26.DisabledBackColor = RGB(205,255,205)
Thisform.Text27.DisabledBackColor = RGB(205,255,205)
Thisform.Text28.DisabledBackColor = RGB(205,255,205)
Thisform.Text29.DisabledBackColor = RGB(205,255,205)
Thisform.Text30.DisabledBackColor = RGB(205,255,205)
Thisform.Text31.DisabledBackColor = RGB(205,255,205)
Thisform.Text32.DisabledBackColor = RGB(205,255,205)
Thisform.Text34.DisabledBackColor = RGB(205,255,205)
Thisform.Text35.DisabledBackColor = RGB(205,255,205)
Thisform.Text4.Enabled = .T.
*Thisform.Text5.Enabled = .T.
Thisform.Text7.Enabled = IIF(ALLTRIM(Thisform.Text7.Value) = "N/A",.F.,.T.)
Thisform.Text10.Enabled = lText10ena
Thisform.Text22.Enabled = lCombosena
Thisform.Text23.Enabled = lCombosena
Thisform.Text24.Enabled = lCombosena
Thisform.Text25.Enabled = lCombosena
Thisform.Text26.Enabled = lCombosena
Thisform.Text27.Enabled = lCombosena
Thisform.Text28.Enabled = lCombosena
Thisform.Text29.Enabled = lCombosena
Thisform.Text30.Enabled = lCombosena
Thisform.Text31.Enabled = lCombosena
Thisform.Text32.Enabled = lText32ena
Thisform.Text34.Enabled = lText32ena
Thisform.Text35.Enabled = lText32ena
Thisform.Command21.Enabled = lCombosena
Thisform.Command22.Enabled = lCombosena
Thisform.Command23.Enabled = lCombosena
Thisform.Command24.Enabled = lCombosena
Thisform.Command25.Enabled = lCombosena
Thisform.Command26.Enabled = lCombosena
Thisform.Command27.Enabled = lCombosena
Thisform.Command28.Enabled = lCombosena
Thisform.Command29.Enabled = lCombosena
Thisform.Command30.Enabled = lCombosena
Thisform.Command21.Visible = lCombosena
Thisform.Command22.Visible = lCombosena
Thisform.Command23.Visible = lCombosena
Thisform.Command24.Visible = lCombosena
Thisform.Command25.Visible = lCombosena
Thisform.Command26.Visible = lCombosena
Thisform.Command27.Visible = lCombosena
Thisform.Command28.Visible = lCombosena
Thisform.Command29.Visible = lCombosena
Thisform.Command30.Visible = lCombosena
Thisform.Combo1.Enabled = .T.
Thisform.Combo2.Enabled = .T.
Thisform.Combo3.Enabled = .T.
Thisform.Combo5.Enabled = lCombosena
Thisform.Combo6.Enabled = lCombosena
Thisform.Combo7.Enabled = lCombosena
Thisform.Combo8.Enabled = lCombosena
Thisform.Combo9.Enabled = lCombosena
Thisform.Combo10.Enabled = lCombosena
Thisform.Combo11.Enabled = lCombosena
Thisform.Combo12.Enabled = lCombosena
Thisform.Combo13.Enabled = lCombosena
Thisform.Combo14.Enabled = lCombosena
Thisform.Combo1.Visible = .T.
Thisform.Combo2.Visible = .T.
Thisform.Combo3.Visible = .T.
Thisform.Combo5.Visible = lCombosena
Thisform.Combo6.Visible = lCombosena
Thisform.Combo7.Visible = lCombosena
Thisform.Combo8.Visible = lCombosena
Thisform.Combo9.Visible = lCombosena
Thisform.Combo10.Visible = lCombosena
Thisform.Combo11.Visible = lCombosena
Thisform.Combo12.Visible = lCombosena
Thisform.Combo13.Visible = lCombosena
Thisform.Combo14.Visible = lCombosena
IF Thisform.Optiongroup1.Value = 1
* Activa controles.
Thisform.Text9.Enabled = .T.
ELSE
* Activa controles.
Thisform.Text11.Enabled = .T.
Thisform.Combo4.Enabled = .T.
Thisform.Combo4.Visible = .T.
ENDIF
Thisform.Text1.SetFocus
ENDIF

You might also like