**RECEVING REPORT ENTRY**
Private Sub_Click RR_FORM
open.database SGF
open.database MMF
open.database SMF
open.database EMF
open.database POMF
open.database RRMF
open.database RRDF
open.database PODF
SEEK (SGF.databasetable, SGFYear=="Year")
IF NOMATCH
{
Print"System Record not found"
}
else
{
lblComname==SGFComName
lblComAdd==SGFComAddress
}
end if
lblRRNO==RRNO+1
lbldate==date
Input txtPONO
Seek(POMF.DATABASETABLE, txtPONO)
IF NOMATCH
{
Print" PO number not found"
}
else if POMFRecStat =="C"
{
Print " Record Status is already closed"
}
else
{
lbldateneeded == POMFDateneeded
lblSuppNo== POMFSuppNo
}
end if
SEEK (SMF.databasetable, txtPONO)
lblSuppAdd==SMFAddress
SEEK (PODF.databasetable,txtPONO)
IF nomatch
{
Print "PO number not found in the PO Detail file"
}
else
{
row==1
grd.MaterialNO(row)== PODFMaterialNO
grd.Qtyord(row)==PODFQtyORdered
grd.Uprice(row)==PODFUPrice
grd.Amount(row)==PODFAmount
grd.RecStat(row)==PODFRecStat
}
end if
SEEK (MMF.databasetable, grdMaterial(row))
if nomatch
{
Print "Material Number not found"
}
else
{
grd.description(row)==PODFdescription
grd.Umsr(row)==PODFUmeasure
}
end if
row==row+1
PODF.movenext
if EOF OR TXTPONO <>PODFPONO
{
Input txtDateRcv
}
else
}
row==1
grd.MaterialNO(row)== PODFMaterialNO
grd.Qtyord(row)==PODFQtyORdered
grd.Uprice(row)==PODFUPrice
grd.Amount(row)==PODFAmount
grd.RecStat(row)==PODFRecStat
}
END IF
Input txtQCby
SEEK (EMF.databasetable, txtQCby)
if nomatch
{
Print "Employee number not found"
}
else
{
tempQCby
tempQCby==txtQCBy
txtQCBy==EMFFName+EMFLName
}
end if
END SUB
Private Sub_Click cmdSAve button
if row==1
{
Print" Nothing to save"
}
else
{
i==0
}
end if
LOOP for i=1 to row-1
RRDF.ADDNEW
RRDFRRNO==lblRRNO
RRDFMaterialNo(row)==grd1MaterialNo(i)
RRDFUprice(row)==grd1Uprice(i)
RRDFQTYRcv(row)==grd1QtyRcv(i)
RRDFAmount(row)==grd1Amount(i)
RRDFRecstat=="O"
RRDF.Update
SEEK(PODF.DATABASETABLE,TXTPONO+grd1MaterialNo(i))
if PODFQTYORdered==PODFQTYReceived
{
PODFREcStat =="C"
}
else
{
PODF.Update
}
end if
SEEK(MMF.databasetable,grd1MaterialNo(i))
MMF.Edit
MMFlastRRNO==lblRRNO
MMFQtyhand==MMFQtyhand+grd1QtyRcv(i)
MMF.Update
return to LOOP
RRMF.ADDnew
RRMFRRNO==lblRRNO
RRMFdatePrepared==lbldate
RRMFdateReceived==txtdateRcv
RRMFPONO==txtPONO
RRMFSuppN0==lblSuppNo
RRMFRecstat=="O"
RRMF.Update
SGF.Edit
SGFRRNO==lblRRNO
SGF.Update
ctr==0
SEEK(PODF.databasetable,txtPONO
if PODFRecstat=="C"
{
PODF.movenext
}
else
{
ctr==ctr+1
PODF.movenext
}
end if
IF EOF OR txtPONO <> PODFPONO OR ctr==1
{
IF ctr==0
{
seek(POMF.databasetable,txtPONO)
}
esle
{
"clearall grid fields"
grd.MaterialNO(row)== ""
grd.Qtyord(row)==""
grd.Uprice(row)==""
grd.Amount(row)==""
grd.RecStat(row)==""
}
end if
else
{
if PODFRecstat=="C"
{
PODF.movenext
}
else
{
ctr==ctr+1
PODF.movenext
}
end if
End Sub
Private Sub_Click cmdcancel button
"clearall grid fields"
grd.MaterialNO(row)== ""
grd.Qtyord(row)==""
grd.Uprice(row)==""
grd.Amount(row)==""
grd.RecStat(row)==""
End sub
Private Sub_Click cmdexit button
close.database SGF
close.database MMF
close.database SMF
close.database EMF
close.database POMF
close.database RRMF
close.database RRDF
close.database PODF
End Sub
No comments:
Post a Comment